/* Rakuyo 33 - site styles. One file, no framework. */

:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #2a2623;
  --shu: #b3261e;
  --moss: #2e5e2b;
  --stone: #6a645c;
  --rule: #e3ded6;
  --tint: #f7f5f1;
  --serif-ja: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif JP", "Noto Serif CJK JP", serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, var(--serif-ja);
  --sans: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic", Meiryo, sans-serif;
  --gutter: 1rem;
  --measure: 70rem;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--sans);
}

:lang(ja) { line-break: strict; }

img { max-width: 100%; height: auto; }

a { color: var(--moss); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--shu); outline-offset: 2px; }

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Seal: the one bold element ---------- */

.seal {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 0.3rem;
  background: var(--shu);
  color: #fff;
  font-family: var(--serif-ja);
  font-size: 1.25rem;
  line-height: 1.05;
  writing-mode: vertical-rl;
  text-orientation: upright;
  box-shadow: inset 0 0 0 3px var(--shu), inset 0 0 0 5px rgba(255, 255, 255, 0.85);
}

.seal-sm {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 0.2rem;
  background: var(--shu);
  color: #fff;
  font: 600 0.9rem/1 var(--sans);
  font-variant-numeric: tabular-nums;
}

/* ---------- Site header ---------- */

.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.home-link {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.05rem;
  padding: 0.5rem 0;
}
.home-link:hover { color: var(--shu); }

.step { display: flex; gap: 0.5rem; }
.step a {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 0.3rem;
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.95rem;
}
.step a:hover { border-color: var(--moss); }

/* ---------- Index ---------- */

/* Vertical padding only: these sit on .wrap elements, which own the side gutter. */
.intro { padding-top: 2rem; padding-bottom: 1.25rem; }
.intro h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.75rem);
  line-height: 1.2;
}
.intro h1 [lang="ja"] {
  display: block;
  font-family: var(--serif-ja);
  font-size: 0.6em;
  color: var(--shu);
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}
.lede { max-width: 38rem; margin: 0.75rem 0 0; color: var(--stone); }

.route {
  display: grid;
  gap: 1.5rem;
  padding-bottom: 2rem;
}
.route .map-box { min-width: 0; }
.route .map { height: 48vh; min-height: 18rem; }

.temples { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.temples li { border-bottom: 1px solid var(--rule); }
.temples a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0.25rem;
  color: var(--ink);
  text-decoration: none;
}
.temples a:hover, .temples a:focus-visible { background: var(--tint); }
.temples a:hover .en { color: var(--moss); }
.temples .names { display: flex; flex-direction: column; min-width: 0; }
.temples .ja { font-family: var(--serif-ja); font-size: 1.05rem; line-height: 1.35; }
.temples .en { font-size: 0.92rem; color: var(--stone); line-height: 1.35; }

@media (min-width: 56rem) {
  .route { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
  .route .map-box { position: sticky; top: 1rem; }
  .route .map { height: calc(100vh - 2rem); max-height: 52rem; }
}

.printed { padding-top: 1rem; padding-bottom: 2rem; border-top: 1px solid var(--rule); }
.printed h2, .where h2, .photos h2 {
  font: 400 1.25rem/1.3 var(--serif);
  margin: 1.5rem 0 0.75rem;
}

/* ---------- Temple page ---------- */

.title { display: flex; gap: 1.1rem; align-items: center; padding: 1.75rem 0 1rem; }
.title h1 { margin: 0; font-weight: 400; line-height: 1.25; }
.title .no { display: block; font: 600 0.9rem/1.4 var(--sans); color: var(--shu); letter-spacing: 0.02em; }
.title .ja { display: block; font-family: var(--serif-ja); font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.3rem); }
.title .en { display: block; font-family: var(--serif); font-size: clamp(1.15rem, 1rem + 0.8vw, 1.45rem); color: var(--stone); }

.dedication { margin: 0 0 1.25rem; color: var(--stone); font-size: 0.97rem; }
.dedication > span { display: block; }

.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 1.75rem; padding: 0; list-style: none; }
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--moss);
  border-radius: 0.3rem;
  color: var(--moss);
  background: var(--paper);
  font: inherit;
  font-size: 0.97rem;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--moss); color: #fff; }
.btn-primary { background: var(--moss); color: #fff; }
.btn-primary:hover { background: #234a21; }

.goeika {
  margin: 0 0 2rem;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--shu);
  background: var(--tint);
  font-family: var(--serif-ja);
  font-size: 1.05rem;
}
.goeika p { margin: 0; }
.goeika footer { margin-top: 0.35rem; font: 0.85rem/1.4 var(--sans); color: var(--stone); }

.facts { margin: 0 0 2rem; border-top: 1px solid var(--rule); }
.facts dt { font-weight: 600; font-size: 0.92rem; padding-top: 0.85rem; }
.facts dt [lang="ja"] { color: var(--shu); font-weight: 400; margin-right: 0.4rem; }
.facts dd { margin: 0; padding: 0.3rem 0 0.85rem; border-bottom: 1px solid var(--rule); }
.facts dd p { margin: 0; }
.facts dd p + p { margin-top: 0.4rem; color: var(--stone); }

/* Wide screens: label | Japanese | English, with dt and dd as grid cells of one row */
@media (min-width: 48rem) {
  .facts { display: grid; grid-template-columns: 9rem minmax(0, 1fr); column-gap: 1rem; }
  .facts dt { padding: 0.85rem 0; border-bottom: 1px solid var(--rule); }
  .facts dd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; padding: 0.85rem 0; }
  .facts dd p + p { margin-top: 0; }
}

.where .map { height: 22rem; }
.map-box { position: relative; }
.map { width: 100%; background: var(--tint); border: 1px solid var(--rule); border-radius: 0.3rem; }
.map-status { min-height: 1.4em; margin: 0.4rem 0 0; font-size: 0.9rem; color: var(--stone); }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 1rem;
  align-items: start;
}
.gallery figure, .gallery-one { margin: 0; }
.gallery-one img { display: block; border: 1px solid var(--rule); border-radius: 0.2rem; }
.gallery-one figcaption { font-size: 0.85rem; color: var(--stone); margin-top: 0.3rem; }
.gallery img { display: block; border: 1px solid var(--rule); border-radius: 0.2rem; }
.gallery figcaption { font-size: 0.85rem; color: var(--stone); margin-top: 0.3rem; }

/* ---------- Footer ---------- */

.site-foot { margin-top: 2rem; border-top: 1px solid var(--rule); background: var(--tint); }
.site-foot .wrap { padding-top: 1.25rem; padding-bottom: 2rem; font-size: 0.92rem; color: var(--stone); }
.site-foot p { margin: 0.3rem 0; }

/* ---------- Leaflet markers ---------- */

.pin {
  display: grid !important;
  place-items: center;
  background: var(--shu);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 0.2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  font: 600 12px/1 var(--sans);
  font-variant-numeric: tabular-nums;
}
.pin-dim { background: #8a827a; }
.pin-me { background: #1f6fd1; border-radius: 50%; }
.leaflet-popup-content { font: 0.95rem/1.4 var(--sans); margin: 0.7rem 0.9rem; }
.leaflet-popup-content a { font-weight: 600; }
.leaflet-popup-content .ja { display: block; font-family: var(--serif-ja); }
.locate {
  font: 0.9rem/1.2 var(--sans) !important;
  padding: 0.45rem 0.7rem !important;
  background: #fff !important;
  color: var(--ink) !important;
  border: 0 !important;
  cursor: pointer;
}

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

@media print {
  .map-box, .actions, .step { display: none; }
  body { font-size: 11pt; }
}
