/* Local reading study, 2026-11-11. Keep this layer after the existing styles. */
:root {
  --font-reading: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
  --sans: var(--font-reading);
  /* Legacy components use this token for headings, not for quoted source text. */
  --serif: var(--font-reading);
  --ink: #243c36;
  --muted: #52635c;
  --reading-text: #30483f;
}

body { font-family: var(--font-reading); font-size: 15px; line-height: 1.75; }

/* Identity first; the complete menu occupies a separate, stable row. */
.site-header,
.timeline-mode .site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  height: auto;
  min-height: 0;
  padding-top: 22px;
  padding-bottom: 0;
  gap: 16px 24px;
  align-items: center;
}
.site-header .brand {
  grid-column: 1;
  grid-row: 1;
  width: auto;
  max-width: 100%;
  min-width: 0;
  gap: 12px;
  font-family: var(--font-reading);
  letter-spacing: 0;
}
.brand-name { font-size: 24px; font-weight: 650; line-height: 1.4; letter-spacing: 0; }
.brand-symbol { font-size: 29px; flex: none; }
.brand small {
  font: 400 12px/1.65 var(--font-reading);
  text-transform: none;
  letter-spacing: 0;
  max-width: none;
  margin-top: 3px;
  color: var(--muted);
}
.site-header .language {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  align-self: center;
  font-size: 13px;
}
.site-header > nav {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  align-self: auto;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  min-height: 50px;
  gap: 0 28px;
}
.nav-main,
.nav-secondary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 26px;
  min-width: 0;
}
.nav-secondary { flex-wrap: nowrap; margin-left: auto; }
.site-header .nav {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 0;
  line-height: 1.5;
  font-family: var(--font-reading);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .055em;
  text-transform: uppercase;
  white-space: nowrap;
}
.site-header .nav.active {
  color: var(--teal);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: .45em;
}
.site-header .nav.active::after { content: none; }
html:lang(ko) .site-header .nav { font-size: 13px; letter-spacing: 0; }

/* Use one family, a comfortable line height and natural letter spacing. */
#main :is(h1, h2, h3, h4, h5, h6) {
  font-family: var(--font-reading);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  overflow-wrap: break-word;
}
#main h1 {
  font-size: clamp(30px, 3.3vw, 46px);
  font-weight: 650;
  line-height: 1.3;
  max-width: 28ch;
  margin-bottom: 20px;
  text-wrap: balance;
}
#main h2 { font-size: clamp(22px, 2vw, 29px); }
#main h3 { font-size: clamp(18px, 1.65vw, 23px); }
html:lang(ko) #main :is(h1, h2, h3) { word-break: keep-all; overflow-wrap: anywhere; }

/* Darken actual reading copy as well as the shared secondary-text token. */
#main :is(
  .lead, .editor-note, .reference-note p, .method-grid p, .context-card p,
  .record-card p, .chapter-card p, .search-result p, .composition-detail p,
  .comparison-grid p, .source-detail > p, .account-body > p, .episode-note p,
  .timeline-body > p, .chrono-inspector > p, .undated-chronicle p,
  .history-boundary, .history-claim p, .history-stop article > p,
  .canon-fact p, .canon-detail p, .canon-opening > p,
  .chronicle-intro p:not(.eyebrow), .inquiry-card > p, .place-card > p
) {
  color: var(--reading-text);
  font-size: 15px;
  line-height: 1.85;
}
#main .lead { max-width: 74ch; }
#main .chronicle-intro > div:first-child { max-width: 760px; }
#main :is(.muted, .history-people, .scholar-attribution) { color: var(--muted); }
#main :is(.chrono-tick, .window-range, .timeline-years, .map-axis, .source-id) {
  font-family: var(--font-reading);
  letter-spacing: 0;
}
.mini-map > span,
#main :is(
  .intro-aside > span, .bce, .tick, .chapter-card-top > span:first-child,
  .sequence-number, .branch-number, .source-code, .method-grid article > span,
  .result-count, .gospel-choice span, .phase-node > span, .phase-heading > span,
  .phase-heading small, .gospel-column-header > span, .stage-caption > span,
  .life-context-node
) { font-family: var(--font-reading); }
#main .chrono-copy > strong {
  font-family: var(--font-reading);
  font-size: 19px;
  line-height: 1.45;
  font-weight: 600;
  letter-spacing: 0;
}
#main :is(.chrono-copy > small, .chrono-source, .chrono-summary, .chrono-bible-ref) {
  font-size: 12px;
  line-height: 1.65;
  letter-spacing: 0;
}
#main .chrono-summary { color: var(--muted); }
.footer-brand { font-family: var(--font-reading); }

@media (max-width: 1050px) {
  .site-header > nav { gap: 0 24px; }
  .nav-main { flex-basis: 100%; gap: 0 22px; }
  .nav-secondary { margin-left: 0; gap: 0 24px; }
}
@media (max-width: 600px) {
  .site-header,
  .timeline-mode .site-header { padding-top: 18px; gap: 12px 10px; }
  .site-header .brand { gap: 8px; }
  .brand-symbol { font-size: 25px; }
  .brand-name { font-size: 19px; line-height: 1.5; }
  .brand small { font-size: 11px; line-height: 1.65; }
  .site-header .language { min-width: 72px; padding: 0 4px; font-size: 12px; }
  .site-header > nav { gap: 0; padding-bottom: 4px; }
  .nav-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 0 16px; }
  .site-header .nav { font-size: 11px; letter-spacing: .035em; white-space: normal; }
  .nav-secondary { gap: 0 24px; }
  .nav-secondary .nav { white-space: nowrap; }
  #main h1 { font-size: clamp(28px, 7.4vw, 34px); }
}
