/* =============================
   ToruRoute 店舗詳細ページ
   最終更新版：スマホ横スクロール修正版 + 長URL折返し
   ============================= */

/* 共通：横スクロール抑止 */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* リンク・画像・iframeのデフォルトはみ出し対策 */
img, iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

body {
  font-family: "Noto Sans JP", system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--color-bg);
  margin: 0;
  padding: 1.2rem;
  color: var(--color-charcoal);
  line-height: 1.6;
}
.container { max-width: 1040px; margin: 0 auto; }

/* Header (full-width, simple) */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  margin: 0 0 1rem;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: .6rem 1rem;
  max-width: 1120px;
  margin: 0 auto;
}
.brand { font-weight: 800; letter-spacing: 0.2px; color: #7A5A3C; text-decoration: none; }
.brand-img { height: 28px; display: block; }
.btn { 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  height: 40px;
  padding: 0 .9rem;
  border-radius: 10px;
  text-decoration: none;
  font-size: .95rem;
  font-weight: 600;
}
.btn svg { width: 18px; height: 18px; display: inline-block; }
.btn.back { background: var(--color-blue); color: #fff; }
.btn.back:hover { filter: brightness(0.96); }
.container a { color: var(--color-blue); }

/* =============================
   HERO セクション
   ============================= */
.hero { 
  width: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.hero-media {
  width: 100%;
  height: 260px;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-color: #e5e7eb;
  position: relative;
}
.hero-media.no-image {
  background-image: linear-gradient(135deg,#e5e7eb,#f3f4f6);
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.04), rgba(0,0,0,0));
}
.hero-content {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.2rem 1.2rem 1.6rem;
}
.title {
  font-size: 1.9rem;
  margin: 0 0 .4rem;
}
.catch-copy {
  font-size: 1.15rem;
  color: #8B4A2B;
  margin: .2rem 0 1rem;
}

/* =============================
   CHIPS
   ============================= */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.chip {
  font-size: .85rem;
  background: #F3F2ED;
  color: #4B4B4B;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: .25rem .6rem;
}
.chip-area {
  background: #FFF3E8;
  color: #E59A3A;
  border-color: #F6DEBF;
}

/* =============================
   SECTION 共通
   ============================= */
.section { 
  margin-top: 1.6rem;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 1.2rem 0 0;
  border-top: 1px solid rgba(44,44,44,0.12);
}
.section-title {
  font-size: 1.1rem;
  margin: 0 0 .9rem;
  color: var(--color-charcoal);
  border-left: 4px solid #F5D9B3;
  padding-left: .6rem;
}
.desc {
  font-size: 1rem;
  line-height: 1.8;
}
.desc .ja { margin: 0 0 .6rem; }
.desc .en { color: rgba(44,44,44,0.75); margin: 0; }

/* =============================
   INFO GRID
   ============================= */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: .75rem 1rem;
}
.info-grid dt {
  font-weight: 700;
  color: rgba(44,44,44,0.85);
}
.info-grid dd {
  margin: .2rem 0 0;
  color: var(--color-charcoal);
  min-width: 0;                 /* ← 折返し許可 */
  overflow-wrap: anywhere;      /* ← 長文/URLを強制折返し */
  word-break: break-all;        /* ← 連続文字（URL等）も確実に折返し */
}
.info-grid > div {
  padding: .35rem 0;
  border-radius: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 8rem 1fr;
  column-gap: 1rem;
  align-items: start;
  border-bottom: 1px solid rgba(44,44,44,0.08);
  min-width: 0;                 /* ← グリッド子の省略許可 */
}
.info-grid > div.info-row-holiday {
  grid-template-columns: 1fr;
}
.info-grid > div.info-row-holiday dt {
  grid-column: 1;
}
.info-grid > div.info-row-holiday dd {
  grid-column: 1;
  margin-top: .35rem;
}
.info-grid > div:last-child { border-bottom: none; }

/* aタグにも同様の折返しを適用（URLは特に長い） */
.info-grid dd a,
.container a {
  overflow-wrap: anywhere;
  word-break: break-word;
  text-decoration: underline;
}
/* URLは幅に合わせて確実に折り返す（iOS/Safari対策） */
.info-grid dd a {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  word-break: break-all;
}

/* =============================
   GALLERY
   ============================= */
.gallery .g-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: .75rem;
}
.gallery .g-item {
  overflow: hidden;
  border-radius: 10px;
  background: #f3f4f6;
}
.gallery img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.gallery .g-empty {
  color: rgba(44,44,44,0.6);
}

/* =============================
   MAP
   ============================= */
.location .map-wrap {
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid rgba(44,44,44,0.08);
}
.map-frame {
  width: 100% !important;
  height: 320px;
  border: 0;
  display: block;
  max-width: 100%;
}

/* =============================
   BENEFIT / COUPON
   ============================= */
.benefit-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  border-left: 4px solid var(--color-orange);
  padding-left: .8rem;
}
.benefit-title {
  margin: 0 0 .4rem;
  font-size: 1.1rem;
  color: var(--color-charcoal);
}
.benefit-desc {
  margin: 0 0 .5rem;
  color: rgba(44,44,44,0.85);
  overflow-wrap: anywhere;      /* ← 説明文も長文折返し */
  word-break: break-word;
}
.benefit-cond {
  margin: 0;
  color: rgba(44,44,44,0.65);
}
.benefit-qr img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  display: block;
}

/* =============================
   QR モーダル
   ============================= */
.qr-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.qr-modal.active {
  opacity: 1;
  pointer-events: all;
}
.qr-modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
}
.qr-modal .close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  border-radius: 50%;
  width: 40px;
  height: 40px;
}

/* =============================
   ERROR MESSAGE
   ============================= */
.error {
  background: rgba(211,79,43,0.08);
  color: var(--color-kinaka);
  padding: .75rem 1rem;
  border-radius: 8px;
  margin-bottom: .8rem;
}

/* =============================
   カラーパレット
   ============================= */
:root {
  --color-blue: #D54B2A;
  --color-green: #6FA56E;
  --color-orange: #E59A3A;
  --color-bg: #FFF8F1;
  --color-charcoal: #2C2C2C;
  --color-teal: #48C0C6;
  --color-kinaka: #D34F2B;
  --color-border: #EADFD3;

  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow-card: 0 6px 24px rgba(44,44,44,0.06);
}

/* =============================
   RESPONSIVE ADJUSTMENTS
   ============================= */
@media (max-width: 860px) {
  .gallery img { height: 150px; }
}

@media (max-width: 768px) {
  body { padding: 0.8rem; }
  .container {
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .info-grid, .admin-grid { grid-template-columns: 1fr; }

  /* ギャラリー：横スクロールのスワイプ式（スナップ） */
  .gallery .g-grid {
    display: flex;
    overflow-x: auto;
    gap: .75rem;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: .4rem;       /* 指でのスワイプ時に安全余白 */
    scrollbar-width: none;       /* Firefox スクロールバー非表示 */
  }
  .gallery .g-grid::-webkit-scrollbar { display: none; } /* WebKit スクロールバー非表示 */
  .gallery .g-item {
    flex: 0 0 85%;               /* 次のカードがチラ見えする幅 */
    scroll-snap-align: start;    /* 各カードでスナップ */
  }
  .gallery img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;        /* 安定した比率で表示 */
    object-fit: cover;
  }

  .benefit-card { grid-template-columns: 1fr; }
  .benefit-qr { justify-self: start; }
  .hero-media { height: 200px; }
  .qr-modal img {
    max-width: 95%;
    max-height: 90vh;
  }
}

/* 極小画面でのギャラリー一列化と安全余白 */
@media (max-width: 480px) {
  /* さらに小さい画面では1枚の占有率を増やす */
  .gallery .g-item { flex-basis: 90%; }
}
