/* =========================================================
   仁宿 - JINYA Official Site Stylesheet
   Version 4.5 / 2025-10
   ---------------------------------------------------------
   STRUCTURE
     01. Design Tokens / Reset
     02. Header / Navigation
     03. Buttons / Layout Base
     04. Hero / Global Sections
     05. Gallery (TOP)
     06. Activity (Masonry)
     07. Access Page / Map（修正版）
     08. Contact Section (TOP)
     09. Footer
     10. Headings / Typography
     11. Animations
     12. CTA Buttons (Activity)
     13. Responsive Layout
     14. Hamburger Menu / Overlay
   ========================================================= */


/* =========================================================
   01. Design Tokens / Reset
   ========================================================= */
:root {
  --color-bg: #FAF8F2;      /* 生成り */
  --color-paper: #ffffff;   /* 白 */
  --color-text: #333333;    /* 炭色 */
  --color-muted: #666666;
  --color-line: rgba(0, 0, 0, 0.08);
  --color-accent: #C6A664;  /* 金 */

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 72px;

  --font-base: "Noto Sans JP", system-ui, -apple-system, "Segoe UI",
    Roboto, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-base);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
.container { width: min(1080px, 92vw); margin-inline: auto; }
.center { text-align: center; }
.muted { color: var(--color-muted); }


/* =========================================================
   02. Header / Navigation
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-line);
}
.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  width: min(1080px, 92vw);
  margin-inline: auto;
}
.site-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.site-header__name {
  letter-spacing: 0.28em;
  font-weight: 600;
  display: none;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.site-nav a {
  padding: 10px 8px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--color-accent);
}
img.site-header__logo { display: block; width: 245px; height: 55px; }


/* ========== Language Switch: リンクborder を無効化 ========== */
.site-nav .lang-switch__item {
  padding: 0;                      /* 余白はゼロに */
  border-bottom: none !important;  /* nav 共通の border を上書き */
  transition: color 0.2s;          /* border-color のトランジションを無効化 */
}

/* hover / current 時も border は出さない */
.site-nav .lang-switch__item:hover,
.site-nav .lang-switch__item[aria-current="page"],
.lang-switch__item--active {
  border-bottom: none !important;
  color: var(--color-accent);
}

/* ========== Language Switch ========== */
.lang-switch {
  display: flex;
  align-items: center;
  margin-left: 16px;          /* [予約する] ボタンとの間隔 */
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.lang-switch__divider {
  margin-inline: 4px;
  font-size: 0.75em;
  opacity: 0.7;
}

/* nav 共通スタイルの上書き */
.lang-switch__item {
  padding: 0;
  border-bottom: none;
  font-weight: 600;
}

.lang-switch__item:hover {
  border-bottom: none;
  color: var(--color-accent);
}

.lang-switch__item--active {
  color: var(--color-accent);
}

/* 必要ならSP時の調整 */
@media (max-width: 768px) {
  .lang-switch {
    margin-left: 12px;
    margin-top: 4px;
  }
}


/* =========================================================
   03. Buttons / Layout Base（v4.6 最終安定版）
   ---------------------------------------------------------
   ・全ボタンの基礎スタイルを統一（SP/PC共通）
   ・セクション余白を柔軟に調整（上：やや広め／下：控えめ）
   ・ページタイトル部分（最初の.section）で自然な見え方に最適化
   ========================================================= */


/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-line);
  background: var(--color-paper);
  color: var(--color-text);
  font-weight: 600;
  border-radius: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-align: center;
  line-height: 1;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* カラーバリエーション */
.btn--accent {
  background: var(--color-accent);
  color: #fff;
  border-color: transparent;
}
.btn--accent:hover {
  opacity: 0.9;
}

/* サイズバリエーション */
.btn--nav {
  width: 120px;
  height: 40px;
  font-size: 14px;
  letter-spacing: 0.05em;
}
.btn--lg {
  width: 208px;
  height: 56px;
  font-size: 16px;
}

/* ---------- Section Base Layout ---------- */
.section {
  padding: clamp(56px, 6vw, 96px) 0; /* 上下均一。基本の呼吸感 */
}

/* 最初のセクションだけ下を少し狭く */
.section:first-of-type {
  padding-bottom: clamp(40px, 4vw, 64px);
}

/* セクション間の重なりを防止（連続section対策） */
.section + .section {
  padding-top: clamp(32px, 4vw, 56px);
}

/* 共通テキストスタック（段落群） */
.text-stack {
  display: grid;
  gap: var(--space-3);
  max-width: 72ch;
  margin-inline: auto;
  margin-bottom: var(--space-5);
}

/* 背景バリエーション */
.section--bg,
.section--about,
.section--contact,
.hero {
  background: var(--color-bg);
}
.section--gallery,
.section--activity {
  background: var(--color-paper);
}

/* リード文（小見出し下の説明） */
.section__lead {
  margin: 0 auto var(--space-2); /* 下の余白を少し軽く */
  text-align: center;
  max-width: 70ch;
  color: var(--color-muted);
  line-height: 1.8;
  font-weight: 400;
}

/* 見出し（参考・上で設定済みでもOK） */
.section__heading {
  margin: 0 0 var(--space-3);
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.04em;
}



/* =========================================================
   Hero / Global Sections（v5.1 SP黒帯修正版）
   ---------------------------------------------------------
   ・SP時も画像が画面全体を確実に覆う
   ・object-fitを強制拡大
   ・上下黒帯を完全除去
   ========================================================= */

.hero {
  position: relative;
  margin: 0;
  padding: 0;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  background: #000;
  flex-shrink: 0;
  border: none;
}

.hero__slides {
  display: grid;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.hero__slide {
  grid-area: 1/1;
  margin: 0;
  padding: 0;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 1.2s ease, transform 1.2s ease;
}
.hero__slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.hero__slides img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  margin: 0;
  padding: 0;
  border: none;
  min-height: 100%; /* ← 高さ不足時の保険 */
}

/* ナビ矢印 */
.hero__ctrl {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  border: none;
  background: rgba(255,255,255,0.85);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s ease;
}
.hero__ctrl:hover { background: rgba(255,255,255,0.95); }
.hero__ctrl--prev { left: 16px; }
.hero__ctrl--next { right: 16px; }

/* ---------- スマホ時調整（黒帯除去強化） ---------- */
@media (max-width: 768px) {
  html, body {
    height: 100%;
    overflow-x: hidden;
  }

  .hero {
    height: 90vh;
    min-height: 90dvh; /* ← 動的vhで正確な高さ確保（iOS対応） */
    background: #000;
  }

  .hero__slides {
    height: 100%;
  }

  .hero__slides img {
    width: 100vw;
    height: 90vh;
    min-height: 90dvh;
    object-fit: cover !important;
    object-position: center center;
  }

  .hero__ctrl {
    width: 28px;
    height: 28px;
  }
}


/* =========================================================
   05. Gallery (TOP) — PC 2列 / SP 1列
   ---------------------------------------------------------
   ・PCでは2カラムの均等グリッド
   ・SPでは1カラム（幅いっぱい）
   ・v4.5構成と完全統合済み
   ========================================================= */
.gallery {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* ✅ PC時は2列 */
  gap: var(--space-4);
  max-width: 1080px;
}

.gallery__item {
  background: var(--color-paper);
  border: 1px solid var(--color-line);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery__item:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}

.gallery__item img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- スマホ：1カラム ---------- */
@media (max-width: 768px) {
  .gallery {
    grid-template-columns: 1fr; /* ✅ 1列表示 */
    gap: var(--space-3);
  }
}


/* =========================================================
   06. Activity (Masonry Gallery)
   ========================================================= */
.masonry-gallery {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  columns: 3;
  column-gap: var(--space-4);
}
.masonry-gallery li {
  display: inline-block; /* ← Safariでの再配置防止 */
  width: 100%;
  margin-bottom: var(--space-4);
  break-inside: avoid;
  -webkit-column-break-inside: avoid; /* ← Safari必須 */
  page-break-inside: avoid;
  overflow: hidden;
  /* transform/opacity系は遅延させる */
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}

.masonry-gallery img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.masonry-gallery img:hover {
  transform: scale(1.02);
  opacity: 0.9;
}
@media (max-width:1100px){ .masonry-gallery { columns: 3; } }
@media (max-width:768px){ .masonry-gallery { columns: 2; } }
@media (max-width:480px){ .masonry-gallery { columns: 1; } }


/* =========================================================
   07. Access Page / Map（v4.2.3 Gallery Scope Fix）
   ---------------------------------------------------------
   ・TOPギャラリーとの競合回避
   ・PC時2列固定／SP1列自動
   ========================================================= */

.section--white { background: var(--color-paper); }

/* --- 地図 --- */
.map-wrapper iframe {
  width: 100%;
  height: clamp(360px, 50vw, 520px);
  border: none;
  border-radius: 4px;
  filter: grayscale(10%) brightness(97%);
  transition: filter 0.3s ease;
}
.map-wrapper iframe:hover {
  filter: grayscale(0%) brightness(100%);
}

/* --- 住所 --- */
.address-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-paper);
  padding: var(--space-4);
  border: 1px solid var(--color-line);
  border-radius: 4px;
  margin-top: var(--space-4);
}
.address-card p {
  margin: 0;
  text-align: left;
  color: var(--color-text);
  line-height: 1.8;
}
.address-card .btn { margin-left: auto; }

/* スマホ時：中央寄せ */
@media (max-width: 768px) {
  .address-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-3);
  }
  .address-card .btn {
    margin-left: 0;
  }
}

/* --- 交通手段 --- */
.transport-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-5);
}
.transport-card {
  background: var(--color-bg);
  padding: var(--space-5) var(--space-4);
  border: 1px solid var(--color-line);
  border-radius: 4px;
  text-align: center;
  line-height: 1.8;
}
.transport-icon {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  background: #fff;
  border-radius: 50%;
  margin: 0 auto var(--space-3);
  border: 1px solid var(--color-line);
}
.transport-icon img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.transport-card h3 {
  font-size: 1.1em;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

/* --- 観光スポット --- */
.section--activity { background: var(--color-bg); }

/* ✅ gallery--spots専用スコープで上書き */
.gallery--spots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-5);
}

.gallery--spots .gallery__item {
  grid-column: auto !important; /* ← TOPギャラリーの指定を打ち消す */
  background: var(--color-paper);
  border: 1px solid var(--color-line);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.gallery--spots .gallery__item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.gallery--spots img {
  width: 100%;
  height: auto;
  display: block;
}
.gallery--spots .spot-info {
  padding: var(--space-3);
  text-align: left;
}
.gallery--spots .spot-info h4 {
  font-size: 1em;
  font-weight: 600;
  margin: 0 0 var(--space-1);
}
.gallery--spots .spot-info p {
  font-size: 0.9em;
  color: var(--color-muted);
  margin: 0;
}

/* --- レスポンシブ --- */
@media (max-width: 768px) {
  .gallery--spots {
    grid-template-columns: repeat(1, 1fr);
    gap: var(--space-3);
  }
}
@media (max-width: 480px) {
  .gallery--spots {
    grid-template-columns: 1fr;
  }
}



/* =========================================================
   08. Contact Section (TOP)
   ========================================================= */
.contact-boxes {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-5);
  margin-bottom: var(--space-5);
}
.contact-box {
  grid-column: span 6;
  background: var(--color-paper);
  padding: var(--space-6) var(--space-4);
  text-align: center;
  border: 1px solid var(--color-line);
}
.contact-icon {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  margin-inline: auto;
  background: var(--color-accent);
  border-radius: 999px;
  margin-bottom: var(--space-3);
}
.contact-icon img {
  filter: brightness(0) invert(1);
  width: 40px;
  height: 40px;
}
.contact-box__value {
  font-size: 1.6em;
  font-weight: 600;
  color: var(--color-accent);
  margin: var(--space-2) 0;
}
@media (max-width:768px){
  .contact-boxes{ grid-template-columns:1fr; }
  .contact-box{ grid-column:span 12; }
}


/* =========================================================
   09. Footer（v4.5 Final統合版）
   ---------------------------------------------------------
   ・SP/PC共通でフッター下の白余白を完全除去
   ・100vh未満のページでも黒背景を下端まで固定
   ・Safari SafeArea対応
   ・09章と15章を一本化（重複除去）
   ========================================================= */

/* ---------- フッター全体 ---------- */
.site-footer {
  width: 100%;
  background: #222;
  color: #ddd;
  border-top: 1px solid var(--color-line);
  padding: var(--space-6) 0 var(--space-3);
  margin: 0;                 /* 余白完全リセット */
  flex-shrink: 0;            /* Flex内で潰れ防止 */
  margin-top: auto;          /* フッターを下端へ押す核心指定 */
}

/* ---------- グリッド構造 ---------- */
.footer-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-4);
}

.footer-col { grid-column: span 4; }

.footer-col__title {
  margin: 0.2em 0 0.6em;
  color: #fff;
  font-weight: 600;
}

.footer-text {
  color: #ddd;
  line-height: 1.8;
  font-weight: 400;
}

.footer-text a {
  color: #eee;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.footer-text a:hover { color: var(--color-accent); }

/* ---------- コピーライト ---------- */
.footer-copy {
  text-align: center;
  padding: 16px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: #bbb;
  font-size: 0.9em;
}

/* ---------- レスポンシブ対応 ---------- */
@media (max-width: 900px) {
  .footer-col { grid-column: span 6; }
}
@media (max-width: 600px) {
  .footer-col { grid-column: span 12; }
}

/* ---------- SafeArea対応（iPhone等） ---------- */
@supports (-webkit-touch-callout: none) {
  .site-footer {
    min-height: calc(env(safe-area-inset-bottom) + 60px);
  }
}

/* ---------- HTML / BODY リセット（下端接地） ---------- */
html {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--color-bg);
}
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}
main {
  flex: 1 0 auto;
  min-height: 0;
  margin: 0;
  padding: 0;
}




/* =========================================================
   10. Headings / Typography（v4.5 修正版）
   ========================================================= */

/* メイン見出し */
.section__heading {
  display: block;
  text-align: center;
  font-size: clamp(22px, 3.6vw, 30px);
  letter-spacing: 0.03em;
  margin: 0 0 var(--space-4);
  font-weight: 500;
  position: relative;
}
.section__heading::after {
  content: "";
  display: block;
  width: 36px;
  height: 2px;
  background: var(--color-accent);
  margin: 12px auto 0;
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: center;
  animation: lineExpand 1s ease 0.6s forwards;
}

/* サブ見出し（indexなど用） */
.section__heading--sub {
  display: block;
  text-align: center;
  font-size: clamp(20px, 3vw, 26px);
  letter-spacing: 0.04em;
  margin: 0 0 var(--space-4);
  font-weight: 600;
  position: relative;
}
.section__heading--sub::after {
  content: "";
  display: block;
  width: 32px;
  height: 2px;
  background: var(--color-accent);
  margin: 12px auto 0;
  border-radius: 1px;
  opacity: 0;
  animation: lineExpand 1s ease 0.5s forwards;
}


/* =========================================================
   11. Animations
   ========================================================= */
@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes lineExpand {
  0% { transform: scaleX(0); opacity: 0; }
  100% { transform: scaleX(1); opacity: 1; }
}


/* =========================================================
   12. CTA Buttons (Activity)
   ========================================================= */
.cta-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: var(--space-5);
}
.cta-buttons .btn {
  min-width: 220px;
  height: 64px;
  font-size: 1.1em;
}
@media (max-width: 600px) {
  .cta-buttons {
    flex-direction: column;
    gap: 16px;
  }
}


/* =========================================================
   13. Responsive Layout（Global）
   ========================================================= */
@media (max-width: 900px) {
  .site-header__bar { height: 72px; }
}
@media (max-width: 768px) {
  .container { width: 90vw; }
  .hero { height: 480px; }
  .hero__slides, .hero__slides img { height: 480px; }
}


/* =========================================================
   14. Hamburger Menu / Overlay（修正版・ヘッダーボタン保持）
   ========================================================= */

/* ---------- トグルボタン ---------- */
.menu-toggle {
  display: none;
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  justify-content: center;
  align-items: center;
  z-index: 300;
}
.menu-toggle span {
  position: absolute;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: 0.35s ease;
}
.menu-toggle span:nth-child(1){ top:10px; }
.menu-toggle span:nth-child(2){ top:18px; }
.menu-toggle span:nth-child(3){ top:26px; }
.menu-toggle.is-open span:nth-child(1){ transform:rotate(45deg); top:18px; }
.menu-toggle.is-open span:nth-child(2){ opacity:0; }
.menu-toggle.is-open span:nth-child(3){ transform:rotate(-45deg); top:18px; }

/* ---------- オーバーレイ ---------- */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 30%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 100;
}
.nav-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- モバイルナビ ---------- */
@media (max-width: 768px) {
  .menu-toggle { display: flex; }

  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    flex-direction: column;
    justify-content: flex-start;
    background: rgba(250, 248, 242, 0.97); /* 生成り背景 */
    width: 70%;
    height: 100vh;
    padding: calc(var(--space-6)) var(--space-5);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 200;
  }
  .site-nav.is-open { transform: translateX(0); }

  .site-nav a {
    display: block;
    padding: 14px 0;
    font-size: 1.1em;
    font-weight: 600;
    border-bottom: 1px solid var(--color-line);
    text-align: left;
  }

@media (max-width: 768px) {
  .site-nav a.btn.btn--accent.btn--nav {
    display: flex;                    /* ← Flex化で中央揃え */
    align-items: center;              /* ← 垂直中央 */
    justify-content: center;          /* ← 水平中央 */
    width: 100%;
    height: 56px;                     /* ← 高さ */
    font-size: 1.1em;
    background: var(--color-accent);
    color: #fff;
    font-weight: 600;
    text-align: center;
    margin-top: var(--space-4);
    border: none;
    border-radius: 0;
    transition: opacity 0.25s ease;
  }
  .site-nav a.btn.btn--accent.btn--nav:hover {
    opacity: 0.9;
  }
}



/* ---------- スクロールロック ---------- */
body.menu-open { overflow: hidden; }


