/* ---------------------------------------------------------------------------
   site.css — chrome around the report pages: nav, homepage, reports feed.

   Loaded after report.css, which supplies the CSS variables, base `body`
   rules, and every class `renderPoster()` emits (`.poster`, `.scores`,
   `.score`, `.metric`, ...). This file only adds what report.css doesn't
   already own: the nav bar, the homepage hero/how-to, and the feed grid that
   wraps each poster card in a link.
--------------------------------------------------------------------------- */

.nav {
    display: flex;
    align-items: baseline;
    gap: 24px;
    padding-bottom: 32px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--rule);
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--paper);
}

.nav .brand {
    font-family: var(--serif);
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.nav a:not(.brand) {
    font-size: 14px;
    color: var(--ink-2);
    text-decoration: none;
}

.nav-login {
    margin-left: auto;
}

/* --- homepage -------------------------------------------------------------- */

.hero {
    max-width: 62ch;
    padding: 24px 0 8px;
}

.hero-head {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 20px;
}

.hero-logo {
    display: block;
    flex-shrink: 0;
    width: clamp(72px, 22vw, 128px);
    height: clamp(72px, 22vw, 128px);
    border-radius: 10px;
}

.hero h1 {
    font-family: var(--serif);
    font-size: clamp(30px, 4.6vw, 44px);
    line-height: 1.12;
    letter-spacing: -0.02em;
    font-weight: 500;
    margin: 0;
}

.hero p {
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink-2);
    margin: 0 0 28px;
}

.cta {
    display: inline-block;
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.how {
    max-width: 68ch;
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--rule);
}

.how h2 {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--ink);
    margin: 0 0 20px;
}

.how ol {
    list-style: none;
    counter-reset: item;
    padding: 0;
    margin: 0;
}

.how ol li {
    counter-increment: item;
    position: relative;
    padding: 16px 0 16px 46px;
    border-top: 1px solid var(--rule-soft);
    color: var(--ink-2);
    line-height: 1.55;
}

.how ol li:last-child {
    border-bottom: 1px solid var(--rule-soft);
}

.how ol li::before {
    content: counter(item, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 18px;
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--accent);
}

.how b {
    font-weight: 600;
    color: var(--ink);
}

/* --- reports feed ------------------------------------------------------------ */

.feed-title {
    font-family: var(--serif);
    font-size: clamp(26px, 3.6vw, 34px);
    font-weight: 500;
    letter-spacing: -0.02em;
    margin: 24px 0 32px;
}

.feed {
    display: grid;
    /* min(340px, 100%) rather than a bare 340px: a bare floor forces that
       track width even when the viewport is narrower, overflowing the page
       on any phone under ~390px instead of shrinking to fit. */
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
    gap: 28px;
}

@media (max-width: 560px) {
    .feed {
        gap: 16px;
    }
}

/* `.feed-card` is a plain div, not a link — the whole-card click-through is
   `.feed-card-link`, a sibling `<a>` stretched over it with `inset: 0`. That
   keeps it out of the poster's own markup, so real links inside the poster
   (the category tags) aren't nested inside another `<a>`, which is invalid
   HTML and makes browsers auto-close the outer one, breaking the card.
   Those inner links sit at a higher z-index so they stay independently
   clickable above the stretched one — see `.category a` in report.css. */
.feed-card {
    position: relative;
}

/* Sits above the poster (z-index: 1), so the global `a:hover` background
   (report.css) would otherwise wash the whole card gray on hover instead of
   just underlining inline text — suppressed here since the card itself
   already has its own hover treatment (none, today). */
.feed-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    transition: none;
}

.feed-card-link:hover {
    background: none;
}

/* the feed shows many cards at once, so the masthead can't afford full size —
   overriding the variable rather than h1's font-size directly keeps the icon
   (sized off the same variable) shrinking in lockstep. */
.feed-card .poster-headline {
    --headline: clamp(22px, 2.6vw, 26px);
}

.feed-card .poster .tagline {
    font-size: 15px;
}

.empty {
    color: var(--ink-2);
}

/* --- about page -------------------------------------------------------------- */

.about {
    max-width: 62ch;
    padding: 24px 0 8px;
}

.about h1 {
    font-family: var(--serif);
    font-size: clamp(28px, 4vw, 38px);
    letter-spacing: -0.02em;
    font-weight: 500;
    margin: 0 0 24px;
}

.about p {
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink-2);
    margin: 0 0 20px;
}

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

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

.footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid var(--rule);
    font-size: 13px;
    color: var(--ink-2);
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-2);
    text-decoration: none;
    font-weight: 600;
}

.footer-brand img {
    display: block;
    border-radius: 4px;
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Icons are single-color SVGs (fill: #0f0f0f) recolored via mask so they
   track --ink-2 across light/dark automatically, instead of needing a
   separate filter rule per theme. Each <i> carries its own --icon (inline
   style, report.tsx's Footer) since a shared class can't point at a
   per-element mask image. */
.footer-social i {
    display: block;
    width: 18px;
    height: 18px;
    background: var(--ink-2);
    -webkit-mask-image: var(--icon);
    mask-image: var(--icon);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.footer-social a:hover i {
    background: var(--ink);
}

.footer-links {
    display: flex;
    gap: 16px;
    margin-left: auto;
}

.footer-links a {
    color: var(--ink-2);
    text-decoration: none;
}

.footer a:hover {
    color: var(--ink);
}