/* ============================================================
   WALKER WILD
   ARTICLE PAGE
   Reuses guides.css shared primitives
   ============================================================ */

.article-page {
    background: #fff;
    color: var(--color-text, #202020);
}


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

.article-hero {
    padding-block:
        clamp(4.5rem, 9vw, 8rem)
        clamp(3.5rem, 7vw, 6rem);
    background: #f4f1e9;
}

.article-hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.55fr);
    gap: clamp(3rem, 9vw, 8rem);
    align-items: end;
}

.article-category {
    display: inline-block;
    margin: 1.5rem 0 1rem;
    color: #676767;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.article-hero__title {
    max-width: 930px;
    margin: 0;
    color: #0b463e;
    font-family: var(--font-heading, inherit);
    font-size: clamp(2.8rem, 6.5vw, 6rem);
    font-weight: 850;
    line-height: 0.94;
    letter-spacing: -0.052em;
    text-wrap: balance;
}

.article-hero__meta {
    padding-top: 1.5rem;
    border-top: 2px solid #173d36;
}

.article-hero__excerpt {
    margin: 0;
    color: #4f4f4f;
    font-size: clamp(1rem, 1.5vw, 1.12rem);
    font-weight: 550;
    line-height: 1.7;
}

.article-date {
    margin: 1.5rem 0 0;
    color: #797979;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}


/* ============================================================
   COVER
   ============================================================ */

.article-cover {
    padding-top: clamp(2rem, 4vw, 3.5rem);
    background: #fff;
}

.article-cover__figure {
    aspect-ratio: 16 / 9;
    margin: 0;
    overflow: hidden;
    background: #ddd8ce;
}

.article-cover__figure img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* ============================================================
   BODY LAYOUT
   ============================================================ */

.article-body {
    padding-block: clamp(4rem, 8vw, 7rem);
    background: #fff;
}

.article-body__layout {
    display: grid;
    grid-template-columns: minmax(150px, 190px) minmax(0, 760px);
    gap: clamp(3rem, 8vw, 7rem);
    justify-content: center;
    align-items: start;
}


/* ============================================================
   SIDE RAIL
   ============================================================ */

.article-rail {
    min-width: 0;
}

.article-rail__inner {
    position: sticky;
    top: 110px;
    padding-top: 1.2rem;
    border-top: 2px solid #173d36;
}

.article-rail__label {
    margin: 0 0 1rem;
    color: #bd7000;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.article-rail__nav {
    display: grid;
}

.article-rail__nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.85rem 0;
    border-top: 1px solid #e3dfd6;
    color: #173d36;
    font-size: 0.8rem;
    font-weight: 750;
    line-height: 1.35;
    text-decoration: none;
}

.article-rail__nav a:last-child {
    border-bottom: 1px solid #e3dfd6;
}

.article-rail__nav a span {
    color: #bd7000;
    transition: transform 150ms ease;
}

.article-rail__nav a:hover span {
    transform: translateX(3px);
}


/* ============================================================
   MARKDOWN CONTENT
   ============================================================ */

.article-content {
    min-width: 0;
    color: #333;
    font-size: clamp(1rem, 1.2vw, 1.08rem);
    line-height: 1.8;
}

.article-content > *:first-child {
    margin-top: 0;
}

.article-content > *:last-child {
    margin-bottom: 0;
}


/* Paragraphs */

.article-content p {
    margin: 0 0 1.45rem;
}


/* Headings */

.article-content h2 {
    margin:
        clamp(3.5rem, 6vw, 5rem)
        0
        1.35rem;
    color: #0b463e;
    font-family: var(--font-heading, inherit);
    font-size: clamp(1.7rem, 3vw, 2.55rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.article-content h3 {
    margin: 2.7rem 0 1rem;
    color: #173d36;
    font-family: var(--font-heading, inherit);
    font-size: clamp(1.25rem, 2vw, 1.6rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.article-content h4 {
    margin: 2rem 0 0.8rem;
    color: #173d36;
    font-size: 1rem;
    font-weight: 800;
}


/* Links */

.article-content a {
    color: #9f5f00;
    font-weight: 700;
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.article-content a:hover {
    color: #734600;
}


/* Strong / emphasis */

.article-content strong {
    color: #173d36;
    font-weight: 800;
}


/* Lists */

.article-content ul,
.article-content ol {
    margin: 1.5rem 0 1.8rem;
    padding-left: 1.35rem;
}

.article-content li {
    margin: 0.6rem 0;
    padding-left: 0.3rem;
}

.article-content li::marker {
    color: #bd7000;
    font-weight: 800;
}


/* Blockquote */

.article-content blockquote {
    margin: clamp(2.5rem, 5vw, 4rem) 0;
    padding:
        1.5rem
        clamp(1.3rem, 3vw, 2rem);
    border-left: 4px solid #d78711;
    background: #f4f1e9;
    color: #173d36;
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    font-weight: 650;
    line-height: 1.6;
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}


/* Separator */

.article-content hr {
    margin: clamp(3rem, 6vw, 5rem) 0;
    border: 0;
    border-top: 1px solid #d8d3c8;
}


/* Images */

.article-content img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    margin:
        clamp(2.5rem, 5vw, 4rem)
        auto;
}


/* Figures */

.article-content figure {
    margin: clamp(2.5rem, 5vw, 4rem) 0;
}

.article-content figure img {
    width: 100%;
    margin: 0;
}

.article-content figcaption {
    margin-top: 0.8rem;
    color: #777;
    font-size: 0.78rem;
    line-height: 1.5;
}


/* Tables */

.article-content table {
    width: 100%;
    margin: clamp(2.5rem, 5vw, 4rem) 0;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.article-content th,
.article-content td {
    padding: 0.9rem 0.8rem;
    border-bottom: 1px solid #ddd8ce;
    text-align: left;
    vertical-align: top;
}

.article-content th {
    border-top: 2px solid #173d36;
    color: #173d36;
    font-weight: 800;
}

.article-content tbody tr:last-child td {
    border-bottom-color: #173d36;
}


/* Inline code */

.article-content code {
    padding: 0.12em 0.32em;
    border-radius: 3px;
    background: #efebe2;
    color: #173d36;
    font-size: 0.9em;
}


/* Code blocks */

.article-content pre {
    max-width: 100%;
    overflow-x: auto;
    margin: 2rem 0;
    padding: 1.25rem;
    background: #073b34;
    color: #fff;
    font-size: 0.86rem;
    line-height: 1.6;
}

.article-content pre code {
    padding: 0;
    background: transparent;
    color: inherit;
}


/* ============================================================
   NEXT / PAGE FOOTER
   ============================================================ */

.article-next {
    padding-block: clamp(4rem, 7vw, 6rem);
    background: #073b34;
}

.article-next__inner {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: clamp(3rem, 8vw, 8rem);
    align-items: center;
}

.article-next h2 {
    margin: 0;
    color: #fff;
    font-family: var(--font-heading, inherit);
    font-size: clamp(2rem, 4vw, 4rem);
    font-weight: 850;
    line-height: 0.96;
    letter-spacing: -0.045em;
    text-transform: uppercase;
}

.article-next__links {
    border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.article-next__links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.article-next__links a > span:last-child {
    color: #dc941d;
    transition: transform 150ms ease;
}

.article-next__links a:hover > span:last-child {
    transform: translateX(3px);
}


/* ============================================================
   ACCESSIBILITY
   ============================================================ */

.article-rail__nav a:focus-visible,
.article-content a:focus-visible,
.article-next__links a:focus-visible {
    outline: 3px solid #d78711;
    outline-offset: 3px;
}


/* ============================================================
   TABLET
   ============================================================ */

@media (max-width: 950px) {

    .article-hero__inner {
        grid-template-columns: minmax(0, 1fr) minmax(250px, 0.5fr);
        gap: 4rem;
    }

    .article-body__layout {
        grid-template-columns: minmax(130px, 170px) minmax(0, 720px);
        gap: 3rem;
    }

}


/* ============================================================
   SMALL TABLET
   ============================================================ */

@media (max-width: 780px) {

    .article-hero__inner,
    .article-next__inner {
        grid-template-columns: 1fr;
        gap: 2.8rem;
    }

    .article-hero__meta {
        max-width: 650px;
    }

    .article-body__layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .article-rail__inner {
        position: static;
    }

    .article-rail__nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    .article-rail__nav a {
        border-top: 1px solid #e3dfd6;
        border-bottom: 1px solid #e3dfd6;
    }

}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 600px) {

    .article-hero {
        padding-block: 3.75rem 3.25rem;
    }

    .article-hero__inner {
        gap: 2.4rem;
    }

    .article-hero__title {
        font-size: clamp(2.35rem, 12vw, 3.7rem);
        line-height: 0.97;
    }

    .article-category {
        margin-top: 1.25rem;
    }

    .article-cover {
        padding-top: 1rem;
    }

    .article-cover .guides-container {
        width: 100%;
    }

    .article-cover__figure {
        aspect-ratio: 4 / 3;
    }

    .article-body {
        padding-block: 3.75rem;
    }

    .article-body__layout {
        gap: 2.5rem;
    }

    .article-rail__nav {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .article-rail__nav a + a {
        border-top: 0;
    }

    .article-content {
        font-size: 1rem;
        line-height: 1.75;
    }

    .article-content h2 {
        margin-top: 3.2rem;
    }

    .article-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .article-next__inner {
        gap: 2.5rem;
    }

}


/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    .article-rail__nav a span,
    .article-next__links a > span:last-child {
        transition: none;
    }

}
