/* The web edition of the front page (home.html + web.js). Colors and type follow the app (ios/.../Theme.swift). */
:root {
  --bg: #F6F3EE; --surface: #FFFFFF; --surface-alt: #EDE8E0; --chip: #EAE5DC;
  --ink: #16130F; --ink2: #5C564E; --ink3: #8C857A; --hairline: rgba(22, 19, 15, .11);
  --accent: #B5401C; --accent-soft: rgba(181, 64, 28, .12); --save: #2D6A4F;
  --left: #2D5DA6; --lean-left: #82A4D8; --center: #A9A397; --lean-right: #E09B86; --right: #B6423A;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --gutter: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F0E0C; --surface: #1A1916; --surface-alt: #262420; --chip: #211F1C;
    --ink: #F2EEE7; --ink2: #ADA69B; --ink3: #7C766C; --hairline: rgba(242, 238, 231, .11);
    --accent: #E5774F; --accent-soft: rgba(229, 119, 79, .12); --save: #62B38A;
    --left: #5B89D1; --lean-left: #93B2E2; --center: #8D887E; --lean-right: #E8A694; --right: #D4614F;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.45 var(--sans); }
a { color: inherit; }
button { font: inherit; color: inherit; }
img { display: block; }
#app { max-width: 760px; margin: 0 auto; padding: 0 0 calc(40px + env(safe-area-inset-bottom)); }
.empty { text-align: center; color: var(--ink3); padding: 80px var(--gutter); }
.empty a { color: var(--accent); }

/* Top bar: section links on the front page, back + share on a story. */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 6px; font-size: 15px; }
.topbar a, .topbar button { color: var(--accent); text-decoration: none; background: none; border: 0; padding: 4px 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.topbar nav { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; row-gap: 4px; }
/* Phones: the App Store banner Safari shows already offers the app, so the link makes room for the others. */
@media (max-width: 480px) { .topbar nav { gap: 14px; font-size: 14px; } .topbar nav .app-link { display: none; } }
.masthead .home { display: block; }
.topbar nav a { color: var(--ink2); }
.topbar nav a:hover, .topbar a:hover { color: var(--accent); }
.topbar svg { width: 18px; height: 18px; }

/* Masthead: nameplate between rules, dateline. */
.masthead { padding: 4px var(--gutter) 0; }
.masthead .rule { border-top: 1.5px solid var(--ink); }
.nameplate { display: block; width: 100%; height: auto; margin: 8px 0 6px; }
.masthead picture { display: block; }
/* One line, like the app's dateline: the type shrinks on narrow phones instead of wrapping. */
.dateline { display: flex; justify-content: center; align-items: center; gap: 8px; white-space: nowrap; border-top: 3px double var(--ink); border-bottom: .75px solid var(--ink);
  padding: 7px 0; font: 600 clamp(9px, 2.85vw, 12px)/1.2 var(--serif); letter-spacing: .08em; text-transform: uppercase; }
.dateline button { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink2); font: inherit; letter-spacing: inherit; text-transform: inherit; display: inline-flex; gap: 5px; align-items: center; }
.dateline svg { width: 11px; height: 11px; }

/* Topic chips. */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 18px var(--gutter) 6px; scrollbar-width: none; position: sticky; top: 0; z-index: 2; background: var(--bg); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 0; border-radius: 999px; padding: 7px 14px; background: var(--chip); color: var(--ink); font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; }
.chip[aria-current="true"] { background: var(--ink); color: var(--bg); }
.chip.sort { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.chip svg { width: 15px; height: 15px; }

/* Section heading. */
.section-head { padding: 28px var(--gutter) 4px; }
.section-head::before { content: ""; display: block; width: 28px; border-top: 2px solid var(--ink); margin-bottom: 10px; }
.section-head h2 { font: 700 24px/1.2 var(--serif); margin: 0; }
.section-head p { margin: 2px 0 0; font-size: 13px; color: var(--ink3); }

/* Story cards. */
.card { display: block; padding: 20px var(--gutter); text-decoration: none; color: var(--ink); position: relative; }
.card + .card::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); border-top: 1px solid var(--hairline); }
.card:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.hero-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; background: var(--surface-alt); margin-bottom: 14px; }
.kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; color: var(--ink2); margin-bottom: 8px; }
.kicker .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.kicker .ess { color: var(--accent); }
.kicker .time { color: var(--ink3); font-weight: 500; }
.card-row { display: flex; gap: 12px; align-items: flex-start; }
.card h3 { font: 600 20px/1.25 var(--serif); margin: 0; flex: 1; }
.card.hero h3 { font: 700 24px/1.22 var(--serif); }
.thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; flex: none; background: var(--surface-alt); }
.card .summary { color: var(--ink2); margin: 8px 0 0; font-size: 15px; }
.card.hero .summary { font-size: 17px; }
.card-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; font-weight: 500; color: var(--ink2); }

/* Outlet badges and the coverage bar. */
.stack { display: inline-flex; }
.stack .badge + .badge { margin-left: -4px; }
.badge { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--surface); border: 1.5px solid var(--ink3);
  color: var(--ink); font: 800 7px/1 var(--sans); letter-spacing: -.03em; box-shadow: 0 0 0 1.5px var(--bg); overflow: hidden; }
.badge.lg { width: 32px; height: 32px; font-size: 9.5px; }
.bar { display: inline-flex; gap: 1.5px; width: 44px; height: 5px; border-radius: 3px; overflow: hidden; background: var(--surface-alt); }
.bar.lg { width: 100%; height: 8px; border-radius: 4px; }
.bar span { height: 100%; }
.l-left { --lean: var(--left); } .l-leanLeft { --lean: var(--lean-left); } .l-center { --lean: var(--center); }
.l-leanRight { --lean: var(--lean-right); } .l-right { --lean: var(--right); }
.badge[class*="l-"] { border-color: var(--lean); }
.bar span[class*="l-"] { background: var(--lean); }

/* Story page. */
.story-img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--surface-alt); }
.credit { font-size: 11px; color: var(--ink3); padding: 6px var(--gutter) 0; }
.story { padding: 20px var(--gutter) 0; }
.pill { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 3px 8px; }
.story h1 { font: 700 30px/1.18 var(--serif); margin: 4px 0 8px; }
.meta { font-size: 13px; color: var(--ink3); margin: 0 0 18px; }
.lede { font: 21px/1.45 var(--serif); margin: 0; }
.attrib { font-size: 12px; color: var(--ink3); margin: 6px 0 0; }
.block { margin-top: 28px; }
.block > .label { font-size: 12px; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; color: var(--ink2); margin: 0 0 10px; }
.points { list-style: none; padding: 0; margin: 0; }
.points li { position: relative; padding-left: 18px; margin: 0 0 14px; }
.points li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.points .src { display: block; font-size: 12px; color: var(--ink3); margin-top: 2px; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 1.5px solid var(--hairline); margin-left: 3px; }
.timeline li { position: relative; padding: 0 0 16px 16px; }
.timeline li::before { content: ""; position: absolute; left: -4.5px; top: .45em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.timeline li.first::before { background: var(--ink3); }
.timeline .when { font-size: 11px; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; color: var(--ink3); }
.timeline a { display: block; font: 600 16px/1.3 var(--serif); text-decoration: none; margin-top: 2px; }
.timeline a:hover { text-decoration: underline; }
.timeline .src { font-size: 12px; color: var(--ink3); }
.panel { background: var(--surface); border-radius: 14px; padding: 16px; }
.panel h3 { font: 600 17px/1.3 var(--sans); margin: 0 0 12px; }
.groups { display: flex; justify-content: space-between; margin-top: 12px; font-size: 14px; color: var(--ink2); }
.groups i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lean); margin-right: 2px; }
.note { font-size: 14px; color: var(--ink2); margin: 12px 0 0; }
.panel .src-link { display: block; font-size: 12px; color: var(--ink3); margin-top: 12px; }
details.earlier { background: var(--surface); border-radius: 14px; padding: 14px 16px; }
details.earlier summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.earlier summary::-webkit-details-marker { display: none; }
details.earlier summary b { font: 600 16px/1.3 var(--serif); display: block; }
details.earlier summary span { font-size: 12px; color: var(--ink3); }
details.earlier[open] summary { margin-bottom: 14px; }
.chev { flex: none; width: 18px; height: 18px; color: var(--ink3); transition: transform .2s; }
details[open] .chev { transform: rotate(180deg); }
.filters { display: flex; background: var(--chip); border-radius: 9px; padding: 2px; margin-bottom: 6px; }
.filters button { flex: 1; border: 0; background: none; border-radius: 7px; padding: 6px 0; font-size: 14px; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); font-weight: 600; }
.articles { list-style: none; padding: 0; margin: 0; }
.articles li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.articles li:last-child { border-bottom: 0; }
.articles .who { font-size: 13px; color: var(--ink2); font-weight: 600; }
.articles .who span { font-weight: 400; color: var(--ink3); }
.articles a { display: block; font: 600 16px/1.3 var(--serif); text-decoration: none; margin: 2px 0; }
.articles a:hover { text-decoration: underline; }
.articles .when { font-size: 12px; color: var(--ink3); }
.fine { font-size: 12px; color: var(--ink3); margin: 28px 0 0; }
.read-full { position: sticky; bottom: 0; padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--bg) 30%); margin-top: 16px; }
.read-full a { display: flex; align-items: center; gap: 14px; background: var(--ink); color: var(--bg); border-radius: 16px; padding: 14px 18px; text-decoration: none; }
.read-full b { display: block; font-size: 17px; }
.read-full small { font-size: 12px; opacity: .7; }
.read-full svg { width: 20px; height: 20px; flex: none; }
.read-full .go { margin-left: auto; }

/* Search. */
.search-box { margin: 6px var(--gutter) 0; display: flex; align-items: center; gap: 8px; background: var(--chip); border-radius: 11px; padding: 0 12px; }
.search-box svg { width: 17px; height: 17px; color: var(--ink3); flex: none; }
.search-box input { flex: 1; border: 0; background: none; font: 17px var(--sans); color: var(--ink); padding: 10px 0; outline: none; min-width: 0; }
.search-box input::-webkit-search-cancel-button { cursor: pointer; }
.page-title { font: 700 32px/1.15 var(--serif); margin: 4px var(--gutter) 12px; }
.hint { padding: 22px var(--gutter) 0; }
.hint .label { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); margin: 0 0 12px; }
.hint .chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.count { font-size: 13px; color: var(--ink3); padding: 14px var(--gutter) 0; }

/* Footer. */
.foot { margin: 36px var(--gutter) 0; padding-top: 20px; border-top: 1px solid var(--hairline); font-size: 13px; color: var(--ink3); text-align: center; }
.foot nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.foot a { color: var(--ink2); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot p { margin: 4px 0; }
.end { text-align: center; color: var(--ink3); font-size: 14px; padding: 28px var(--gutter) 0; }

@media (min-width: 700px) {
  :root { --gutter: 28px; }
  .card h3 { font-size: 21px; }
  .card.hero h3 { font-size: 30px; }
  .story h1 { font-size: 38px; }
  .thumb { width: 110px; height: 110px; }
}
@media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
