/* Layout: one narrow column of sections; cards in a wrapping grid. Mobile first. */
:root {
  --paper: #f2f4f0;
  --card: #ffffff;
  --ink: #18212d;
  --muted: #56616e;
  --line: #d8ddd5;
  --indigo: #24396a;
  --indigo-soft: #e3e8f3;
  --on-indigo: #ffffff;
  --hinoki: #b88a4a;
  --ok-bg: #dcefe0; --ok-fg: #1d5a31;
  --mid-bg: #e3e8f3; --mid-fg: #24396a;
  --ask-bg: #f5ead2; --ask-fg: #6f4c0d;
  --no-bg: #f4ddd9; --no-fg: #86291e;
  --bike-bg: #e7e2f1; --bike-fg: #4a3577;
  --ph-ride: #d9e3d3; --ph-tours: #dde3ea; --ph-stay: #ece2d3; --ph-onsen: #dfe6e8;
  --ph-ink: #4f5b52;
  --display: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  --body: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #11161c; --card: #19202a; --ink: #e6e9e4; --muted: #9aa4ae; --line: #2a323d;
    --indigo: #93aae0; --indigo-soft: #222c40; --on-indigo: #0f141b; --hinoki: #d2a86c;
    --ok-bg: #1d3424; --ok-fg: #9fd8ae; --mid-bg: #222c40; --mid-fg: #b5c6ee;
    --ask-bg: #3a2f17; --ask-fg: #ecc979; --no-bg: #3d211d; --no-fg: #f0a59a;
    --bike-bg: #2c2440; --bike-fg: #c9b8ef;
    --ph-ride: #1f2a22; --ph-tours: #1f2630; --ph-stay: #2b251c; --ph-onsen: #1c2729; --ph-ink: #a9b5ac;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #11161c; --card: #19202a; --ink: #e6e9e4; --muted: #9aa4ae; --line: #2a323d;
  --indigo: #93aae0; --indigo-soft: #222c40; --on-indigo: #0f141b; --hinoki: #d2a86c;
  --ok-bg: #1d3424; --ok-fg: #9fd8ae; --mid-bg: #222c40; --mid-fg: #b5c6ee;
  --ask-bg: #3a2f17; --ask-fg: #ecc979; --no-bg: #3d211d; --no-fg: #f0a59a;
  --bike-bg: #2c2440; --bike-fg: #c9b8ef;
  --ph-ride: #1f2a22; --ph-tours: #1f2630; --ph-stay: #2b251c; --ph-onsen: #1c2729; --ph-ink: #a9b5ac;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 16px; line-height: 1.6;
}
[hidden] { display: none !important; }
a { color: var(--indigo); }
a:focus-visible, .btn:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--hinoki); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.25; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 800; }
h2 { font-size: 1.4rem; font-weight: 800; margin-top: 2.5rem; margin-bottom: 1rem; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0; }
code { font-size: .9em; background: var(--indigo-soft); padding: .1em .35em; border-radius: 4px; }

.wrap {
  max-width: 1120px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
main.wrap { padding-block: 1.5rem 3rem; display: flex; flex-direction: column; gap: 1.5rem; }
main.wrap > h2 { margin-bottom: -0.5rem; }

/* Header */
.site-head { background: var(--card); border-bottom: 1px solid var(--line); }
.head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding-block: .8rem; }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.2rem; color: var(--ink); text-decoration: none; display: flex; align-items: baseline; gap: .5rem; }
.brand small { font-family: var(--body); font-size: .7rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; gap: .25rem; overflow-x: auto; max-width: 100%; }
.nav a { padding: .4rem .75rem; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 500; white-space: nowrap; }
.nav a:hover { background: var(--indigo-soft); }

/* Hero */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: start; padding-block: 1rem .5rem; }
.hero > div { display: flex; flex-direction: column; gap: .8rem; max-width: 40rem; min-width: 0; }
.hero-ja { writing-mode: vertical-rl; font-family: var(--display); font-weight: 800; font-size: 1.6rem; letter-spacing: .3em; color: var(--hinoki); }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hinoki); }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 40rem; }
.page-head { display: flex; flex-direction: column; gap: .6rem; padding-top: .5rem; }

/* Section tiles on the home page */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.tile { display: grid; grid-template-rows: auto auto 1fr auto; gap: .35rem; padding: 1.2rem; border-radius: 14px; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); }
.tile:hover { border-color: var(--indigo); }
.tile svg { width: 48px; height: 36px; color: var(--indigo); }
.tile-title { font-family: var(--display); font-weight: 800; font-size: 1.5rem; }
.tile-text { color: var(--muted); }
.tile-n { font-size: .85rem; font-weight: 700; color: var(--hinoki); }

.guide-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .5rem; }
.guide-list a { display: block; padding: .8rem 1rem; border-radius: 10px; background: var(--indigo-soft); color: var(--indigo); font-weight: 700; text-decoration: none; }
.guide-list a::after { content: " →"; }
.guides h2, .badges-explained h2 { margin-top: 1rem; }
.explain { display: grid; gap: .6rem; }
.explain p { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.text-link { font-weight: 700; text-decoration: none; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: end; padding: 1rem; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.f { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; font-weight: 700; color: var(--muted); }
.f select { font: inherit; font-size: .95rem; font-weight: 400; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem; min-width: 0; max-width: 100%; }
.f-check { flex-direction: row; align-items: center; gap: .4rem; font-size: .95rem; color: var(--ink); font-weight: 500; padding-bottom: .45rem; }
.f-check input { width: 1.1rem; height: 1.1rem; accent-color: var(--indigo); }
.count { margin-left: auto; font-size: .85rem; color: var(--muted); padding-bottom: .45rem; font-variant-numeric: tabular-nums; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.card-body { display: flex; flex-direction: column; gap: .5rem; padding: 1rem; flex: 1; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--indigo); }
.where { font-size: .88rem; color: var(--muted); }
.price { font-size: .9rem; font-weight: 500; }
.badges { display: flex; flex-wrap: wrap; gap: .35rem; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge.mid { background: var(--mid-bg); color: var(--mid-fg); }
.badge.ask { background: var(--ask-bg); color: var(--ask-fg); }
.badge.no { background: var(--no-bg); color: var(--no-fg); }
.badge.bike { background: var(--bike-bg); color: var(--bike-fg); }
.card-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: .4rem; }
.btn { display: inline-block; padding: .5rem 1rem; border-radius: 8px; background: var(--indigo); color: var(--on-indigo); font-weight: 700; font-size: .9rem; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--indigo); border: 1px solid var(--indigo); }
.btn-ghost.is-off { border-style: dashed; border-color: var(--line); color: var(--muted); font-weight: 500; }
.btn-light { background: var(--on-indigo); color: var(--indigo); white-space: nowrap; }

/* Photo placeholders */
.ph { aspect-ratio: 16 / 7; max-width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; color: var(--ph-ink); }
.ph svg { width: 64px; height: 48px; opacity: .8; }
.ph span { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-align: right; }
.ph-ride { background: var(--ph-ride); } .ph-tours { background: var(--ph-tours); }
.ph-stay { background: var(--ph-stay); } .ph-onsen { background: var(--ph-onsen); }

/* JAPANIMA banner */
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding: 1.4rem; border-radius: 14px; background: var(--indigo); color: var(--on-indigo); }
.cta > div { display: flex; flex-direction: column; gap: .3rem; max-width: 36rem; min-width: 0; }
.cta-kicker { font-size: .75rem; font-weight: 700; letter-spacing: .12em; }
.cta-title { font-family: var(--display); font-weight: 800; font-size: 1.4rem; }
.grid-cta { grid-column: 1 / -1; }

/* Detail pages */
.crumbs { font-size: .88rem; color: var(--muted); }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 1.5rem; align-items: center; }
.detail > div { display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.detail .ph { border-radius: 14px; aspect-ratio: 4 / 3; }
.facts { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.facts dt, .facts dd { padding: .8rem 1rem; border-top: 1px solid var(--line); margin: 0; overflow-wrap: anywhere; }
.facts dt { font-weight: 700; color: var(--muted); font-size: .9rem; }
.facts dt:first-of-type, .facts dt:first-of-type + dd { border-top: 0; }
.draft { border: 2px dashed var(--hinoki); border-radius: 12px; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.draft-label { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hinoki); }
.draft dl { margin: 0; display: grid; gap: .3rem; }
.draft dt { font-weight: 700; }
.draft dd { margin: 0 0 .4rem; color: var(--muted); }

.n { font-family: var(--body); font-size: .9rem; font-weight: 700; color: var(--hinoki); margin-left: .3rem; }
.plain-list { margin: 0; padding-left: 1.2rem; columns: 2 240px; }
.note, .empty { color: var(--muted); }
.prose { max-width: 42rem; display: flex; flex-direction: column; gap: .8rem; }
.prose h2 { margin: 1rem 0 0; }
.prose p { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); background: var(--card); }
.foot-row { padding-block: 1.5rem; display: flex; flex-direction: column; gap: .6rem; font-size: .88rem; color: var(--muted); max-width: 1120px; }

@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
  .hero-ja { writing-mode: horizontal-tb; font-size: 1.1rem; order: -1; }
  .detail { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .facts dd { border-top: 0; padding-top: 0; }
  .count { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; transition: none !important; } }

/* Hand-written guide pages */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; }
.stats > div { display: flex; flex-direction: column; gap: .15rem; padding: 1rem; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.stat-label { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hinoki); }
.stat-value { font-family: var(--display); font-weight: 800; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.stat-note { font-size: .82rem; color: var(--muted); }
.prose h3 { font-size: 1.15rem; margin-top: .6rem; }
.prose .bath-list, .prose .steps { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .45rem; }
.table-wrap { overflow-x: auto; }
.price-table { border-collapse: collapse; width: 100%; min-width: 26rem; background: var(--card); font-variant-numeric: tabular-nums; }
.price-table th, .price-table td { padding: .55rem .8rem; border-bottom: 1px solid var(--line); text-align: right; }
.price-table th:first-child, .price-table td:first-child { text-align: left; }
.price-table th { font-size: .8rem; color: var(--muted); }

/* Photos (free-to-use, credited on photo-credits.html) */
.photo { position: relative; margin: 0; aspect-ratio: 16 / 7; overflow: hidden; background: var(--ph-tours); }
.photo-ride { background: var(--ph-ride); } .photo-stay { background: var(--ph-stay); } .photo-onsen { background: var(--ph-onsen); }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.2rem .6rem .35rem;
  font-size: .68rem; line-height: 1.3; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.detail .photo { border-radius: 14px; aspect-ratio: 4 / 3; }
.hero-photo .photo, .prose .photo, main > .photo { border-radius: 14px; margin-block: 1rem; }
.tile .photo { margin: -1.2rem -1.2rem .4rem; border-radius: 14px 14px 0 0; }
.tile:has(.photo) svg { display: none; }
