/* Stitch Manual: warm heritage broadsheet */
:root {
  --paper: #f7f2e6;
  --paper-deep: #efe7d4;
  --ink: #221c17;
  --ink-soft: #4f463d;
  --rule: #b9ab90;
  --rule-strong: #221c17;
  --red: #8a1c22;
  --red-dark: #6e1419;
  --sage: #4f5e4a;
  --sage-wash: #e6e7da;
  --focus: #8a1c22;
  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --text: "Libre Caslon Text", "Iowan Old Style", Georgia, serif;
  --measure: 68ch;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.1875rem; /* 19px */
  line-height: 1.65;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums proportional-nums;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--red-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 1px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 0.75rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 700px) { .wrap { padding: 0 2rem; } }

/* ---------- Nameplate ---------- */
.nameplate { padding-top: 1.25rem; }
.np-grid { display: grid; grid-template-columns: 1fr; align-items: center; gap: 0.75rem; }
.np-title { text-align: center; margin: 0; }
.np-title a {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.6rem, 9.5vw, 6.2rem);
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  font-variation-settings: "opsz" 96;
  display: inline-block;
  padding: 0.25rem 0;
}
.np-ear {
  display: none;
  border: 1px solid var(--rule-strong);
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
  line-height: 1.4;
  max-width: 15rem;
}
.np-ear p { margin: 0; }
.np-ear .ear-head { font-family: var(--display); font-style: italic; font-size: 1.1rem; margin-bottom: 0.15rem; }
.np-ear.right { justify-self: end; text-align: right; }
@media (min-width: 980px) {
  .np-grid { grid-template-columns: 15rem 1fr 15rem; }
  .np-ear { display: block; }
}
.np-rules { border-top: 3px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); height: 7px; margin-top: 0.6rem; }
.np-line {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1.5rem;
  padding: 0.35rem 0; border-bottom: 1px solid var(--rule-strong);
  font-size: 1rem;
}
.np-line .np-motto { font-style: italic; color: var(--ink-soft); }
.nav-desk { display: none; gap: 0.25rem 1.6rem; }
.nav-desk a, .nav-mobile a {
  color: var(--ink); text-decoration: none; font-size: 1.05rem;
  padding: 0.55rem 0.1rem; display: inline-block; min-height: 44px;
}
.nav-desk a:hover, .nav-mobile a:hover, .nav-desk a[aria-current="page"] { color: var(--red); text-decoration: underline; }
.menu-btn {
  font: inherit; font-size: 1rem; background: transparent; color: var(--ink);
  border: 1px solid var(--ink); padding: 0.5rem 1rem; min-height: 44px; cursor: pointer;
}
.menu-btn:hover { background: var(--ink); color: var(--paper); }
.nav-mobile[hidden] { display: none; }
.nav-mobile:not([hidden]) { display: flex; flex-direction: column; border-bottom: 1px solid var(--rule-strong); padding: 0.25rem 0 0.75rem; }
.nav-mobile a { border-bottom: 1px solid var(--rule); padding: 0.75rem 0; }
@media (min-width: 820px) {
  .nav-desk { display: flex; flex-wrap: wrap; }
  .menu-btn { display: none; }
  .nav-mobile, .nav-mobile:not([hidden]) { display: none; }
}

/* ---------- Type ---------- */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.12; color: var(--ink); font-variation-settings: "opsz" 48; }
h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); margin: 0 0 0.75rem; letter-spacing: -0.005em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin: 0 0 0.6rem; }
h3 { font-size: 1.45rem; margin: 0 0 0.4rem; }
h4 { font-size: 1.2rem; margin: 0 0 0.3rem; }
p { margin: 0 0 1rem; }
.dek { font-size: 1.3rem; line-height: 1.5; color: var(--ink-soft); font-style: italic; margin-bottom: 1.25rem; max-width: 40em; }
.small { font-size: 1rem; line-height: 1.5; }
.muted { color: var(--ink-soft); }

/* ---------- Front page ---------- */
.front { display: grid; grid-template-columns: 1fr; gap: 0; border-bottom: 1px solid var(--rule-strong); }
.lead { padding: 1.75rem 0; }
.lead h1 { font-size: clamp(2.3rem, 5.6vw, 4rem); max-width: 14ch; }
.side { padding: 1.5rem 0; border-top: 1px solid var(--rule-strong); }
@media (min-width: 900px) {
  .front { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .lead { padding: 2rem 2.25rem 2.25rem 0; border-right: 1px solid var(--rule-strong); }
  .side { padding: 2rem 0 2rem 2.25rem; border-top: 0; }
}
.side h2 { font-size: 1.6rem; border-bottom: 3px double var(--rule-strong); padding-bottom: 0.35rem; margin-bottom: 0.5rem; }
.era { margin: 0 0 1.1rem; }
.era h3 { font-style: italic; font-weight: 500; font-size: 1.3rem; margin: 0.6rem 0 0.15rem; }
.era ul { list-style: none; margin: 0; padding: 0; }
.era li { border-bottom: 1px solid var(--rule); }
.era li:first-child { border-top: 1px solid var(--rule); }
.era a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; min-height: 44px; color: var(--ink); text-decoration: none; }
.era a:hover .m-name { color: var(--red); text-decoration: underline; }
.era .m-meta { color: var(--ink-soft); font-size: 0.95rem; white-space: nowrap; align-self: center; }

/* Finder */
.finder { margin: 1.5rem 0 0; border-top: 1px solid var(--rule-strong); padding-top: 1.1rem; }
.finder label { display: block; font-family: var(--display); font-size: 1.35rem; margin-bottom: 0.4rem; }
.finder-row { display: flex; gap: 0; }
.finder input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.15rem; color: var(--ink);
  background: #fffdf7; border: 1px solid var(--ink); border-right: 0; padding: 0.7rem 0.85rem; min-height: 52px; border-radius: 0;
}
.finder input::placeholder { color: #776c60; }
.finder button {
  font: inherit; font-size: 1.05rem; background: var(--red); color: #fff; border: 1px solid var(--red); padding: 0 1.2rem; min-height: 52px; cursor: pointer;
}
.finder button:hover { background: var(--red-dark); }
.finder-help { font-size: 1rem; color: var(--ink-soft); margin: 0.5rem 0 0; }
.finder-results { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.finder-results li { border-bottom: 1px solid var(--rule); }
.finder-results a { display: block; padding: 0.6rem 0; min-height: 44px; text-decoration: none; color: var(--ink); }
.finder-results a strong { color: var(--red); font-weight: 600; }
.finder-results .none { padding: 0.6rem 0; color: var(--ink-soft); }

/* Ruled multi-column section */
.section { padding: 2.25rem 0; border-bottom: 1px solid var(--rule-strong); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem 2rem; border-bottom: 3px double var(--rule-strong); padding-bottom: 0.4rem; margin-bottom: 1.25rem; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--ink-soft); font-style: italic; }
.cols { display: grid; grid-template-columns: 1fr; }
.cols > * { padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.cols > *:last-child { border-bottom: 0; }
@media (min-width: 760px) {
  .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols > * { padding: 0.25rem 1.5rem 1rem; border-bottom: 0; border-left: 1px solid var(--rule); }
  .cols > *:nth-child(2n+1) { border-left: 0; padding-left: 0; }
}
@media (min-width: 1060px) {
  .cols.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols.three > * { border-left: 1px solid var(--rule); padding-left: 1.5rem; }
  .cols.three > *:nth-child(3n+1) { border-left: 0; padding-left: 0; }
}
.story h3 a { color: var(--ink); text-decoration: none; }
.story h3 a:hover { color: var(--red); text-decoration: underline; }
.story p { font-size: 1.05rem; line-height: 1.55; }
.story .more { font-size: 1rem; }

/* Particulars table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.particulars { width: 100%; border-collapse: collapse; font-size: 1.02rem; line-height: 1.4; }
.particulars caption { text-align: left; font-style: italic; color: var(--ink-soft); padding-bottom: 0.5rem; }
.particulars th, .particulars td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem 0.6rem 0; border-bottom: 1px solid var(--rule); }
.particulars thead th { font-family: var(--display); font-weight: 600; font-size: 1.05rem; border-bottom: 1px solid var(--rule-strong); }
.particulars tbody th { font-weight: 400; }
.particulars tbody th a { font-weight: 700; }

/* Stacked table on small screens */
@media (max-width: 699px) {
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack tr { display: block; border-bottom: 1px solid var(--rule-strong); padding: 0.5rem 0; }
  table.stack th, table.stack td { display: block; border: 0; padding: 0.15rem 0; }
  table.stack td::before { content: attr(data-label) ": "; color: var(--ink-soft); font-style: italic; }
}

.request { display: grid; gap: 1rem; align-items: center; padding: 2rem 0; border-bottom: 1px solid var(--rule-strong); }
@media (min-width: 820px) { .request { grid-template-columns: 2fr 1fr; } }
.request h2 { font-size: 1.8rem; }
.btn {
  display: inline-block; font-family: var(--text); font-size: 1.1rem; text-decoration: none;
  background: var(--ink); color: var(--paper); padding: 0.8rem 1.4rem; min-height: 48px; border: 1px solid var(--ink);
}
.btn:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }

/* ---------- Article / guide ---------- */
.crumbs { font-size: 1rem; padding-top: 0.9rem; color: var(--ink-soft); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.crumbs li + li::before { content: "/"; margin-right: 0.5rem; color: var(--rule); }
.crumbs a { color: var(--ink-soft); }

.article-head { padding: 1.25rem 0 1.5rem; border-bottom: 1px solid var(--rule-strong); }
.article-head h1 { max-width: 22ch; }
.article-head .dek { margin-bottom: 0; }

.article { display: grid; grid-template-columns: 1fr; gap: 0 3rem; padding: 1.75rem 0 2.5rem; }
@media (min-width: 1000px) {
  .article { grid-template-columns: minmax(0, 1fr) 19rem; }
  .article aside.margin { grid-column: 2; grid-row: 1 / span 40; }
}
.prose { max-width: var(--measure); min-width: 0; }
.prose h2 { margin-top: 2.5rem; padding-top: 0.75rem; border-top: 1px solid var(--rule-strong); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.75rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.4rem; }
.prose .dropcap::first-letter {
  float: left; font-family: var(--display); font-weight: 600; color: var(--red);
  font-size: 4.6em; line-height: 0.82; padding: 0.06em 0.12em 0 0; font-variation-settings: "opsz" 96;
}

/* Margin column: particulars */
aside.margin { font-size: 1rem; line-height: 1.5; }
.card-part { border-top: 3px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); padding: 0.75rem 0 0.5rem; margin-bottom: 1.5rem; }
.card-part h2 { font-size: 1.35rem; margin: 0 0 0.5rem; }
.card-part dl { margin: 0; }
.card-part dt { font-style: italic; color: var(--ink-soft); }
.card-part dd { margin: 0 0 0.6rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--rule); }
.card-part dd:last-of-type { border-bottom: 0; }
.toc ol { padding-left: 1.2rem; margin: 0; }
.toc li { margin: 0.2rem 0; }
.toc a { display: inline; padding: 0.3rem 0; line-height: 1.9; }
@media (min-width: 1000px) { .margin .sticky { position: sticky; top: 1rem; } }

/* Numbered steps with drawings */
ol.steps { list-style: none; padding: 0; margin: 1rem 0 1.5rem; counter-reset: step; }
ol.steps > li {
  counter-increment: step; position: relative; padding: 0.9rem 0 0.9rem 3.1rem; border-top: 1px solid var(--rule); margin: 0;
}
ol.steps > li:last-child { border-bottom: 1px solid var(--rule); }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0.7rem;
  font-family: var(--display); font-weight: 600; font-size: 1.9rem; line-height: 1; color: var(--red);
  font-variant-numeric: lining-nums; width: 2.2rem; text-align: right;
}
ol.steps.has-fig > li { display: grid; grid-template-columns: 1fr; gap: 0.5rem 1.25rem; }
@media (min-width: 640px) {
  ol.steps > li.with-fig { display: grid; grid-template-columns: minmax(0, 1fr) 128px; gap: 0 1.25rem; align-items: start; }
}
.step-fig { width: 128px; height: auto; color: var(--ink); }
.step-fig .acc { stroke: var(--red); }
.step-fig .accf { fill: var(--red); }
.step-fig .sage { stroke: var(--sage); }

figure.plate { margin: 1.5rem 0; padding: 1rem 0; border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); }
figure.plate svg { display: block; width: 100%; max-width: 560px; margin: 0 auto; color: var(--ink); }
figure.plate figcaption { font-size: 1rem; font-style: italic; color: var(--ink-soft); margin-top: 0.6rem; }
.plate .acc { stroke: var(--red); }
.plate .accf { fill: var(--red); }
.plate text, .step-fig text { font-family: var(--text); font-size: 13px; fill: var(--ink); stroke: none; }

.note {
  border-left: 4px solid var(--red); background: #f3e6dc; padding: 0.85rem 1rem; margin: 1.25rem 0; font-size: 1.05rem;
}
.note strong { color: var(--red-dark); }
.note.sage { border-left-color: var(--sage); background: var(--sage-wash); }
.note.sage strong { color: var(--sage); }
.note p:last-child { margin-bottom: 0; }

table.trouble { width: 100%; border-collapse: collapse; font-size: 1.02rem; line-height: 1.45; margin: 1rem 0 1.5rem; }
.trouble th, .trouble td { text-align: left; vertical-align: top; padding: 0.65rem 0.75rem 0.65rem 0; border-bottom: 1px solid var(--rule); }
.trouble thead th { font-family: var(--display); border-bottom: 1px solid var(--rule-strong); }
.trouble tbody th { font-weight: 700; }

.sources { font-size: 1rem; }
.sources li { overflow-wrap: anywhere; }

.related { border-top: 3px double var(--rule-strong); padding-top: 0.75rem; margin-top: 2.5rem; }

/* ---------- Footer ---------- */
.foot { border-top: 3px solid var(--rule-strong); margin-top: 2.5rem; padding: 0.25rem 0 2rem; }
.foot-rule { border-top: 1px solid var(--rule-strong); margin-top: 4px; }
.foot-grid { display: grid; grid-template-columns: 1fr; }
.foot-grid > div { padding: 1rem 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 640px) {
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-grid > div { padding: 1rem 1.25rem; border-left: 1px solid var(--rule); border-bottom: 0; }
  .foot-grid > div:nth-child(2n+1) { border-left: 0; padding-left: 0; }
}
@media (min-width: 1060px) {
  .foot-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .foot-grid > div:nth-child(2n+1) { border-left: 1px solid var(--rule); padding-left: 1.25rem; }
  .foot-grid > div:first-child { border-left: 0; padding-left: 0; }
}
.foot h2 { font-size: 1.2rem; font-style: italic; font-weight: 500; margin: 0 0 0.4rem; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li a { display: inline-block; padding: 0.35rem 0; min-height: 40px; color: var(--ink); font-size: 1rem; }
.foot li a:hover { color: var(--red); }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; border-top: 1px solid var(--rule-strong); padding-top: 0.9rem; font-size: 0.98rem; color: var(--ink-soft); }
.foot-base .np-small { font-family: var(--display); font-size: 1.5rem; color: var(--ink); font-weight: 600; }

/* 404 */
.notfound { padding: 3rem 0; max-width: 46rem; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print { .nav-desk, .menu-btn, .nav-mobile, .finder, .foot { display: none; } body { background: #fff; } }
