/* Zil — measurements and colors matched to the reference reader. */
:root {
  color-scheme: light;
  --bg: oklch(96.8% .007 85);
  --surface: oklch(98.8% .005 90);
  --text: oklch(18.5% .005 60);
  --muted: oklch(48% .008 70);
  --line: oklch(86% .011 82);
  --accent: oklch(50% .17 28);
  --header: oklch(18.5% .005 60);
  --header-text: oklch(96.8% .007 85);
  font-family: 'Work Sans', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1d1c19;
  --surface: #24231f;
  --text: #f2f0e8;
  --muted: #b9b6ac;
  --line: #45433c;
  --accent: #f0a095;
}
*, *::before, *::after { box-sizing: border-box; border: 0 solid var(--line); }
body { margin: 0; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; transition: color .15s, background-color .15s; }
a:hover { color: var(--accent); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button { background: transparent; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 100; padding: 16px; background: var(--surface); }
.site-header { position: sticky; top: 0; z-index: 50; background: var(--header); color: var(--header-text); }
.header-inner { max-width: 1152px; margin: auto; padding: 12px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.logo { display: block; min-width: 0; flex-shrink: 0; font-size: 20px; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.logo:hover { color: inherit; }
.nav-browse { display: flex; align-items: center; flex: 1; min-width: 0; gap: 24px; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.selected-label-short { display: none; }
.nav-pill.reader-toggle { justify-content: center; padding: 8px; border: 1px solid color-mix(in oklab, var(--header-text) 30%, transparent); }
.reader-toggle .icon { width: 18px; height: 18px; }
.reader-toggle[aria-expanded="true"] { background: var(--header-text); color: var(--header); }
.nav-pill.selected-toggle { font-size: 13px; line-height: 20px; padding-block: 5px; border: 1px solid color-mix(in oklab, var(--header-text) 30%, transparent); flex-shrink: 0; }
.selected-toggle:disabled { opacity: .5; cursor: default; }
.country-nav, .topic-nav { display: flex; align-items: center; gap: 6px; font-size: 14px; line-height: 20px; }
.country-nav { flex: 1; flex-wrap: wrap; }
.topic-nav { border-left: 1px solid color-mix(in oklab, var(--header-text) 20%, transparent); padding-left: 16px; }
.nav-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 9999px; font-weight: 500; color: color-mix(in oklab, var(--header-text) 65%, transparent); white-space: nowrap; }
.nav-pill:hover { color: var(--header-text); background: color-mix(in oklab, var(--header-text) 10%, transparent); }
.nav-pill.active { color: var(--header); background: var(--header-text); }
.nav-flag { font-size: 16px; line-height: 1; }
.icon { width: 14px; height: 14px; flex-shrink: 0; display: block; }
.page { max-width: 1152px; margin: 0 auto; padding: 32px 20px; }
.feed { display: grid; grid-auto-rows: 1fr; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.source-card { border-width: 1px; background: var(--surface); padding: 20px; height: 100%; display: flex; flex-direction: column; }
.source-card-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 12px; padding-bottom: 12px; border-bottom-width: 1px; }
.source-card-header h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; font-size: 16px; font-weight: 600; line-height: 1; letter-spacing: -.01em; }
.source-count { font-size: .6rem; line-height: 1.5; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.headline-list, .detail-list { list-style: none; padding: 0; margin: 0; }
.headline-list { margin-top: 12px; flex: 1; }
.headline { padding: 10px 0; }
.headline-list .headline { border-bottom: 1px solid color-mix(in oklab, var(--line) 70%, transparent); }
.headline-list .headline:first-child { padding-top: 0; }
.headline-list .headline:last-child { border-bottom: 0; }
.headline-link { display: block; font-size: 14px; line-height: 1.375; overflow-wrap: anywhere; }
.headline-meta { font-size: .65rem; line-height: 1.5; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.more { display: inline-flex; align-items: center; gap: 6px; width: fit-content; margin-top: 16px; padding: 6px 12px; border: 1px solid var(--text); color: var(--text); font-size: .65rem; text-transform: uppercase; letter-spacing: .18em; line-height: 1.5; }
.more:hover { background: var(--text); color: var(--bg); }
.empty-source { color: var(--muted); font-size: 12px; flex: 1; }
.site-footer { max-width: 1152px; margin: auto; color: var(--muted); font-size: 12px; line-height: 16px; padding: 0 20px 40px; }
.source-heading { border-bottom: 1px solid var(--text); padding-bottom: 16px; margin-bottom: 32px; }
.source-title { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.source-title h1 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.source-badge { position: relative; display: inline-grid; place-items: center; flex: 0 0 auto; width: 20px; height: 20px; overflow: hidden; background: #fff; color: #383630; border: 1px solid var(--line); font-size: 12px; font-weight: 600; line-height: 1; }
.source-icon { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 1px; background: #fff; }
.source-badge--large { width: 48px; height: 48px; font-size: 24px; }
.source-badge--large .source-icon { padding: 4px; }
.source-name { display: flex; align-items: center; gap: 8px; }
.source-name > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.eyebrow { color: var(--muted); font-size: .65rem; line-height: 1.5; letter-spacing: .24em; text-transform: uppercase; margin: 0; }
h1 { font-size: 36px; font-weight: 600; letter-spacing: -.025em; margin: 4px 0 0; line-height: 1.25; }
.source-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; font-size: 12px; line-height: 16px; color: var(--muted); margin-top: 12px; }
.text-link { text-decoration: underline; text-underline-offset: 4px; }
.headline--detail { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding: 20px 0; border-bottom-width: 1px; }
.headline--detail:last-child { border-bottom: 0; }
.headline-number { font-size: 18px; line-height: 28px; font-weight: 600; color: var(--muted); padding-top: 4px; font-variant-numeric: tabular-nums; }
.headline-body { min-width: 0; }
.headline--detail .headline-link { display: inline; font-size: 18px; line-height: 1.375; }
.headline--detail .headline-meta { font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; }
.headline--illustrated { align-items: first baseline; }
.headline--illustrated .headline-number { padding-top: 0; }
.headline-media { display: block; grid-column: 2; align-self: start; overflow: hidden; border: 1px solid var(--line); background: var(--surface); aspect-ratio: 16 / 9; }
.headline-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.headline--illustrated .headline-link { font-size: 22px; font-weight: 500; letter-spacing: -.015em; }
.headline--illustrated .share-btn { top: auto; bottom: 20px; }
.share-btn { position: absolute; right: 0; top: 20px; padding: 6px; background: var(--bg); color: var(--muted); opacity: 0; }
.headline--detail:hover .share-btn, .share-btn:focus-visible { opacity: 1; }
.share-btn:hover { color: var(--accent); }
.reader-panel { background: var(--surface); color: var(--text); border-bottom: 1px solid var(--line); }
.reader-panel-inner { max-width: 1152px; padding: 12px 20px; margin: auto; display: flex; gap: 20px; align-items: center; }
.reader-search { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding-left: 12px; border: 1px solid var(--line); background: var(--bg); }
.reader-search > .icon { color: var(--muted); }
.reader-search input { width: 100%; min-width: 0; background: transparent; color: inherit; padding: 10px 12px 10px 0; font-size: 16px; line-height: 22px; }
.reader-search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.reader-search input:focus-visible { outline: none; }
.reader-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.reader-control { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9999px; font-size: 12px; line-height: 20px; white-space: nowrap; }
.reader-control:hover { border-color: var(--text); }
.reader-control[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--surface); }
.state { padding: 64px 0; color: var(--muted); text-align: center; grid-column: 1 / -1; }
.state h1 { font-size: 30px; color: var(--text); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 20px; opacity: 0; pointer-events: none; max-width: 90vw; z-index: 60; }
.toast.show { opacity: 1; }
.selection-heading { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px 24px; margin-bottom: 28px; }
.selection-description { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 20px; }
.shuffle-stories { min-height: 44px; margin: 0; white-space: nowrap; }
.shuffle-stories:disabled { opacity: .5; cursor: default; }
.selection-panel { border: 1px solid var(--line); background: var(--surface); padding: 0 24px; }
.selection-summary { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 20px 0; }
.selection-summary h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.selection-summary > span { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.selected-grid { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 40px; }
.selected-story { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 16px; padding: 24px 0; border-top: 1px solid var(--line); }
.selected-story--image { grid-template-columns: minmax(0, 1fr) 104px; }
.story-copy { min-width: 0; }
.story-source { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 18px; font-weight: 500; }
.selected-story h2 { font-size: 20px; font-weight: 400; line-height: 1.375; letter-spacing: -.01em; margin: 8px 0; overflow-wrap: anywhere; }
.story-meta { font-size: .65rem; line-height: 1.5; color: var(--muted); font-variant-numeric: tabular-nums; }
.story-thumbnail { display: block; aspect-ratio: 1; align-self: start; overflow: hidden; border: 1px solid var(--line); }
.story-image { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 768px) { .selected-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .header-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; padding: 8px 16px; }
  .logo { grid-column: 1; grid-row: 1; display: flex; align-items: center; min-height: 44px; font-size: 18px; }
  .header-actions { grid-column: 2; grid-row: 1; gap: 6px; }
  .selected-toggle { padding-inline: 10px; }
  .selected-label { display: none; }
  .selected-label-short { display: inline; }
  .nav-pill.reader-toggle { width: 44px; }
  .reader-panel-inner { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .reader-search { flex-basis: 100%; }
  .nav-browse { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; gap: 12px; scrollbar-width: none; }
  .nav-browse::-webkit-scrollbar { display: none; }
  .topic-nav { flex-shrink: 0; padding-left: 12px; gap: 2px; font-size: 13px; }
  .topic-nav .nav-pill { padding-inline: 10px; }
  .topic-nav .icon { display: none; }
  .country-nav { flex: 0 0 auto; flex-wrap: nowrap; }
  .nav-pill { min-height: 44px; flex-shrink: 0; }
  .nav-pill:focus-visible { outline-offset: -3px; }
  .selection-panel { padding: 0 16px; }
  .selected-story--image { grid-template-columns: minmax(0, 1fr) 80px; }
  .selected-story h2 { font-size: 18px; }
}
@media (min-width: 640px) { .feed { grid-template-columns: repeat(2, minmax(0, 1fr)); } h1 { font-size: 48px; } }
@media (min-width: 640px) {
  .headline--illustrated { grid-template-columns: auto minmax(0, 1fr) minmax(180px, 24%); }
  .headline--illustrated .headline-body { padding-right: 16px; }
  .headline-media { grid-column: 3; grid-row: 1; }
  .headline--illustrated .share-btn { right: calc(24% + 16px); }
}
@media (min-width: 1024px) { .feed { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (hover: none) { .share-btn { position: static; grid-column: 2; justify-self: end; opacity: 1; padding: 0; } }
@media (prefers-reduced-motion: reduce) { a { transition: none; } }
