/* =========================================================
   arimegu  共通スタイル
   配色：藍（主色）・白鼠（地）・朱（ありがとうの印）
   書体：見出し＝しっぽり明朝 / 本文＝Zen角ゴシック
   ========================================================= */

:root {
  --ai: #2a4a68;          /* 藍：主色・リンク・主要ボタン */
  --ai-deep: #1c3349;
  --ai-pale: #e3e9ef;
  --paper: #eff1ec;       /* 白鼠：背景 */
  --surface: #fbfbf8;     /* 面 */
  --ink: #1e252b;         /* 文字 */
  --ink-soft: #5c666d;    /* 補足文字 */
  --line: #d4d8cf;        /* 罫線 */
  --shu: #c13a2b;         /* 朱：ありがとうの印 */
  --shu-pale: #f6e4e0;
  --wakanae: #4f7a45;     /* 若苗：成功・有効 */
  --wakanae-pale: #e4eee0;
  --kincha: #9a6a1b;      /* 金茶：注意 */
  --kincha-pale: #f4ecd9;

  --font-serif: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-sans: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;

  --radius: 4px;
  --gap: 1rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.75;
}

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

a { color: var(--ai); text-underline-offset: 0.2em; }
a:hover { color: var(--ai-deep); }

:focus-visible { outline: 3px solid #7fa3c4; outline-offset: 2px; }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 0.6em;
  letter-spacing: 0.02em;
}
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

.muted { color: var(--ink-soft); }
.small { font-size: 0.875rem; }
.nowrap { white-space: nowrap; }
.pre-line { white-space: pre-line; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- レイアウト ---------- */

.container { width: 100%; max-width: 44rem; margin: 0 auto; padding: 0 1.1rem; }
.container--wide { max-width: 72rem; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 3.5rem;
}
.brand {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.08em;
}
.brand small { display: block; font-size: 0.68rem; letter-spacing: 0.1em; color: var(--ink-soft); font-weight: 500; }

.main { padding: 1.5rem 0 6rem; }

.site-footer { padding: 2rem 0 7rem; color: var(--ink-soft); font-size: 0.85rem; }
.site-footer a { color: inherit; margin-right: 1rem; }

/* 旅人：画面下のタブ（スマホ） / 上部のタブ（PC） */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 3.6rem; font-size: 0.72rem; color: var(--ink-soft); text-decoration: none; gap: 0.1rem;
}
.tabbar a[aria-current="page"] { color: var(--ai); font-weight: 700; }
.tabbar svg { width: 22px; height: 22px; }
@media (min-width: 48rem) {
  .tabbar { position: static; border: 0; background: none; display: flex; gap: 1.2rem; padding: 0; }
  .tabbar a { flex-direction: row; min-height: auto; font-size: 0.9rem; gap: 0.35rem; }
  .tabbar svg { width: 18px; height: 18px; }
  .main { padding-bottom: 3rem; }
  .site-footer { padding-bottom: 2rem; }
}

/* 施設・運営：上部ナビ */
.nav-row { display: flex; gap: 0.2rem; overflow-x: auto; padding: 0 0 0.2rem; scrollbar-width: thin; }
.nav-row a {
  white-space: nowrap; padding: 0.55rem 0.8rem; color: var(--ink-soft); text-decoration: none;
  border-bottom: 2px solid transparent; font-size: 0.92rem;
}
.nav-row a[aria-current="page"] { color: var(--ai); border-bottom-color: var(--ai); font-weight: 700; }

.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 1.2rem; }
.page-head h1 { margin: 0; }

/* ---------- 区画 ---------- */

.section { margin: 0 0 2.2rem; }
.section > h2 { padding-bottom: 0.35rem; border-bottom: 1px solid var(--line); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.2rem;
}
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }

.grid-2 { display: grid; gap: 1rem; }
@media (min-width: 48rem) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.stack > * + * { margin-top: 0.75rem; }

.dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.2rem; margin: 0; }
.dl dt { color: var(--ink-soft); font-size: 0.9rem; }
.dl dd { margin: 0; }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain > li { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.list-plain > li:last-child { border-bottom: 0; }

/* ---------- ボタン・フォーム ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 2.75rem; padding: 0.5rem 1.2rem;
  border: 1px solid var(--ai); border-radius: var(--radius);
  background: var(--ai); color: #fff;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--ai-deep); color: #fff; }
.btn--secondary { background: var(--surface); color: var(--ai); }
.btn--secondary:hover { background: var(--ai-pale); color: var(--ai-deep); }
.btn--danger { background: var(--surface); color: var(--shu); border-color: var(--shu); }
.btn--danger:hover { background: var(--shu-pale); color: var(--shu); }
.btn--shu { background: var(--shu); border-color: var(--shu); }
.btn--shu:hover { background: #a02e22; }
.btn--small { min-height: 2.1rem; padding: 0.25rem 0.75rem; font-size: 0.875rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--ai); text-decoration: underline; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 1rem; }

.field { margin-bottom: 1.1rem; }
.field > label, .field > .label { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.field .hint { font-size: 0.85rem; color: var(--ink-soft); margin: 0.25rem 0 0; }
.required::after { content: "必須"; margin-left: 0.5rem; font-size: 0.7rem; color: var(--shu); border: 1px solid currentColor; padding: 0 0.3rem; border-radius: 2px; vertical-align: 0.1em; }

.input, .select, .textarea {
  width: 100%; padding: 0.6rem 0.75rem; min-height: 2.75rem;
  border: 1px solid #b9bfb5; border-radius: var(--radius);
  background: #fff; color: var(--ink); font: inherit;
}
.textarea { min-height: 7rem; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ai); outline: 2px solid var(--ai-pale); }
.input--code { font-size: 1.6rem; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; max-width: 14rem; }
.input--inline { width: auto; min-width: 8rem; }
.is-invalid { border-color: var(--shu) !important; }
.field-error { color: var(--shu); font-size: 0.875rem; margin: 0.25rem 0 0; }

.check { display: flex; gap: 0.55rem; align-items: flex-start; margin: 0.5rem 0; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: 0.35rem; accent-color: var(--ai); flex: none; }

.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; margin-bottom: 1.2rem; }
.filters .field { margin: 0; }
.filters .input, .filters .select { min-width: 9rem; }

/* 選択式のタグ（チェックボックス） */
.choice-group { display: flex; flex-wrap: wrap; gap: 0.5rem; border: 0; margin: 0; padding: 0; }
.choice-group legend { font-weight: 700; margin-bottom: 0.4rem; padding: 0; }
.choice {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.8rem; border: 1px solid #b9bfb5; border-radius: 999px;
  background: #fff; cursor: pointer; font-size: 0.93rem; line-height: 1.4;
}
.choice input { accent-color: var(--ai); margin: 0; }
.choice:has(input:checked) { border-color: var(--ai); background: var(--ai-pale); color: var(--ai-deep); font-weight: 700; }
.choice-group--shu .choice:has(input:checked) { border-color: var(--shu); background: var(--shu-pale); color: #8d2a1f; }
.choice-group--shu .choice input { accent-color: var(--shu); }

/* ★評価の入力 */
.rating-input { display: flex; flex-wrap: wrap; gap: 0.4rem; border: 0; padding: 0; margin: 0; }
.rating-input legend { font-weight: 700; margin-bottom: 0.4rem; padding: 0; }
.rating-input label {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.4rem 0.7rem;
  border: 1px solid #b9bfb5; border-radius: var(--radius); background: #fff; cursor: pointer;
}
.rating-input input { accent-color: var(--kincha); margin: 0; }
.rating-input label:has(input:checked) { border-color: var(--kincha); background: var(--kincha-pale); font-weight: 700; }

/* ---------- 表示部品 ---------- */

.flash { padding: 0.8rem 1rem; border-radius: var(--radius); margin-bottom: 1.2rem; border-left: 4px solid; }
.flash--ok { background: var(--wakanae-pale); border-color: var(--wakanae); }
.flash--warn { background: var(--kincha-pale); border-color: var(--kincha); }
.flash--error { background: var(--shu-pale); border-color: var(--shu); }
.flash ul { margin: 0.2rem 0 0; padding-left: 1.2rem; }
.flash p:last-child { margin-bottom: 0; }

.badge {
  display: inline-block; padding: 0 0.5rem; border-radius: 2px; font-size: 0.78rem; line-height: 1.7;
  background: var(--ai-pale); color: var(--ai-deep); white-space: nowrap;
}
.badge--ok { background: var(--wakanae-pale); color: #365930; }
.badge--warn { background: var(--kincha-pale); color: #6d4a10; }
.badge--off { background: #e6e6e3; color: #5f5f5a; }
.badge--shu { background: var(--shu-pale); color: #8d2a1f; }

.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.chips li { font-size: 0.85rem; padding: 0.1rem 0.6rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.chips--shu li { border-color: #e2b3aa; color: #8d2a1f; background: #fff8f6; }

.stars { color: var(--kincha); letter-spacing: 0.05em; white-space: nowrap; }
.stars .off { color: #cfc8b8; }

.meter { height: 0.5rem; background: #dfe2da; border-radius: 999px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--ai); }

/* ---------- ありがとうの印（朱印） ---------- */

.seal {
  --size: 4.6rem;
  width: var(--size); height: var(--size); flex: none;
  border: 2px solid var(--shu); border-radius: 50%;
  display: grid; place-items: center;
  color: var(--shu); background: #fffaf8;
  box-shadow: inset 0 0 0 3px #fffaf8, inset 0 0 0 4px rgba(193, 58, 43, 0.55);
  transform: rotate(-6deg);
}
.seal__text {
  /* 施設名の先頭2文字を印のように大きく */
  font-family: var(--font-serif); font-weight: 700;
  font-size: calc(var(--size) * 0.3); line-height: 1; letter-spacing: 0.04em;
  white-space: nowrap;
}
.seal--large { --size: 6rem; }

.thanks-book { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.thanks-book li { display: flex; gap: 1rem; align-items: flex-start; }
.thanks-book .body { flex: 1; min-width: 0; }
.thanks-book time { font-size: 0.82rem; color: var(--ink-soft); }

/* ---------- 旅人カルテの見出し（手帳の扉） ---------- */

.passport {
  background: var(--ai); color: #f2f4f6;
  border-radius: 6px; padding: 1.3rem 1.3rem 1.1rem; margin-bottom: 1.6rem;
  position: relative; overflow: hidden;
}
.passport::after {
  /* 波の地紋（青海波を簡略化） */
  content: ""; position: absolute; inset: auto -2rem -2.5rem auto; width: 11rem; height: 11rem; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 1rem rgba(255, 255, 255, 0.05), 0 0 0 2rem rgba(255, 255, 255, 0.04);
}
.passport a { color: #fff; }
.passport__id { font-size: 0.82rem; letter-spacing: 0.12em; opacity: 0.85; margin: 0; }
.passport__name { font-family: var(--font-serif); font-size: 1.45rem; margin: 0.1rem 0 0.6rem; }
.passport__row { display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; align-items: baseline; position: relative; z-index: 1; }
.passport__level { font-family: var(--font-serif); font-size: 1.1rem; }
.passport__level strong { font-size: 1.9rem; margin-left: 0.2rem; }
.passport__title { font-family: var(--font-serif); font-size: 1.05rem; }
.passport .meter { background: rgba(255, 255, 255, 0.2); margin-top: 0.8rem; position: relative; z-index: 1; }
.passport .meter > span { background: #f2f4f6; }
.passport__next { font-size: 0.82rem; opacity: 0.9; margin: 0.35rem 0 0; position: relative; z-index: 1; }

/* ---------- 宿 ---------- */

.hotel-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
@media (min-width: 40rem) { .hotel-list { grid-template-columns: 1fr 1fr; } }
.hotel-item { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.hotel-item a { color: inherit; text-decoration: none; display: block; }
.hotel-item__photo { aspect-ratio: 3 / 2; background: #dfe3dc; object-fit: cover; width: 100%; }
.hotel-item__photo--empty { display: grid; place-items: center; color: var(--ink-soft); font-family: var(--font-serif); }
.hotel-item__body { padding: 0.8rem 1rem 1rem; }
.hotel-item__name { font-family: var(--font-serif); font-size: 1.1rem; margin: 0 0 0.2rem; color: var(--ai-deep); }
.hotel-item__meta { font-size: 0.85rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 0 0.9rem; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.4rem; margin-bottom: 1.4rem; }
.gallery figure { margin: 0; }
.gallery img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; border-radius: 3px; }
.gallery figcaption { font-size: 0.78rem; color: var(--ink-soft); }
.gallery--hero figure:first-child { grid-column: 1 / -1; }
.gallery--hero figure:first-child img { aspect-ratio: 16 / 9; }

.hotel-values {
  font-family: var(--font-serif); font-size: 1.05rem; line-height: 2;
  border-left: 3px solid var(--shu); padding: 0.2rem 0 0.2rem 1rem; margin: 0 0 1rem;
}

.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.bar-list li { display: grid; grid-template-columns: 7.5rem 1fr 3rem; gap: 0.7rem; align-items: center; font-size: 0.9rem; }
.bar-list .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-soft); }

.history { list-style: none; margin: 0; padding: 0; }
.history li { display: grid; grid-template-columns: 5.2rem 1fr; gap: 0.2rem 0.8rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.history li:last-child { border-bottom: 0; }
.history time { font-variant-numeric: tabular-nums; color: var(--ink-soft); font-size: 0.9rem; }
.history .badges { grid-column: 2; display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; font-size: 0.85rem; }

.review { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.review:last-child { border-bottom: 0; }
.review__head { display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; align-items: baseline; font-size: 0.9rem; }
.review__comment { margin: 0.5rem 0; white-space: pre-line; }

/* ---------- ホーム（未ログイン） ---------- */

.hero { padding: 2.2rem 0 1.6rem; }
.hero__lead {
  font-family: var(--font-serif); font-size: 1.5rem; line-height: 1.6; font-weight: 600;
  margin: 0 0 1rem; letter-spacing: 0.04em;
}
@media (min-width: 30rem) { .hero__lead { font-size: 1.9rem; } }
@media (min-width: 48rem) { .hero__lead { font-size: 2.5rem; } }
.hero__body { max-width: 34rem; color: var(--ink-soft); }
.hero__seals { display: flex; gap: 0.6rem; margin: 1.3rem 0 0; }
.hero__seals .seal { --size: 3.8rem; }
.hero__seals .seal:nth-child(2) { transform: rotate(4deg); }
.hero__seals .seal:nth-child(3) { transform: rotate(-2deg); }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 0.8rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2rem 1fr; gap: 0.6rem; }
.steps li::before {
  content: counter(step); font-family: var(--font-serif); font-weight: 700; color: var(--ai);
  border: 1px solid var(--ai); border-radius: 50%; width: 2rem; height: 2rem; display: grid; place-items: center;
}

/* ---------- 表 ---------- */

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { background: #e7eae3; font-weight: 700; font-size: 0.85rem; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table form { margin: 0; }
.empty { padding: 1.5rem; text-align: center; color: var(--ink-soft); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.8rem; margin-bottom: 1.4rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 0.8rem 1rem; }
.stat__label { font-size: 0.85rem; color: var(--ink-soft); margin: 0; }
.stat__value { font-family: var(--font-serif); font-size: 1.6rem; margin: 0; }
.stat__value small { font-size: 0.9rem; margin-left: 0.2rem; font-family: var(--font-sans); color: var(--ink-soft); }
.stat a { font-size: 0.85rem; }

/* 月別推移の棒グラフ */
.month-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0.3rem; align-items: end; height: 10rem; padding-top: 1.2rem; }
.month-chart__col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 0.2rem; }
.month-chart__bar { width: 70%; background: var(--ai); border-radius: 2px 2px 0 0; min-height: 1px; }
.month-chart__val, .month-chart__label { font-size: 0.72rem; color: var(--ink-soft); white-space: nowrap; }

/* ---------- 施設：QR表示画面 ---------- */

.qr-screen {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--surface); text-align: center; padding: 1.5rem;
}
.qr-screen__name { font-family: var(--font-serif); font-size: 1.6rem; margin: 0 0 0.3rem; }
.qr-screen__guide { font-size: 1.15rem; margin: 0 0 1.2rem; }
.qr-box {
  width: min(78vw, 60vh, 26rem); aspect-ratio: 1; background: #fff;
  border: 2px solid var(--ai); border-radius: 8px; padding: 0.8rem; display: grid; place-items: center;
}
.qr-box svg { width: 100%; height: 100%; }
.qr-timer { width: min(78vw, 60vh, 26rem); margin-top: 0.8rem; }
.qr-timer .meter > span { transition: width 1s linear; }
.qr-screen__foot { margin-top: 1.4rem; font-size: 0.9rem; color: var(--ink-soft); }
@media (prefers-reduced-motion: reduce) { .qr-timer .meter > span { transition: none; } }

/* ---------- 特典の提示 ---------- */

.present-card {
  border: 2px solid var(--ai); border-radius: 8px; background: #fff; padding: 1rem 1.1rem; margin-bottom: 1.4rem;
  display: grid; grid-template-columns: 1fr auto; gap: 0.2rem 1rem; align-items: center;
}
.present-card__clock { font-variant-numeric: tabular-nums; font-size: 1.2rem; font-weight: 700; }

.pagination { display: flex; flex-wrap: wrap; gap: 0.3rem; list-style: none; padding: 0; margin: 1.2rem 0 0; }
.pagination a, .pagination span {
  display: inline-block; min-width: 2.4rem; padding: 0.35rem 0.6rem; text-align: center;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none;
}
.pagination [aria-current="page"] span { background: var(--ai); color: #fff; border-color: var(--ai); }
.pagination .disabled span { color: #aaa; }

/* ---------- 運営画面は密度を上げる ---------- */

.admin .main { padding-top: 1.2rem; }
.admin .table { font-size: 0.88rem; }
.admin .site-header { background: #26313b; border-bottom: 0; }
.admin .brand, .admin .brand small { color: #f0f2f3; }
.admin .site-header a:not(.brand), .admin .site-header .link-button { color: #dfe5ea; }
.admin .nav-row a { color: #b8c3cc; }
.admin .nav-row a[aria-current="page"] { color: #fff; border-bottom-color: #fff; }

@media print {
  .site-header, .tabbar, .site-footer, .actions { display: none; }
}
