/* Two Hours Out, site stylesheet.
   One file for every page. Colours live in the :root block; the five region
   colours are picked automatically from data-region on a card or a post body. */

:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);

  --paper: #FBFBF9;
  --card: #FFFFFF;
  --stone: #E3E7E3;
  --iso-wall: #C4CBC7; --iso-wall2: #D6DBD8; --iso-chairs: #E3E7E3; --iso-boxes: #F3F5F3; --iso-ring: #FBFBF9; --iso-line: #8E9AA0;
  --ink: #16232B;
  --ink-soft: #5C6B73;
  --line: #DCE1E0;
  --link: #2B4C9B;
  --stamp: #B13523;

  /* Region colours: one per direction out of Tokyo */
  --chiba: #1B7F8E;
  --kanagawa: #2B4C9B;
  --yamanashi: #3F7D3A;
  --saitama: #7B3F8C;
  --ibaraki: #C7861A;

  --tokyo: #B13523;

  --display: "Lora", Georgia, "Times New Roman", serif;
  --body: "DM Sans", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14191D; --card: #1C2329; --stone: #2A3238; --iso-wall: #2E383F; --iso-wall2: #3A454C; --iso-chairs: #2A3238; --iso-boxes: #232A2E; --iso-ring: #1C2329; --iso-line: #55626A; --ink: #ECEAE4; --ink-soft: #9AA6AD; --line: #2E383F;
    --link: #8FB0F0; --stamp: #B13523;
    --chiba: #4FB3C2; --kanagawa: #7C9BE0; --yamanashi: #7CBF72; --saitama: #B98BCC; --ibaraki: #E3AE4F; --tokyo: #B13523;
  }
}
:root[data-theme="dark"] {
  --paper: #14191D; --card: #1C2329; --stone: #2A3238; --iso-wall: #2E383F; --iso-wall2: #3A454C; --iso-chairs: #2A3238; --iso-boxes: #232A2E; --iso-ring: #1C2329; --iso-line: #55626A; --ink: #ECEAE4; --ink-soft: #9AA6AD; --line: #2E383F;
  --link: #8FB0F0; --stamp: #B13523;
  --chiba: #4FB3C2; --kanagawa: #7C9BE0; --yamanashi: #7CBF72; --saitama: #B98BCC; --ibaraki: #E3AE4F; --tokyo: #B13523;
}

/* Region lookup: anything with data-region gets a --region colour */
[data-region="chiba"]     { --region: var(--chiba); }
[data-region="kanagawa"]  { --region: var(--kanagawa); }
[data-region="yamanashi"] { --region: var(--yamanashi); }
[data-region="saitama"]   { --region: var(--saitama); }
[data-region="ibaraki"]   { --region: var(--ibaraki); }
[data-region="tokyo"]     { --region: var(--tokyo); }

html { scroll-padding-top: env(safe-area-inset-top, 0px); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
*, *::before, *::after { box-sizing: inherit; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
}
img, svg { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--link); outline-offset: 3px; border-radius: 4px;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.08; letter-spacing: 0; margin: 0; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 1rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1.1rem; }

.text { max-width: 42rem; margin-left: auto; margin-right: auto; padding-left: 1.25rem; padding-right: 1.25rem; }
.wide { max-width: 70rem; margin-left: auto; margin-right: auto; padding-left: 1.25rem; padding-right: 1.25rem; }
.section { margin-top: 4rem; }

/* Masthead */
.masthead {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem;
  padding-top: 1.1rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.3rem; }
.brand svg { width: 30px; height: 30px; margin-right: .1rem; }
.masthead nav { display: flex; flex-wrap: wrap; gap: 1.1rem; font-weight: 500; font-size: .95rem; }
.masthead nav a { color: var(--ink-soft); text-decoration: none; }
.masthead nav a:hover, .masthead nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* Home hero */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.5rem; align-items: center; padding-top: 3.5rem; padding-bottom: 1rem; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 3.9rem); font-weight: 600; letter-spacing: -.01em; line-height: 1.05; }
.hero .lede { font-size: 1.15rem; color: var(--ink-soft); margin: 1.25rem 0 1.5rem; max-width: 34rem; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding-top: 2.25rem; } }


/* Japan map on the home page */
.japanmap { width: 100%; max-width: 440px; margin-left: auto; display: block; overflow: visible; }
.japanmap .land { fill: var(--stone); }
.japanmap .pin { cursor: pointer; text-decoration: none; }
.japanmap .pin circle { fill: var(--region, var(--stamp)); stroke: var(--paper); stroke-width: 3; transition: stroke-width .15s; }
.japanmap .pin:hover circle, .japanmap .pin:focus-visible circle { stroke-width: 6; }
.japanmap .pin text { font-family: var(--body); font-size: 13px; font-weight: 600; fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.railmap-note { font-size: .9rem; color: var(--ink-soft); text-align: right; margin-top: .25rem; }
@media (max-width: 860px) { .japanmap { margin-left: 0; } .railmap-note { text-align: left; } }

/* Subscribe form (used on home hero and every footer) */
.subscribe { display: flex; flex-wrap: wrap; gap: .6rem; max-width: 30rem; }
.subscribe input { flex: 1 1 13rem; font: inherit; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.subscribe button { font: inherit; font-weight: 700; padding: .7rem 1.15rem; border: 0; border-radius: 8px; background: var(--ink); color: var(--paper); cursor: pointer; }
.subscribe button:hover { opacity: .9; }
.form-note { font-size: .85rem; color: var(--ink-soft); margin-top: .5rem; }


/* Post cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.5rem 1.25rem; }
.card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.card .band { height: 7px; background: var(--region); }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card .body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.card .region { font-size: .82rem; font-weight: 700; color: var(--region); }
.card .meta-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .6rem; }
.card .date { font-size: .82rem; color: var(--ink-soft); }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card .facts { font-size: .9rem; color: var(--ink-soft); margin: 0; }
.card .verdict-row { margin-top: auto; padding-top: .5rem; display: flex; align-items: center; gap: .6rem; font-size: .92rem; color: var(--ink-soft); }

/* Verdict stamp */
.stamp {
  display: inline-block; font-family: var(--display); font-weight: 600; font-style: italic; line-height: 1;
  color: var(--stamp); border: 2px solid var(--stamp); border-radius: 5px; padding: .38em .55em .32em;
  transform: rotate(-4deg); white-space: nowrap;
}
.stamp.small { font-size: .85rem; padding: .3em .45em .25em; }

/* Seasonal strip */
.season { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.season article { border-top: 3px solid var(--region, var(--line)); padding-top: .8rem; }
.season .when { font-family: var(--display); font-weight: 700; font-size: 1.05rem; color: var(--region, var(--ink)); }
.season p { margin: .35rem 0 0; color: var(--ink-soft); font-size: .95rem; }

/* Photo spots list */
.spots { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; max-width: 44rem; }
.spots li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
.spots .time { font-family: var(--display); font-weight: 700; font-size: 1.3rem; }
.spots p { margin: 0; color: var(--ink-soft); }
.spots b { color: var(--ink); }

/* Footer */
footer { margin-top: 5rem; border-top: 1px solid var(--line); padding-top: 2.5rem; padding-bottom: 3rem; }
footer .cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; }
footer h2 { font-size: 1.35rem; margin-bottom: .4rem; }
footer p { color: var(--ink-soft); }
footer .fine { font-size: .88rem; margin-top: 2rem; }
@media (max-width: 700px) { footer .cols { grid-template-columns: 1fr; } }

/* Post page */
.post-top { padding-top: 1.5rem; }
.route-wrap { overflow-x: auto; padding-bottom: .25rem; }
.route { display: flex; align-items: flex-end; min-width: 34rem; padding: 1.25rem 0 .5rem; gap: 0; }
.route .stop { display: flex; flex-direction: column; align-items: center; gap: .35rem; flex: none; }
.route .dot { width: 16px; height: 16px; border-radius: 50%; background: var(--card); border: 4px solid var(--region); }
.route .stop.end .dot { background: var(--region); }
.route .name { font-weight: 700; font-size: .92rem; white-space: nowrap; }
.route .leg { flex: 1; position: relative; height: 5px; background: var(--region); margin-bottom: calc(.92rem * 1.6 + .35rem + 5px); }
.route .leg span { position: absolute; left: 50%; transform: translateX(-50%); bottom: 10px; font-size: .8rem; color: var(--ink-soft); white-space: nowrap; }
.route .total { flex: none; margin-left: 1rem; margin-bottom: calc(.92rem * 1.6 + .35rem - 8px); font-family: var(--display); font-weight: 800; font-size: 1.6rem; color: var(--region); line-height: 1; }
@media (max-width: 600px) {
  .route-wrap { overflow: visible; }
  .route { min-width: 0; flex-direction: column; align-items: flex-start; padding: 1rem 0 0 .25rem; }
  .route .stop { flex-direction: row; gap: .75rem; }
  .route .leg { flex: none; width: 5px; height: 2.4rem; margin: 0 0 0 5.5px; }
  .route .leg span { left: 1.4rem; right: auto; bottom: auto; top: 50%; transform: translateY(-50%); }
  .route .total { margin: .75rem 0 0; }
}

.hero-photo { margin-top: 1rem; }
.hero-photo img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 10px; }

.post-head { margin-top: 1.75rem; }
.post-head .meta { color: var(--ink-soft); font-size: .95rem; margin-bottom: .75rem; }
.post-head .meta b { color: var(--region); }
.post-head h1 { font-size: clamp(2rem, 5.5vw, 3.4rem); margin-bottom: 1.25rem; }
.verdict { display: flex; align-items: flex-start; gap: 1rem; }
.verdict .stamp { font-size: 1.15rem; margin-top: .1rem; flex: none; }
.verdict p { margin: 0; font-family: var(--display); font-weight: 500; font-style: italic; font-size: 1.2rem; line-height: 1.35; }

.prose { margin-top: 2rem; }
.why { margin-top: 3rem; }
.why h2 { margin-bottom: 1.25rem; }
.prose p { margin-bottom: 1.2rem; }

.photos { margin-top: 2.5rem; }
.photos h2 { margin-bottom: 1.25rem; }
.photos .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem 1.25rem; }
@media (max-width: 640px) { .photos .grid { grid-template-columns: 1fr; } }
.photos figure { margin: 0; }
.photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }
figcaption { font-size: .92rem; color: var(--ink-soft); margin-top: .55rem; line-height: 1.5; }
figcaption b { color: var(--ink); font-weight: 600; }

.practical { margin-top: 3rem; border-top: 4px solid var(--region); padding-top: 1.25rem; }
.practical dl { margin: 0; display: grid; grid-template-columns: 10.5rem 1fr; gap: .85rem 1.25rem; }
.practical dt { font-weight: 700; }
.practical dd { margin: 0; }
.practical dd small { color: var(--ink-soft); }
@media (max-width: 560px) {
  .practical dl { grid-template-columns: 1fr; gap: .15rem 0; }
  .practical dt { margin-top: .9rem; color: var(--region); font-size: .9rem; }
}

.nearby { margin-top: 3rem; }
.nearby p b { color: var(--ink); }

.also { margin-top: 3rem; }
.also .cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* Walk posts: the day as a timeline */
.timeline { list-style: none; margin: 2rem 0 0; padding: 0; }
.timeline > li { display: grid; grid-template-columns: 4.5rem 1fr; gap: 0 1rem; }
.timeline .t { font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: var(--region); line-height: 1.5; }
.timeline .entry { position: relative; border-left: 3px solid var(--region); padding: 0 0 2.2rem 1.25rem; }
.timeline .entry::before { content: ""; position: absolute; left: -8px; top: .45rem; width: 13px; height: 13px; border-radius: 50%; background: var(--paper); border: 3px solid var(--region); }
.timeline > li:last-child > .entry { padding-bottom: .5rem; }
.timeline h3 { font-size: 1.2rem; margin-bottom: .35rem; }
.timeline p { margin: 0 0 .6rem; }
.timeline figure { margin: .6rem 0 .2rem; }
.timeline img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; }
.timeline figure.tall img { aspect-ratio: 4 / 5; }
.timeline figure.tall { max-width: 34rem; }
@media (max-width: 560px) {
  .timeline > li { grid-template-columns: 1fr; }
  .timeline .t { padding-left: 1.25rem; }
}

/* Series grid: one subject, many foregrounds */
.series { margin-top: 3rem; }
.series .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.series figure { margin: 0; }
.series img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.series figcaption { font-size: .85rem; margin-top: .35rem; }

/* Video: a poster frame that loads YouTube only when tapped */
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--ink); margin: .6rem 0 .2rem; }
.video img { width: 100%; height: 100%; object-fit: cover; opacity: .85; aspect-ratio: auto; border-radius: 0; }
.video button { position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--paper); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.video button svg { width: 26px; height: 26px; margin-left: 4px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Links out to Instagram and YouTube */
.elsewhere { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.elsewhere a { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .95rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 500; font-size: .95rem; }
.elsewhere a:hover { border-color: var(--ink); }

/* Language versions of a post */
.langs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.langs a { font-size: .9rem; font-weight: 500; padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); }
.langs a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

:root[lang="ja"] {
  --display: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --body: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
}
:root[lang="ja"] body { line-height: 1.9; }
:root[lang="ja"] h1, :root[lang="ja"] h2, :root[lang="ja"] h3 { line-height: 1.35; letter-spacing: .02em; font-weight: 600; }
:root[lang="ja"] .post-head h1 { font-size: clamp(1.7rem, 4.4vw, 2.6rem); }
:root[lang="ja"] .stamp, :root[lang="ja"] .verdict p { font-style: normal; }
:root[lang="ja"] .verdict p { font-size: 1.1rem; line-height: 1.6; }

:root[lang="mr"] {
  --display: "Tiro Devanagari Marathi", "Noto Serif Devanagari", "Mangal", serif;
  --body: "Mukta", "Noto Sans Devanagari", "Mangal", sans-serif;
}
:root[lang="mr"] body { line-height: 1.8; font-size: 18px; }
:root[lang="mr"] h1, :root[lang="mr"] h2, :root[lang="mr"] h3 { line-height: 1.35; letter-spacing: 0; font-weight: 400; }
:root[lang="mr"] .post-head h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
:root[lang="mr"] .stamp, :root[lang="mr"] .verdict p { font-style: normal; }
:root[lang="mr"] .stamp { font-weight: 400; }
:root[lang="mr"] .verdict p { font-size: 1.2rem; line-height: 1.6; }

/* Listen control and the paragraph being read */
.listen { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .8rem; margin: 0 0 1.25rem; }
.listen button { font: inherit; font-weight: 600; font-size: .92rem; padding: .45rem .95rem; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer; }
.listen .listen-stop { background: transparent; color: var(--ink); }
.listen .listen-hint, .listen .listen-note { font-size: .85rem; color: var(--ink-soft); }
.reading { background: color-mix(in srgb, var(--region) 14%, transparent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--region) 14%, transparent); border-radius: 4px; }

/* Line diagrams drawn in the site's own style */
.diagram svg { width: 100%; height: auto; display: block; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.diagram .band { stroke: var(--line); stroke-width: 1.5; }
.diagram .chairs { fill: var(--stone); }
.diagram .boxes { fill: var(--paper); }
.diagram .ringside { fill: var(--card); }
.diagram .dohyo { fill: var(--stone); stroke: var(--ink-soft); stroke-width: 1.5; }
.diagram text { font-family: var(--body); font-size: 14px; fill: var(--ink); }
.diagram text.strong { font-weight: 700; }
.diagram text.soft { fill: var(--ink-soft); font-weight: 500; }
.diagram text.small { font-size: 12px; }
.diagram .seat-dot { fill: var(--region); stroke: var(--paper); stroke-width: 3; }
.diagram .royal { fill: var(--ink-soft); }
.diagram .hall-box { fill: var(--paper); stroke: var(--line); stroke-width: 1.5; }
.diagram .arrow { stroke: var(--ink-soft); stroke-width: 2; fill: none; }
:root[lang="ja"] .diagram text, :root[lang="mr"] .diagram text { font-size: 13px; }

/* Clips: vertical phone videos side by side */
.clips { margin-top: 3rem; }
.clips .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 300px)); gap: 1.25rem; }
.clips figure { margin: 0; }
.video.vertical { aspect-ratio: 9 / 16; max-width: 300px; }

/* Language pills inside the masthead, and lists in prose */
.masthead .langs { margin: 0 0 0 .5rem; display: inline-flex; gap: .35rem; }
.masthead .langs a { font-size: .82rem; padding: .25rem .6rem; font-weight: 500; }
.prose ul { padding-left: 1.2rem; margin: 0 0 1.2rem; }
.prose li { margin-bottom: .45rem; }
.prose h2 { margin-top: 2.2rem; }
.masthead .langs a[aria-current="page"] { color: var(--paper); text-decoration: none; }
.masthead .langs a:hover { text-decoration: none; }

/* Isometric hall drawing and its legend */
.diagram.iso svg { background: transparent; border: 0; border-radius: 0; }
.legend { margin: .7rem 0 0; padding-left: 1.5rem; list-style: decimal; }
.legend li { margin-bottom: .3rem; color: var(--ink); }
.legend li::marker { font-weight: 700; color: var(--region); }
.brand img { width: 30px; height: 30px; display: block; }

/* Theme toggle: follows the device until the reader chooses; the choice is remembered on that device */
.theme-toggle { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; display: inline-grid; place-items: center; padding: 0; margin-left: .4rem; vertical-align: middle; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}
.masthead nav { align-items: center; }
