/*
 * AskDimitri — the letters archive (public/archive.html, public/letters/*.html).
 * Colours and fonts come from /css/tokens.css; forms, navigation and the footer from
 * /css/site.css. The gold is decorative only (2.3:1 on paper), so no text uses it.
 */

/* ---------------------------------------------------------------- one letter */

.issue-head .eyebrow { margin-bottom: 14px; }
/* The link sits in a muted line of the same colour, so the underline is what marks it. */
.issue-head .eyebrow a {
  color: var(--muted); text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.issue-head .eyebrow a:hover { color: var(--ink); }
.issue-head h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(28px, 6vw, 38px); line-height: 1.22;
  color: var(--ink); margin: 0 0 16px;
}
.issue-head h1::after {
  content: ""; display: block; width: 64px; height: 3px;
  background: var(--gold); border-radius: 2px; margin-top: 18px;
}
.dateline { font-size: 14px; color: var(--muted); margin: 0 0 36px; line-height: 1.6; }
.issue-head .tags { margin: -24px 0 36px; }

/* Topic chips: on a letter they lead to that topic on the archive; on the archive they jump
   to its section. Soft gold fill with ink text (the gold itself never carries text). */
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { margin: 0; }
.tag {
  display: inline-flex; align-items: center; min-height: 28px; padding: 2px 11px;
  font-family: var(--sans); font-size: 12.5px; font-weight: 500; line-height: 1.3; letter-spacing: 0.01em;
  color: var(--ink); text-decoration: none;
  background: var(--gold-tint); border: 1px solid var(--gold-line); border-radius: 999px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.tag:hover { border-color: var(--ink); background: var(--card); text-decoration: underline; text-underline-offset: 2px; }

.issue-body { font-family: var(--serif); font-size: 18px; line-height: 1.8; color: var(--text); }
.issue-body p { margin: 0 0 20px; }
.issue-body a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.issue-body em { font-style: italic; }
.issue-body h2 {
  font-family: var(--serif); font-weight: 500; font-size: 25px; line-height: 1.3;
  color: var(--ink); margin: 0 0 18px;
}
.issue-body h3 {
  font-family: var(--serif); font-weight: 600; font-size: 19px; line-height: 1.35;
  color: var(--ink); margin: 0 0 8px;
}
.issue-body .standfirst { font-style: italic; color: var(--muted); font-size: 19px; }
.issue-body .kicker {
  font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin: 44px 0 6px; padding-top: 28px; border-top: 1px solid var(--hairline);
}
.issue-body .key { font-weight: 600; color: var(--ink); }
.issue-body .note { font-family: var(--sans); font-size: 13.5px; color: var(--muted); line-height: 1.6; }

.issue-body .toc {
  font-family: var(--sans); font-size: 14.5px; line-height: 1.6; color: var(--muted);
  margin: 0 0 28px; padding-left: 1.4em;
}
.issue-body .toc li { margin: 0 0 4px; }

.issue-body .pull {
  margin: 28px 0; padding: 2px 0 2px 20px; border-left: 3px solid var(--delta);
  font-style: italic; font-size: 19px; line-height: 1.7; color: var(--ink);
}
.issue-body .pull p:last-child { margin-bottom: 0; }

/* Boxes: the action lists, checklists and fact tables of the email template */
.issue-body .box {
  margin: 28px 0; padding: 20px 22px; border: 1px solid var(--hairline); border-radius: 10px;
  background: var(--card); font-size: 16.5px; line-height: 1.7;
}
.issue-body .box > :last-child { margin-bottom: 0; }
.issue-body .box p { margin: 0 0 12px; }
.issue-body .box-label {
  font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); line-height: 1.5;
}
.issue-body .box .box-label { margin: 0 0 14px; }
.issue-body .steps { margin: 0; padding-left: 1.5em; }
.issue-body .steps li { margin: 0 0 14px; padding-left: 4px; }
.issue-body .steps li:last-child { margin-bottom: 0; }
.issue-body .steps li::marker { font-weight: 600; color: var(--ink); }
.issue-body .steps .item-title { font-style: italic; color: var(--ink); margin: 0 0 4px; }
.issue-body .steps li p:last-child { margin-bottom: 0; }

.issue-body .facts { margin: 0; }
.issue-body .fact {
  display: grid; grid-template-columns: minmax(5.5em, max-content) 1fr; gap: 4px 16px;
  padding: 12px 0; border-top: 1px solid var(--hairline);
}
.issue-body .fact:first-child { border-top: 0; padding-top: 0; }
.issue-body .fact:last-child { padding-bottom: 0; }
.issue-body .fact dt { font-weight: 600; color: var(--ink); }
.issue-body .fact dd { margin: 0; }
.issue-body .prices .fact { grid-template-columns: 1fr auto; }
.issue-body .prices .fact dt { font-weight: 400; color: var(--text); }
.issue-body .prices .fact dd { font-weight: 600; color: var(--ink); text-align: right; white-space: nowrap; }
@media (max-width: 420px) {
  .issue-body .fact { grid-template-columns: 1fr; }
  .issue-body .prices .fact { grid-template-columns: 1fr auto; }
}

/* A headline number on dark ink (paper on ink is 10:1, glow on ink 9:1) */
.issue-body .stat {
  margin: 28px 0; padding: 24px 22px; border-radius: 10px; text-align: center;
  background: var(--ink); color: var(--paper);
}
.issue-body .stat .stat-number {
  font-family: var(--serif); font-weight: 600; font-size: clamp(30px, 8vw, 40px); line-height: 1.15;
  margin: 0 0 8px; color: var(--paper);
}
.issue-body .stat figcaption { font-family: var(--sans); font-size: 14px; line-height: 1.6; color: var(--glow); }

.issue-body .split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 28px 0; }
.issue-body .split .stat { margin: 0; }
.issue-body .split-col { border: 1px solid var(--hairline); border-radius: 10px; background: var(--card); padding: 18px 18px; }
.issue-body .split-list { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: 14.5px; line-height: 1.5; }
.issue-body .split-list li { margin: 0 0 12px; }
.issue-body .split-list li:last-child { margin-bottom: 0; }
.issue-body .split-num { display: block; font-family: var(--serif); font-weight: 600; font-size: 22px; color: var(--ink); }
.issue-body .split-note { color: var(--muted); }
@media (max-width: 480px) { .issue-body .split { grid-template-columns: 1fr; } }

.issue-body .news { padding: 18px 0; border-top: 1px solid var(--hairline); }
.issue-body .news p:last-child { margin-bottom: 0; }
.issue-body .news-source {
  font-family: var(--sans); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 6px;
}

/* The email's buttons become links to the form at the end of the page */
.issue-body .cta { margin: 28px 0; }
.issue-body .cta a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px;
  font-family: var(--sans); font-size: 15px; font-weight: 500; text-decoration: none;
  color: var(--ink); background: var(--card); border: 1px solid var(--ink); border-radius: 8px;
  transition: background 0.2s ease;
}
.issue-body .cta a:hover { background: var(--tint); }

.issue-body .signoff { margin-top: 32px; }
.issue-body .signoff p { margin: 0 0 6px; }

.issue-sign { margin: 8px 0 0; }
.issue-sign .sig-name { font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--ink); margin: 0 0 6px; }
.issue-sign .sig-creds { font-size: 13.5px; color: var(--muted); line-height: 1.6; margin: 0; }
.issue-sign .sig-creds a { color: var(--muted); }

.issue-sources { margin-top: 40px; border-top: 1px solid var(--hairline); padding-top: 24px; }
.issue-sources h2 { font-family: var(--serif); font-weight: 500; font-size: 20px; color: var(--ink); margin: 0 0 12px; }
.issue-sources ol { margin: 0; padding-left: 1.5em; font-size: 14.5px; line-height: 1.6; }
.issue-sources li { margin: 0 0 8px; overflow-wrap: anywhere; }

.issue-tool { margin: 40px 0 0; border: 1px solid var(--hairline); border-left: 3px solid var(--gold); background: var(--card); border-radius: 10px; padding: 14px 18px; }
.issue-tool p { margin: 0; font-size: 15px; line-height: 1.6; }

.issue-nav { margin: 48px 0 0; border-top: 1px solid var(--hairline); padding-top: 20px; }
.issue-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 15px; line-height: 1.5; }
.issue-nav .dir {
  display: block; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.issue-nav a { color: var(--ink); }

.join-lead { margin: 48px 0 0; font-family: var(--serif); font-size: 19px; line-height: 1.5; color: var(--ink); }
.join-lead + .reply-card { margin-top: 20px; }

/* ---------------------------------------------------------------- the archive */

.archive-title { font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 6vw, 36px); line-height: 1.25; color: var(--ink); margin: 0 0 16px; }
.archive-intro { font-size: 16px; color: var(--text); margin: 0 0 12px; }
/* "Start here": three letters for a newcomer, in reading order, above the full list */
.start-here {
  margin: 32px 0 0; padding: 22px 24px 24px; border: 1px solid var(--hairline); border-left: 3px solid var(--gold);
  border-radius: 10px; background: var(--card);
}
.start-here h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; line-height: 1.3; color: var(--ink); margin: 0 0 6px; }
.start-here-lead { font-size: 15px; color: var(--muted); margin: 0 0 18px; line-height: 1.6; }
.start-here-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.start-here-list li { display: grid; grid-template-columns: 30px 1fr; gap: 2px 14px; align-items: start; }
.start-num {
  grid-row: 1 / span 2; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; margin-top: 1px;
  font-family: var(--serif); font-weight: 600; font-size: 15px; color: var(--paper); background: var(--ink);
}
.start-title { font-family: var(--serif); font-weight: 500; font-size: 19px; line-height: 1.35; margin: 2px 0 0; }
.start-title a { color: var(--ink); text-decoration: none; }
.start-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.start-why { font-size: 15px; color: var(--text); margin: 0; line-height: 1.6; }

.archive-section { font-family: var(--serif); font-weight: 500; font-size: 22px; line-height: 1.3; color: var(--ink); margin: 44px 0 0; }
.issue-list { list-style: none; margin: 32px 0 0; padding: 0; }
.archive-section + .issue-list { margin-top: 14px; }
.issue-list .tags { margin-top: 12px; }
.issue-list li { padding: 22px 0; border-top: 1px solid var(--hairline); }
.issue-list li:last-child { border-bottom: 1px solid var(--hairline); }
.issue-list .issue-meta { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.issue-list .issue-link { font-family: var(--serif); font-weight: 500; font-size: 22px; line-height: 1.3; margin: 0 0 8px; }
.issue-list .issue-link a { color: var(--ink); text-decoration: none; }
.issue-list .issue-link a:hover { text-decoration: underline; text-underline-offset: 3px; }
.issue-list .issue-desc { font-size: 15.5px; color: var(--text); margin: 0; line-height: 1.6; }
.muted-note { font-size: 14px; color: var(--muted); margin: 18px 0 0; }

/* "By topic": the same letters grouped, oldest first within a topic */
.topics { margin: 48px 0 0; padding-top: 28px; border-top: 1px solid var(--hairline); }
.topics h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; line-height: 1.3; color: var(--ink); margin: 0 0 6px; }
.topics-lead { font-size: 15px; color: var(--muted); margin: 0 0 8px; line-height: 1.6; }
.topic { padding: 18px 0 4px; }
.topic h3 { font-family: var(--serif); font-weight: 600; font-size: 18px; line-height: 1.35; color: var(--ink); margin: 0 0 10px; }
.topic-count { font-family: var(--sans); font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 6px; }
.topic ul { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--hairline); font-size: 15px; line-height: 1.6; }
.topic li { margin: 0 0 6px; }
.topic a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
/* A topic jumped to from a chip sits clear of the top of the window */
.topic, .issue-list li { scroll-margin-top: 24px; }

@media (prefers-reduced-motion: reduce) {
  .issue-body .cta a, .tag { transition: none; }
}
