/* ==========================================================
   吉田野営2026 Webパンフレット v0.1
   色を変えたいときは、下の :root の値だけ直せばOKです
   ========================================================== */
:root {
  --bg: #FAF8F3;            /* 温かみのあるオフホワイト */
  --surface: #FFFFFF;
  --text: #1A1A1A;
  --text-sub: #5F5C55;
  --line: #E7E2D8;
  --accent: #0089BA;        /* アクセント（飾り・枠） */
  --accent-strong: #00729B; /* アクセント（文字・ボタン。読みやすい濃さ） */
  --accent-soft: #E3F3F9;
  --ph: #ECE9E2;            /* 写真プレースホルダーの地色 */
  --radius: 14px;
  --shadow: 0 6px 24px rgba(26, 26, 26, .12);
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
          "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
}

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

html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- 全体レイアウト ---------- */
.app {
  height: 100vh;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
@media (min-width: 561px) {
  body { background: #F1EEE7; }
  .app, .detail { box-shadow: 0 0 0 1px var(--line); }
}

/* ---------- ヘッダー ---------- */
.site-header {
  padding: calc(14px + env(safe-area-inset-top)) 20px 12px;
  text-align: center;
}
.logo { margin: 0 0 8px; }
.logo img { margin: 0 auto; height: 48px; width: auto; }
.event-meta { margin: 0; display: flex; flex-direction: column; gap: 0; }
.event-date { font-size: 15px; font-weight: 700; letter-spacing: .06em; }
.event-venue { font-size: 13px; color: var(--text-sub); }

/* ---------- タブ ---------- */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 16px;
}
.tab {
  position: relative;
  min-height: 52px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-sub);
}
.tab[aria-selected="true"] {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #fff;
  font-weight: 700;
}
/* 色以外でも選択中とわかるよう、下線バーを出す */
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 7px;
  width: 28px; height: 3px;
  margin-left: -14px;
  border-radius: 2px;
  background: #fff;
}

/* ---------- フィルター（横スクロール） ---------- */
.filters { position: relative; padding: 12px 0 10px; }
/* 右（左）にまだタグが続いていることを、ぼかし＋矢印ボタンで知らせる */
.filters::before, .filters::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 72px;
  pointer-events: none; opacity: 0; transition: opacity .2s; z-index: 1;
}
.filters::before { left: 0; width: 28px; background: linear-gradient(to right, var(--bg), rgba(250,248,243,0)); }
.filters::after  { right: 0; background: linear-gradient(to left, var(--bg) 45%, rgba(250,248,243,0)); }
.filters.can-left::before, .filters.can-right::after { opacity: 1; }
.filters-more {
  position: absolute; right: 8px; top: 50%; z-index: 2;
  width: 40px; height: 40px; margin-top: -19px;
  border: 1.5px solid var(--accent-strong); border-radius: 50%;
  background: var(--surface); color: var(--accent-strong);
  font-size: 24px; font-weight: 700; line-height: 1; padding: 0 0 4px 2px;
  box-shadow: 0 2px 6px rgba(26,26,26,.12);
}
.filters-scroll {
  display: flex;
  gap: 8px;
  padding: 2px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.filters-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.chip[aria-pressed="true"] {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.chip[aria-pressed="true"]::before { content: "✓ "; font-weight: 700; }
.chip-clear { border-style: dashed; color: var(--text-sub); }

/* ---------- パネル ---------- */
.panels { flex: 1; min-height: 0; position: relative; }
.panel { position: absolute; inset: 0; }

/* ---------- MAP ---------- */
.panel-map { border-top: 1px solid var(--line); overflow: hidden; }
.map-viewport {
  position: absolute; inset: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
  background: #F3F0E8;
  cursor: grab;
}
.map-viewport.is-dragging { cursor: grabbing; }
.map-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.map-image { width: 100%; height: 100%; pointer-events: none; -webkit-user-drag: none; }
.map-pins { position: absolute; inset: 0; }

.pin {
  position: absolute;
  transform: translate(-50%, -100%);
  min-width: 46px; height: 28px;
  padding: 0 8px;
  margin-top: -7px;                 /* 下の三角ぶん */
  border: 2px solid var(--accent-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-strong);
  font-size: 12px; font-weight: 800; line-height: 1;
  letter-spacing: .02em;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(26,26,26,.18);
  transition: transform .18s ease;
  transform-origin: 50% calc(100% + 7px);
}
/* タップしやすいよう、見た目より広い当たり判定 */
.pin::before { content: ""; position: absolute; inset: -10px -4px -12px; }
.pin::after {
  content: "";
  position: absolute; left: 50%; bottom: -8px;
  width: 10px; height: 10px; margin-left: -5px;
  background: inherit;
  border-right: 2px solid var(--accent-strong);
  border-bottom: 2px solid var(--accent-strong);
  transform: rotate(45deg);
  border-bottom-right-radius: 2px;
}
.pin.is-selected {
  z-index: 5;
  background: var(--accent-strong);
  color: #fff;
  transform: translate(-50%, -100%) scale(1.2);
  box-shadow: 0 0 0 4px rgba(255,255,255,.95), 0 0 0 7px rgba(0,137,186,.45), 0 6px 14px rgba(26,26,26,.3);
}
.pin.is-selected.is-pulse { animation: pin-pulse 1.1s ease-out 2; }
@keyframes pin-pulse {
  0%   { box-shadow: 0 0 0 4px rgba(255,255,255,.95), 0 0 0 5px rgba(0,137,186,.7), 0 6px 14px rgba(26,26,26,.3); }
  100% { box-shadow: 0 0 0 4px rgba(255,255,255,.95), 0 0 0 26px rgba(0,137,186,0), 0 6px 14px rgba(26,26,26,.3); }
}

.map-status {
  position: absolute; left: 12px; top: 12px; margin: 0;
  padding: 0 14px;
  border-radius: 999px;
  min-height: 44px;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  font-size: 13px; font-weight: 600;
  box-shadow: 0 2px 6px rgba(26,26,26,.1);
}
.map-status span { margin-left: 8px; color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }

.map-controls {
  position: absolute; right: 12px; top: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.map-controls button {
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.96);
  font-size: 20px; font-weight: 600; line-height: 1;
  box-shadow: 0 2px 6px rgba(26,26,26,.1);
}
.map-controls .zoom-reset { font-size: 12px; font-weight: 700; }

/* ミニカード */
.mini-card {
  position: absolute;
  left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: card-in .22s ease-out;
}
@keyframes card-in { from { opacity: 0; transform: translateY(12px); } }
.mini-thumb { width: 84px; height: 84px; border-radius: 10px; overflow: hidden; }
.mini-thumb img, .mini-thumb .ph { width: 100%; height: 100%; object-fit: cover; }
.mini-main { min-width: 0; padding-right: 30px; }
.mini-name {
  margin: 2px 0 4px; font-size: 16px; font-weight: 700; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mini-tags { display: flex; gap: 4px; overflow: hidden; margin-bottom: 6px; }
.mini-more {
  min-height: 36px; padding: 0 2px;
  border: 0; background: none;
  color: var(--accent-strong);
  font-size: 15px; font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px;
}
.mini-more::after { content: ""; position: absolute; inset: 0; border-radius: 16px; } /* カード全体をタップ可能に */
.mini-close {
  position: absolute; right: 2px; top: 2px; z-index: 1;
  width: 44px; height: 44px;
  border: 0; background: none;
  font-size: 20px; color: var(--text-sub);
}

.booth {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--text);
  color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; line-height: 1.6;
}
.tag {
  flex: 0 0 auto;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 12px; color: var(--text-sub); white-space: nowrap; line-height: 1.6;
}

/* 写真プレースホルダー */
.ph {
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px;
  background: var(--ph);
  color: #A9A59A;
  font-size: 12px;
}
.ph svg { width: 28px; height: 28px; }

/* 座標確認モード（?edit=1） */
.edit-readout {
  position: absolute; left: 12px; right: 68px; top: 12px;
  padding: 10px 12px; border-radius: 12px;
  background: #1A1A1A; color: #fff;
  font-size: 14px; font-family: ui-monospace, Menlo, monospace;
  user-select: text; -webkit-user-select: text;
}
.edit-cross {
  position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2px solid #E5484D; border-radius: 50%; background: rgba(229,72,77,.25);
  pointer-events: none;
}

/* ---------- 出店者一覧 ---------- */
.panel-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 16px calc(40px + env(safe-area-inset-bottom));
}
.list-status { margin: 4px 2px 12px; font-size: 13px; color: var(--text-sub); }
.vendor-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 14px;
}
.vendor-card {
  display: block; width: 100%;
  padding: 0; border: 0; background: none;
  text-align: left;
  border-radius: var(--radius);
}
.vendor-photo {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ph);
  margin-bottom: 10px;
}
.vendor-photo img, .vendor-photo .ph { width: 100%; height: 100%; object-fit: cover; }
.vendor-name {
  display: block;
  margin: 6px 0 2px;
  font-size: 15px; font-weight: 700; line-height: 1.45;
}
.vendor-cat { display: block; font-size: 13px; color: var(--text-sub); }

.empty { padding: 48px 8px; text-align: center; color: var(--text-sub); }

/* ---------- ボタン ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 54px;
  padding: 0 20px;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  font-size: 16px; font-weight: 700;
  text-decoration: none;
}
.btn-primary { background: var(--accent-strong); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-disabled { background: transparent; border-color: var(--line); color: #8F8B82; font-weight: 600; }
.btn-text { background: none; color: var(--text-sub); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; min-height: 48px; margin-top: 8px; }
.empty .btn { width: auto; margin: 16px auto 0; }

/* ---------- 出店者詳細 ---------- */
.detail {
  position: fixed; top: 0; bottom: 0; left: 50%;
  width: 100%; max-width: 560px;
  transform: translateX(-50%);
  z-index: 20;
  display: flex; flex-direction: column;
  background: var(--bg);
  animation: detail-in .24s ease-out;
}
@keyframes detail-in { from { opacity: 0; transform: translate(-50%, 24px); } }
.detail-bar {
  flex: 0 0 auto;
  padding: calc(6px + env(safe-area-inset-top)) 8px 6px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.detail-back {
  min-height: 44px; padding: 0 14px;
  border: 0; border-radius: 10px; background: none;
  font-size: 16px; font-weight: 700;
}
.detail-body {
  flex: 1; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
}

.gallery { position: relative; }
.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide {
  flex: 0 0 100%;
  aspect-ratio: 4 / 3;
  scroll-snap-align: center;
  background: var(--ph);
}
.gallery-slide img, .gallery-slide .ph { width: 100%; height: 100%; object-fit: cover; }
.gallery-count {
  position: absolute; right: 12px; bottom: 12px;
  padding: 2px 10px; border-radius: 999px;
  background: rgba(26,26,26,.7); color: #fff;
  font-size: 13px; font-weight: 600;
}

.detail-info { padding: 22px 20px 0; }
.detail-name { margin: 10px 0 12px; font-size: 24px; font-weight: 800; line-height: 1.4; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.detail-tags .tag { font-size: 13px; padding: 3px 12px; background: var(--surface); }
.detail-desc { margin: 0 0 28px; font-size: 16px; line-height: 1.9; }
.detail-actions { display: grid; gap: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
