/* ============================================================
   旭区ファンフェスタ2026 — style.css  （バグ修正版）
   ============================================================

   【修正ポイント一覧】
   ① body { overlay { ... } }
       → CSSブロック内にHTMLタグ的な記述が混入し body が閉じなかった
         overlay ブロックごと削除（backdrop-filterはbody::beforeで対応）

   ② header::before { overlay { ... } }
       → 同様の混入で content/position 等が全て無効になっていた
         overlay ブロックを削除し、正しいプロパティのみ残す

   ③ ・h3 { ... }
       → 先頭の「・」でセレクタ無効。h3 → .contact-title に改名

   ④ background-image: url(../../images/...)
       → Xサーバーでは同一フォルダ運用なので url(images/ファイル名) に修正

   ⑤ gallery-item の aspect-ratio: 3/4
       → 縦長に崩れるため 1/1（正方形）に修正

   ⑥ iOS Safari で background-attachment:fixed が効かない問題
       → スマホのメディアクエリで scroll に切り替え
============================================================ */

:root {
  --sky-light: #b8e4f9;
  --sky-mid: #79c8f0;
  --sky-dark: #3ca8e0;
  --accent-yellow: #f5c842;
  --accent-orange: #f08030;
  --accent-red: #e03020;
  --white: #ffffff;
  --nav-bg: #b8e4f9;
  --text-dark: #1a1a1a;
  --text-blue: #1565c0;
  --shadow: 0 4px 16px rgba(0,0,0,0.30);
  --radius: 8px;
}

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

/* ========== BODY ========== */
/*
  【修正①】overlay{ ... } ブロックを削除。
  bodyには背景画像と基本プロパティのみ記述する。
*/
body {
  font-family: 'Noto Sans JP', sans-serif;
  background-image: url(背景用.png);  /* 【修正④】同一フォルダ相対パス */
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* ========== HEADER ========== */
header {
  background-image: url(背景用.png);  /* 【修正④】同一フォルダ相対パス */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #a8d8f0;   /* 画像読み込み前の代替色 */
  position: relative;
  overflow: hidden;
  padding: 20px 40px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  min-height: 200px;
}

/* 雲オーバーレイ */
/*
  【修正②】overlay{ ... } ブロックを削除。
  content / position / inset / background / pointer-events を正しく記述。
*/
header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 260px 120px at 5%  60%, rgba(255,255,255,0.55) 0%, transparent 70%),
    radial-gradient(ellipse 200px 90px  at 20% 80%, rgba(255,255,255,0.40) 0%, transparent 70%),
    radial-gradient(ellipse 300px 140px at 50% 30%, rgba(255,255,255,0.45) 0%, transparent 65%),
    radial-gradient(ellipse 180px 80px  at 78% 70%, rgba(255,255,255,0.35) 0%, transparent 70%),
    radial-gradient(ellipse 240px 110px at 95% 50%, rgba(255,255,255,0.50) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

header > * { position: relative; z-index: 1; }

/* ========== 左：タイトル画像 ========== */
.header-left {
  flex-shrink: 0;
  height: 160px;
  display: flex;
  align-items: center;
}
.header-left img {
  height: 160px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* ========== 中央：ロゴ画像群 ========== */
.header-center {
  flex-shrink: 0;
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
}
.header-center img {
  height: 72px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* ========== 右：日付・会場 ========== */
.header-right {
  flex-shrink: 0;
  height: 160px;
  display: flex;
  align-items: center;
}
.event-date {
  font-size: clamp(18px, 3.5vw, 32px);
  font-weight: 900;
  color: white;
  line-height: 1.6;
  text-shadow:
    -3px -3px 0 #4a8fc0,  3px -3px 0 #4a8fc0,
    -3px  3px 0 #4a8fc0,  3px  3px 0 #4a8fc0,
     0   -3px 0 #4a8fc0,  0    3px 0 #4a8fc0,
    -3px  0   0 #4a8fc0,  3px  0   0 #4a8fc0;
  letter-spacing: 0.02em;
}

/* ===== NAV ===== */
.site-nav {
  width: 100%;
  background: var(--sky-light);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,120,180,0.2);
}
.nav-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.nav-item {
  color: #1565c0;
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(12px, 3vw, 15px);
  padding: 8px 20px;
  border: 2px solid var(--sky-mid);
  border-radius: 4px;
  transition: all 0.2s;
  white-space: nowrap;
  background: rgba(255,255,255,0.45);
}
.nav-item:hover,
.nav-item.active {
  background: var(--sky-dark);
  border-color: var(--sky-dark);
  color: var(--white);
}
.nav-item.coming-soon {
  color: var(--accent-orange);
}

/* ===== MAIN ===== */
main {
  width: 92%;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

/* ===== スクロールライズ ===== */
.rise {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.rise.visible { opacity: 1; transform: translateY(0); }

/* ===== セクション共通 ===== */
.section {
  margin: 48px auto;
}
.section-header {
  text-align: center;
  margin-bottom: 16px;
}

/* ============================================================
   ① ギャラリー
   ============================================================ */
.gallery-section {
  width: 100%;
  margin: 0;
  padding: 0;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: 100%;
}
.gallery-item {
  aspect-ratio: 1 / 1;  /* 【修正⑤】3/4（縦長）→ 1/1（正方形）に修正 */
  overflow: hidden;
  position: relative;
  background: var(--sky-light);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.40s ease;
}
.gallery-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,60,120,0.28) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.30s;
}
.gallery-item:hover img              { transform: scale(1.05); }
.gallery-item:hover .gallery-overlay { opacity: 1; }

/* ============================================================
   ② インスタグラム
   ============================================================ */
.section-title-btn {
  background: var(--white);
  border: 3px solid #ccc;
  border-radius: 24px;
  padding: 8px 32px;
  font-size: clamp(15px, 4vw, 20px);
  font-weight: 900;
  color: var(--text-dark);
  margin: 0 auto 16px;
  display: block;
  text-align: center;
  width: fit-content;
}
.instagram-embed {
  display: block;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  aspect-ratio: 4 / 3;
  background: var(--sky-light);
  border: 3px solid var(--sky-mid);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.instagram-embed img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ============================================================
   ③ 出展者一覧
   ============================================================ */

/* ── セクションタイトル ── */
.exhibitor-title {
  text-align: center;
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 900;
  color: var(--text-dark);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.exhibitor-title .link-text {
  color: var(--text-blue);
  text-decoration: none;
  position: relative;
  padding-bottom: 4px;
}
/* グラデーション下線 */
.exhibitor-title .link-text::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--sky-mid), var(--sky-dark), var(--sky-mid));
}
.spark {
  color: var(--accent-yellow);
  font-size: 0.9em;
}

/* ── グリッド：3列×2段・中央揃え ── */
.exhibitor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);   /* 3列固定 */
  gap: 16px;
  max-width: 580px;
  margin: 24px auto 0;
}

/* ── カード本体 ── */
.exhibitor-card {
  display: flex;                             /* ← blockからflexに変更 */
  align-items: center;                       /* 上下中央 */
  justify-content: center;                   /* 左右中央 */
  aspect-ratio: 1 / 1;
  background: rgba(255, 255, 255, 0.92);
  border: none;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  text-decoration: none;
  cursor: pointer;
  padding: 10%;
  box-shadow:
    0 2px 8px  rgba(0, 80, 160, 0.10),
    0 1px 3px  rgba(0, 80, 160, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.exhibitor-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow:
    0 12px 32px rgba(0, 80, 160, 0.20),
    0  4px 12px rgba(0, 80, 160, 0.10);
}

/* ── 画像：カード内に全体を収めて上下左右中央揃え ── */
.exhibitor-card img {
  max-width: 100%;                           /* コンテンツ幅に収める */
  max-height: 100%;                          /* コンテンツ高さに収める */
  width: auto;                               /* 縦横比を自動維持 */
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: transform 0.30s ease;
}
.exhibitor-card:hover img {
  transform: scale(1.05);
}

/* ── ホバーオーバーレイ「詳しく見る」── */
.exhibitor-card-hover {
  position: absolute;
  inset: 0;
  background: rgba(10, 50, 100, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  border-radius: 12px;
  transition: opacity 0.22s ease;
}
.exhibitor-card:hover .exhibitor-card-hover {
  opacity: 1;
}
.exhibitor-card-hover span {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  padding: 6px 18px;
  border-radius: 20px;
  backdrop-filter: blur(2px);
}

/* ============================================================
   主催者・お問い合わせ
   ============================================================ */
/*
  【修正③】・h3 { ... } → .contact-title に改名（先頭「・」でセレクタ無効だった）
*/
.contact-block {
  margin-top: 40px;
  text-align: center;
}
.contact-title {
  font-size: clamp(16px, 4vw, 22px);
  font-weight: 900;
  color: var(--text-dark);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.contact-info {
  font-size: clamp(13px, 3vw, 16px);
  line-height: 2;
  color: var(--text-dark);
}
.contact-info a {
  color: var(--text-blue);
  text-decoration: none;
}
.contact-info a:hover {
  text-decoration: underline;
}

/* ===== FOOTER ===== */
footer {
  background: var(--nav-bg);
  color: #888;
  text-align: center;
  padding: 20px 16px;
  font-size: 12px;
}
footer a {
  color: var(--sky-mid);
  text-decoration: none;
}

/* ============================================================
   レスポンシブ（スマホ）
   ============================================================ */
@media (max-width: 600px) {

  /* ── ヘッダー：3列をflex比率で画面幅100%に収める ── */
  header {
    flex-direction: row;
    align-items: stretch;         /* 3列の高さを揃える */
    justify-content: space-between;
    padding: 8px 6px;
    gap: 4px;
    min-height: auto;
    overflow: hidden;
  }

  /* 左（タイトル）：幅22% 固定 */
  .header-left {
    flex: 0 0 22%;
    flex-shrink: 1;       /* PC側の flex-shrink:0 を上書き */
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  .header-left img {
    width: 100%;          /* コンテナ幅に追従 */
    height: auto;
    max-height: 18vw;
    object-fit: contain;
  }

  /* 中央（ブランド＋お宝）：幅44% 固定 */
  .header-center {
    flex: 0 0 44%;
    flex-shrink: 1;       /* PC側の flex-shrink:0 を上書き */
    height: auto;
    gap: 3px;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
  }
  .header-center img {
    width: 100%;          /* コンテナ幅に追従 */
    height: auto;
    max-height: 13vw;
    object-fit: contain;
  }

  /* 右（日付・会場）：幅34% 固定 */
  .header-right {
    flex: 0 0 34%;
    flex-shrink: 1;       /* PC側の flex-shrink:0 を上書き */
    height: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
  }
  .event-date {
    font-size: clamp(8px, 2.8vw, 13px);
    text-align: left;
    line-height: 1.8;
    white-space: nowrap;
    text-shadow:
      -1px -1px 0 #4a8fc0,  1px -1px 0 #4a8fc0,
      -1px  1px 0 #4a8fc0,  1px  1px 0 #4a8fc0;
  }

  /* ── NAV：全タブ1行強制 ── */
  .site-nav {
    padding: 5px 4px;
    gap: 3px;
  }
  .nav-inner {
    flex-wrap: nowrap;
    width: 100%;
    justify-content: space-between;
  }
  .nav-item {
    padding: 6px 4px;
    font-size: clamp(9px, 2.6vw, 12px);
    white-space: nowrap;
    flex: 1;
    text-align: center;
    border-radius: 3px;
  }

  /* ── ギャラリー・出展者 ── */
  .gallery-grid { gap: 2px; }
  .gallery-item { aspect-ratio: 1 / 1; }
  .exhibitor-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 100%; }
  .exhibitor-card { padding: 8%; border-radius: 8px; display: flex; align-items: center; justify-content: center; }

  /* iOS Safari は background-attachment:fixed 非対応 */
  body, header { background-attachment: scroll; }
}