/* ===============
   PAGE HERO (list.html)
   =============== */
.page-hero {
    position: relative;
    padding: 108px 0 52px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 60%, #e2e8f0 100%);
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 80% at 90% 50%, rgba(37, 99, 235, 0.06) 0%, transparent 60%);
    pointer-events: none;
}

.page-hero::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, #7c3aed 50%, #16a34a 100%);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.breadcrumb a {
    color: var(--primary-color);
    transition: opacity 0.2s;
}

.breadcrumb a:hover {
    opacity: 0.75;
}

.breadcrumb-sep {
    color: var(--text-muted);
    font-size: 1rem;
}

.breadcrumb span:last-child {
    color: var(--text-muted);
}

/* Hero title & desc */
.page-hero-title {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--secondary-color);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 14px;
}

.page-hero-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 560px;
}

/* Dark mode page-hero */
html[data-theme="dark"] .page-hero {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 60%, #020617 100%);
}
html[data-theme="dark"] .page-hero::before {
    background: radial-gradient(ellipse 70% 80% at 90% 50%, rgba(96, 165, 250, 0.1) 0%, transparent 60%);
}

/* ===============
   ARCHIVE LIST (list.html)
   =============== */
.archive-list {
    margin: 60px 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 32px;
}

.archive-item {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.archive-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 55px rgba(15, 23, 42, 0.14);
    border-color: rgba(37, 99, 235, 0.35);
}

/* Image wrapper with category badge overlay */
.archive-img-link {
    display: block;
    position: relative;
    overflow: hidden;
}

.archive-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.archive-item:hover .archive-img {
    transform: scale(1.05);
}

.archive-category {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 4px 12px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 999px;
    pointer-events: none;
}

/* Card body */
.archive-content {
    padding: 24px 26px 28px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.archive-date {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.archive-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary-color);
    line-height: 1.35;
    margin-bottom: 12px;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.archive-item:hover .archive-title {
    color: var(--primary-color);
}

.archive-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.65;
    margin-bottom: 20px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-read-more {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 4px;
    padding: 9px 20px;
    background: var(--primary-color);
    color: #fff !important;
    border-radius: 999px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.25);
}

.btn-read-more:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

/* ===============
   PAGINATION
   =============== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 16px 0 64px;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 24px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--secondary-color);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-soft);
}

.pagination-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.pagination-prev { padding-left: 20px; }
.pagination-next { padding-right: 20px; }

/* Legacy pagination support (span/a generic) */
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary-color);
    transition: all 0.2s ease;
}

.pagination a:hover,
.pagination .current {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

/* ===============
   PAGE HERO — Article variant
   =============== */
.page-hero--article {
    padding-bottom: 44px;
}

.article-hero-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.article-hero-category {
    display: inline-block;
    padding: 4px 14px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 999px;
}

.article-hero-date {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.article-hero-title {
    font-size: 2.4rem !important;
    max-width: 820px;
}

.article-hero-desc {
    max-width: 640px;
}

.breadcrumb-current {
    color: var(--text-muted);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 300px;
    display: inline-block;
    vertical-align: bottom;
}

/* ===============
   ARTICLE DETAIL (news.html)
   =============== */
.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
    gap: 32px;
    align-items: flex-start;
    margin: 36px 0 80px;
}

.article-container {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

/* Hero image inside article */
.article-hero-img {
    margin: 0;
    width: 100%;
    overflow: hidden;
    max-height: 460px;
}

.article-hero-img img {
    width: 100%;
    height: 100%;
    max-height: 460px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.article-hero-img:hover img {
    transform: scale(1.02);
}

/* Article body */
.article-body {
    padding: 36px 38px;
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-color);
}

.article-body p {
    margin-bottom: 22px;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 28px 0;
    border: 1px solid var(--border-color);
}

.article-body h2 {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin: 40px 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.article-body h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 32px 0 12px;
}

.article-body a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-body ul, .article-body ol {
    padding-left: 24px;
    margin-bottom: 22px;
}

.article-body li {
    margin-bottom: 8px;
}

/* Back to list link */
.article-back {
    padding: 20px 38px 28px;
    border-top: 1px solid var(--border-color);
}

.article-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    transition: gap 0.2s ease;
}

.article-back-link:hover {
    gap: 10px;
}

/* ===============
   ARTICLE SIDEBAR
   =============== */
.article-sidebar {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    position: sticky;
    top: 92px;
}

.sidebar-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    padding: 20px 22px 16px;
    color: var(--secondary-color);
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 0.01em;
}

/* Sidebar post list */
.sidebar-posts {
    display: flex;
    flex-direction: column;
}

.sidebar-post {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 14px;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.sidebar-post:last-child {
    border-bottom: none;
}

.sidebar-post:hover {
    background: var(--hover-overlay);
}

.sidebar-post-img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.sidebar-post-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-post-date {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-post-title {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--secondary-color);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.sidebar-post:hover .sidebar-post-title {
    color: var(--primary-color);
}

/* Sidebar CTA */
.sidebar-cta {
    padding: 20px 22px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-top: 1px solid rgba(37, 99, 235, 0.15);
    text-align: center;
}

.sidebar-cta-text {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 12px;
}

.sidebar-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: var(--primary-color);
    color: #fff !important;
    border-radius: 999px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.3);
    width: 100%;
    justify-content: center;
}

.sidebar-cta-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

/* ===============
   DARK MODE — article
   =============== */
html[data-theme="dark"] .sidebar-cta {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
    border-top-color: rgba(96, 165, 250, 0.2);
}
html[data-theme="dark"] .sidebar-cta-text {
    color: #e2e8f0;
}


/* ===============
   SHOW/LANDING PAGE (show.html)
   =============== */

/* Category hero — two-column layout */
.page-hero--category {
    padding-bottom: 0;
    overflow: visible;
}

.category-hero-inner {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 48px;
    align-items: center;
    padding-bottom: 48px;
}

.category-hero-text {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.category-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.25);
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 999px;
    margin-bottom: 18px;
    width: fit-content;
}

.category-hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 28px;
    padding: 13px 30px;
    background: var(--primary-color);
    color: #fff !important;
    border-radius: 999px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    width: fit-content;
}

.category-hero-cta:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
}

/* Hero image */
.category-hero-img-wrap {
    position: relative;
}

.category-hero-img {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18), 0 4px 16px rgba(15, 23, 42, 0.1);
    border: 1px solid var(--border-color);
    display: block;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.category-hero-img-wrap:hover .category-hero-img {
    transform: translateY(-4px);
    box-shadow: 0 32px 80px rgba(15, 23, 42, 0.22), 0 8px 24px rgba(15, 23, 42, 0.12);
}

/* Decorative glow behind image */
.category-hero-img-wrap::before {
    content: '';
    position: absolute;
    inset: -12px;
    background: radial-gradient(ellipse at center, rgba(37, 99, 235, 0.14) 0%, transparent 70%);
    border-radius: var(--radius-lg);
    z-index: -1;
}

/* Category content body */
.category-body-wrap {
    max-width: 900px;
    margin: 52px auto 32px;
}

.category-article-body {
    padding: 0;
    font-size: 1.07rem;
    line-height: 1.85;
    color: var(--text-color);
}

/* Inline CTA Banner */
.category-inline-cta {
    margin: 40px 0 20px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(37, 99, 235, 0.22);
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.category-inline-cta-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 28px;
}

.category-inline-cta-icon {
    font-size: 2.2rem;
    flex-shrink: 0;
}

.category-inline-cta-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 4px;
}

.category-inline-cta-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.category-inline-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 11px 24px;
    background: var(--primary-color);
    color: #fff !important;
    border-radius: 999px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.88rem;
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
}

.category-inline-cta-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

/* Related section */
.show-related-section {
    margin-top: 16px;
    margin-bottom: 80px;
}

/* Dark mode overrides */
html[data-theme="dark"] .category-hero-badge {
    background: rgba(96, 165, 250, 0.12);
    border-color: rgba(96, 165, 250, 0.3);
    color: #93c5fd;
}
html[data-theme="dark"] .category-inline-cta {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
    border-color: rgba(96, 165, 250, 0.2);
}
html[data-theme="dark"] .category-inline-cta-title {
    color: #e2e8f0;
}



/* ===============
   RESPONSIVE
   =============== */
@media (max-width: 768px) {
    .page-hero {
        padding: 96px 0 40px;
    }

    .page-hero-title {
        font-size: 2rem;
    }

    .page-hero-desc {
        font-size: 0.95rem;
    }

    .archive-list {
        margin: 40px 0;
        gap: 22px;
    }

    .archive-img {
        height: 190px;
    }

    .pagination {
        gap: 10px;
    }

    .pagination-btn {
        padding: 9px 18px;
        font-size: 0.85rem;
    }

    .pagination a,
    .pagination span {
        min-width: 38px;
        height: 38px;
        padding: 0 12px;
        font-size: 0.85rem;
    }

    .article-layout {
        grid-template-columns: 1fr;
        gap: 0;
        margin: 30px 0 50px;
    }

    .article-container {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        border-bottom: none;
    }

    .article-body {
        padding: 24px 20px;
    }

    .article-back {
        padding: 16px 20px 22px;
    }

    .article-hero-img img {
        max-height: 240px;
    }

    .article-hero-title {
        font-size: 1.7rem !important;
    }

    .article-sidebar {
        position: static;
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        border-top: none;
    }

    .article-body {
        font-size: 1rem;
    }

    /* show.html mobile */
    .category-hero-inner {
        grid-template-columns: 1fr;
        gap: 28px;
        padding-bottom: 36px;
    }

    .category-hero-img {
        max-height: 260px;
        order: -1;
    }

    .category-body-wrap {
        margin-top: 36px;
    }

    .category-inline-cta-inner {
        flex-wrap: wrap;
        gap: 14px;
    }

    .category-inline-cta-btn {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
}


/* Dark theme overrides (list / news) */
html[data-theme="dark"] .archive-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 15px 35px rgba(96, 165, 250, 0.15);
}
html[data-theme="dark"] .pagination-btn {
    background: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-color);
}
html[data-theme="dark"] .pagination-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}
html[data-theme="dark"] .pagination a,
html[data-theme="dark"] .pagination span {
    background: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-color);
}
html[data-theme="dark"] .pagination a:hover,
html[data-theme="dark"] .pagination .current {
    background: var(--primary-color);
    color: #fff;
}
html[data-theme="dark"] .article-sidebar {
    background: var(--surface-color);
    border-color: var(--border-color);
}
