/* Category Page Specific Styles */

.category-hero {
    position: relative;
    width: 100%;
    min-height: 280px;
    background-image: url('https://images.pexels.com/photos/546819/pexels-photo-546819.jpeg?auto=compress&cs=tinysrgb&w=1600');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0;
    padding: 0;
    margin-top: -1px;
}

.category-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(10, 22, 40, 0.85), rgba(26, 54, 93, 0.85));
}

.category-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 50px 20px;
}

.category-hero-content h1 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #FFFFFF;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.category-hero-content p {
    font-size: 16px;
    color: #CBD5E0;
    line-height: 1.5;
}

/* Category Filters */
.category-filters {
    padding: 10px 0;
    background: rgba(10, 22, 40, 0.82);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(49, 130, 206, 0.3);
    position: sticky;
    top: 64px;
    z-index: 50;
}

.filters-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    padding: 0 12px;
}

.category-filters .filters-container {
    width: 100%;
}

.sort-options {
    display: flex;
    gap: 12px;
    margin-left: 0;
    align-items: stretch;
}

.sort-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    line-height: 1.2;
    min-height: 34px;
    padding: 6px 14px;
    background: rgba(49, 130, 206, 0.2);
    border: 1px solid rgba(49, 130, 206, 0.3);
    border-radius: 999px;
    color: #CBD5E0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.sort-btn:visited {
    color: #CBD5E0;
}

.sort-btn.active:visited {
    color: #fff;
}

.sort-btn:hover {
    background: rgba(49, 130, 206, 0.4);
    color: #FFFFFF;
    transform: translateY(-1px);
}

.sort-btn.active {
    background: linear-gradient(135deg, #3182CE, #2C5282);
    color: white;
    border-color: transparent;
}

/* Category Posts Grid */
.category-posts {
    padding: 40px 20px;
    background: transparent;
    width: 100%;
    overflow-x: visible;
}

.category-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.category-posts .posts-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
}

/* Post Card Styling - UPDATED */
.category-posts .post-card {
    background: rgba(10, 22, 40, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    border: 1px solid rgba(49, 130, 206, 0.2);
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    cursor: pointer;
}

.category-posts .post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(49, 130, 206, 0.3);
    border-color: rgba(49, 130, 206, 0.7);
    background: rgba(10, 22, 40, 0.85);
}

/* 16:9 Image Ratio */
.category-posts .post-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.category-posts .post-card:hover img {
    transform: scale(1.02);
}

.category-posts .post-content {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Updated Font Sizes */
.category-posts .post-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #A0AEC0;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.category-posts .post-meta i {
    margin-right: 3px;
    color: #3182CE;
}

.category-posts .post-content h3 {
    font-size: 16px;
    margin-bottom: 10px;
    line-height: 1.4;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px;
}

.category-posts .post-content h3 a {
    text-decoration: none;
    color: #FFFFFF;
    transition: color 0.2s ease;
}

.category-posts .post-content h3 a:hover {
    color: #3182CE;
}

.category-posts .post-content p {
    font-size: 13px;
    color: #CBD5E0;
    margin-bottom: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.category-posts .read-more {
    margin-top: auto;
    align-self: flex-start;
}

/* Tablet: 3 columns */
@media (min-width: 769px) and (max-width: 1199px) {
    .filters-container {
        padding: 0 20px;
    }

    .category-posts .posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }

    .category-posts .post-card {
        min-height: 360px;
    }
}

/* Mobile: 1 column */
@media (max-width: 768px) {
    .category-hero-content h1 {
        font-size: 28px;
    }

    .category-hero-content p {
        font-size: 13px;
    }

    .category-filters {
        top: 60px;
        padding: 8px 0;
    }

    .filters-container {
        justify-content: center;
        padding: 0 10px;
        gap: 10px;
    }

    .sort-options {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        justify-content: stretch;
        gap: 8px;
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
    }

    .sort-btn {
        width: 100%;
        min-height: 32px;
        padding: 6px 8px;
        font-size: 11px;
        font-weight: 600;
        white-space: normal;
        word-break: break-word;
        hyphens: auto;
    }

    .category-container {
        padding: 0 12px;
    }

    .category-posts {
        padding: 20px 12px 32px;
    }

    .category-posts .posts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .category-posts .post-card {
        min-height: auto;
    }

    /* Mobile font adjustments */
    .category-posts .post-content h3 {
        font-size: 18px;
        min-height: auto;
    }

    .category-posts .post-content p {
        font-size: 14px;
    }

    .category-posts .post-meta {
        font-size: 12px;
    }

    .category-posts .read-more {
        font-size: 14px;
    }

    .no-posts {
        padding: 40px 18px;
        border-radius: 14px;
    }

    .no-posts h3 {
        font-size: 20px;
    }

    .no-posts i {
        font-size: 48px;
    }
}

/* Desktop: 5 columns */
@media (min-width: 1200px) {
    .category-container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 20px;
    }

    .category-posts .posts-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 20px;
    }

    .category-posts .post-card {
        min-height: 380px;
    }
}

/* Large Desktop */
@media (min-width: 1600px) {
    .category-container {
        max-width: 1600px;
    }

    .category-posts .posts-grid {
        gap: 24px;
    }

    .category-posts .post-card {
        min-height: 400px;
    }
}

/* No Posts Message */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    background: rgba(10, 22, 40, 0.5);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    grid-column: 1 / -1;
}

.no-posts i {
    font-size: 60px;
    color: #3182CE;
    margin-bottom: 20px;
}

.no-posts h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #FFFFFF;
}

.no-posts p {
    color: #CBD5E0;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #3182CE;
}

.loading-spinner i {
    font-size: 24px;
    margin-right: 10px;
}

/* Pagination Styling (WordPress Native) */
.pagination {
    margin-top: 40px;
    width: 100%;
}

.pagination .screen-reader-text {
    display: none;
}

.pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Generic for all page numbers including circles */
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(49, 130, 206, 0.1);
    border: 1px solid rgba(49, 130, 206, 0.3);
    color: #CBD5E0;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 38px;
    height: 38px;
    border-radius: 50%;
    padding: 0;
    box-sizing: border-box;
}

/* Exclude padding on circles, but keep generic width. Let's make sure pills can expand */
.pagination .prev.page-numbers,
.pagination .next.page-numbers {
    padding: 0 20px;
    border-radius: 30px;
    min-width: auto;
}

/* Dots shouldn't have borders */
.pagination .page-numbers.dots {
    background: transparent;
    border-color: transparent;
    color: #A0AEC0;
}

/* Hover effect for clickable links */
.pagination a.page-numbers:hover {
    background: rgba(49, 130, 206, 0.4);
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(49, 130, 206, 0.2);
}

/* Current active page */
.pagination .page-numbers.current {
    background: linear-gradient(135deg, #3182CE, #2C5282);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.3);
}

