/* Guide only: a paper notebook in light mode, a quiet field journal at night. */
:root,
:root[data-theme="light"] {
  --journal-note: #fff3d5;
  --journal-note-alt: #fce9df;
  --journal-free: #edf1d9;
  --journal-tape: #ebc38dbc;
}
:root[data-theme="dark"] {
  --journal-note: #292b22;
  --journal-note-alt: #312821;
  --journal-free: #252e23;
  --journal-tape: #937452c4;
}

body { background: var(--journal-desk); }
.header { border-bottom: 0; }
.shell {
  --text: var(--journal-ink);
  --muted: var(--journal-muted);
  --line: var(--journal-edge);
  padding: 0 clamp(24px, 5vw, 54px) 26px;
}
.journal-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.journal-heading .eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--journal-accent); margin: 0; }
.step-number {
  display: inline-grid;
  place-items: center;
  min-width: 29px;
  min-height: 23px;
  padding: 0 5px;
  margin-inline-end: 7px;
  border-radius: 4px;
  color: var(--journal-tab-ink);
  background: var(--journal-tab);
  font: 750 12px/1.2 sans-serif;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  vertical-align: .12em;
}
.step-mark .step-number { margin-inline-end: 0; }
#pace-heading, .planner-heading .step-heading {
  padding: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.7;
}
#pace-heading, .planner-heading { margin-bottom: 9px; }
#planner { scroll-margin-top: 20px; }
.plan-hero h1, .route-heading h2 { font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif CJK JP", serif; font-weight: 700; }
.trip-summary, .planner { background: var(--journal-paper); border-radius: 5px; box-shadow: 0 3px 0 var(--journal-shadow); }
.trip-summary .total { background: var(--journal-note); }

.timeline-title h3 { color: var(--journal-accent); }
.timeline { max-width: none; }
.timeline>li { grid-template-columns: 84px 28px minmax(0, 1fr); }
.timeline-time { padding-top: 12px; }
.timeline-time .time-number {
  display: inline-block;
  max-width: 100%;
  padding: 4px 10px;
  background: var(--journal-tab);
  color: var(--journal-tab-ink);
  font-weight: 750;
  clip-path: polygon(2% 0, 97% 3%, 100% 90%, 3% 100%, 0 54%);
}
.timeline-time small { margin-inline-start: 8px; }
.timeline-body { min-width: 0; }
.line-track::after { background: none; border-left: 1px dashed var(--journal-edge); }
.timeline-card { position: relative; border-color: var(--journal-edge); border-radius: 3px 7px 5px 8px; background: var(--journal-note); box-shadow: 2px 4px 0 var(--journal-shadow); }
.timeline>li:not(.endpoint):nth-child(odd) .timeline-card:not(.free-card) { background: var(--journal-note-alt); }
.timeline>li:not(.endpoint) .timeline-card::before {
  content: "";
  position: absolute;
  width: 50px;
  height: 14px;
  top: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(6deg);
  background: repeating-linear-gradient(115deg, transparent 0 4px, var(--journal-grid) 4px 5px), var(--journal-tape);
  clip-path: polygon(0 6%, 100% 0, 95% 34%, 100% 65%, 96% 98%, 0 100%, 4% 65%);
  pointer-events: none;
}
.timeline-card.free-card { background: var(--journal-free); }
.timeline>li[aria-current="step"] .timeline-card { border-color: var(--mint); }
.endpoint .timeline-card { padding-inline: 0; box-shadow: none; }
.spot-details { border-top-color: var(--journal-edge); }

#trip-summary[hidden], #plan-tools[hidden] { display: none; }
#plan:has(#plan-tools[hidden]) { margin-block-end: 36px; }
.time-suggestion {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--mint);
  border-radius: 6px;
  color: var(--mint);
  background: var(--journal-paper);
  font-weight: 650;
  cursor: pointer;
}

@media (max-width: 600px) {
  .shell { width: calc(100% - 20px); padding-inline: 14px; }
  .timeline>li { grid-template-columns: 20px minmax(0, 1fr); gap: 8px; }
  .timeline-time { grid-area: 1 / 2; display: flex; align-items: baseline; gap: 6px; padding-top: 0; }
  .timeline-time small { margin: 0; }
  .line-track { grid-area: 1 / 1 / 3; padding-top: 7px; }
  .line-track::after { top: 16px; }
  .timeline-body { grid-area: 2 / 2; }
  .timeline-card, .timeline>li[aria-current="step"] .timeline-card { padding: 14px 12px; }
  .timeline-card h4 { overflow-wrap: anywhere; }
  .transit-details summary { min-height: 44px; }
}

/* A small landscape print keeps the journal useful at a glance. */
.route-photo {
  margin: 20px 0 18px;
  padding: 8px 8px 0;
  background: #fff;
  border: 1px solid #ded9ce;
  border-radius: 3px;
  box-shadow: 2px 4px 0 var(--journal-shadow);
}
.route-photo[hidden] { display: none; }
.route-photo img {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: center 48%;
  border-radius: 1px;
}
.route-photo figcaption {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 3px 12px;
  padding: 8px 3px 9px;
  color: #625144;
  font-size: 11px;
  line-height: 1.6;
}
.route-photo figcaption a { color: inherit; text-underline-offset: 2px; }
@media (max-width: 640px) {
  .route-photo { margin-top: 16px; padding: 6px 6px 0; }
  .route-photo img { height: 196px; }
  .route-photo figcaption { padding: 7px 2px 8px; }
}

.walk-label, .bus-label, .free-label, .buffer-label { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.walk-label::before, .bus-label::before, .free-label::before, .buffer-label::before {
  content: "";
  display: inline-block;
  width: 17px;
  height: 17px;
  flex: none;
  background-color: currentColor;
  -webkit-mask: url("/assets/icons/footprints.svg") center / contain no-repeat;
  mask: url("/assets/icons/footprints.svg") center / contain no-repeat;
}

.bus-label::before {
  -webkit-mask-image: url("/assets/icons/bus-front.svg");
  mask-image: url("/assets/icons/bus-front.svg");
}
:root[data-theme="dark"] .route-photo {
  background: var(--journal-paper);
  border-color: var(--journal-edge);
}
:root[data-theme="dark"] .route-photo figcaption { color: var(--journal-muted); }

.free-label::before {
  -webkit-mask-image: url("/assets/icons/clock.svg");
  mask-image: url("/assets/icons/clock.svg");
}
.buffer-label::before {
  -webkit-mask-image: url("/assets/icons/coffee.svg");
  mask-image: url("/assets/icons/coffee.svg");
}
.transit small.buffer-label { display: inline-flex; }


/* Shared photo height comes from the desktop/mobile rules above. */
.route-photo img[src*="yumoto-sounji-gate"] { object-position: center 30%; }
.route-photo img[src*="nikko-toshogu-yomeimon"] { object-position: center 15%; }
.route-photo img[src*="kanazawa-kenrokuen-autumn"] { object-position: center 40%; }
.route-photo img[src*="kusatsu-yubatake-town"] { object-position: center 40%; }
.route-photo img[src*="kyoto-kiyomizu"] { object-position: center 75%; }
.route-photo img[src*="kamakura-daibutsu"] { object-position: center top; }

.route-photo img[src*="arashiyama-bamboo"] { object-position: center bottom; }

.route-photo img[src*="beppu-umi"] { object-position: center 65%; }

.route-photo img[src*="yufuin-kinrin"] { object-position: center 58%; }

.route-photo img[src*="matsuyama-castle"] { object-position: center 62%; }
