/* Styles for the pages built by scripts/build-journal.mjs: the journal, its guides,
   About, Contact, Disclosure and Privacy.
   Same tokens and names as the app, so the two read as one product: paper ground,
   ink text, bronze for links and eyebrows, gold only on ink. No shadows, no motion.
   Every colour comes from the token block below; a dark variant is a token change,
   so do not write a colour value anywhere else in this file. */
:root {
  --paper: #F5F0EA; --paper-2: #EBE4DA; --white: #FFFFFF;
  --ink: #0C0B0A; --ink-2: #4A4541; --ink-3: #6B655F;
  --line: #DDD5CA; --control: #8F867B;
  --gold: #C9A96E; --bronze: #7A5A1E;
  --on-ink-2: #D9D2C8; --on-ink-3: #B0AAA4; --ink-line: #2B2723;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --measure: 680px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* The column keeps the footer at the bottom of the window on a page shorter than it (Contact on a tall screen). */
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); font: 400 16px/1.5 var(--sans); overflow-wrap: break-word; }
main { flex: 1 0 auto; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--bronze); outline-offset: 2px; }
.on-ink :focus-visible { outline-color: var(--gold); }
[tabindex="-1"]:focus { outline: none; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 10; padding: 10px 14px; background: var(--white); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 6px; font-size: 14px; font-weight: 600; }
.skip-link:focus { left: 8px; }

/* Header: the app's bar (.top in app.html), so moving between site and app does not change the frame. */
.site-top { background: var(--ink); color: var(--paper); min-height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 6px 0 16px; }
.wordmark { font: italic 500 28px/1 var(--serif); color: var(--paper); text-decoration: none; padding: 8px 0; }
.site-nav { display: flex; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--paper); font-size: 14px; font-weight: 500; text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }
.site-nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 6px; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
.article { max-width: var(--measure); margin: 0 auto; }

.eyebrow, .crumbs { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bronze); }
.crumbs ol { display: flex; flex-wrap: wrap; list-style: none; padding: 0; }
.crumbs li + li::before { content: "/"; margin: 0 8px; color: var(--control); }
.crumbs a { display: inline-block; padding: 13px 0; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.head > .eyebrow { margin-bottom: 8px; }
.head h1 { font: 600 30px/1.08 var(--serif); letter-spacing: -0.005em; text-wrap: balance; }
.head h1 em { font-style: italic; font-weight: 500; }
.dek { margin-top: 12px; font-size: 18px; line-height: 1.5; color: var(--ink-2); }
.meta { margin-top: 12px; font-size: 13px; color: var(--ink-3); }

.disclosure { margin-top: 24px; padding: 8px 12px; background: var(--white); border-left: 3px solid var(--gold); font-size: 14px; line-height: 1.5; color: var(--ink); }
.disclosure a { color: var(--ink); font-weight: 600; }

.prose { margin-top: 24px; font-size: 18px; line-height: 1.65; }
.prose > * + * { margin-top: 16px; }
.prose h2 { font: 600 26px/1.15 var(--serif); margin-top: 40px; }
.prose h3 { font: 600 18px/1.3 var(--sans); margin-top: 28px; }
.prose h2 + *, .prose h3 + * { margin-top: 8px; }
.prose h2 + .table-wrap, .prose h3 + .table-wrap { margin-top: 12px; }
.prose a { color: var(--bronze); font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { color: var(--ink); }
/* The no-break space keeps the arrow on the same line as the last word of the link. */
.prose a[target="_blank"]::after { content: "\00A0\2197"; font-size: 0.8em; }
.aff { margin-left: 4px; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--bronze); font-weight: 600; }
/* position: relative keeps the visually hidden "(opens in a new tab)" text of a link in a
   scrolled-away cell inside the frame; without it that text widens the whole page. */
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px;
  /* A table wider than its frame scrolls sideways, and a column that is cut off exactly at the
     frame leaves no sign of it. The two grey edges stay fixed to the frame; the two white covers
     travel with the table and hide an edge only when that end of the table is in view. */
  background:
    linear-gradient(var(--white), var(--white)) left / 20px 100% no-repeat local,
    linear-gradient(var(--white), var(--white)) right / 20px 100% no-repeat local,
    linear-gradient(to right, var(--control), var(--white)) left / 10px 100% no-repeat scroll,
    linear-gradient(to left, var(--control), var(--white)) right / 10px 100% no-repeat scroll,
    var(--white); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); min-width: 108px; }
.prose thead th { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); background: var(--paper-2); border-bottom-color: var(--control); }
.prose tbody td:first-child { font-weight: 600; }
/* A web address used as link text has no spaces; let it break so a three-column table still fits a phone. */
.prose td a { overflow-wrap: anywhere; }
.prose tbody tr:last-child td { border-bottom: 0; }

/* Hand-off into the app. Slim: one line after the introduction. Panel: after the article. */
.handoff-slim { margin-top: 24px; padding: 12px 14px; background: var(--paper-2); border-radius: 8px; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.handoff-slim a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.handoff { margin-top: 48px; padding: 24px 16px; background: var(--ink); color: var(--paper); border-radius: 8px; }
.handoff .eyebrow { color: var(--gold); }
.handoff h2 { font: 600 30px/1.08 var(--serif); margin-top: 8px; text-wrap: balance; }
/* Only the 500 italic of the serif is loaded; a 600 italic would be faked by the browser. */
.handoff h2 em { font-style: italic; font-weight: 500; }
.handoff p { margin-top: 12px; font-size: 16px; color: var(--on-ink-2); max-width: 520px; }
.handoff .pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 420px; margin-top: 16px; }
.handoff .pick.one { grid-template-columns: minmax(0, 1fr); max-width: 260px; }
.handoff .pick a { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 8px; background: var(--gold); color: var(--ink); font-size: 15px; font-weight: 700; text-align: center; text-decoration: none; border-radius: 6px; }
.handoff .pick a:hover { background: var(--paper); }
.handoff .fine { font-size: 13px; color: var(--on-ink-3); margin-top: 12px; }

.related { margin-top: 48px; }
.related > h2, .topic > div > h2 { font: 600 26px/1.15 var(--serif); }
.guides { list-style: none; padding: 0; margin-top: 8px; border-top: 1px solid var(--line); }
.guides li { position: relative; padding: 16px 0; border-bottom: 1px solid var(--line); }
/* Rows are h3 under a topic or "Keep reading", and h2 on a topic page. The link is the
   title only; ::after stretches it over the row so the whole row can be clicked. */
.guides h2, .guides h3 { font: 600 22px/1.2 var(--serif); }
.guides h2 a, .guides h3 a { text-decoration: none; }
.guides h2 a::after, .guides h3 a::after { content: ""; position: absolute; inset: 0; }
.guides li:hover h2 a, .guides li:hover h3 a { text-decoration: underline; text-decoration-color: var(--bronze); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.guides p { margin-top: 4px; font-size: 15px; color: var(--ink-2); max-width: 620px; }
.guides .meta { margin-top: 6px; }
.more { margin-top: 12px; font-size: 14px; }
.more a { display: inline-block; padding: 12px 0; color: var(--bronze); font-weight: 600; }

/* Journal index: topics, not dates. */
.topics-nav { margin-top: 20px; }
.topics-nav ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.topics-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; background: var(--white); border: 1.5px solid var(--control); border-radius: 999px; font-size: 14px; font-weight: 500; text-decoration: none; }
.topics-nav a:hover { border-color: var(--ink); }
.topic { margin-top: 40px; scroll-margin-top: 16px; }
.topic-blurb { margin-top: 8px; font-size: 15px; color: var(--ink-2); }
.topic-list { margin-top: 24px; }
.index .handoff { margin-top: 56px; }

.site-foot { background: var(--ink); color: var(--paper); padding: 32px 16px 24px; }
.foot-in { max-width: 1036px; margin: 0 auto; display: grid; gap: 24px; }
.foot-brand .wordmark { display: inline-block; }
.foot-brand p { margin-top: 4px; font-size: 14px; color: var(--on-ink-2); max-width: 300px; }
.foot-col h2 { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.foot-col ul { list-style: none; padding: 0; margin-top: 4px; }
.foot-col a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; color: var(--paper); text-decoration: none; }
.foot-col a:hover { text-decoration: underline; }
.foot-note { max-width: 1036px; margin: 24px auto 0; padding-top: 16px; border-top: 1px solid var(--ink-line); font-size: 13px; color: var(--on-ink-3); }
.foot-note a { color: var(--paper); }

/* The serif's default figures are old-style, where "1." reads as a capital I; headings use lining
   figures. This rule must stay below every `font:` shorthand above, because the shorthand resets it. */
.head h1, .prose h2, .handoff h2, .related > h2, .topic > div > h2, .guides h2, .guides h3 { font-variant-numeric: lining-nums; }

/* Narrow phones: tighter cells so a three-column table fits without scrolling. */
@media (max-width: 480px) {
  /* Long words may hyphenate, but only words of nine letters or more and never within four
     letters of either end, so "Moder-ately" is allowed and "Cot-ton" is not. A web address
     never takes a hyphen: a reader could copy it as part of the address. */
  .prose th, .prose td { padding: 10px 8px; min-width: 64px; -webkit-hyphens: auto; hyphens: auto;
    -webkit-hyphenate-limit-before: 4; -webkit-hyphenate-limit-after: 4; hyphenate-limit-chars: 9 4 4; }
  .prose td a { -webkit-hyphens: manual; hyphens: manual; }
  .prose th:first-child, .prose td:first-child { padding-left: 12px; }
  .prose th:last-child, .prose td:last-child { padding-right: 12px; }
}
/* The narrowest phones: a little smaller, so three columns keep whole words. */
@media (max-width: 340px) {
  .prose table { font-size: 14px; }
}
@media (min-width: 720px) {
  .wrap { padding: 40px 32px 64px; }
  .head h1 { font-size: 38px; }
  .handoff { padding: 32px; }
  .handoff h2 { font-size: 38px; }
  .foot-in { grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
  .site-foot { padding: 48px 32px 32px; }
  .foot-cols2 { display: contents; }
}
@media (max-width: 719px) {
  .foot-cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
}
@media (min-width: 960px) {
  .topic { display: grid; grid-template-columns: 260px minmax(0, 1fr); column-gap: 56px; align-items: start; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--control); }
  .topic .guides { margin-top: 0; border-top: 0; }
  .topic .guides li:first-child { padding-top: 0; }
}
@media print {
  .site-top, .site-foot, .handoff, .handoff-slim, .related, .skip-link, .topics-nav { display: none; }
  body { background: var(--white); }
  .prose a::after { content: none; }
}
