/* ==========================================================
   NEXO ARTICLE — PREMIUM EDITORIAL LAYOUT
========================================================== */

body {
    margin: 0;
    padding: 0;
    background: #fff;
}

.article-wrapper {
    width: 92%;
    max-width: 1320px;
}

/* ==========================================================
   HEADER
========================================================== */

.article-header {
    margin-top: 118px;
    padding: 58px 0 34px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin-bottom: 30px;
    color: var(--navy);
    text-decoration: none;
    font-weight: 700;
    transition: .2s ease;
}

.back-link:hover {
    color: var(--gold);
    transform: translateX(-2px);
}

.article-category,
.related-category {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(184, 135, 85, .10);
    color: var(--gold);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.article-category {
    margin-bottom: 22px;
}

.article-title {
    max-width: 980px;
    margin: 0 0 24px;
    color: var(--navy);
    font-size: clamp(42px, 4.5vw, 64px);
    line-height: 1.08;
    letter-spacing: -.035em;
    text-wrap: balance;
}

.article-excerpt {
    max-width: 900px;
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 21px;
    line-height: 1.72;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px 26px;
    margin: 26px 0 0;
    color: var(--muted);
    font-size: 14px;
    flex-wrap: wrap;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.meta-item i {
    width: 17px;
    color: var(--navy);
    text-align: center;
}

/* ==========================================================
   HERO IMAGE
========================================================== */

.article-image-section {
    padding: 0 0 62px;
}

.article-hero {
    margin: 0;
}

.article-image {
    width: 100%;
    height: clamp(390px, 43vw, 600px);
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 26px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .13);
}

/* ==========================================================
   READING AREA
========================================================== */

.article-content-section {
    padding: 8px 0 105px;
}

.article-reading-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 820px);
    gap: 72px;
    align-items: start;
    justify-content: start;
}

.article-content-column {
    min-width: 0;
}

.article-content {
    max-width: 820px;
    margin: 0;
    color: #2B3442;
    font-size: 19px;
    line-height: 1.9;
}

.article-content p {
    margin: 0 0 24px;
}

.article-content p:empty {
    display: none;
}

.article-content > p:has(> br:only-child) {
    min-height: 0;
    margin: 0;
}

.article-content h2,
.article-content h3 {
    position: relative;
    color: var(--navy);
    letter-spacing: -.025em;
}

.article-content h2 {
    margin: 64px 0 24px;
    padding-top: 12px;
    font-size: 36px;
    line-height: 1.22;
}

.article-content h2::before {
    content: "";
    display: block;
    width: 42px;
    height: 3px;
    margin-bottom: 16px;
    border-radius: 99px;
    background: var(--gold);
}

.article-content h3 {
    margin: 44px 0 18px;
    font-size: 28px;
    line-height: 1.3;
}

.article-content ul,
.article-content ol {
    margin: 24px 0 28px;
    padding-left: 28px;
}

.article-content li {
    margin-bottom: 12px;
    padding-left: 4px;
}

.article-content strong {
    color: #1D2939;
}

.article-content a {
    color: var(--navy);
    font-weight: 700;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.article-content img {
    width: 100%;
    max-height: 620px;
    object-fit: cover;
    border-radius: 20px;
    margin: 42px 0;
}

/* ==========================================================
   TABLE OF CONTENTS
========================================================== */

.article-toc {
    position: sticky;
    top: 145px;
    height: calc(100vh - 175px);
    max-height: calc(100vh - 175px);
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
    padding-right: 8px;
}

.article-toc {
    cursor: default;
    -webkit-overflow-scrolling: touch;
}

.article-toc::-webkit-scrollbar {
    width: 5px;
}

.article-toc::-webkit-scrollbar-track {
    background: transparent;
}

.article-toc::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 999px;
}

.article-toc::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

.toc-card {
    border-left: 1px solid #E2E8F0;
    padding: 6px 0 6px 22px;
}

.toc-label,
.section-kicker {
    color: var(--gold);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.toc-title {
    margin: 8px 0 16px;
    color: var(--navy);
    font-size: 19px;
    font-weight: 800;
}

.toc-card ol {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.toc-item a {
    display: block;
    color: #64748B;
    font-size: 13px;
    line-height: 1.45;
    text-decoration: none;
    transition: .2s ease;
}

.toc-item a:hover {
    color: var(--navy);
}

.toc-h3 a {
    padding-left: 10px;
    color: #8491A3;
    font-size: 12px;
}

/* ==========================================================
   ARTICLE CTA
========================================================== */

.article-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    margin-top: 64px;
    padding: 34px 36px;
    border: 1px solid rgba(6, 43, 104, .09);
    border-radius: 24px;
    background: linear-gradient(135deg, #F7F9FC 0%, #FFFFFF 100%);
    box-shadow: 0 18px 45px rgba(15, 23, 42, .06);
}

.article-cta-copy {
    max-width: 560px;
}

.article-cta h2 {
    margin: 8px 0 10px;
    color: var(--navy);
    font-size: 26px;
    line-height: 1.25;
}

.article-cta p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.article-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    gap: 12px;
    min-height: 52px;
    padding: 0 24px;
    border-radius: 11px;
    background: var(--navy);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 12px 26px rgba(6, 43, 104, .18);
    transition: .2s ease;
}

.article-cta-button:hover {
    color: #fff;
    background: var(--navy-light);
    transform: translateY(-2px);
}

/* ==========================================================
   RELATED POSTS
========================================================== */

.related-posts {
    padding: 82px 0 92px;
    background: #F8FAFC;
}

.related-posts h2 {
    max-width: 700px;
    margin: 8px 0 38px;
    color: var(--navy);
    font-size: 38px;
    line-height: 1.2;
    letter-spacing: -.025em;
}

#relatedPosts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.related-card {
    display: block;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .06);
    border-radius: 22px;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .06);
    transition: .3s ease;
}

.related-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 28px 60px rgba(15, 23, 42, .11);
}

.related-image {
    position: relative;
    height: 210px;
    overflow: hidden;
}

.related-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: .4s ease;
}

.related-card:hover .related-image img {
    transform: scale(1.05);
}

.related-content {
    padding: 24px;
}

.related-category {
    margin-bottom: 16px;
    font-size: 11px;
}

.related-card h3 {
    margin: 0 0 14px;
    color: var(--navy);
    font-size: 24px;
    line-height: 1.3;
}

.related-date {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    color: var(--muted);
    font-size: 13px;
    flex-wrap: wrap;
}

.related-date i {
    color: var(--gold);
}

.related-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.no-related-posts {
    color: var(--muted);
    font-style: italic;
}

/* ==========================================================
   ARTICLE NAVIGATION
========================================================== */

.article-navigation {
    padding: 48px 0 86px;
}

#articleNavigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    padding-top: 10px;
}

.nav-card {
    min-width: 0;
}

.nav-card.next {
    text-align: right;
}

.nav-card a {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: .25s ease;
}

.nav-card a:hover {
    transform: translateY(-3px);
}

.nav-card span {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.nav-card strong {
    display: block;
    color: var(--navy);
    font-size: 22px;
    line-height: 1.4;
    transition: .2s ease;
}

.nav-card a:hover strong {
    color: var(--gold);
}

.nav-card.empty {
    min-height: 1px;
}

/* ==========================================================
   404
========================================================== */

.article-not-found {
    margin-top: 118px;
    padding: 120px 0;
}

.article-not-found h1 {
    margin: 0 0 12px;
    color: var(--navy);
    font-size: 64px;
}

.article-not-found p {
    color: var(--muted);
    font-size: 20px;
}

.article-not-found a {
    color: var(--navy);
    font-weight: 700;
}

/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width: 1050px) {
    .article-wrapper {
        width: 90%;
    }

    .article-reading-layout {
        grid-template-columns: 190px minmax(0, 1fr);
        gap: 42px;
    }

    #relatedPosts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .article-header {
        padding-top: 42px;
    }

    .article-title {
        font-size: clamp(38px, 9vw, 52px);
    }

    .article-excerpt {
        font-size: 18px;
    }

    .article-image-section {
        padding-bottom: 42px;
    }

    .article-image {
        height: 380px;
        border-radius: 20px;
    }

    .article-reading-layout {
        display: block;
    }

    .article-toc {
        position: static;
        height: auto;
        max-height: none;
        overflow: visible;
        margin-bottom: 36px;
    }

    .toc-card {
        border: 1px solid #E2E8F0;
        border-radius: 18px;
        padding: 20px;
        background: #F8FAFC;
    }

    .article-content {
        font-size: 18px;
        line-height: 1.82;
    }

    .article-content h2 {
        font-size: 31px;
    }

    .article-content h3 {
        font-size: 25px;
    }

    .article-cta {
        display: block;
        padding: 28px;
    }

    .article-cta-button {
        margin-top: 22px;
    }

    #relatedPosts {
        grid-template-columns: 1fr;
    }

    #articleNavigation {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .nav-card.next {
        text-align: left;
    }
}

@media (max-width: 560px) {
    .article-wrapper {
        width: 88%;
    }

    .article-header {
        margin-top: 100px;
        padding: 34px 0 26px;
    }

    .back-link {
        margin-bottom: 24px;
    }

    .article-title {
        font-size: 37px;
    }

    .article-meta {
        gap: 10px 18px;
    }

    .article-image {
        height: 300px;
        border-radius: 18px;
    }

    .article-content-section {
        padding-bottom: 70px;
    }

    .article-content h2 {
        margin-top: 50px;
        font-size: 29px;
    }

    .article-content h3 {
        margin-top: 36px;
        font-size: 24px;
    }

    .related-posts h2 {
        font-size: 32px;
    }

    .related-image {
        height: 230px;
    }
}
