/* 
 * Category Page Specific Styles 
 * Based on Figma Design
 */

.category-page {
    padding: 0 0 80px 0;
}

/* Hero Box */
.category-hero-box {
    background-color: #f0f0f0;
    border-radius: 20px;
    padding: 120px 40px;
    text-align: center;
    position: relative;
    margin-bottom: 60px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.category-hero-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 20px;
    pointer-events: none;
}

.category-breadcrumb {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    padding-left: 10px;
}

.category-breadcrumb a {
    color: #111;
    text-decoration: none;
}

.breadcrumb-separator {
    margin: 0 5px;
}

.category-hero-title {
    font-size: 64px;
    font-weight: 800;
    color: #fff;
    margin: 0;
    font-family: inherit;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Controls (Filters & Search) */
.category-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
}

.category-filters {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-btn {
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 30px;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    color: #111;
    background-color: rgba(56, 110, 78, 0.1);
}

.filter-btn.active {
    font-weight: 700;
    color: #fff;
    background-color: #386e4e;
    padding: 12px 32px;
    /* Bigger box! */
    font-size: 16px;
}

/* Search Bar */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border: none;
    border-radius: 30px;
    padding: 8px 15px;
    background: #fff;
    width: 280px;
}

.search-icon {
    color: #666;
    margin-right: 10px;
    flex-shrink: 0;
}

.search-input,
.search-input:focus,
.search-input:active {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    width: 100%;
    font-size: 14px;
    color: #333;
    appearance: none;
    -webkit-appearance: none;
    padding: 0 !important;
    margin: 0 !important;
}

/* Blog Grid */
.category-blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 50px;
}

.category-blog-grid>article {
    background-color: #fff;
    border-radius: 20px;
    overflow: hidden;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;

    /* Animation based on Figma Specs */
    animation: catCardFadeIn 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* Staggered Delay Logic - Starts after 200ms base delay */
.category-blog-grid>article:nth-child(1) {
    animation-delay: 200ms;
}

.category-blog-grid>article:nth-child(2) {
    animation-delay: 400ms;
}

.category-blog-grid>article:nth-child(3) {
    animation-delay: 600ms;
}

.category-blog-grid>article:nth-child(4) {
    animation-delay: 800ms;
}

.category-blog-grid>article:nth-child(5) {
    animation-delay: 1000ms;
}

.category-blog-grid>article:nth-child(6) {
    animation-delay: 1200ms;
}

.category-blog-grid>article:nth-child(7) {
    animation-delay: 1400ms;
}

.category-blog-grid>article:nth-child(8) {
    animation-delay: 1600ms;
}

.category-blog-grid>article:nth-child(9) {
    animation-delay: 1800ms;
}

/* Fallback for many cards */
.category-blog-grid>article:nth-child(n+10) {
    animation-delay: 2000ms;
}

@keyframes catCardFadeIn {
    0% {
        opacity: 0;
        transform: translateY(24px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.card-link-wrapper {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-image-wrapper {
    width: 100%;
    padding: 14px 14px 0 14px;
    margin-bottom: 14px;
}

.card-placeholder-image,
.card-image-wrapper img {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #e6e6e6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    object-fit: cover;
}

.card-content-wrapper {
    padding: 0 14px 20px 14px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #111;
    line-height: 1.3;
}

.card-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* Load More Button */
.category-load-more-container {
    display: flex;
    justify-content: center;
}

.btn-load-more {
    background-color: #386e4e;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 40px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-load-more:hover {
    background-color: #2c593e;
}

/* ==============================================
   RESPONSIVE — LAPTOP / SMALL DESKTOP (1024px)
   ============================================== */
@media (max-width: 1024px) {
    .category-page {
        padding: 30px 0 60px 0;
    }

    .category-hero-box {
        padding: 90px 30px;
    }

    .category-hero-title {
        font-size: 52px;
    }

    /* 2-column grid on laptop */
    .category-blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }

    /* Stack controls vertically */
    .category-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .category-filters {
        width: 100%;
    }

    .search-input-wrapper {
        width: 100%;
        max-width: 400px;
    }
}

/* ==============================================
   RESPONSIVE — TABLET (768px)
   ============================================== */
@media (max-width: 768px) {
    .category-page {
        padding: 24px 0 48px 0;
    }

    .category-hero-box {
        padding: 70px 20px 40px 20px;
        margin-bottom: 40px;
    }

    .category-hero-title {
        font-size: 40px;
    }

    .category-breadcrumb {
        font-size: 13px;
        margin-bottom: 15px;
        padding-left: 0;
    }

    /* 2-column grid on tablet */
    .category-blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        margin-bottom: 40px;
    }

    /* Controls */
    .category-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        margin-bottom: 32px;
    }

    .category-filters {
        flex-wrap: wrap;
        gap: 10px;
    }

    .filter-btn {
        font-size: 14px;
        padding: 7px 14px;
    }

    .filter-btn.active {
        font-size: 14px;
        padding: 9px 22px;
    }

    .search-input-wrapper {
        width: 100%;
        max-width: 100%;
    }

    /* Cards */
    .card-title {
        font-size: 15px;
    }

    .card-excerpt {
        font-size: 12px;
    }

    /* Load more */
    .btn-load-more {
        width: 100%;
        text-align: center;
    }
}

/* ==============================================
   RESPONSIVE — MOBILE (480px)
   ============================================== */
@media (max-width: 480px) {
    .category-page {
        padding: 16px 0 40px 0;
    }

    .category-hero-box {
        padding: 56px 16px 32px 16px;
        border-radius: 14px;
        margin-bottom: 28px;
    }

    .category-hero-title {
        font-size: 30px;
    }

    .category-breadcrumb {
        font-size: 12px;
    }

    /* Single column on mobile */
    .category-blog-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 32px;
        max-width: 100%;
    }

    /* Controls */
    .category-controls {
        gap: 12px;
        margin-bottom: 24px;
    }

    .category-filters {
        gap: 8px;
    }

    .filter-btn {
        font-size: 13px;
        padding: 6px 12px;
    }

    .filter-btn.active {
        padding: 8px 18px;
        font-size: 13px;
    }

    /* Cards — tighter on mobile */
    .card-image-wrapper {
        padding: 10px 10px 0 10px;
        margin-bottom: 10px;
    }

    .card-content-wrapper {
        padding: 0 12px 16px 12px;
    }

    .card-title {
        font-size: 14px;
        margin: 0 0 6px 0;
    }

    .card-excerpt {
        font-size: 12px;
        line-height: 1.45;
        /* Limit to 2 lines on mobile to keep cards compact */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Load more */
    .btn-load-more {
        width: 100%;
        padding: 12px 24px;
        font-size: 14px;
    }
}