/* ==========================================================================
   Category Hub Page Styles (category.css)
========================================================================== */

/* --- 1. Header Section --- */
.category-hub-header {
    background-color: #ffffff;
    text-align: center;
    padding: 15px 16px 25px; 
    margin-bottom: 32px; 
    border-bottom: 1px solid rgba(45, 40, 56, 0.06); 
}
.category-hub-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    color: var(--text-black);
    letter-spacing: -0.04em;
    margin: 0 0 12px;
}
.category-hub-desc {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* --- 2. Layout Structure & Containers --- */
#main-content {
    width: 100%;
}
.category-hub-showcase {
    width: 100%;
    background-color: #fff;
    padding: 40px 0;
    margin-bottom: 48px;
    border-bottom: 1px solid rgba(45, 40, 56, 0.06);
}
.category-hub-showcase-inner {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}
.hub-subcat-section,
.hub-subcat-layout-3,
.hub-tabs-nav {
    width: 100%;
    box-sizing: border-box;
}

/* --- 3. Sub-category Tabs Navigation --- */
.hub-subcat-section {
    margin-bottom: 56px;
}
.hub-tabs-nav {
    display: flex;
    gap: 30px;
    margin-bottom: 32px; 
    border-bottom: 1px solid rgba(45, 40, 56, 0.08);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.hub-tabs-nav::-webkit-scrollbar {
    display: none;
}
button.hub-tab-btn {
    background: transparent;
    border: none;
    padding: 0 0 16px 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    transition: color 0.2s ease;
    cursor: pointer !important; 
    pointer-events: auto !important; 
    position: relative !important;
    z-index: 10 !important;
}
button.hub-tab-btn.is-active {
    color: var(--text-black);
    font-weight: 700;
}
button.hub-tab-btn::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--text-black);
    border-radius: 3px 3px 0 0;
    opacity: 0;
    transform: scaleX(0.8);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
button.hub-tab-btn.is-active::after {
    opacity: 1;
    transform: scaleX(1);
}
.hub-subcat-panel {
    animation: fadeInPanel 0.4s ease forwards;
}
@keyframes fadeInPanel {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 4. Showcase Layout (Mobile First Base Styles) --- */
.hub-subcat-layout-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start; 
}

/* Hero Area (Left/Top Large Image) */
.hub-subcat-hero .card.card-landscape {
    background: transparent;
    border: none;
    border-radius: 0;
}
.hub-subcat-hero .card.card-landscape:hover {
    background: transparent;
    border-color: transparent;
}
.hub-subcat-hero .cover.cover-landscape {
    border-radius: var(--radius-md);
    aspect-ratio: 16 / 10;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
    margin-bottom: 20px; 
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.hub-subcat-hero .card-body {
    padding: 0; 
    border-bottom: none; 
}
.hub-subcat-hero .card.card-landscape .title {
    font-size: 20px;
    line-height: 1.45; 
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.hub-subcat-hero .card.card-landscape .title:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.hub-subcat-hero .desc {
    padding-bottom: 28px; 
    margin-bottom: 28px;  
    border-bottom: 1px solid rgba(45, 40, 56, 0.08); 
}
.hub-subcat-hero .card.card-landscape .desc {
    -webkit-line-clamp: 2;
}

/* List Area (Right/Bottom Text Items) */
.hub-subcat-list {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.hub-list-item {
    border-bottom: 1px solid rgba(45, 40, 56, 0.06);
    padding-bottom: 28px; 
    margin-bottom: 28px;  
}
.hub-list-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}
.hub-list-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    padding: 16px;
    margin: -16px; 
    border-radius: 16px;
    transition: background-color 0.3s ease;
}
.hub-list-title {
    margin: 0 0 10px 0; 
    font-size: 20px;
    line-height: 1.5; 
    font-weight: 700;
    color: var(--link-color);
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-shrink: 0; 
}
.hub-list-title:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}
.hub-list-desc {
    margin: 0;
    color: var(--text-dark);
    font-size: 14px;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-shrink: 0; 
}

/* --- 5. View All Button --- */
.hub-panel-footer {
    margin-top: auto; 
    display: flex;
    justify-content: center; 
}
.btn-hub-view-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    background: #ffffff; 
    border: 1px solid rgba(45, 40, 56, 0.15); 
    border-radius: 999px; 
    text-decoration: none;
    transition: all 0.3s ease;
}
.btn-hub-view-all:hover {
    border-color: var(--theme-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
}


/* ==========================================================================
   6. Responsive Layout & Breakpoints
========================================================================== */

/* --- Utility: 1200px Visibility Toggle --- */
@media (max-width: 1199px) { .hide-under-1200 { display: none !important; } }
@media (min-width: 1200px) { .show-under-1200 { display: none !important; } }

/* --- Base Padding Adjustments (>= 768px) --- */
@media (min-width: 768px) {
    .category-hub-showcase-inner { padding: 0 30px; }
    .hub-subcat-hero .card-body { padding: 0 4px; }
}

/* --- Mobile Fixes (< 768px) --- */
@media (max-width: 767px) {
    .hub-subcat-hero article.card:first-child .card-body {
        border-bottom: none !important; 
        padding-bottom: 24px !important; 
    }
    .hub-subcat-hero article.card:nth-child(2) .card-body {
        border-bottom: 1px solid rgba(45, 40, 56, 0.08) !important;
        padding-bottom: 24px !important;
    }
    .hub-list-item {
        border-bottom: 1px solid rgba(45, 40, 56, 0.06) !important;
        padding-bottom: 24px !important;
        margin-bottom: 24px !important;
    }
}

/* --- Tablet & Mobile Fixes (<= 1199px) --- */
@media (max-width: 1199px) {
    .hub-subcat-hero .card.card-landscape .title {
        line-height: 1.4 !important;
        margin-bottom: 10px !important;
        font-weight: 700 !important;
    }
    .hub-subcat-hero .card.card-landscape .desc {
        padding-bottom: 0 !important; 
        border-bottom: none !important; 
        margin-bottom: 0 !important;
        font-size: 14px !important;
        line-height: 1.6 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
    .hub-subcat-hero .card.card-landscape .card-body {
        padding-bottom: 24px !important;
        border-bottom: 1px solid rgba(45, 40, 56, 0.08) !important;
    }
}

/* --- Tablet 2x2 Grid (768px - 1199px) --- */
@media (min-width: 768px) and (max-width: 1199px) {
    .hub-subcat-layout-3 {
        grid-template-columns: 1fr;
        gap: 24px; 
    }
    .hub-subcat-hero {
        display: grid;
        grid-template-columns: 1fr 1fr; 
        gap: 30px;
    }
    .hub-subcat-list {
        display: grid;
        grid-template-columns: 1fr 1fr; 
        row-gap: 0;
        column-gap: 30px;
        align-items: start;
    }
    .hub-subcat-hero .desc {
        border-bottom: 1px solid rgba(45, 40, 56, 0.08); 
        padding-bottom: 24px;
        margin-bottom: 0; 
    }
    .hub-list-item {
        border-bottom: 1px solid rgba(45, 40, 56, 0.06);
        padding-bottom: 24px;
        margin-bottom: 0;
    }
    .hub-subcat-list article.hub-list-item:last-of-type {
        border-bottom: 1px solid rgba(45, 40, 56, 0.06) !important;
        padding-bottom: 24px !important;
    }
    .hub-panel-footer {
        grid-column: 1 / -1; 
        margin-top: 16px;
    }
}

/* --- Desktop Layout (>= 1200px) --- */
@media (min-width: 1200px) {
    .hub-panel-footer {
        justify-content: flex-end; 
    }
    .hub-subcat-layout-3 {
        grid-template-columns: 1.25fr 1fr;
        gap: 60px;
    }
    .hub-subcat-hero .card.card-landscape .title {
        font-size: 28px; 
        margin-bottom: 16px;
        letter-spacing: -0.02em;
    }
    .hub-subcat-hero .card.card-landscape .desc {
        font-size: 15px;
        line-height: 1.7;
        margin-bottom: 10px;
        border-bottom: none; 
        padding-bottom: 0;
    }
    .hub-list-item {
        border-bottom: 1px solid rgba(45, 40, 56, 0.08) !important; 
        padding-bottom: 28px !important;
        margin-bottom: 28px !important;
    }
    .hub-subcat-list article.hub-list-item:last-of-type {
        border-bottom: 1px solid rgba(45, 40, 56, 0.08) !important;
        padding-bottom: 28px !important;
        margin-bottom: 24px !important; 
    }
    .hub-list-title {
        font-size: 24px; 
        line-height: 1.5;
        margin-bottom: 12px;
    }
    .hub-list-desc {
        font-size: 15px; 
        line-height: 1.7;
        margin-bottom: 10px;
    }
}