/* =========================================================
   Compendium — public site styles
   Palette: cool herbal paper, conifer ink, and a matcha accent
   reserved for the source-count markers.
   ========================================================= */

:root {
    --paper:      #F1F4ED;
    --paper-deep: #E4EBDF;
    --card:       #FFFFFF;
    --ink:        #121F19;
    --stone:      #5D6D64;
    --leaf:       #2C6A4B;
    --leaf-deep:  #1C4733;
    --tint:       #DBE8DD;
    --matcha:     #C2DC78;
    --line:       rgba(18, 31, 25, .13);
    --line-soft:  rgba(18, 31, 25, .07);

    --wrap: 1180px;
    --radius: 4px;
    --radius-lg: 10px;

    --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
    --sans: "Archivo", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.6;
    font-synthesis-weight: none;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--leaf-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--leaf); }

:focus-visible {
    outline: 2px solid var(--leaf);
    outline-offset: 3px;
    border-radius: 2px;
}

h1, h2, h3, h4 {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -.015em;
    line-height: 1.15;
    margin: 0;
    text-wrap: balance;
}

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 40px, 860px); margin-inline: auto; }

.skip {
    position: absolute; left: -9999px; top: 0;
    background: var(--ink); color: #fff; padding: 10px 16px; z-index: 99;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- header ---------- */

.site-head {
    position: sticky; top: 0; z-index: 40;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line-soft);
}

.site-head__in {
    display: flex; align-items: center; gap: 28px;
    min-height: 68px;
}

.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); }
.brand__mark { width: 22px; height: 22px; align-self: center; }
.brand__name { font-family: var(--serif); font-size: 23px; letter-spacing: -.02em; }
.brand__sub {
    font-size: 12.5px; color: var(--stone); font-family: var(--sans);
    letter-spacing: .01em;
}

.nav { margin-left: auto; display: flex; align-items: center; gap: 26px; }
.nav a {
    color: var(--ink); text-decoration: none; font-size: 15px;
    padding-block: 4px; border-bottom: 1px solid transparent;
}
.nav a:hover { border-bottom-color: var(--leaf); }
.nav a[aria-current="page"] { border-bottom-color: var(--ink); }

.nav__admin { color: var(--stone) !important; }

.burger {
    display: none; margin-left: auto; background: none; border: 1px solid var(--line);
    border-radius: var(--radius); width: 42px; height: 38px; cursor: pointer;
    align-items: center; justify-content: center;
}
.burger span { display: block; width: 18px; height: 1.5px; background: var(--ink); position: relative; }
.burger span::before, .burger span::after {
    content: ""; position: absolute; left: 0; width: 18px; height: 1.5px; background: var(--ink);
}
.burger span::before { top: -6px; }
.burger span::after { top: 6px; }

/* ---------- hero ---------- */

.hero { padding: 74px 0 66px; border-bottom: 1px solid var(--line-soft); }

.hero__grid {
    display: grid; grid-template-columns: 1.08fr .92fr; gap: 64px; align-items: end;
}

.hero__title {
    font-size: clamp(40px, 5.4vw, 68px);
    line-height: 1.03;
    letter-spacing: -.03em;
    max-width: 12ch;
}
.hero__title em { font-style: italic; font-weight: 300; }

.hero__lead {
    margin: 26px 0 0; max-width: 46ch; color: var(--stone);
    font-size: 18px; line-height: 1.65;
}

.hero__search { margin-top: 30px; display: flex; gap: 8px; max-width: 430px; }
.hero__search input {
    flex: 1; padding: 13px 16px; border: 1px solid var(--line);
    border-radius: var(--radius); background: var(--card); font: inherit; font-size: 15.5px;
    color: var(--ink);
}
.hero__search input::placeholder { color: color-mix(in srgb, var(--stone) 75%, transparent); }

.hero__figure { position: relative; }
.hero__figure img {
    width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
    border-radius: var(--radius-lg);
}
.hero__caption {
    margin-top: 12px; font-size: 13px; color: var(--stone); max-width: 34ch;
    padding-left: 14px; border-left: 2px solid var(--tint);
}

.hero__stats {
    display: flex; gap: 34px; margin-top: 40px; padding-top: 26px;
    border-top: 1px solid var(--line-soft);
}
.hero__stat b {
    display: block; font-family: var(--serif); font-size: 30px; font-weight: 400; line-height: 1;
}
.hero__stat span { font-size: 13.5px; color: var(--stone); }

/* ---------- buttons ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 22px; border-radius: var(--radius); border: 1px solid var(--leaf-deep);
    background: var(--leaf-deep); color: #fff; font: inherit; font-size: 15px;
    cursor: pointer; text-decoration: none; transition: background .18s ease, color .18s ease;
}
.btn:hover { background: var(--leaf); border-color: var(--leaf); color: #fff; }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--card); color: var(--ink); border-color: var(--ink); }

.btn-small { padding: 9px 15px; font-size: 14px; }

/* ---------- sections ---------- */

.section { padding: 66px 0; }
.section + .section { padding-top: 0; }

.section__head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 20px; margin-bottom: 30px;
    padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.section__head h2 { font-size: 27px; }
.section__head a { font-size: 14.5px; color: var(--stone); }

/* ---------- lead article ---------- */

.feature {
    display: grid; grid-template-columns: 1.02fr 1fr; gap: 46px; align-items: center;
    background: var(--card); border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg); overflow: hidden;
}
.feature__media { overflow: hidden; height: 100%; min-height: 320px; }
.feature__media img { width: 100%; height: 100%; object-fit: cover; }
.feature__body { padding: 40px 44px 40px 0; }
.feature__title { font-size: clamp(28px, 3.2vw, 38px); margin-bottom: 14px; }
.feature__title a { color: inherit; text-decoration: none; }
.feature__title a:hover { text-decoration: underline; text-decoration-color: var(--tint); }
.feature__excerpt { color: var(--stone); margin: 0 0 22px; max-width: 48ch; }

/* ---------- metadata ---------- */

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 13.5px; color: var(--stone); }
.meta > * + *::before {
    content: ""; display: inline-block; width: 1px; height: 11px;
    background: var(--line); margin-right: 14px; vertical-align: -1px;
}

.rubric {
    color: var(--leaf-deep); text-decoration: none; font-size: 13.5px;
    border-bottom: 1px solid var(--tint);
}
.rubric:hover { border-bottom-color: var(--leaf); }

.evidence {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; color: var(--leaf-deep);
}
.evidence::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%;
    background: var(--matcha); box-shadow: 0 0 0 3px color-mix(in srgb, var(--matcha) 30%, transparent);
}

/* ---------- cards ---------- */

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }

.card { display: flex; flex-direction: column; }
.card__media { border-radius: var(--radius-lg); overflow: hidden; background: var(--paper-deep); }
.card__media img {
    width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
    transition: transform .5s cubic-bezier(.2,.7,.3,1);
}
.card:hover .card__media img { transform: scale(1.035); }
.card__title { font-size: 21px; margin: 16px 0 8px; }
.card__title a { color: inherit; text-decoration: none; }
.card__title a:hover { text-decoration: underline; text-decoration-color: var(--tint); }
.card__excerpt { color: var(--stone); font-size: 15px; margin: 0 0 14px; }
.card .meta { margin-top: auto; }

/* ---------- list rows ---------- */

.rows { display: flex; flex-direction: column; }

.row {
    display: grid; grid-template-columns: 132px 1fr; gap: 26px; align-items: start;
    padding: 26px 0; border-top: 1px solid var(--line-soft);
}
.row:last-child { border-bottom: 1px solid var(--line-soft); }
.row__media { border-radius: var(--radius); overflow: hidden; background: var(--paper-deep); }
.row__media img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.row__title { font-size: 22px; margin-bottom: 8px; }
.row__title a { color: inherit; text-decoration: none; }
.row__title a:hover { text-decoration: underline; text-decoration-color: var(--tint); }
.row__excerpt { color: var(--stone); font-size: 15.5px; margin: 0 0 12px; max-width: 62ch; }

/* ---------- topic pills ---------- */

.rubrics { display: flex; flex-wrap: wrap; gap: 10px; }
.rubrics a {
    display: inline-flex; align-items: baseline; gap: 8px;
    padding: 10px 16px; background: var(--card); border: 1px solid var(--line-soft);
    border-radius: 40px; text-decoration: none; color: var(--ink); font-size: 15px;
}
.rubrics a:hover { border-color: var(--leaf); }
.rubrics a[aria-current="page"] { background: var(--leaf-deep); color: #fff; border-color: var(--leaf-deep); }
.rubrics em { font-style: normal; color: var(--stone); font-size: 13px; }
.rubrics a[aria-current="page"] em { color: color-mix(in srgb, #fff 70%, transparent); }

/* ---------- filters on the articles page ---------- */

.filters {
    display: flex; flex-wrap: wrap; align-items: center; gap: 22px;
    padding: 18px 0; border-block: 1px solid var(--line-soft); margin-bottom: 10px;
}
.filters__links { display: flex; flex-wrap: wrap; gap: 18px; }
.filters__links a {
    text-decoration: none; color: var(--stone); font-size: 15px;
    padding-bottom: 3px; border-bottom: 1.5px solid transparent;
}
.filters__links a:hover { color: var(--ink); }
.filters__links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--leaf); }

.searchbox { margin-left: auto; display: flex; gap: 8px; }
.searchbox input {
    padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--card); font: inherit; font-size: 15px; width: 230px; color: var(--ink);
}

.result-note { color: var(--stone); font-size: 15px; margin: 22px 0 0; }

/* ---------- pagination ---------- */

.pager { display: flex; gap: 8px; margin: 40px 0 0; flex-wrap: wrap; }
.pager a, .pager span {
    min-width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none;
    color: var(--ink); font-size: 15px; padding-inline: 12px;
}
.pager a:hover { border-color: var(--ink); }
.pager .is-current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- article page ---------- */

.article-head { padding: 56px 0 30px; }
.article-head h1 {
    font-size: clamp(34px, 4.6vw, 54px); letter-spacing: -.03em; margin: 16px 0 20px;
    max-width: 20ch;
}
.article-head .meta { margin-top: 6px; }
.article-lead { font-size: 20px; color: var(--stone); max-width: 60ch; line-height: 1.6; margin: 0; }

.article-cover { margin: 34px 0 0; }
.article-cover img {
    width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border-radius: var(--radius-lg);
}
.article-cover figcaption { font-size: 13px; color: var(--stone); margin-top: 10px; }

.article-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 60px;
    padding: 46px 0 70px; align-items: start;
}

.prose { font-family: var(--serif); font-size: 20px; line-height: 1.72; max-width: 68ch; }
.prose p { margin: 0 0 1.15em; }
.prose h2 { font-size: 29px; margin: 1.7em 0 .55em; letter-spacing: -.02em; }
.prose h3 { font-size: 23px; margin: 1.5em 0 .5em; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.2em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--leaf); }
.prose strong { font-weight: 600; }
.prose a { color: var(--leaf-deep); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose blockquote {
    margin: 1.6em 0; padding: 4px 0 4px 24px; border-left: 2px solid var(--matcha);
    font-style: italic; color: var(--ink);
}
.prose blockquote p { margin: 0; }
.prose code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em;
    background: var(--tint); padding: 1px 5px; border-radius: 3px;
}
.prose-figure { margin: 1.8em 0; }
.prose-figure img { width: 100%; border-radius: var(--radius-lg); }
.prose-figure figcaption {
    font-family: var(--sans); font-size: 13px; color: var(--stone); margin-top: 9px;
}

.aside { position: sticky; top: 92px; font-size: 15px; }
.aside__block + .aside__block { margin-top: 30px; }
.aside h3 { font-size: 17px; margin-bottom: 12px; font-family: var(--sans); font-weight: 600; }
.sources { margin: 0; padding: 0; list-style: none; counter-reset: src; }
.sources li {
    counter-increment: src; position: relative; padding-left: 26px; margin-bottom: 14px;
    font-size: 14.5px; color: var(--stone); line-height: 1.5;
}
.sources li::before {
    content: counter(src); position: absolute; left: 0; top: 1px;
    font-size: 12px; color: var(--leaf-deep);
    background: var(--tint); width: 18px; height: 18px; border-radius: 50%;
    display: grid; place-items: center;
}
.aside__links { list-style: none; margin: 0; padding: 0; }
.aside__links li { margin-bottom: 14px; }
.aside__links a { font-family: var(--serif); font-size: 17px; color: var(--ink); text-decoration: none; }
.aside__links a:hover { text-decoration: underline; text-decoration-color: var(--tint); }
.aside__links span { display: block; font-size: 13px; color: var(--stone); }

/* ---------- disclaimers ---------- */

.notice {
    background: var(--tint); border-radius: var(--radius-lg); padding: 26px 30px;
    font-size: 15.5px; line-height: 1.6; color: var(--leaf-deep); max-width: 68ch;
}
.notice strong { font-weight: 600; }
.notice-band { background: var(--paper-deep); padding: 34px 0; border-block: 1px solid var(--line-soft); }
.notice-band p { margin: 0; color: var(--stone); font-size: 15px; max-width: 78ch; }
.notice-band b { color: var(--ink); font-weight: 600; }

/* ---------- subscribe block ---------- */

.subscribe {
    background: var(--leaf-deep); color: #fff; border-radius: var(--radius-lg);
    padding: 46px 48px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center;
}
.subscribe h2 { font-size: 30px; color: #fff; margin-bottom: 10px; }
.subscribe p { margin: 0; color: color-mix(in srgb, #fff 72%, transparent); font-size: 15.5px; }
.subscribe form { display: flex; gap: 8px; }
.subscribe input {
    flex: 1; padding: 13px 16px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, #fff 28%, transparent);
    background: color-mix(in srgb, #fff 10%, transparent); color: #fff; font: inherit; font-size: 15px;
}
.subscribe input::placeholder { color: color-mix(in srgb, #fff 60%, transparent); }
.subscribe .btn { background: var(--matcha); border-color: var(--matcha); color: var(--leaf-deep); }
.subscribe .btn:hover { background: #fff; border-color: #fff; color: var(--leaf-deep); }

/* ---------- footer ---------- */

.site-foot {
    border-top: 1px solid var(--line); margin-top: 70px; padding: 46px 0 40px;
    font-size: 14.5px; color: var(--stone);
}
.site-foot__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
.site-foot h4 { font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 12px; }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin-bottom: 9px; }
.site-foot a { color: var(--stone); text-decoration: none; }
.site-foot a:hover { color: var(--ink); text-decoration: underline; }
.site-foot__bottom {
    margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line-soft);
    display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 13.5px;
}

/* ---------- flash messages ---------- */

.flash { margin: 20px auto 0; padding: 14px 18px; border-radius: var(--radius); font-size: 15px; }
.flash-ok { background: var(--tint); color: var(--leaf-deep); }
.flash-err { background: #FBE6E1; color: #8A3520; }

/* ---------- empty state ---------- */

.empty { padding: 60px 0; text-align: left; }
.empty h2 { font-size: 26px; margin-bottom: 10px; }
.empty p { color: var(--stone); max-width: 48ch; }

/* ---------- hero entrance ---------- */

@media (prefers-reduced-motion: no-preference) {
    .reveal > * { animation: rise .7s cubic-bezier(.2,.7,.3,1) backwards; }
    .reveal > *:nth-child(2) { animation-delay: .08s; }
    .reveal > *:nth-child(3) { animation-delay: .16s; }
    @keyframes rise {
        from { opacity: 0; transform: translateY(14px); }
        to   { opacity: 1; transform: none; }
    }
}

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
    .hero__grid { grid-template-columns: 1fr; gap: 40px; }
    .hero__figure img { aspect-ratio: 16 / 10; }
    .feature { grid-template-columns: 1fr; }
    .feature__media { min-height: 240px; }
    .feature__body { padding: 30px 30px 34px; }
    .cards { grid-template-columns: repeat(2, 1fr); }
    .article-grid { grid-template-columns: 1fr; gap: 40px; }
    .aside { position: static; border-top: 1px solid var(--line); padding-top: 26px; }
    .subscribe { grid-template-columns: 1fr; padding: 34px; }
    .site-foot__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
    body { font-size: 16px; }
    .burger { display: inline-flex; }
    .nav {
        display: none; position: absolute; top: 68px; left: 0; right: 0;
        background: var(--paper); border-bottom: 1px solid var(--line);
        flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 20px 16px;
    }
    .nav.is-open { display: flex; }
    .nav a { padding: 12px 0; width: 100%; border-bottom: 1px solid var(--line-soft); }
    .cards { grid-template-columns: 1fr; }
    .row { grid-template-columns: 92px 1fr; gap: 18px; }
    .row__title { font-size: 19px; }
    .row__excerpt { font-size: 15px; }
    .section { padding: 44px 0; }
    .hero { padding: 46px 0 44px; }
    .prose { font-size: 18.5px; }
    .article-cover img { aspect-ratio: 3 / 2; }
    .site-foot__grid { grid-template-columns: 1fr; gap: 28px; }
    .searchbox { margin-left: 0; width: 100%; }
    .searchbox input { width: 100%; }
    .filters { gap: 14px; }
}
