/* zonenews.io — the reader-facing article page.
 *
 * Palette taken from the iOS app so the web fallback and the app read as one
 * product; see meerkat-ios/Newsletter/Extensions/Color+Extensions.swift, which
 * is the source of every hex value below. Light and dark are the app's two
 * schemes, switched on prefers-color-scheme rather than on a toggle, because
 * this page is a one-shot landing from a shared link and has nowhere to keep a
 * preference.
 *
 * No build step and no framework. One stylesheet, served by Flask.
 */

:root {
    --brand: #239b98;

    --bg: #ffffff;
    --surface: #f2f2f2;
    --text: #1c2526;
    --text-secondary: #6b7280;
    --separator: #e5e7eb;

    /* The two ends of the coverage split. Brand teal against the app's
     * secondary blue (#37508D), which is what distinguishes them in the app. */
    --centric: #37508d;
    --progressive: #239b98;

    --measure: 42rem;
    --radius: 12px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a1c1c;
        --surface: #262626;
        --text: #e0e0e0;
        --text-secondary: #9ca3af;
        --separator: #374151;
        --centric: #6699ff;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.6;
}

/* Clears the sticky install bar so the last section is never trapped
 * underneath it. Only the article page carries one, hence the class: on the
 * landing and error pages this much padding is just dead space. */
body.has-cta { padding-bottom: 6.5rem; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--brand); }

/* ------------------------------------------------------------------ header */

.site-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    max-width: var(--measure);
    margin: 0 auto;
    padding: 1.25rem 1.25rem 0;
}

.wordmark {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    text-decoration: none;
    color: var(--text);
}

.wordmark-mark { color: var(--brand); }

.shared-badge {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* ----------------------------------------------------------------- article */

main { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }

.cover {
    margin: 1.5rem 0 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}

.cover img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; }

.headline {
    margin: 1.5rem 0 0.75rem;
    font-size: 2rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 2rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--separator);
    border-radius: 999px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.prose { margin: 0 0 1.75rem; }

.prose h2, .panel h2 {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.prose p { margin: 0; }

.topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 2rem;
    padding: 0;
    list-style: none;
}

.panel {
    margin: 0 0 1.5rem;
    padding: 1.25rem;
    background: var(--surface);
    border-radius: var(--radius);
}

/* ---------------------------------------------------------------- coverage */

.coverage-bar {
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--separator);
}

.coverage-centric { background: var(--centric); }
.coverage-progressive { background: var(--progressive); }

.coverage-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0.6rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.swatch {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    margin-right: 0.35rem;
    border-radius: 2px;
}

.swatch-centric { background: var(--centric); }
.swatch-progressive { background: var(--progressive); }

.meters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.25rem;
}

.meter-label {
    margin: 0 0 0.35rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.meter-label b { color: var(--text); font-variant-numeric: tabular-nums; }

.meter-track {
    height: 6px;
    border-radius: 999px;
    background: var(--separator);
    overflow: hidden;
}

.meter-track span { display: block; height: 100%; background: var(--brand); }

/* ------------------------------------------------------------------ quotes */

.quote {
    margin: 0 0 1rem;
    padding-left: 0.9rem;
    border-left: 3px solid var(--brand);
}

.quote:last-child { margin-bottom: 0; }
.quote p { margin: 0; }

.quote footer {
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.quote-role { color: var(--text-secondary); }

/* ----------------------------------------------------------------- sources */

.sources { margin: 0; padding: 0; list-style: none; }

.source {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--separator);
}

.source:first-child { border-top: 0; padding-top: 0; }

.source-logo { border-radius: 6px; flex: 0 0 auto; background: var(--bg); }

.source-body a {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    line-height: 1.35;
}

.source-body a:hover { color: var(--brand); }

.source-meta {
    margin: 0.2rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* The `.related` strip was removed with the section it styled: every neighbour
 * it linked to was a code-less URL, and those answer 403 now. */

/* --------------------------------------------------------------------- CTA */

.cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    border-top: 1px solid var(--separator);
    /* Clears the iOS home indicator when the page is opened from a share sheet
     * in a full-height browser. */
    padding-bottom: env(safe-area-inset-bottom);
}

.cta-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    max-width: var(--measure);
    margin: 0 auto;
    padding: 0.9rem 1.25rem;
}

.cta-text { margin: 0; font-size: 0.9375rem; font-weight: 600; }

.cta-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.button {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.button-primary { background: var(--brand); color: #ffffff; }

.button-ghost {
    background: transparent;
    border-color: var(--separator);
    color: var(--text);
}

/* Neither store URL is configured yet. Shown rather than hidden so the page
 * does not silently lose half its call to action once one lands. */
.button-disabled {
    background: var(--surface);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* ----------------------------------------------------------------- landing */

.landing { padding: 3rem 0; }

.landing h1 {
    margin: 0 0 0.75rem;
    font-size: 2.25rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.landing-lede {
    margin: 0 0 1.75rem;
    font-size: 1.0625rem;
    color: var(--text-secondary);
}

/* ------------------------------------------------------------------- error */

/* A link that names nothing, or an article link with no verified referrer code.
 * Laid out like the landing card rather than like an article: there is nothing
 * to read, so the page is one sentence of explanation and a way forward. */
.error { padding: 3rem 0; }

.error h1 {
    margin: 0 0 0.75rem;
    font-size: 2rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.error-message {
    margin: 0 0 1.75rem;
    font-size: 1.0625rem;
    color: var(--text-secondary);
}

/* ------------------------------------------------------------------ footer */

.site-footer {
    max-width: var(--measure);
    margin: 2rem auto 0;
    padding: 1.5rem 1.25rem;
    border-top: 1px solid var(--separator);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.site-footer p { margin: 0; }

/* ------------------------------------------------------------------ mobile */

@media (max-width: 480px) {
    .headline { font-size: 1.625rem; }
    .landing h1 { font-size: 1.875rem; }
    .error h1 { font-size: 1.75rem; }
    .meters { grid-template-columns: 1fr; }
    .cta-inner { flex-direction: column; align-items: stretch; }
    .cta-text { text-align: center; }
    .cta-actions { justify-content: center; }
}
