/* World News, under the template's house system (ART.md; Template/HOUSE.md) and its pane-app register
   (HOUSE 11): sections on plates on the gray page, one face, gray chrome, no shadows, no glass. Color has one
   meaning here: which source a headline came from (--src-1 to --src-3, by the order of the file's sources[]),
   on the Datelines' ticks and the swatches. Staleness and failure are words and a hollow tick, never a hue. */

@font-face {
  font-family: 'Ysabeau Office';
  src: url(fonts/ysabeau-office-gw.woff2) format('woff2');
  font-weight: 400 650;
  font-display: block;
}

:root {
  --page: #e8eef0;
  --sheet: #f6f9fa;
  --ink: #0f1c23;
  --ink-2: #45555d;
  --ink-3: #5b6a72;
  --line: #c9d4d8;
  --line-strong: #74858c;
  --src-1: #1f5f99;
  --src-2: #a64a1a;
  --src-3: #6d2736;
  --draw: cubic-bezier(0.2, 0, 0, 1);
  --sheet-in: cubic-bezier(0.32, 0.72, 0, 1);
  --face: 'Ysabeau Office', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #141d21;
    --sheet: #1c272c;
    --ink: #e6edee;
    --ink-2: #a3b1b6;
    --ink-3: #8b9a9f;
    --line: #2a373c;
    --line-strong: #64757b;
    --src-1: #8cbcf0;
    --src-2: #f0a070;
    --src-3: #ab8198;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--page);
  color: var(--ink);
  font: 400 13.5px/1.35 var(--face);
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
h1, h2, h3, p, dl, dd { margin: 0; }
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: -1px; }

/* ── the header: the name, the stamp, the regions as tabs ── */
/* the header's sides follow the pane's 760 px column, so on a wide screen the name starts where the plates do */
.head { flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); padding: calc(6px + env(safe-area-inset-top)) calc(max(16px, 50% - 364px) + env(safe-area-inset-right)) 0 calc(max(16px, 50% - 364px) + env(safe-area-inset-left)); }
.head h1 { font-size: 15px; font-weight: 650; line-height: 22px; }
.stamp-home { min-width: 0; padding-bottom: 6px; }
.stamp { position: relative; display: block; max-width: 100%; font-size: 11.5px; line-height: 16px; color: var(--ink-2); }
.stamp .lead { color: var(--ink); }
/* the hit runs up over the name (not a control) and down into the gap: 22 + 16 + 6 = 44 px */
.stamp::before { content: ''; position: absolute; inset: -22px 0 -6px; }

.tabs { display: flex; min-width: 0; overflow-x: auto; scrollbar-width: none; scroll-padding: 0 16px; margin: 0 -8px; }
.tabs::-webkit-scrollbar { display: none; }
/* the row scrolls sideways and is exactly a key tall, so a ring outside a key would be clipped to a bar */
.tabs button:focus-visible { outline-offset: -2px; }
.tabs button { position: relative; flex: 0 0 auto; min-width: 44px; height: 44px; padding: 0 8px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; text-align: center; }
/* the chosen tab: 620 in ink, a tracer under it drawn from its tail to its head (HOUSE 4.3) */
.tabs [aria-selected="true"] { color: var(--ink); font-weight: 620; }
.tabs [aria-selected="true"]::after {
  content: '';
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 9px;
  height: 4px;
  background:
    radial-gradient(circle at calc(100% - 2px) 50%, var(--ink) 1.9px, transparent 2.1px),
    linear-gradient(90deg, transparent, var(--ink) calc(100% - 3px), transparent calc(100% - 3px)) 0 1px / 100% 2px no-repeat;
  animation: tracer-in 160ms var(--draw);
}
@keyframes tracer-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ── the pane: it scrolls inside the frame, so the header stays put; with no band under it, it pads the home
   indicator itself (HOUSE 4.14, 11.1 rule 1) ── */
.pane { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.panebody { max-width: 760px; margin: 0 auto; padding: 0 calc(16px + env(safe-area-inset-right)) 0 calc(16px + env(safe-area-inset-left)); padding-top: 4px; padding-bottom: calc(28px + env(safe-area-inset-bottom)); }

/* ── the Datelines, on their plate: the chosen rows' ticks in their source's color (ink for a source past the
   third), the other rows' in --ink-3. The picture is a plain image; a hidden layer over it takes the taps
   (app.js, render) ── */
.dlw { position: relative; width: fit-content; margin: 6px 0 2px; }
.dl { display: block; overflow: visible; }
.dlhit { position: absolute; inset: 0; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.dl text { fill: var(--ink-2); }
.dl .lab { font-size: 10.5px; }
.dl .rn { font-size: 12.5px; }
.dl .on .rn { fill: var(--ink); font-weight: 620; }
.dl .tk { fill: var(--ink-3); }
.dl .on .tk, .dl .sel { fill: var(--ink); }
.dl .row.on .tk.src-1 { fill: var(--src-1); }
.dl .row.on .tk.src-2 { fill: var(--src-2); }
.dl .row.on .tk.src-3 { fill: var(--src-3); }
.dl .sel { stroke: var(--sheet); stroke-width: 1.5; }
.dl .cnt { font-size: 10.5px; stroke: var(--sheet); stroke-width: 3px; paint-order: stroke; }
.dl .ho { fill: none; stroke: var(--ink-3); stroke-width: 1; }
.dl .on .ho { stroke: var(--ink); }
.dl .hair { stroke: var(--line); }
.dl .scale { stroke: var(--line-strong); }
.dl .mark { stroke: var(--ink-3); }

/* ── sections on plates (HOUSE 11.1 rule 4), stories inside them parted by hairlines ── */
.sec { margin-top: 12px; padding: 12px 12px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--sheet); }
.sec > h2, .sec-head h2 { font-size: 15px; font-weight: 650; padding-bottom: 2px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 2px; }
.sec-meta { flex: 0 0 auto; font-size: 12.5px; color: var(--ink-2); }
.lead-sec { padding-bottom: 10px; }
.cap { font-size: 11px; line-height: 15px; color: var(--ink-2); }
/* a key in place of a how-to-read sentence (HOUSE 4.15, 11.1 rule 6): the marks drawn small, each with its word */
.key { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; font-size: 11.5px; line-height: 15px; color: var(--ink-2); }
.key .sw { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 2px; vertical-align: -1px; }
.sw.hollow { background: none; border: 1px solid var(--ink); }
/* All's sources: the colors' key and a table (HOUSE 11.1 rule 3) */
.keytab { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 13.5px; }
.keytab th { padding: 4px 0; font-size: 11.5px; font-weight: 600; color: var(--ink-2); text-align: right; border-bottom: 1px solid var(--line-strong); }
.keytab th:first-child, .keytab td:first-child { text-align: left; }
.keytab td { padding: 6px 0; text-align: right; border-bottom: 1px solid var(--line); font-weight: 560; }
.keytab td:first-child { font-weight: 400; }
.keytab tr:last-child td { border-bottom: 0; }
.sw { display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 2px; vertical-align: -0.5px; background: var(--ink-3); }
.sw.src-1 { background: var(--src-1); }
.sw.src-2 { background: var(--src-2); }
.sw.src-3 { background: var(--src-3); }
.src .sw { width: 8px; height: 8px; margin-right: 5px; }
.statement { padding: 8px 0 10px; line-height: 1.4; max-width: 62ch; }
.statement b { font-weight: 620; }
.story { position: relative; display: block; padding: 11px 0 12px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.sec-head + .story, .statement + .story { border-top: 0; }
/* the headline is the link; its ::after stretches over the row, so a tap anywhere opens the story */
.story a::after { content: ''; position: absolute; inset: 0; }
.story a:focus-visible { outline: 0; }
.story a:focus-visible::after { outline: 2px solid var(--ink); outline-offset: 2px; }
.story:has(a:active) { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.story:has(> [aria-current="true"])::before { content: ''; position: absolute; left: -10px; top: 10px; bottom: 11px; width: 2px; background: var(--ink); }
.hl, .src, .sum { max-width: 62ch; overflow-wrap: anywhere; }
.hl { display: block; font-size: 15px; line-height: 20px; font-weight: 600; color: inherit; text-decoration: none; }
.src { display: block; margin-top: 4px; font-size: 12.5px; line-height: 17px; color: var(--ink-2); }
.src .lead { color: var(--ink); }
.sum { display: block; margin-top: 4px; font-size: 12.5px; line-height: 17px; color: var(--ink-2); }
/* on All a summary shows two lines (HOUSE 11.1 rule 10); a region's tab shows it whole. Display only: the words are the feed's */
.sum.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* the key at the end of every pane (HOUSE 11.1 rule 1) */
.aboutlink { display: block; margin: 14px 0 0; min-height: 44px; font-size: 12.5px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.aboutlink:active { color: var(--ink); }

/* text keys: a 28 px frame on a 44 px hit */
.textkey { position: relative; height: 44px; padding: 0 10px; font-size: 12.5px; }
.textkey::before { content: ''; position: absolute; inset: 8px 0; border: 1px solid var(--line-strong); border-radius: 6px; }
.textkey:active::before { background: color-mix(in srgb, currentColor 22%, transparent); }

/* a problem with the data is a sentence on a plate, never a blank pane */
.notice { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 5; width: max-content; max-width: min(300px, calc(100% - 32px)); padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--sheet); line-height: 1.4; text-align: center; }
.notice.kept { position: fixed; }
.notice-lines { margin-top: 6px; font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; text-align: left; }

/* ── About: a full-height sheet ── */
.about { position: fixed; inset: 0; z-index: 20; }
.about-sheet { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--sheet); animation: sheet-in 220ms var(--sheet-in); }
@keyframes sheet-in { from { transform: translateY(100%); } }
.about-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: env(safe-area-inset-top) calc(8px + env(safe-area-inset-right)) 0 calc(16px + env(safe-area-inset-left)); border-bottom: 1px solid var(--line); }
.about-head h2 { font-size: 15px; font-weight: 650; }
.about .textkey::before { border: 0; }
.about-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 0 calc(16px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left)); }
.about-body section { max-width: 62ch; padding: 12px 0; border-bottom: 1px solid var(--line); }
.about-body h3 { margin-bottom: 6px; font-size: 13.5px; font-weight: 650; }
.about-body p { line-height: 1.5; }
.about-body p + p, .about-body div + p, .about-body p + div { margin-top: 8px; }
.about-body a { color: var(--ink); }
.about-body .src-name { font-weight: 620; }
.about-body dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; line-height: 1.45; }
.about-body dt { color: var(--ink-2); }
.about-body dd { overflow-wrap: anywhere; }
.about-foot { margin-top: 8px; }

@media (hover: hover) {
  .tabs button:hover, .stamp:hover, .aboutlink:hover { color: var(--ink); }
  .textkey:hover::before { background: color-mix(in srgb, currentColor 7%, transparent); }
}
/* a phone on its side: the header is one row */
@media (orientation: landscape) and (max-height: 500px) {
  .head { grid-template-columns: max-content minmax(0, 1fr); grid-template-rows: 22px 24px; column-gap: 16px; padding-top: env(safe-area-inset-top); }
  .stamp-home { grid-area: 2 / 1; padding-bottom: 0; }
  .stamp { white-space: nowrap; }
  .tabs { grid-area: 1 / 2 / 3 / 3; align-self: center; margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; scroll-behavior: auto !important; }
}
