/* Shared story-card component — the in-app overlay (index.html) and the public
   share pages (routes/share.js) both render this markup and load this file, so
   they look identical (the share page just omits the ✕ close button).
   Relies on the host page defining --bg/--surface/--surface-2/--border/--text/
   --muted/--faint/--cayman and a per-card --cat accent. */

.story-card {
  background: var(--bg);
  border-radius: 16px;
  color: var(--text);
}
/* selecting text in a card tints to that story's section colour */
.story-card ::selection, .story-card::selection {
  background: color-mix(in srgb, var(--cat, var(--cayman)) 32%, transparent);
  color: var(--text);
}
.ov-hero {
  display: block;
  position: relative;
  width: 100%; height: 190px;
  margin: 16px 0 4px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  color: var(--cat, var(--cayman));
}
.ov-hero .ov-hero-img { position: absolute; inset: 0; display: block; }
/* film grade on the plain (unfiltered) hero photo only — canvas dither/tint is untouched */
.ov-hero .ov-hero-img > img { filter: var(--photo-grade, none); }
.ov-hero canvas, .ov-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ov-hero canvas { image-rendering: pixelated; }
html[data-noimgs] .ov-hero { display: none; }
/* Tinting is done by the ORIGINAL canvas algorithm (/thumbs.js) on both the
   overlay and the share page — no CSS blend layers. */
/* frosted photo-credit pill, bottom-right, links to the outlet. Hidden and
   shrunk by default; the (i) button reveals it — it scales/fades in smoothly. */
.ov-hero .ov-src-pill {
  position: absolute; right: 10px; bottom: 10px; z-index: 3;
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 60%; padding: 5px 11px 5px 6px; border-radius: 999px;
  background: rgba(10, 11, 13, 0.45);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff; text-decoration: none; font-size: 12px; font-weight: 600;
  opacity: 0; transform: scale(.8); transform-origin: bottom right;
  pointer-events: none;
  transition: opacity .26s ease, transform .3s cubic-bezier(.2,.8,.25,1);
}
.story-card.info-open .ov-hero .ov-src-pill {
  opacity: 1; transform: scale(1); pointer-events: auto;
}
.ov-hero .ov-src-pill img { width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto; filter: none; }
.ov-hero .ov-src-pill svg { width: 15px; height: 15px; flex: 0 0 auto; }
.ov-hero .ov-src-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.story-card .ov-top { display: flex; align-items: center; gap: 8px; }
.story-card .ov-kicker {
  position: relative; z-index: 0;
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--cat, var(--cayman));
  margin-right: auto;
  /* label always visible; the FROSTED PILL is a separate layer (::before)
     whose opacity is driven by --pill (0 = plain text out of the pill, 1 =
     full pill). Overhang the content edge partway; extra left padding offsets
     the letter-spacing's trailing gap so the label sits optically centred. */
  padding: 7px 12px 7px 15px; margin-left: -7px; border-radius: 999px;
  --pill: 1;
}
.story-card .ov-kicker::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: var(--pill, 1); transition: opacity .2s ease;
}
/* each icon sits in a frosted circle — a translucent surface chip with a
   backdrop blur, so it reads over both light and dark content behind the bar */
.story-card .ov-top-btn {
  border: none; color: var(--muted); cursor: pointer;
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  transition: color .15s, background .15s;
}
/* every top-row icon renders at one consistent size, whatever the source SVG
   viewBox declares */
.story-card .ov-top-btn svg { width: 18px; height: 18px; stroke-width: 2; }
/* pull the last icon a touch past the padding edge so the cluster reads as
   optically centred against the right margin */
.story-card .ov-top-btn:last-child { margin-right: -6px; }
.story-card .ov-top-btn:hover { color: var(--text); background: color-mix(in srgb, var(--surface) 85%, transparent); }

.story-card h2 {
  font-family: "Zodiak", Georgia, serif; font-weight: 700;
  font-size: clamp(27px, 4.6vw, 38px); line-height: 1.08;
  letter-spacing: -0.015em; margin: 14px 0 0;
}
.story-card .ov-sum { font-size: 15px; line-height: 1.7; color: var(--text); margin: 18px 0 0; }

/* We only replace an outlet's headline when it breaches our standards — say so
   plainly rather than passing our words off as theirs. */
.ov-edited {
  display: flex; align-items: center; gap: 6px; margin-top: 9px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  color: var(--cat, var(--cayman));
}
.ov-edited svg { width: 13px; height: 13px; flex: 0 0 auto; }
/* we changed their headline — tapping swaps the outlet's original back in */
.ov-edited {
  background: none; border: none; padding: 0; font: inherit;
  cursor: pointer; text-align: left;
}
.ov-edited:hover .ov-edit-lbl, .ov-edited:focus-visible .ov-edit-lbl { text-decoration: underline; text-underline-offset: 2px; }
.ov-edited.raw { color: var(--muted); }
.ov-edited.raw svg { color: var(--hot); }

/* Key facts: generated on request, then cached for everyone. */
.kf-btn {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 16px;
  background: none; border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  color: var(--muted); border-radius: 999px; padding: 7px 13px;
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.kf-btn:hover { color: var(--cat, var(--text)); border-color: color-mix(in srgb, var(--cat, var(--border)) 45%, transparent); }
.kf-btn svg { width: 14px; height: 14px; flex: 0 0 auto; }
.kf-btn .kf-chev { transition: transform .25s ease; }
.kf-btn[aria-expanded="true"] { color: var(--cat, var(--text)); }
.kf-btn[aria-expanded="true"] .kf-chev { transform: rotate(180deg); }
/* once expanded the control has done its job and gets out of the way */
.kf-btn.gone { display: none; }
.kf-panel {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height .4s cubic-bezier(.2,.7,.2,1), opacity .3s ease, margin-top .3s ease;
}
.kf-panel.open { max-height: 420px; opacity: 1; margin-top: 12px; }
.kf-wait { font-size: 12.5px; color: var(--faint); }
.kf-list { margin: 0; padding: 0; list-style: none; }
.kf-list li {
  position: relative; padding-left: 18px; margin-bottom: 9px;
  font-size: 14px; line-height: 1.6; color: var(--text); min-height: 1.6em;
}
/* citation chip: the outlet, linking straight to the line it came from */
.kf-cite {
  display: inline-flex; align-items: center; vertical-align: 1px;
  margin-left: 6px; padding: 2px 7px; border-radius: 5px;
  background: var(--surface-2); color: var(--muted);
  font-family: ui-monospace, Menlo, monospace; font-size: 10.5px;
  text-decoration: none; white-space: nowrap;
}
.kf-cite:hover { color: var(--cat, var(--text)); background: color-mix(in srgb, var(--cat, var(--surface-2)) 16%, var(--surface-2)); }
/* single-source story: the card already names the outlet, so the citation is
   just the jump */
.kf-cite.icon { padding: 2px 4px; }
.kf-cite.icon svg { width: 11px; height: 11px; }
.kf-list li b { font-weight: 700; color: var(--text); }
.kf-list li::before {
  content: ""; position: absolute; left: 2px; top: .62em;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--cat, var(--cayman));
}

/* source row: animated stacked outlet avatars + "N sources" + "latest X ago" */
.story-card .ov-source { display: flex; align-items: center; gap: 9px; margin-top: 13px; }
.story-card .ov-avatars { display: inline-flex; }
.story-card .ov-avatars .avatar {
  width: 24px; height: 24px; border-radius: 50%; object-fit: cover;
  background: var(--surface-2); border: 2px solid var(--bg);
  margin-left: -8px; animation: ov-pop .32s cubic-bezier(.2,.9,.3,1.3) backwards;
}
.story-card .ov-avatars .avatar:first-child { margin-left: 0; }
.story-card .ov-avatars .avatar:nth-child(2) { animation-delay: .05s; }
.story-card .ov-avatars .avatar:nth-child(3) { animation-delay: .1s; }
.story-card .ov-avatars .avatar:nth-child(4) { animation-delay: .15s; }
.story-card .ov-avatars .avatar:nth-child(5) { animation-delay: .2s; }
.story-card .ov-avatars .avatar.more {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--muted);
}
@keyframes ov-pop { from { transform: scale(.4); opacity: 0; } }
.story-card .ov-source .who { font-size: 13px; font-weight: 600; color: var(--text); }
.story-card .ov-source .when {
  margin-left: auto; font-family: ui-monospace, Menlo, monospace;
  font-size: 11px; color: var(--faint); white-space: nowrap;
}

/* "why it matters" — collapsible; opened by the (i) button in the top row */
.ov-why {
  max-height: 0; opacity: 0; overflow: hidden; margin-top: 0;
  transition: max-height .38s cubic-bezier(.2,.7,.2,1), opacity .3s ease, margin-top .3s ease;
  font-size: .88rem; line-height: 1.55; color: var(--text);
  border-left: 3px solid var(--cat, var(--cayman));
  background: color-mix(in srgb, var(--cat, var(--cayman)) 8%, transparent);
  border-radius: 0 10px 10px 0; padding: 0 .8rem;
}
.ov-why.open { max-height: 260px; opacity: 1; margin-top: 16px; padding: .7rem .8rem; }
.ov-why .ov-why-lbl {
  display: block; font-size: .62rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--cat, var(--cayman)); margin-bottom: .25rem;
}

.ov-conflict, .ov-coverage { font-size: .82rem; line-height: 1.5; margin-top: 14px; color: var(--muted); }
.ov-conflict b { color: var(--text); }

/* merged coverage: connected timeline — a hairline down the left, a tick out
   to each source's avatar node; outlet name, its distinctive pull quote, and
   the publish time on the right. Shared by the overlay and the share page. */
.ov-srcs { margin-top: 24px; }
.ov-srcs .lbl { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.ov-src-list { position: relative; padding-left: 30px; }
.ov-src-list::before {
  content: ""; position: absolute; left: 4px; top: 18px; bottom: 18px;
  width: 1px; background: var(--border);
}
.ov-srcs a, .ov-src {
  position: relative;
  display: flex; align-items: flex-start; gap: 10px;
  text-decoration: none; color: var(--muted);
  padding: 11px 0; font-size: .9rem;
}
.ov-srcs a::before, .ov-src::before {
  content: ""; position: absolute; left: -26px; top: 24px;
  width: 14px; height: 1px; background: var(--border);
}
.ov-srcs a:hover .who, .ov-src:hover .who { color: var(--cat, var(--cayman)); }
.ov-src .who { text-decoration: none; }
/* the quote deep-links to its own line in the source (#:~:text=) */
.ov-src .quote { text-decoration: none; cursor: pointer; }
.ov-src .quote:hover { color: var(--text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--cat, var(--cayman)) 55%, transparent); text-underline-offset: 2px; }
.ov-srcs a .avatar, .ov-src .avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  background: var(--surface-2); box-shadow: 0 0 0 3px var(--bg);
  margin-left: -13px; position: relative; z-index: 1;
}
.ov-srcs .col, .ov-src .col { min-width: 0; flex: 1; }
.ov-srcs .who, .ov-src .who { display: block; font-size: 13.5px; font-weight: 700; color: var(--text); line-height: 1.5; }
.ov-srcs .quote, .ov-src .quote {
  display: block; margin-top: 2px;
  font-size: 12.5px; line-height: 1.5; color: var(--muted);
}
.ov-srcs .quote::before, .ov-src .quote::before { content: "“"; color: var(--cat, var(--cayman)); }
.ov-srcs .quote::after, .ov-src .quote::after { content: "”"; color: var(--cat, var(--cayman)); }
.ov-srcs .when, .ov-src .when {
  margin-left: auto; flex: 0 0 auto; padding-top: 3px;
  font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--faint);
}

/* actions: Read original = filled pill in the story-type colour */
.ov-actions { display: flex; align-items: center; gap: 1rem; margin-top: 24px; padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.ov-actions a.ov-read {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--cat, var(--cayman)); color: #fff; text-decoration: none;
  font-weight: 700; font-size: .9rem; padding: 10px 18px; border-radius: 999px;
  white-space: nowrap;
}
.ov-actions a.ov-read svg { flex: 0 0 auto; }
.ov-actions .code { font-family: ui-monospace, Menlo, monospace; letter-spacing: .02em; margin-left: auto; font-size: 12px; color: var(--faint); }
/* ranking score chip beside the reference code */
.ov-actions .score { font-family: ui-monospace, Menlo, monospace; font-size: 11px; letter-spacing: .02em; color: var(--faint);
  padding: 1px 6px; border: 1px solid var(--border); border-radius: 999px; white-space: nowrap; flex: 0 0 auto; }
.ov-actions .ov-meta .score { margin-left: 0; }
/* merged stories: no "read at" pill — just quiet left-aligned metadata
   (reference code + how long the story took to develop) */
.ov-actions .ov-meta { display: flex; align-items: baseline; gap: 10px; margin-right: auto; min-width: 0; }
.ov-actions .ov-meta .code { margin-left: 0; }
.ov-actions .ov-dev { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
