/* Shared styles for the Nippon trip site (all pages). */

:root {
  --paper: #f6f1e7;
  --card: #fffcf6;
  --ink: #1f1c18;
  --muted: #6d655b;
  --line: #e2d9c8;
  --shu: #c0392b;        /* torii vermilion */
  --shu-soft: #f3dcd4;
  --ai: #2b4c6f;         /* indigo */
  --ai-soft: #dde6ef;
  --matcha: #5b7f4a;
  --matcha-soft: #e2ebd9;
  --lantern: #c98a1c;
  --sakura: #b5577a;
  --stone: #7a7268;
  --stone-soft: #ebe5da;
  --shadow: 0 1px 2px rgba(40, 30, 20, .06), 0 4px 16px rgba(40, 30, 20, .06);
  --radius: 14px;
  --serif: "Shippori Mincho B1", "Hiragino Mincho ProN", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15130f;
    --card: #1f1c17;
    --ink: #efe8dc;
    --muted: #a59b8d;
    --line: #353028;
    --shu: #e0644f;
    --shu-soft: #3b211b;
    --ai: #8db3dc;
    --ai-soft: #1d2a38;
    --matcha: #93bb7d;
    --matcha-soft: #222d1d;
    --lantern: #e5b04a;
    --sakura: #e08aab;
    --stone: #a89f93;
    --stone-soft: #2a2620;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
}

a { color: var(--ai); }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.25; }
h2 { font-size: 1.6rem; margin: 2.2rem 0 .8rem; }
h3 { font-size: 1.2rem; margin: 1.6rem 0 .6rem; }

main {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 16px 64px;
}

/* Header + day navigation */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  text-decoration: none;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.25rem;
  white-space: nowrap;
}
.brand span { color: var(--shu); }

.day-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.day-nav::-webkit-scrollbar { display: none; }

.day-nav a {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 42px;
  padding: 4px 8px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.2;
}
.day-nav a b { color: var(--ink); font-weight: 600; }
.day-nav a small { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; }
.day-nav a:hover { background: var(--stone-soft); }
.day-nav a.active { background: var(--shu); color: #fff; }
.day-nav a.active b { color: #fff; }
.day-nav a.text { justify-content: center; font-weight: 600; color: var(--ink); }

/* Hero */

.hero { padding: 36px 0 8px; }
.hero .kicker {
  color: var(--shu);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .8rem;
}
.hero h1 { font-size: clamp(2rem, 6vw, 3rem); margin: .3rem 0 .6rem; }
.hero .lead { font-size: 1.1rem; color: var(--muted); max-width: 680px; margin: 0; }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.stats li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: .88rem;
}
.stats li b { font-weight: 600; }

/* Generic cards and callouts */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin: 16px 0;
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

.callout {
  border-left: 4px solid var(--ai);
  background: var(--ai-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 16px;
  margin: 16px 0;
}
.callout.warn { border-color: var(--shu); background: var(--shu-soft); }
.callout.good { border-color: var(--matcha); background: var(--matcha-soft); }
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }

.glance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.glance > div {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.glance h4 {
  margin: 0 0 4px;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.glance p { margin: 0; font-size: .95rem; }

/* Tables */

.table-wrap { overflow-x: auto; margin: 12px 0; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
tfoot td { font-weight: 600; border-bottom: 0; }

/* Option tabs */

.tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin: 24px 0 8px;
}
.tabs button {
  font: inherit;
  text-align: left;
  cursor: pointer;
  background: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  transition: border-color .15s, background .15s;
}
.tabs button:hover { border-color: var(--stone); }
.tabs button[aria-selected="true"] { border-color: var(--shu); background: var(--shu-soft); }
.tabs button b { display: block; font-weight: 600; }
.tabs button small { color: var(--muted); font-size: .82rem; }
.tabs-label {
  margin: 28px 0 0;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 600;
}
.tabs-label + .tabs { margin-top: 8px; }
.option[hidden] { display: none; }

/* Timeline */

.timeline {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 61px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--line);
}
.timeline > li {
  position: relative;
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 26px;
  padding: 8px 0;
}
.timeline > li > time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: .92rem;
  text-align: right;
  padding-top: 13px;
}
.timeline > li::before {
  content: "";
  position: absolute;
  left: 56px;
  top: 19px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--k, var(--stone));
  box-shadow: 0 0 0 3px var(--paper);
}
.timeline > li > div {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--k, var(--stone));
  border-radius: 10px;
  padding: 10px 14px;
}
.timeline > li > div::before {
  content: attr(data-label);
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--k, var(--stone));
}
.timeline h4 { margin: 2px 0 4px; font-size: 1.02rem; font-weight: 600; }
.timeline p { margin: 4px 0; }
.timeline ul { margin: 4px 0; padding-left: 20px; }

[data-kind="see"]     { --k: var(--ai); }
[data-kind="eat"]     { --k: var(--sakura); }
[data-kind="evening"] { --k: var(--lantern); }
[data-kind="chill"]   { --k: var(--matcha); }
[data-kind="move"]    { --k: var(--stone); }
[data-kind="shop"]    { --k: var(--sakura); }
[data-kind="sleep"]   { --k: var(--muted); }
.timeline > li[data-kind="move"] > div { background: var(--stone-soft); }

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 2px !important;
}
.facts > span {
  font-size: .8rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 8px;
}

a.map {
  font-size: .78rem;
  font-weight: 600;
  margin-left: 6px;
  text-decoration: none;
  white-space: nowrap;
}
a.map:hover { text-decoration: underline; }

.eur { color: var(--muted); font-size: .9em; white-space: nowrap; }

/* Photos */

.photo { margin: 0; }
.photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  border-radius: 10px;
  background: var(--stone-soft);
}
.photo figcaption { margin-top: 3px; font-size: .7rem; color: var(--muted); }
.photo figcaption a { color: inherit; text-decoration: none; }
.photo figcaption a:hover { text-decoration: underline; }
.hero > .photo { margin-bottom: 20px; }
.hero > .photo img { aspect-ratio: 21 / 9; border-radius: var(--radius); }
.timeline .photo { margin: 8px 0 6px; max-width: 520px; }

/* Legend */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .82rem;
  color: var(--muted);
  margin: 8px 0;
}
.legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--k);
}

/* Index page */

.route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 18px 0;
  font-weight: 600;
}
.route span { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.route i { color: var(--muted); font-style: normal; }

.day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.day-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s;
}
.day-card:hover { transform: translateY(-2px); border-color: var(--shu); }
.day-card > img {
  display: block;
  width: calc(100% + 32px);
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin: -14px -16px 12px;
  background: var(--stone-soft);
}
.day-card .date { font-size: .8rem; color: var(--shu); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.day-card h3 { margin: 4px 0 6px; font-size: 1.15rem; }
.day-card p { margin: 0; font-size: .9rem; color: var(--muted); }
.day-card .pick { margin-top: 8px; font-size: .82rem; color: var(--ink); }
.day-card .pick b { color: var(--matcha); }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--matcha); flex: 0 0 auto; }
.checklist label { cursor: pointer; }
.checklist .when { display: inline-block; min-width: 76px; font-weight: 600; color: var(--shu); font-size: .88rem; }
.checklist input:checked + label { color: var(--muted); text-decoration: line-through; }

/* Prev / next + footer */

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 40px 0 0;
}
.pager a {
  flex: 1;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--ink);
}
.pager a:hover { border-color: var(--shu); }
.pager a small { display: block; color: var(--muted); font-size: .78rem; }
.pager a.next { text-align: right; }

.site-footer {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  color: var(--muted);
  font-size: .85rem;
  border-top: 1px solid var(--line);
}
.site-footer label { white-space: nowrap; }
.site-footer input {
  width: 72px;
  font: inherit;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  color: var(--ink);
}

@media (max-width: 560px) {
  .timeline::before { left: 7px; }
  .timeline > li { grid-template-columns: 1fr; gap: 4px; padding-left: 26px; }
  .timeline > li > time { text-align: left; padding-top: 0; }
  .timeline > li::before { left: 2px; top: 13px; }
  .photo img, .hero > .photo img { aspect-ratio: 16 / 9; }
}
