/* The story pages: each piece, the Analysis and Opinion indexes and the writers' pages
   (lib/analysis-page.js). Shared styles are in /site.css. */

/* ---------- Masthead: in /masthead.css ---------- */

/* ---------- Story ---------- */
.article { padding-block: var(--pad-y) var(--s7); }
.story { display: grid; gap: var(--s3); }
.story-meta { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); align-items: center; }
.dot { width: 4px; height: 4px; background: var(--rule); border-radius: 50%; }
/* Headline, dek and body: same sizes as the front page's lead story */
.story h1 {
  font-size: clamp(var(--fs-32), 4.4vw, var(--fs-40));
  line-height: 1.05;
  letter-spacing: -0.025em;
}
.story .dek { font-size: var(--fs-18); line-height: 1.45; color: var(--text); font-style: italic; }
/* The story's illustration (drawn on newsprint white, so dark mode dims it a little). The box
   holds its 3:2 space in the wash color until the image loads. */
.story-art { margin: var(--s1) 0 0; display: grid; gap: var(--s1); }
.story-art img {
  display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover;
  background: var(--wash); filter: brightness(var(--art-brightness, 1));
}
.caption { font-family: var(--mono); font-size: var(--fs-12); color: var(--muted); }
.story .body { display: grid; gap: 1.1em; padding-top: var(--s1); }
.story .body p, .story .body li { font-size: var(--fs-16); line-height: 1.7; color: var(--text); }
/* The first paragraph opens the story in bold */
.story .body > p:first-child { font-weight: 700; color: var(--ink); }
.story .body a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.story .body a:hover { color: var(--accent-text); }
/* Markdown extras: subheads, lists and quotes in the post body */
.story .body h2 { font-size: var(--fs-24); line-height: 1.2; letter-spacing: -0.015em; margin-top: 0.6em; }
.story .body h3 { font-size: var(--fs-18); line-height: 1.3; margin-top: 0.4em; }
.story .body ul, .story .body ol { margin: 0; padding-left: 1.4em; display: grid; gap: 0.4em; }
.story .body blockquote {
  margin: 0; padding-left: var(--s3); border-left: 3px solid var(--line);
  font-style: italic;
}
.story .body hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s1) 0; width: 100%; }
.story .body code { font-family: var(--mono); font-size: 0.95em; background: var(--wash); padding: 0 4px; border-radius: var(--r-sm); }

/* Index pages: one entry per piece, divided by rules */
.index h1 { margin-top: 5px; }
/* The list itself is styled by /story-list.css. Its last entry's rule closes it, so the footer
   below it skips its own. */
.index-list + .story-foot { border-top: 0; }
.author-stats { margin-top: calc(var(--s1) * -1); }
/* A writer's header: their portrait (if writers.json has one) beside their name, bio and stats */
.author-head { display: grid; gap: var(--s3); align-items: start; }
.author-intro { display: grid; gap: var(--s3); }
/* The name a step smaller than a section page's title, and the bio at body size, in italic */
.author-head h1 { font-size: clamp(1.375rem, 2.6vw, 1.75rem); } /* 22px on phones, up to 28px */
.author-head .dek { font-size: var(--fs-16); line-height: 1.7; font-style: italic; }
.author-head.has-photo { grid-template-columns: 120px minmax(0, 1fr); }
@media (min-width: 640px) { .author-head.has-photo { grid-template-columns: 200px minmax(0, 1fr); gap: var(--s5); align-items: center; } }
.author-photo { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: var(--wash); filter: brightness(var(--art-brightness, 1)); }
/* Links to the writer's profiles elsewhere, separated by the masthead's bullet */
.author-links { margin-top: calc(var(--s1) * -1); }
.author-links a { color: var(--ink); }
.author-links a:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.author-links .bullet { margin-inline: 8px; }
.author-note { font-family: var(--mono); font-size: var(--fs-12); color: var(--muted); }
.author-note a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.author-note a:hover { color: var(--accent-text); }

.sources { display: grid; gap: var(--s1); margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--rule); }
.sources ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); }
.sources a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.sources a:hover { color: var(--accent-text); text-decoration-thickness: 2px; }

.story-foot {
  display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; justify-content: space-between;
  margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--rule);
}
.back {
  font-family: var(--mono); font-size: var(--fs-12); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink);
  display: inline-flex; align-items: center; min-height: 44px;
}
.back:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 4px; }
