/* ============================================================
   Tripsmith — Atelier register
   Shared stylesheet for the public editorial surface:
   /atelier, /method, /library, /journal, /colophon,
   /subscriptions, /dispatches.
   The PWA (index.html, trip-mode.html) uses a different stack
   and is intentionally not affected by this file.
   ============================================================ */

/* ---------- 1. Tokens ---------- */

:root {
  --ink:        #0E0F12;
  --ink-soft:   #3A3B40;
  --muted:      #6A655B;
  --paper:      #FBF7EF;
  --paper-2:    #F4EEDC;
  --line:       #D9CFB8;
  --line-soft:  #E7DFC8;
  --hairline:   #1B1C20;
  --vermilion:  #B8332A;
  --vermilion-deep: #8E2419;

  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --jp:    "Noto Serif JP", "Hiragino Mincho ProN", "YuMincho", serif;

  --col:    62ch;        /* body column */
  --col-narrow: 54ch;    /* tighter standfirst column */
  --gutter: 36px;
}

/* ---------- 2. Reset, page chrome ---------- */

* { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "onum";
}

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--vermilion); }

img, svg { max-width: 100%; display: block; }

::selection { background: var(--vermilion); color: var(--paper); }

/* ---------- 3. Page frame ---------- */

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 48px 96px;
  position: relative;
}

.page-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 48px 96px;
  position: relative;
}

/* ---------- 4. Masthead (top of each page) ---------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 0.5px solid var(--hairline);
  margin-bottom: 56px;
}

.masthead-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.masthead-brand .mark {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.masthead-brand .mark .smith { color: var(--vermilion); }

.masthead-section {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.masthead-section .sep {
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--vermilion);
  margin: 0 10px 4px;
  vertical-align: middle;
}

.masthead-cta {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--vermilion);
  border-bottom: 0.5px solid var(--vermilion);
  padding-bottom: 1px;
}

/* ---------- 5. Editorial primitives ---------- */

.eyebrow {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--vermilion);
  display: inline-block;
  margin-bottom: 24px;
}

.eyebrow .dot {
  display: inline-block;
  margin: 0 8px;
  color: var(--muted);
}

h1.title,
.title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 18px;
  max-width: 22ch;
}

.standfirst {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 19px;
  line-height: 1.5;
  color: var(--vermilion);
  max-width: 42ch;
  margin: 0 0 48px;
}

.standfirst.dark { color: var(--ink-soft); }

.hairline {
  border: 0;
  border-top: 0.5px solid var(--hairline);
  margin: 40px 0;
}

.hairline.dashed { border-top-style: dashed; border-top-color: var(--line); }

.hairline.short { width: 64px; margin: 28px 0; }

/* body prose */
.body-prose {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.72;
  color: var(--ink);
  max-width: var(--col);
}

.body-prose p {
  margin: 0 0 1.2em;
}

.body-prose p + p { text-indent: 1.6em; }

.body-prose em,
.body-prose .ital { font-style: italic; color: var(--vermilion); }

.body-prose strong { font-weight: 600; }

/* chapter numeral */
.chapter-numeral {
  font-family: var(--jp);
  font-weight: 400;
  font-size: 40px;
  line-height: 1;
  color: var(--vermilion);
  display: inline-block;
}

.chapter-row {
  display: flex;
  align-items: baseline;
  gap: 22px;
  margin: 56px 0 18px;
}

.chapter-row .chapter-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  color: var(--ink);
}

.chapter-row .chapter-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--muted);
  margin-left: 6px;
}

/* epigraph */
.epigraph {
  font-family: var(--serif);
  font-style: italic;
  font-size: 21px;
  line-height: 1.45;
  color: var(--vermilion);
  max-width: 52ch;
  margin: 0 0 28px;
  padding-left: 18px;
  border-left: 1px solid var(--vermilion);
}

/* the standard / six-line list */
.standard-list {
  list-style: none;
  margin: 28px 0;
  padding: 0;
  max-width: var(--col);
}

.standard-list li {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink);
  padding: 14px 0;
  border-bottom: 0.5px dashed var(--line);
}

.standard-list li:last-child { border-bottom: none; }

/* vignettes (recent curations) */
.vignettes {
  list-style: none;
  margin: 24px 0;
  padding: 0;
  max-width: var(--col);
}

.vignettes li {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  padding: 12px 0;
  border-top: 0.5px solid var(--line);
}

.vignettes li:last-child { border-bottom: 0.5px solid var(--line); }

/* dot-leader contents row */
.contents-list {
  list-style: none;
  margin: 32px 0;
  padding: 0;
}

.contents-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  align-items: baseline;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 0.5px dashed var(--line);
  font-family: var(--serif);
  font-size: 18px;
}

.contents-row a { display: contents; }

.contents-row .num {
  font-family: var(--jp);
  color: var(--vermilion);
  font-size: 20px;
  letter-spacing: 0.02em;
}

.contents-row .num .prefix {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}

.contents-row .title-cell {
  font-style: italic;
  color: var(--ink);
  position: relative;
  overflow: hidden;
}

.contents-row .title-cell::after {
  content: "";
  display: inline-block;
  width: 100%;
  margin-left: 8px;
  vertical-align: middle;
  border-bottom: 1px dotted var(--line);
  transform: translateY(-4px);
}

.contents-row .meta-cell {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.contents-row:hover .title-cell { color: var(--vermilion); }

/* vendor card (museum object label) */
.vendor-card {
  border-top: 0.5px solid var(--hairline);
  padding: 22px 0 26px;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 28px;
  max-width: 880px;
}

.vendor-card h3 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  margin: 0 0 6px;
  color: var(--ink);
}

.vendor-card .kind {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.vendor-card .desc {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 10px;
}

.vendor-card .meta {
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}

.vendor-card .meta dt {
  display: inline;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.vendor-card .meta dd {
  display: inline;
  margin: 0 0 0 4px;
  font-family: var(--serif);
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}

.vendor-card .meta dd::after { content: "\A"; white-space: pre; }

/* marginalia */
.marginalia {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  border-left: 1px solid var(--vermilion);
  padding-left: 14px;
  max-width: 240px;
  margin: 4px 0 16px 24px;
  float: right;
}

@media (max-width: 760px) {
  .marginalia { float: none; max-width: none; margin: 18px 0; }
}

/* colophon block */
.colophon-block {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-soft);
  border-top: 0.5px solid var(--hairline);
  padding-top: 28px;
  margin-top: 64px;
  display: grid;
  grid-template-columns: 9rem 1fr;
  row-gap: 8px;
  column-gap: 18px;
  max-width: 720px;
}

.colophon-block dt {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  align-self: baseline;
}

.colophon-block dd {
  margin: 0;
  font-family: var(--serif);
  color: var(--ink);
}

/* outbound link */
.read-on {
  display: inline-block;
  margin-top: 40px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--vermilion);
  border-bottom: 0.5px solid var(--vermilion);
  padding-bottom: 1px;
}

/* signature line */
.house-signature {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
  margin-top: 28px;
}

.house-signature .desk { color: var(--vermilion); }

/* ---------- 6. Masthead footer (bottom of every page) ---------- */

.masthead-footer {
  margin-top: 96px;
  padding: 40px 0 28px;
  border-top: 0.5px solid var(--hairline);
}

.masthead-footer .mf-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  align-items: baseline;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--ink);
}

.masthead-footer .mf-row a {
  color: var(--ink);
  padding: 2px 0;
}

.masthead-footer .mf-row a:hover { color: var(--vermilion); }

.masthead-footer .mf-row .sep {
  display: inline-block;
  margin: 0 14px;
  color: var(--muted);
}

.masthead-footer .mf-meta {
  margin-top: 22px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.masthead-footer .mf-meta .desk { color: var(--vermilion); }

/* ---------- 7. Mobile ---------- */

/* Vendor-card has a 220-px sidebar on desktop. On iPad portrait (768 px)
   and other narrow desktops up to ~880 px, the sidebar squeezes the prose
   column to <540 px — readable but cramped. Stack early. */
@media (max-width: 880px) {
  .vendor-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .colophon-block {
    grid-template-columns: 1fr;
    row-gap: 4px;
  }
  .colophon-block dt { margin-top: 10px; }
}

@media (max-width: 760px) {
  .page,
  .page-narrow { padding: 32px 22px 64px; }

  .masthead {
    flex-wrap: wrap;
    gap: 14px;
    padding-bottom: 14px;
    margin-bottom: 36px;
  }

  .masthead-brand .mark { font-size: 19px; }

  .masthead-section { font-size: 9px; letter-spacing: 0.2em; }

  .masthead-cta { font-size: 14px; }

  h1.title, .title { font-size: clamp(32px, 9vw, 44px); }

  .standfirst { font-size: 17px; max-width: none; margin-bottom: 32px; }

  .body-prose { font-size: 17px; }

  .body-prose p + p { text-indent: 1.2em; }

  .chapter-row { flex-direction: column; align-items: flex-start; gap: 6px; }

  .chapter-row .chapter-title { font-size: 24px; }

  .chapter-numeral { font-size: 32px; }

  .contents-row {
    grid-template-columns: 3rem 1fr;
    row-gap: 4px;
  }

  .contents-row .meta-cell { grid-column: 2; }

  .contents-row .title-cell::after { display: none; }

  .vendor-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .colophon-block {
    grid-template-columns: 1fr;
    row-gap: 4px;
  }

  .colophon-block dt { margin-top: 10px; }
}

/* Very narrow screens (iPhone SE, older Android): tighten page padding so
   the body column gets every available pixel. */
@media (max-width: 420px) {
  .page,
  .page-narrow { padding: 28px 18px 56px; }
  h1.title, .title { font-size: clamp(28px, 9vw, 38px); }
  .standfirst { font-size: 16px; }
  .body-prose { font-size: 16.5px; }
  .vendor-card .meta { font-size: 10px; }
}

/* ---------- 8. Print ---------- */

@media print {
  html, body { background: #fff; color: #000; }
  .masthead-cta,
  .masthead-footer { display: none; }
  .page, .page-narrow { padding: 0; max-width: none; }
  .chapter-row { break-before: page; page-break-before: always; }
  .chapter-row:first-of-type { break-before: auto; page-break-before: auto; }
  p { orphans: 3; widows: 3; }
  a { color: #000; text-decoration: none; }
  .standfirst, .epigraph { color: #000; }
  .eyebrow, .masthead-section { color: #444; }
  .vermilion, .body-prose em { color: #000; }
}

/* ---------- 9. Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
