/* News shared styles */
.container { max-width: 1200px; }

/* News card improvements */
.news-card {
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.news-card:focus-visible {
    outline: 3px solid #f97316;
    outline-offset: 3px;
}

.news-card h2 { 
    line-height: 1.3; 
    font-weight: 700;
}

/* Media hover zoom */
.news-card .media img {
    transform: scale(1);
    transition: transform 0.5s ease;
}

.news-card:hover .media img {
    transform: scale(1.05);
}

.line-clamp-3 { 
    display: -webkit-box; 
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
}

.line-clamp-2 { 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
}

/* Post content styling */
.news-article {
    color: #374151;
    line-height: 1.7;
}

.news-article h1 { 
    font-size: 2.5rem; 
    line-height: 1.2; 
    font-weight: 700; 
    color: #111827;
    margin-bottom: 1.5rem;
}

.news-article h2 { 
    font-size: 1.875rem; 
    margin-top: 2.5rem; 
    margin-bottom: 1rem;
    font-weight: 600; 
    color: #111827;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 0.5rem;
}

.news-article h3 { 
    font-size: 1.5rem; 
    margin-top: 2rem; 
    margin-bottom: 1rem;
    font-weight: 600; 
    color: #374151;
}

.news-article p { 
    margin-bottom: 1.5rem; 
    color: #374151; 
    line-height: 1.7;
}

.news-article img { 
    border-radius: 0.75rem; 
    margin: 2rem 0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.news-article blockquote { 
    border-left: 4px solid #f97316; 
    padding-left: 1.5rem; 
    color: #4B5563; 
    font-style: italic;
    background: #fef3c7;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin: 2rem 0;
}

.news-article pre { 
    background: #1f2937; 
    color: #e5e7eb; 
    padding: 1.5rem; 
    border-radius: 0.75rem; 
    overflow: auto;
    margin: 2rem 0;
    border: 1px solid #374151;
}

.news-article code { 
    background: #f3f4f6; 
    padding: 0.25rem 0.5rem; 
    border-radius: 0.375rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
}

.news-article ul, .news-article ol {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.news-article li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.news-article a {
    color: #f97316;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

.news-article a:hover {
    color: #ea580c;
}

/* Tag filter styling */
.tag-pill { 
    border: 1px solid #e5e7eb; 
    background: #ffffff; 
    color: #374151; 
    border-radius: 9999px; 
    padding: 0.5rem 1rem; 
    font-size: 0.875rem; 
    line-height: 1; 
    cursor: pointer; 
    transition: all 0.2s ease;
    font-weight: 500;
    border-width: 2px;
}

.tag-pill:hover { 
    border-color: #f97316; 
    color: #f97316;
    transform: translateY(-1px);
}

.tag-pill.active { 
    background: #f97316; 
    color: #ffffff; 
    border-color: #f97316;
    box-shadow: 0 4px 6px -1px rgba(249, 115, 22, 0.3);
}

/* Pagination styling */
.pagination-btn { 
    border: 2px solid #e5e7eb; 
    background: #ffffff; 
    color: #374151; 
    border-radius: 0.5rem; 
    padding: 0.5rem 1rem; 
    font-size: 0.875rem; 
    cursor: pointer; 
    transition: all 0.2s ease;
    font-weight: 500;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Prev/Next nav buttons on post page */
#prev-next a {
    min-height: 4.5rem; /* ensure consistent height */
    border-width: 2px;
}

#prev-next a:hover {
    border-color: #f97316;
}

#prev-next a:focus-visible {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

@media (max-width: 640px) {
    #prev-next a {
        min-height: 4rem;
    }
}

.pagination-btn:hover { 
    border-color: #f97316; 
    color: #f97316;
    transform: translateY(-1px);
}

.pagination-btn.active { 
    background: #f97316; 
    color: #ffffff; 
    border-color: #f97316;
    box-shadow: 0 4px 6px -1px rgba(249, 115, 22, 0.3);
}

.pagination-btn[disabled] { 
    opacity: 0.5; 
    cursor: not-allowed;
    transform: none;
}

/* Loading animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .news-card .p-6 { 
        padding: 1rem; 
    }
    
    .news-article h1 {
        font-size: 2rem;
    }
    
    .news-article h2 {
        font-size: 1.5rem;
    }
    
    .news-article h3 {
        font-size: 1.25rem;
    }
    
    .tag-pill {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .pagination-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
        min-width: 40px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .news-article {
        color: #d1d5db;
    }
    
    .news-article h1,
    .news-article h2,
    .news-article h3 {
        color: #f9fafb;
    }
    
    .news-article code {
        background: #374151;
        color: #e5e7eb;
    }
    
    .news-article blockquote {
        background: #374151;
        color: #d1d5db;
    }
}

/* Focus states for accessibility */
.tag-pill:focus,
.pagination-btn:focus {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

/* Smooth transitions */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}