/* templates.css */

/* Palette 01 — Turquoise Paper */
.turquoise-paper {
    --paper: #e5efeb;
    --ink: #20201d;
    --muted: #596b66;
    --line: #a5cec6;
    --accent: #007f79;
    --accent-hover: #00655f;
    --accent-text: #007f79;
}

/* Palette 02 — Cobalt Dust */
.cobalt-dust {
    --paper: #e9edf2;
    --ink: #20201d;
    --muted: #606575;
    --line: #b5c9e8;
    --accent: #0047ab;
    --accent-hover: #003783;
}

/* Palette 03 — Emerald & Green Dust */
.emerald-gold {
    --paper: #e8eee2;
    --ink: #20201d;
    --muted: #60685b;
    --line: #a8c7b2;
    --accent: #00965e;
    --accent-hover: #007a4c;
}

/* Palette 04 — Faded Red */
.faded-red {
    --paper: #f2e6e2;
    --ink: #20201d;
    --muted: #6b5e5b;
    --line: #dba9a8;
    --accent: #d3494e;
    --accent-hover: #b3333a;
}

/* Palette 05 — Violet Haze */
.violet-haze {
    --paper: #eee8ed;
    --ink: #20201d;
    --muted: #68606b;
    --line: #c4afce;
    --accent: #783ca0;
    --accent-hover: #5e287f;
}

/* Palette 06 — Blood Orange */
.blood-orange {
    --paper: #f3e7d8;
    --ink: #20201d;
    --muted: #6b6155;
    --line: #d9ae87;
    --accent: #d44b0b;
    --accent-hover: #ad3906;
}

/* Shared foundation for all article palettes */
.article-page {
    --reading-font: Palatino, "Palatino Linotype", "Book Antiqua",
        Georgia, serif;
    --gold: var(--accent);

    background: var(--paper);
    color: var(--ink);
}

/* Horizontal rules */
.article-page hr {
    height: 0;
    margin: 32px 0;
    border: 0;
    border-top: 1px solid var(--line);
}

/* Article links */
.article-body a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.article-body a:hover {
    color: var(--accent-hover);
    text-decoration-thickness: 2px;
}

/* Byline and date left; reading time right */
.article-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 24px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font: 12px/1.5 Arial, Helvetica, sans-serif;
}

.article-byline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
}

.article-author {
    color: var(--ink);
}

.article-read-time {
    margin-left: auto;
}

/* One comfortable reading column */
.article-body {
    max-width: 720px;
    margin: 40px auto 64px;
    font: 400 20px/1.65 var(--reading-font);
}

.article-body p {
    margin: 0 0 1.15em;
}

.article-body h2 {
    margin: 2em 0 0.75em;
    font-family: var(--reading-font);
    font-size: clamp(27px, 3vw, 34px);
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -0.3px;
}

/* Colored italic pullouts, without a box or background */
.article-body .article-pullout,
.article-body .article-pullout.is-tinted {
    margin: 36px 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font: italic 400 clamp(26px, 3vw, 34px)/1.35
        var(--reading-font);
    letter-spacing: -0.3px;
}

.article-body .article-pullout p {
    margin: 0;
    color: inherit;
}

.article-body > .article-pullout:first-child {
    margin-top: 0;
}

/*
 * Optional research notes
 *
 * Wrap a related passage and its note in .article-evidence.
 * Put the passage first, then an aside.research-note.
 * Notes remain in the reading flow until there is enough
 * room to place them in the left margin.
 */
.article-evidence {
    position: relative;
    margin: 0 0 1.15em;
}

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

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

.article-body .research-note {
    margin: 24px 0 28px;
    padding: 14px 0 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font: 13px/1.6 Arial, Helvetica, sans-serif;
    overflow-wrap: anywhere;
}

.article-body .research-note h3 {
    margin: 0 0 10px;
    color: var(--accent);
    font: 400 21px/1.2 var(--reading-font);
    letter-spacing: -0.2px;
}

.article-body .research-note p {
    margin: 0 0 12px;
}

.article-body .research-note p:last-child {
    margin-bottom: 0;
}

.article-body .research-note .research-source {
    display: block;
    margin-top: 12px;
    font-size: 11px;
    font-style: normal;
    line-height: 1.5;
}

.article-body .research-note a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.article-body .research-note a:hover {
    color: var(--accent-hover);
    text-decoration-thickness: 2px;
}

/*
 * On wide screens, each evidence passage and its note share
 * a grid row. Long notes reserve their own vertical space.
 * The main reading column retains its existing position.
 */
@media (min-width: 1280px) {
    .article-evidence {
        display: grid;
        grid-template-columns: 180px minmax(0, 1fr);
        column-gap: 40px;
        align-items: start;
        width: calc(100% + 220px);
        margin-left: -220px;
    }

    .article-evidence > :not(.research-note) {
        grid-column: 2;
        min-width: 0;
    }

    .article-evidence > :first-child {
        grid-row: 1;
    }

    .article-body .article-evidence > .research-note {
        grid-column: 1;
        grid-row: 1;
        margin: 0;
    }

    .article-evidence > p {
        margin-bottom: 0;
    }
}

/* Accessible text */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Site tagline */
.site-tagline {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0;
}

/* Article opening */
.article-masthead {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 48px;
    padding: 64px 0 48px;
}

.article-masthead .eyebrow {
    color: var(--accent);
    text-transform: uppercase;
}

.article-title {
    display: flex;
    align-items: baseline;
    gap: 0.045em;
    margin: 16px 0 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(100px, 16vw, 200px);
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: -0.085em;
}

/* Canted square beside the opening title */
.article-title-square {
    display: inline-block;
    flex: 0 0 auto;
    width: 0.14em;
    height: 0.14em;
    background: var(--accent);
    transform: rotate(-8deg);
}

.article-deck {
    max-width: 460px;
}

.article-deck h2 {
    margin: 0 0 18px;
    font: 400 clamp(28px, 3vw, 38px)/1.2
        var(--reading-font);
    letter-spacing: -0.5px;
}

.article-deck p {
    margin: 0;
    color: var(--muted);
    font: 400 18px/1.6 var(--reading-font);
}

.article-ending {
    color: var(--accent);
    font-weight: 700;
}

/* Author and contact */
.article-afterword {
    max-width: 720px;
    margin: 0 auto 56px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font: 14px/1.65 Arial, Helvetica, sans-serif;
}

.article-afterword p {
    margin: 0 0 14px;
}

.article-afterword .article-author-name {
    margin-bottom: 3px;
    color: var(--ink);
    font-size: 22px;
}

.article-afterword h2 {
    margin: 28px 0 12px;
    color: var(--ink);
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
}

.article-afterword a {
    color: var(--accent);
}

.article-afterword .article-reuse {
    margin-top: 28px;
    font-size: 12px;
}

/* Mobile */
@media (max-width: 620px) {
    .article-body {
        margin-top: 28px;
        font-size: 19px;
    }

    .article-body .article-pullout,
    .article-body .article-pullout.is-tinted {
        margin: 28px 0;
        padding: 0;
    }

    .article-body > .article-pullout:first-child {
        margin-top: 0;
    }

    .article-masthead {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 40px 0 30px;
    }

    .article-title {
        font-size: clamp(100px, 25vw, 150px);
    }

    .article-deck {
        max-width: none;
    }

    .article-afterword {
        margin-bottom: 40px;
    }
}

/* Keep research notes readable when printing */
@media print {
    .article-evidence {
        display: block;
        width: auto;
        margin-left: 0;
    }

    .article-body .article-evidence > .research-note {
        margin: 16px 0 24px;
        break-inside: avoid;
    }
}