/* Storylines: categories, ledes (stories.js). Colors come from theme variables. */
.story-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.story-cat { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; }
.story-cat:hover { border-color: var(--accent); }
.story-cat.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.story-cat:focus-visible, .story-kind:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.story-lede { font-family: var(--serif); font-style: italic; color: var(--dim); margin: 0 0 4px !important; }
.story-controls select optgroup { font-style: normal; font-weight: 700; }
/* The kind list has 350+ options: its longest label must not size the control past the screen. */
.story-controls > label { min-width: 0; max-width: 100%; }
.story-controls select { max-width: min(100%, 24em); min-width: 0; text-overflow: ellipsis; }
@media (max-width: 480px) {
	.story-cat { font-size: 12px; padding: 3px 8px; }
	.story-controls > label { flex: 1 1 100%; }
	.story-controls select { max-width: 100%; flex: 1 1 auto; }
}
/* Severity badge on major and landmark stories (stories-extra.js). */
.story-sev { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; vertical-align: 1px; border: 1px solid var(--accent); color: var(--accent); }
.story-sev-5 { background: var(--accent); color: var(--on-accent); }

/* Story formats (stories-arcs.js): prose, capsule, timeline, Q&A, by the numbers,
   tale of the tape and pull quote. Theme tokens only, so every palette works. */
.story-text { margin: 0 0 2px; }
.story-text .sf-wrap > p { margin: 0 0 6px; }
.story-text .sf-wrap > p:last-child { margin-bottom: 0; }
.sf-cap { margin: 0; font-size: 14px; color: var(--text); }
.story-fmt-capsule .sf-cap { padding-left: 8px; border-left: 3px solid var(--line); }
.sf-tl { list-style: none; margin: 4px 0 6px; padding: 0 0 0 4px; }
.sf-tl li { position: relative; display: grid; grid-template-columns: minmax(64px, max-content) 1fr; gap: 2px 10px; padding: 0 0 6px 14px; border-left: 2px solid var(--line); }
.sf-tl li:last-child { padding-bottom: 0; }
.sf-tl li::before { content: ""; position: absolute; left: -5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.sf-when { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--accent); white-space: nowrap; padding-top: 1px; }
.sf-what { min-width: 0; }
.sf-qa { margin: 4px 0 0; }
.sf-qa dt { font-weight: 700; margin: 6px 0 1px; }
.sf-qa dt:first-child { margin-top: 0; }
.sf-qa dd { margin: 0 0 0 12px; padding-left: 8px; border-left: 2px solid var(--accent-soft, var(--line)); }
.sf-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; margin: 6px 0; }
.sf-num { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sf-num b { font-family: var(--display, var(--serif)); font-size: 20px; line-height: 1.1; color: var(--text); overflow-wrap: anywhere; }
.sf-num span { font-size: 11px; color: var(--dim); line-height: 1.25; }
.sf-tape { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 13px; table-layout: fixed; }
.sf-tape th { font-size: 12px; font-weight: 700; padding: 4px 6px; border-bottom: 2px solid var(--line); overflow-wrap: anywhere; }
.sf-tape th:first-child, .sf-tape td:first-child { text-align: right; }
.sf-tape th:last-child, .sf-tape td:last-child { text-align: left; }
.sf-tape td { padding: 3px 6px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sf-tape .sf-tape-k { width: 34%; text-align: center; font-size: 11px; letter-spacing: .03em; text-transform: uppercase; color: var(--dim); }
.sf-tape td.sf-edge { font-weight: 700; color: var(--accent); }
.sf-pull { margin: 2px 0 8px; padding: 2px 0 2px 12px; border-left: 3px solid var(--accent); font-family: var(--serif); font-size: 18px; font-style: italic; line-height: 1.3; color: var(--text); }
.story-compact .sf-nums { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }
.story-compact .sf-num b { font-size: 16px; }
.story-compact .sf-pull { font-size: 15px; }
@media (max-width: 480px) {
	.sf-tl li { grid-template-columns: 1fr; gap: 0; }
	.sf-tape { font-size: 12px; }
	.sf-tape .sf-tape-k { width: 30%; font-size: 10px; }
	.sf-pull { font-size: 16px; }
}

/* Story formats: typewritten Q&A questions, newsprint timeline dates. */
.sf-qa dt { font-family: var(--f-typewriter); font-weight: 400; }
.sf-when { font-family: var(--f-newsprint); font-weight: 400; font-size: 13px; }

/* "Why this story?" (stories-why.js): the link under a story and the evidence dialog. */
.story .story-foot { gap: 6px; flex-wrap: wrap; }
.why-dialog { width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius, 12px); background: var(--panel); color: var(--text); box-shadow: 0 16px 48px rgba(0, 0, 0, .35); overflow: auto; overscroll-behavior: contain; }
.why-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.why-dialog > * { margin-left: 18px; margin-right: 18px; }
.why-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 1; margin: 0; padding: 14px 18px 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.why-title { margin: 2px 0 2px; font-size: 1.15rem; }
.why-claim { margin: 0; font-family: var(--serif); font-style: italic; color: var(--dim); }
.why-close { flex: none; }
.why-intro { margin-top: 10px; margin-bottom: 4px; }
.why-sec { margin-top: 14px; margin-bottom: 14px; }
.why-h { margin: 0 0 2px; font-size: 15px; }
.why-note { margin: 0 0 6px; }
.why-more { margin: 4px 0 0; }
.why-table td, .why-table th { white-space: nowrap; }
.why-table tr.why-hl td { background: color-mix(in srgb, var(--accent) 16%, transparent); font-weight: 600; }
.why-table tr.why-gap td { color: var(--dim); padding-top: 0; padding-bottom: 0; }
@media (max-width: 480px) {
	.why-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
	.why-dialog > * { margin-left: 12px; margin-right: 12px; }
	.why-top { padding: 10px 12px 8px; }
	.why-table { font-size: 12px; }
}
/* The kind in a card's kicker links to all stories of that kind; it keeps the kicker's look. */
.story-kicker .story-kind-link { color: inherit; text-decoration: none; }
.story-kicker .story-kind-link:hover, .story-kicker .story-kind-link:focus-visible { text-decoration: underline; }
.story-kind-note { margin: -4px 0 10px; }
