:root {
    --primary-accent: #b91c1c;
    --primary-dark: #991b1b;
    --text-dark: #333333;
    --text-muted: #666666;
    --text-dimmer: #888888;
    --text-dimmed: #999999;
    --border-soft: #e2e8f0;
    --bg-light: #f8fafc;
    --pure-white: #ffffff;
}

.category-page {
    margin-top: 140px !important;
    padding: 0 20px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Remove text underlining from all links */
.category-article,
.more-news-article {
    text-decoration: none !important;
    color: inherit;
}

.category-article:hover,
.more-news-article:hover {
    text-decoration: none !important;
}

/* Ensure no underlining in any state */
a:link, a:visited, a:hover, a:active {
    text-decoration: none;
}

.category-article *,
.more-news-article * {
    text-decoration: none !important;
}

/* Category Header */
.category-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: var(--pure-white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid var(--border-soft);
}

.category-title {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.category-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Main Category Grid - 3x5 Layout */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 50px;
}

.category-article {
    background: var(--pure-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid var(--border-soft);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.category-article:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.category-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.category-article:hover .category-image {
    transform: scale(1.05);
}

.category-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.category-article-title {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text-dark);
    line-height: 1.4;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2; /* Standard property */
    max-height: 2.8em;
}

.category-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 3; /* Standard property */
    max-height: 4.5em;
}

.category-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-dimmer);
    font-size: 0.85rem;
    font-weight: 400;
    margin-top: auto;
}

/* Enhanced text-only articles */
.text-only-article {
    background: var(--pure-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid var(--border-soft);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.text-only-article .category-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 280px;
    justify-content: flex-start; /* Changed from center to flex-start */
}

.text-only-article .category-article-title {
    font-size: 1.4rem; /* Slightly larger */
    margin-bottom: 15px;
    color: var(--text-dark);
    line-height: 1.3;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Allow more lines for title */
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 3; /* Standard property */
    flex-shrink: 0;
}

.text-only-article .category-excerpt {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    color: var(--text-muted);
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 6; /* More lines for excerpt */
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 6; /* Standard property */
    max-height: 9.6em; /* 6 lines * 1.6 line-height */
}

.text-only-article .category-meta {
    margin-top: auto;
    flex-shrink: 0;
}

/* More News Section */
.more-news-section {
    padding: 40px 0;
    border-top: 1px solid var(--border-soft);
}

.more-news-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 35px;
    color: var(--text-dark);
    font-weight: 600;
}

.more-news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.more-news-article {
    background: var(--pure-white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    border: 1px solid var(--border-soft);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.more-news-article:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.more-news-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.more-news-article:hover .more-news-image {
    transform: scale(1.05);
}

.more-news-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.more-news-article-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text-dark);
    line-height: 1.4;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2; /* Standard property */
    max-height: 2.8em;
}

.more-news-excerpt {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 12px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2; /* Standard property */
    max-height: 2.8em;
}

.more-news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-dimmer);
    font-size: 0.8rem;
    font-weight: 400;
    margin-top: auto;
}

/* No Posts Message */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 1.1rem;
    grid-column: 1 / -1;
    background: var(--bg-light);
    border-radius: 12px;
    border: 1px dashed var(--border-soft);
}

/* Empty Category State */
.no-category-posts {
    margin-bottom: 40px;
}

.no-posts-message {
    text-align: center;
    padding: 40px 20px;
    background: var(--pure-white);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid var(--border-soft);
    margin-bottom: 30px;
}

.no-posts-message h3 {
    color: var(--text-dark);
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.no-posts-message p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
    max-width: 500px;
    margin: 0 auto;
}

/* ================= RESPONSIVE DESIGN ================= */
@media (max-width: 1200px) {
    .container {
        max-width: 1000px;
    }
}

@media (max-width: 1024px) {
    .category-grid,
    .more-news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .category-title {
        font-size: 2rem;
    }
    
    .category-header {
        padding: 25px 20px;
    }
}

@media (max-width: 900px) {
    .category-page {
        padding: 0 15px;
    }
    
    .category-image {
        height: 200px;
    }
    
    .more-news-image {
        height: 160px;
    }
}

@media (max-width: 768px) {
    .category-page {
        margin-top: 120px !important;
        padding: 0 15px;
    }
    
    .category-header {
        padding: 20px 15px;
        margin-bottom: 25px;
    }
    
    .category-grid,
    .more-news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .category-title {
        font-size: 1.75rem;
    }
    
    .category-description {
        font-size: 1rem;
    }
    
    .more-news-section {
        padding: 30px 0;
    }
    
    .more-news-title {
        font-size: 1.5rem;
        margin-bottom: 25px;
    }
    
    .category-image {
        height: 200px;
    }
    
    .more-news-image {
        height: 160px;
    }
    
    .category-content,
    .more-news-content,
    .text-only-article {
        padding: 20px;
    }
    
    .text-only-article .category-content {
        min-height: 220px;
        padding: 25px;
    }
    
    .category-article-title {
        font-size: 1.1rem;
    }
    
    .more-news-article-title {
        font-size: 1rem;
    }
    
    .category-excerpt {
        font-size: 0.9rem;
    }
    
    .more-news-excerpt {
        font-size: 0.85rem;
    }
}

@media (max-width: 640px) {
    .category-page {
        padding: 0 12px;
    }
    
    .category-header {
        padding: 18px 12px;
        margin-bottom: 20px;
    }
    
    .category-grid,
    .more-news-grid {
        gap: 16px;
    }
    
    .category-title {
        font-size: 1.5rem;
    }
    
    .more-news-title {
        font-size: 1.3rem;
    }
    
    .category-image {
        height: 180px;
    }
    
    .more-news-image {
        height: 150px;
    }
    
    .category-content,
    .more-news-content {
        padding: 18px;
    }
    
    .text-only-article .category-content {
        padding: 20px;
        min-height: 200px;
    }
}

@media (max-width: 480px) {
    .category-page {
        margin-top: 100px !important;
        padding: 0 10px;
    }
    
    .category-header {
        padding: 15px 10px;
        margin-bottom: 20px;
    }
    
    .category-title {
        font-size: 1.3rem;
    }
    
    .more-news-title {
        font-size: 1.2rem;
        margin-bottom: 20px;
    }
    
    .category-image {
        height: 160px;
    }
    
    .more-news-image {
        height: 140px;
    }
    
    .category-content,
    .more-news-content {
        padding: 16px;
    }
    
    .text-only-article .category-content {
        min-height: 180px;
        padding: 18px;
    }
    
    .category-article-title {
        font-size: 1rem;
    }
    
    .more-news-article-title {
        font-size: 0.95rem;
    }
    
    .category-excerpt {
        font-size: 0.85rem;
    }
    
    .more-news-excerpt {
        font-size: 0.8rem;
    }
    
    .category-meta,
    .more-news-meta {
        font-size: 0.75rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .no-posts-message {
        padding: 30px 15px;
    }
    
    .no-posts-message h3 {
        font-size: 1.3rem;
    }
    
    .no-posts-message p {
        font-size: 0.9rem;
    }
}

@media (max-width: 360px) {
    .category-page {
        padding: 0 8px;
    }
    
    .category-header {
        padding: 12px 8px;
    }
    
    .category-title {
        font-size: 1.2rem;
    }
    
    .category-description {
        font-size: 0.9rem;
    }
    
    .category-image {
        height: 150px;
    }
    
    .more-news-image {
        height: 130px;
    }
    
    .category-content,
    .more-news-content {
        padding: 14px;
    }
    
    .text-only-article .category-content {
        padding: 16px;
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .category-article,
    .more-news-article {
        transition: none;
    }
    
    .category-article:hover,
    .more-news-article:hover {
        transform: none;
    }
    
    .category-article:active,
    .more-news-article:active {
        transform: scale(0.98);
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .category-article,
    .more-news-article,
    .category-image,
    .more-news-image {
        transition: none;
    }
    
    .category-article:hover .category-image,
    .more-news-article:hover .more-news-image {
        transform: none;
    }
}