/* Shared compact editorial system. Mandatory contract: DESIGN.md. */
:root {
  --paper: #faf8f2;
  --pine: #356259;
  --clay: #a34b32;
  --ink: #283b35;
  --muted: #56614f;
  --text-secondary: #60675d;
  --text-summary: #697063;
  --text-crumb: #677260;
  --line-control: #bbb9ae;
  --line-shell: #cdcbbf;
  --line: #d6d5c9;
  --line-note: #dad8cd;
  --line-footer: #c9cbbb;
  --line-filter: #d9d9cd;
  --line-input: #909c87;
  --surface-input: #fffdf7;
  --surface-active: #e8ede5;
  --surface-nav: #faf8f2f5;
  --surface-table: #e7e9dd;
  --surface-route: #ece6d9;
  --ink-caption: #493a29;
  --focus: #ab7b45;
  --font-ui: system-ui,-apple-system,sans-serif;
  --font-editorial: Georgia,'AppleMyungjo','YuMincho','Songti SC',serif;
  --font-meta: ui-monospace,monospace;
  --space-2: 2px;
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-10: 10px;
  --space-12: 12px;
  --space-14: 14px;
  --space-16: 16px;
  --space-18: 18px;
  --space-20: 20px;
  --space-22: 22px;
  --space-24: 24px;
  --space-26: 26px;
  --space-30: 30px;
  --type-micro: 8px;
  --type-caption: 9px;
  --type-meta: 10px;
  --type-crumb: 11px;
  --type-summary: 12px;
  --type-control: 13px;
  --type-dek: 14px;
  --type-body: 16px;
  --type-section: 17px;
  --type-brand: 23px;
  --type-icon: 25px;
  --type-nav-icon: 21px;
  --leading-nav: 13px;
  --leading-nav-icon: 24px;
  --leading-title: 1.32;
  --leading-section: 1.45;
  --leading-row: 1.4;
  --leading-summary: 1.55;
  --leading-dek: 1.65;
  --leading-body: 1.9;
  --leading-note: 1.7;
  --weight-title: 600;
  --weight-emphasis: 650;
  --door-height: 61px;
  --locale-width: 110px;
  --gutter: var(--space-18);
  --row-gap: var(--space-12);
  --type-row: var(--type-section);
  --type-title: clamp(27px,6.5vw,39px);
  --radius-control: 4px;
  --radius-compact: 3px;
  --control-min: 44px;
  --control-input: 48px;
  --control-padding: 12px;
  --header-height: 66px;
  --shell-width: 920px;
  --content-width: 760px;
  --intro-width: 570px;
  --article-width: 620px;
  --nav-height: 48px;
  --nav-width: 76px;
  --bottom-clearance: 76px;
  --thumb-width: 64px;
  --thumb-height: 60px;
  --plate-height: 128px;
  --plate-width: 240px;
}
* {
  box-sizing: border-box;
}
html {
  scroll-padding-top: 90px;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
}
a {
  color: inherit;
  text-decoration: none;
}
button,input,select {
  font: inherit;
}
button,select {
  min-height: var(--control-min);
  background: transparent;
  border: 1px solid var(--line-control);
  border-radius: var(--radius-control);
  color: inherit;
}
button {
  padding: 0 var(--control-padding);
  cursor: pointer;
  font-size: var(--type-control);
}
header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--shell-width);
  margin: auto;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line-shell);
}
header>div {
  display: flex;
  gap: var(--space-6);
}
.brand {
  font-size: var(--type-brand);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.2px;
  position: relative;
  padding-left: var(--space-12);
}
.brand span {
  display: block;
  font-size: var(--type-micro);
  letter-spacing: 2px;
  margin-top: 5px;
}
select {
  max-width: var(--locale-width);
  padding: 0 var(--space-8);
  font-size: var(--type-summary);
}
#searchTop {
  font-size: var(--type-icon);
  min-width: var(--control-min);
  border: 0;
}
main {
  max-width: var(--content-width);
  margin: auto;
  padding: var(--space-16) var(--gutter) calc(var(--bottom-clearance) + env(safe-area-inset-bottom));
}
.sample {
  font-size: var(--type-meta);
  letter-spacing: .3px;
  color: var(--muted);
  margin-bottom: var(--space-20);
  display: flex;
  gap: var(--space-6);
  align-items: center;
}
.intro small {
  font-size: var(--type-meta);
  letter-spacing: 1.5px;
  color: var(--clay);
  font: var(--type-meta) var(--font-meta);
}
h1 {
  font-size: var(--type-title);
  line-height: var(--leading-title);
  letter-spacing: -.8px;
  word-break: keep-all;
  overflow-wrap: break-word;
  margin: var(--space-10) 0 var(--space-12);
  font-weight: var(--weight-title);
  font-family: var(--font-editorial);
}
h2 {
  font-size: var(--type-section);
  line-height: var(--leading-section);
  margin: var(--space-26) 0 var(--space-10);
}
h3 {
  font-size: var(--type-row);
  line-height: var(--leading-row);
  letter-spacing: -.4px;
  margin: var(--space-6) 0;
  font-weight: var(--weight-emphasis);
}
.intro p,.dek {
  color: var(--text-secondary);
  font-size: var(--type-dek);
  line-height: var(--leading-dek);
  margin: 0;
}
.doors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-14);
  margin: var(--space-22) 0;
}
.doors a {
  border-top: 2px solid var(--pine);
  padding: var(--space-10) 0 var(--space-4);
  font-size: var(--type-dek);
  min-height: var(--door-height);
  font-weight: var(--weight-emphasis);
  border-color: var(--pine);
}
.doors span {
  display: block;
  font-size: var(--type-meta);
  color: var(--muted);
  margin-bottom: var(--space-6);
  font: var(--type-meta) var(--font-meta);
}
.row {
  display: flex;
  gap: var(--row-gap);
  padding: var(--space-16) 0;
  border-top: 1px solid var(--line);
  align-items: flex-start;
}
.row>div {
  flex: 1;
  min-width: 0;
}
.row small {
  font-size: var(--type-meta);
  color: var(--pine);
}
.row p {
  font-size: var(--type-summary);
  line-height: var(--leading-summary);
  color: var(--text-summary);
  margin: var(--space-4) 0 0;
}
.number {
  font-size: var(--type-summary);
  color: var(--muted);
  padding-top: 3px;
  position: absolute;
  bottom: 0;
  left: 0;
  font: var(--type-meta) var(--font-meta);
}
.footnote {
  font-size: var(--type-meta);
  line-height: var(--leading-note);
  color: var(--muted);
  border-top: 1px solid var(--line-note);
  padding-top: var(--space-12);
  margin-top: var(--space-22);
}
#bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  background: var(--surface-nav);
  border-top: 1px solid var(--line-footer);
  padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(12px);
  z-index: 5;
  padding: var(--space-2) var(--space-8) env(safe-area-inset-bottom);
}
#bottom a {
  flex: 0 1 var(--nav-width);
  min-width: var(--control-min);
  min-height: var(--control-input);
  text-align: center;
  padding: 3px var(--space-2);
  font-size: var(--type-meta);
  line-height: var(--leading-nav);
  height: var(--nav-height);
  position: relative;
  border-radius: var(--radius-compact);
}
#bottom a span {
  display: block;
  font-size: var(--type-nav-icon);
  margin-bottom: 3px;
}
#bottom a[aria-current] {
  background: var(--surface-active);
  color: var(--pine);
  font-weight: 700;
}
.filters {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
  margin: var(--space-20) 0 var(--space-12);
}
.filters button[aria-pressed=true] {
  background: var(--surface-active);
  color: var(--pine);
  border-color: var(--pine);
  border-bottom: 2px solid var(--pine);
}
.selection {
  color: var(--muted);
  font-size: var(--type-summary);
}
.empty {
  padding: var(--space-30) 0;
  color: var(--muted);
}
label {
  display: block;
  margin: var(--space-22) 0 var(--space-10);
  font-size: var(--type-dek);
}
input {
  width: 100%;
  min-height: var(--control-input);
  padding: var(--space-10) var(--space-12);
  border: 1px solid var(--line-input);
  background: var(--surface-input);
  border-radius: var(--radius-compact);
}
body:has(input:focus) #bottom {
  display: none;
}
.crumb {
  font-size: var(--type-crumb);
  line-height: var(--leading-body);
  color: var(--text-crumb);
}
.crumb a {
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-flex;
  min-height: var(--control-min);
  align-items: center;
}
article p {
  font-size: var(--type-body);
  line-height: var(--leading-body);
  word-break: normal;
}
article section {
  margin: var(--space-30) 0;
}
.art {
  height: var(--plate-height);
  background: var(--surface-table);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-24) 0;
  position: relative;
  overflow: hidden;
}
.art span {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font: var(--type-caption) var(--font-meta);
  letter-spacing: 1.2px;
  color: var(--ink-caption);
}
.art1 {
  background: var(--surface-route);
}
.toc {
  border-left: 2px solid var(--pine);
  padding: var(--space-8) var(--space-14);
  font-size: var(--type-control);
  border-color: var(--pine);
}
.toc b {
  display: block;
  margin-bottom: var(--space-8);
  color: var(--pine);
}
.toc a {
  display: block;
  padding: var(--space-12) 0;
  min-height: var(--control-min);
}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.sample,.doors span,.number,.footnote,.selection,.empty {
  color: var(--muted);
}
.brand:before {
  content: '';
  position: absolute;
  left: 0;
  top: 2px;
  width: 5px;
  height: 24px;
  background: var(--clay);
}
.sample:before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--clay);
  flex: none;
}
.intro {
  border-left: 2px solid var(--clay);
  padding-left: var(--space-14);
}
.doors a:last-child {
  border-color: var(--clay);
}
.row>span:last-child {
  color: var(--clay);
}
.story-art {
  width: var(--thumb-width);
  flex: none;
  position: relative;
  padding-bottom: var(--space-14);
}
.editorial-graphic {
  display: block;
  width: 100%;
  height: 100%;
}
.mini {
  height: var(--thumb-height);
}
#bottom a>span:first-child {
  font: var(--type-nav-icon)/var(--leading-nav-icon) var(--font-ui);
  margin: 0;
}
#bottom a .nav-label {
  font: var(--type-meta)/var(--leading-nav) var(--font-ui);
  white-space: nowrap;
  margin: 0;
}
#bottom a[aria-current]:before {
  content: '';
  position: absolute;
  top: -3px;
  left: calc(50% - 10px);
  width: 20px;
  height: 2px;
  background: var(--pine);
}
.filters button {
  font-size: var(--type-control);
  border: 0;
  border-bottom: 1px solid var(--line-filter);
  border-radius: 0;
  padding: 0 var(--space-12);
}
.art .editorial-graphic {
  width: var(--plate-width);
  max-width: 80%;
  margin: auto;
}
article section h2 {
  display: flex;
  gap: var(--space-8);
  align-items: baseline;
}
article section h2:before {
  content: '';
  width: 14px;
  height: 2px;
  background: var(--clay);
  flex: none;
}
.row:hover h3,.doors a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Responsive editorial geometry is intentional, not a second design system. */
@media(min-width:800px) {
  :root {--thumb-width:88px;--thumb-height:72px;--plate-height:155px}
  .intro,.doors {max-width:var(--intro-width)}
  article {max-width:var(--article-width);margin:auto}
}
@media(max-width:350px) {
  :root {--gutter:var(--space-14);--thumb-width:48px;--thumb-height:52px;--row-gap:var(--space-8);--type-row:var(--type-body)}
}
@media(prefers-reduced-motion:reduce) {* {scroll-behavior:auto!important}}

/* Photography reuses the reading, summary and spacing roles. */
:root {--photo-cover-ratio:4 / 3}
.story-art img {object-fit:cover}
.article-photo {margin:var(--space-20) 0}
.article-photo img {display:block;width:100%;height:auto}
.cover-photo img {aspect-ratio:var(--photo-cover-ratio);object-fit:contain}
.article-photo figcaption {font-size:var(--type-summary);line-height:var(--leading-summary);color:var(--text-secondary);margin-top:var(--space-8)}
.photo-credit {display:block;color:var(--muted);margin-top:var(--space-4)}
.photo-credit a {text-decoration:underline;text-underline-offset:3px;overflow-wrap:anywhere}
