/* Internet Chronicle — editorial record, two themes.
   Ported from the design canvas "Timeline Variants":
   light warm-paper timeline + dark warm-black reading pages, AUTO/LIGHT/DARK
   toggle, Spectral serif for display & prose, IBM Plex Mono for everything
   structural. Status colors carry meaning; oxblood/salmon is the only accent.
   Extensions not in the canvas (kept in the same idiom): the EN pending
   marker, LOW CONFIDENCE flag, ARCHIVED source links, update source links. */

:root {
  --bg: #faf7f1;
  --ink: #1c1a16;
  --body: #3d3830;
  --muted: #6f6759;
  --faint: #8a8171;
  --hairline: #e2dcd0;
  --accent: #7a2e1f;      /* links */
  --ok: #2e7d4f;          /* resolved / concluded */
  --warn: #9a5a15;        /* ongoing + category accent */
  --alert: #a63d2d;       /* disputed / low confidence */
  --shadow: rgba(40, 32, 16, 0.06);
}
html[data-theme="dark"] {
  --bg: #16130f;
  --ink: #eae2d3;
  --body: #c9c0ad;
  --muted: #a39882;
  --faint: #7d7261;
  --hairline: #3a342a;
  --accent: #e08a70;
  --ok: #86c29d;
  --warn: #d3a05f;
  --alert: #e0876d;
  --shadow: rgba(0, 0, 0, 0.3);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #16130f;
    --ink: #eae2d3;
    --body: #c9c0ad;
    --muted: #a39882;
    --faint: #7d7261;
    --hairline: #3a342a;
    --accent: #e08a70;
    --ok: #86c29d;
    --warn: #d3a05f;
    --alert: #e0876d;
    --shadow: rgba(0, 0, 0, 0.3);
  }
}

:root {
  --serif: "Spectral", "Hiragino Mincho ProN", "Noto Serif JP", "Songti SC",
           "SimSun", Georgia, serif;
  --mono: "IBM Plex Mono", "Hiragino Sans", "Noto Sans JP", "PingFang SC",
          "Microsoft YaHei", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.page {
  max-width: 780px;
  margin: 0 auto;
  padding: 30px 52px 44px;
}

/* mono utility text — the structural voice of the page */
.up      { letter-spacing: 0.13em; text-transform: uppercase; font-size: 10.5px; }
.label   { letter-spacing: 0.18em; text-transform: uppercase; font-size: 10.5px; color: var(--muted); }
.serif   { font-family: var(--serif); }

/* ------------------------------------------------------------ top chrome */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.topbar a { color: var(--muted); }
.topbar a:hover { color: var(--ink); text-decoration: none; }
.topbar .active, .topbar .back { color: var(--ink); font-weight: 500; }
.switchers { display: flex; gap: 18px; flex-wrap: wrap; }

.masthead {
  margin: 24px 0 6px;
  text-align: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 41px;
  letter-spacing: 0.005em;
  line-height: 1.08;
}
.masthead a { color: var(--ink); }
.masthead a:hover { text-decoration: none; }
.tagline {
  margin: 0 0 24px;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15.5px;
  color: var(--muted);
}
.double-rule { border-top: 3px solid var(--ink); }
.double-rule::after {
  content: "";
  display: block;
  border-top: 1px solid var(--ink);
  margin-top: 2px;
}
.thin-rule { border-top: 1px solid var(--hairline); margin: 18px 0 26px; }

/* -------------------------------------------------------------- timeline */
.year-mark {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 0 2px;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
}
.year-mark::before, .year-mark::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--hairline);
}

.entry {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--hairline);
}
.gutter { text-align: right; padding-top: 6px; }
.gdate { font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.gyear { font-size: 11px; color: var(--faint); margin-top: 3px; }
.dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted);
  margin-right: 7px;
  vertical-align: 1px;
}
.dot.s-ongoing { background: var(--warn); }
.dot.s-resolved, .dot.s-concluded { background: var(--ok); }
.dot.s-disputed { background: var(--alert); }

.eyebrow {
  margin: 0 0 8px;
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 2;
}
.st { font-weight: 500; }
.st.s-ongoing { color: var(--warn); }
.st.s-resolved, .st.s-concluded { color: var(--ok); }
.st.s-disputed { color: var(--alert); }
.cat { color: var(--warn); }
.eyebrow .cat-plain { color: inherit; }
.saga-tag {
  border: 1px solid var(--ink);
  padding: 1px 6px;
  color: var(--ink);
}
.lowconf { color: var(--alert); font-weight: 500; }

.headline {
  margin: 0 0 7px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 25px;
  line-height: 1.28;
}
.headline a { color: var(--ink); }
.headline a:hover { color: var(--accent); text-decoration: none; }
.subline {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}
.mlink {
  font-family: var(--mono);
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}
.foot-motto {
  margin: 30px 0 0;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------------------------------------------------------- detail pages */
.detail h1 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 33px;
  line-height: 1.2;
}
.outcome-slab {
  border-left: 3px solid var(--ink);
  padding: 2px 0 2px 20px;
  margin: 0 0 24px;
}
.outcome-slab .label { font-size: 10px; display: block; margin-bottom: 5px; }
.outcome-slab p {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.5;
}
.summary {
  margin: 0 0 28px;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.65;
  color: var(--body);
}
.section-rule {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
}
.section-rule::after { content: ""; flex: 1; border-top: 1px solid var(--hairline); }

.update-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 32px;
  margin: 0 0 20px;
}
.udate {
  text-align: right;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 3px;
}
.update-row p {
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.6;
  color: var(--body);
}
.usrc { font-size: 10px; letter-spacing: 0.1em; margin-right: 10px; }

.sources { display: flex; flex-direction: column; gap: 10px; margin: 0 0 28px; }
.source { margin: 0; font-size: 12px; line-height: 1.6; }
.source a { word-break: break-all; }
.src-tag {
  display: inline-block;
  border: 1px solid var(--ink);
  padding: 0 5px;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 9px;
}
.src-tag.spacer { visibility: hidden; border-color: transparent; }
.src-pub { color: var(--faint); }
.archived { font-size: 10px; letter-spacing: 0.1em; }

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  border-top: 1px solid var(--hairline);
  padding-top: 16px;
  margin-top: 4px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.detail .entry .headline { font-size: 22px; line-height: 1.3; }
.detail .entry .subline { font-size: 14.5px; }
.detail .entry { padding: 20px 0; }
.detail .gutter { padding-top: 5px; }

/* i18n pending marker — canonical text shown until translated */
.pending {
  font-family: var(--mono);
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--hairline);
  padding: 0 3px;
  vertical-align: super;
  cursor: help;
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 620px) {
  .page { padding: 22px 22px 30px; }
  .masthead { font-size: 27px; margin-top: 16px; }
  .tagline { font-size: 13px; margin-bottom: 16px; }
  .entry, .update-row { grid-template-columns: 1fr; gap: 6px; }
  .gutter { text-align: left; padding-top: 0; }
  .gyear { display: inline; margin-left: 6px; }
  .gdate { font-size: 12px; }
  .udate { text-align: left; }
  .headline { font-size: 19px; }
  .detail h1 { font-size: 23px; line-height: 1.25; }
  .subline { font-size: 13.5px; }
  .topbar { font-size: 10px; letter-spacing: 0.12em; }
}

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