/* ===================================
   ぴにょぐらむ撮影会 - Appleデザインシステム版
   =================================== */

/* リセット & 基本設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* CSS変数 - Apple Design System */
:root {
    --primary: #C67DFF;
    --accent: #FF2D55;
    --secondary: #5856D6;
    --gray-900: #000000;
    --gray-700: #2C2C2E;
    --gray-600: #3A3A3C;
    --gray-50: #F2F2F7;
    --gradient-main: linear-gradient(135deg, #C67DFF, #5856D6);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.04);
}

/* ベーススタイル */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 
                 'Helvetica Neue', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
    background: #F5F5F5;
    color: #000000;
    line-height: 1.47059;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
    text-align: center; /* 子要素の中央配置を確実にする */
}

/* ヘッダー */
header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 rgba(0,0,0,0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--gray-600);
    font-size: 14px;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.65;
}

/* メインコンテナ */
.main-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    max-width: 1400px;
    margin: 80px auto 30px auto; /* ヒーローセクションとの間隔を確保 */
    padding: 0 30px;
    position: relative; /* 重なりを防ぐ */
    text-align: left; /* メインコンテナのテキストは左寄せ */
    z-index: 1; /* ヒーローセクションより下に配置 */
    clear: both; /* フロートクリア */
}

/* 左側：イベント一覧 */
.events-section {
    background: white;
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
    position: relative; /* 位置を明確化 */
    z-index: 1; /* ヒーローセクションより下に配置 */
    margin-top: 0; /* 上部マージンを確実に0に */
}

.section-title {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0,0,0,0.06);
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    align-items: start; /* カードの高さを揃える */
}

.event-card {
    background: white;
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%; /* カードの高さを統一 */
    margin: 0 !important; /* マージンを0に設定 */
    padding: 0 !important; /* パディングを0に設定 */
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(198,125,255,0.15);
    border-color: rgba(198,125,255,0.3);
}

.event-card:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(198,125,255,0.2);
}

/* ▼ 新しいスコープ化されたメディア枠 */
.media-frame {
    position: relative;
    aspect-ratio: 40 / 21;     /* 1200x630 固定比 */
    width: 100%;
    overflow: hidden;
    margin: 0;
    line-height: 0;            /* 下の謎余白対策 */
    border-radius: 16px 16px 0 0; /* 必要に応じて調整 */
    background: #111;
    isolation: isolate;        /* スタックコンテキスト分離 */
}

/* 画像本体：切れない・余白ゼロ */
.media-frame > img {
    display: block;            /* baseline ギャップ消し */
    width: 100%;
    height: 100%;
    object-fit: contain;       /* 切れ防止（coverにしたい枠は別クラスで切替） */
    object-position: var(--pos, center);
    position: relative;
    z-index: 1;
}

/* ぼかし背景（必要な枠だけに適用） */
.media-frame.has-blur::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--bg) center/cover no-repeat;
    filter: blur(14px) saturate(0.95) brightness(0.95);
    transform: scale(1.1);
    z-index: 0;
}

/* ▼ これが "オーバーレイ帯" の正しいスコープ（グローバル .overlay は使わない） */
.media-frame > .media-overlay {
    position: absolute;
    inset: auto 0 0 0;  /* 下部にピタッと */
    padding: var(--overlay-p, 0); /* 既存があれば使う */
    line-height: normal;         /* テキストはここで管理 */
    z-index: 2;
}

/* ▼ 一時的な保険：グローバル .overlay を無効化（本番は該当CSS自体を削除） */
:root .overlay {
    position: static !important;
    inset: auto !important;
    left: auto !important; 
    right: auto !important;
    top: auto !important; 
    bottom: auto !important;
}

/* height直指定を使わない。aspect-ratioで高さを確保 */
.hero img, .hero figure { 
    height: auto !important; 
}

/* ▼ 被写体の寄せ位置（任意） */
.media-frame[data-focal="left"]   { --pos: left  center; }
.media-frame[data-focal="right"]  { --pos: right center; }
.media-frame[data-focal="top"]    { --pos: center top; }
.media-frame[data-focal="bottom"] { --pos: center bottom; }
.media-frame[data-focal="center"] { --pos: center center; }

/* 既存クラスとの互換性維持 */
.event-card-image,
.card-media,
.hero-media {
    /* .media-frame のスタイルを継承 */
    position: relative;
    aspect-ratio: 40 / 21;
    width: 100%;
    overflow: hidden;
    margin: 0;
    line-height: 0;
    border-radius: 12px 12px 0 0;
    background: #111;
    isolation: isolate;        /* スタックコンテキスト分離 */
}

.event-card-image > img,
.card-media > img,
.hero-media > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: var(--pos, center);
    position: relative;
    z-index: 1;
}

/* 既存のぼかし背景（.has-blurクラスで管理） */
.event-card-image.has-blur::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--bg) center/cover no-repeat;
    filter: blur(14px) saturate(0.95) brightness(0.95);
    transform: scale(1.1);
    z-index: 0;
}

/* 既存のオーバーレイ（段階的に .media-overlay に移行） */
.event-card-image .overlay,
.card-media .overlay,
.hero-media .overlay {
    position: absolute;
    inset: auto 0 0 0;
    margin: 0;
    line-height: normal;
    pointer-events: none;
    z-index: 2;
}

.event-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    z-index: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.badge-new {
    background: rgba(52, 199, 89, 0.9);
    color: white;
}

.badge-popular {
    background: rgba(0, 122, 255, 0.9);
    color: white;
}

.badge-limited {
    background: rgba(255, 149, 0, 0.9);
    color: white;
}

.event-content {
    padding: 20px;
    flex: 1; /* 利用可能なスペースを拡張 */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.event-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--gray-900);
    line-height: 1.3;
}

.event-info {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 8px;
    line-height: 1.4;
}

.event-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--gray-50);
    border-top: 1px solid rgba(0,0,0,0.04);
    min-height: 60px; /* 画像サイズに合わせた最小高さ */
}

.event-price {
    font-size: 19px;
    font-weight: 600;
    color: var(--primary);
}

/* 右側：カレンダー */
.calendar-section {
    position: relative; /* stickyをrelativeに変更 */
    top: 0; /* topを0に */
    height: fit-content;
    min-height: 600px; /* カレンダーセクション全体の最小高さを固定 */
    z-index: 1; /* ヒーローセクションより下に配置 */
    margin-top: 0; /* 上部マージンを確実に0に */
}

.calendar-container {
    background: white;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
    height: 560px; /* 高さを固定 */
    min-height: 560px; /* 最小高さも固定 */
    max-height: 560px; /* 最大高さも固定 */
    width: 100%; /* 幅を100%に固定 */
    box-sizing: border-box; /* ボックスサイズ計算を統一 */
    overflow: hidden; /* オーバーフローを隠す */
    display: flex;
    flex-direction: column; /* 縦方向のレイアウト */
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    height: 40px; /* ヘッダーの高さを固定 */
    min-height: 40px;
    max-height: 40px;
    flex-shrink: 0; /* ヘッダーは縮小しない */
    box-sizing: border-box;
}

.calendar-title {
    font-size: 19px;
    font-weight: 600;
    color: var(--gray-900);
}

.calendar-nav {
    display: flex;
    gap: 10px;
}

.calendar-nav button {
    background: var(--gray-50);
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.calendar-nav button:hover {
    background: rgba(198,125,255,0.1);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 80px); /* 各セル80px固定 */
    gap: 2px;
    background: rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.04);
    height: 480px; /* 固定高さ: 6行 × 80px = 480px */
    min-height: 480px; /* 最小高さも固定 */
    max-height: 480px; /* 最大高さも固定 */
    width: 100%; /* 幅を100%に固定 */
    overflow: hidden; /* オーバーフローを隠す */
    box-sizing: border-box; /* ボックスサイズ計算を統一 */
    flex-shrink: 0; /* グリッドは縮小しない */
}

.calendar-weekday {
    background: var(--gray-50);
    padding: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: var(--gray-600);
}

.calendar-day {
    background: white;
    height: 80px; /* 固定高さ */
    min-height: 80px; /* 最小高さも固定 */
    max-height: 80px; /* 最大高さも固定 */
    padding: 5px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* オーバーフローを隠す */
    box-sizing: border-box; /* ボックスサイズ計算を統一 */
    border: none; /* ボーダーを削除してサイズを安定化 */
}

.calendar-day:hover {
    background: rgba(198,125,255,0.05);
}

.calendar-day-number {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    flex-shrink: 0; /* 日付番号は縮小しない */
}

.calendar-day.other-month {
    color: var(--gray-600);
    background: var(--gray-50);
}

.calendar-day.today {
    background: rgba(255,204,0,0.2);
}

.calendar-day.has-event {
    background: rgba(198,125,255,0.08);
}

.calendar-event {
    font-size: 10px;
    background: var(--gradient-main);
    color: white;
    padding: 2px 4px;
    border-radius: 4px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0; /* イベントも縮小しない */
    height: 16px; /* 高さを固定 */
    min-height: 16px; /* 最小高さも固定 */
    max-height: 16px; /* 最大高さも固定 */
    line-height: 12px; /* 行の高さを固定 */
    box-sizing: border-box; /* ボックスサイズ計算を統一 */
}

.calendar-event.individual {
    background: linear-gradient(135deg, #34C759, #C67DFF);
}

.calendar-event.group {
    background: linear-gradient(135deg, #FF2D55, #FF9500);
}

.calendar-event.more-events {
    background: linear-gradient(135deg, #8E8E93, #AEAEB2);
    font-weight: 600;
}

/* イベントリスト */
.event-list {
    margin-top: 20px;
    background: white;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
}

.event-list-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--gray-900);
}

.event-list-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--gray-50);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.event-list-item:hover {
    background: rgba(198,125,255,0.08);
    transform: translateX(4px);
}

.event-list-item.no-events {
    background: #f8f9fa;
    color: #6c757d;
    cursor: default;
    font-style: italic;
    text-align: center;
    justify-content: center;
}

.event-list-item.no-events:hover {
    background: #f8f9fa;
    transform: none;
}

.event-list-date {
    font-size: 21px;
    font-weight: 600;
    color: var(--primary);
    margin-right: 15px;
    min-width: 40px;
    text-align: center;
}

.event-list-info {
    flex: 1;
}

.event-list-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.event-list-type {
    font-size: 12px;
    color: var(--gray-600);
}

/* カード内のボタン */
.card-actions {
    display: flex;
    gap: 8px;
    padding: 10px 15px;
    background: var(--gray-50);
    border-top: 1px solid rgba(0,0,0,0.04);
}

.btn-detail {
    flex: 1;
    padding: 8px 16px;
    background: white;
    color: var(--primary);
    text-align: center;
    text-decoration: none;
    border: 1px solid var(--primary);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
    z-index: 10; /* カードのクリックイベントより上に配置 */
}

.btn-detail:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05); /* ホバー時の拡大効果 */
}

/* 旧ヒーロー定義は削除 - 統一版に置き換え */

/* 3) ヒーロー統一版：見切れない自然サイズ＋非オーバーラップ */
:root{
  /* 画面幅ごとの"目安高さ"だけ触ればOK */
  --hero-h-sm: clamp(220px, 55vw, 350px);
  --hero-h-md: clamp(280px, 42vw, 450px);
  --hero-h-lg: clamp(320px, 38vw, 520px);
}

.hero.no-overlap{
  position: relative;
  isolation: isolate;        /* 他セクションへ侵食しない */
  overflow: clip;            /* 子要素を枠内に閉じ込める */
  margin-block: 12px clamp(16px, 4vw, 28px);
  z-index: 0;
}

/* デフォ高さ → 画面幅で切替 */
.hero.no-overlap{ --hero-h: var(--hero-h-md); }
@media (max-width: 480px){  .hero.no-overlap{ --hero-h: var(--hero-h-sm); } }
@media (min-width: 1024px){ .hero.no-overlap{ --hero-h: var(--hero-h-lg); } }

/* ヒーローは "高さ主導"。比率は無効化して切れを防ぐ */
.hero.no-overlap .media-frame{
  height: var(--hero-h);
  max-height: 46svh;         /* 画面の約半分までに抑制（好みで調整） */
  width: 100%;
  aspect-ratio: auto !important;  /* ここがポイント：比率固定を外す */
  border-radius: 16px;
  overflow: hidden;
}

/* 画像は常に全体表示（左右に余白OK） */
.hero.no-overlap .media-frame > img{
  width: 100%;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  display: block;
  vertical-align: bottom;
}

/* オーバーレイは枠内に固定 */
.hero.no-overlap .media-overlay{ inset: auto 0 0 0; }

/* fill-gradient の下地（既に定義済ならそのまま） */
.media-frame.fill-gradient::before{
  content:""; position:absolute; inset:0; z-index:0;
  background: linear-gradient(90deg, var(--c1,#1b1b1b), var(--c2,#2a2a2a));
}

/* グローバル .overlay の副作用を無効化（該当CSSを削除できない場合のみ） */
:root .overlay{
  position: static !important;
  inset: auto !important;
  left: auto !important; right: auto !important;
  top: auto !important;  bottom: auto !important;
}

.hero-media .media-overlay .hero-link {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

/* ヒーロー画像のクリック可能なスタイル */
.hero-frame .media-overlay .hero-link {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
    transition: opacity 0.2s ease;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.1); /* デバッグ用：クリック領域を可視化 */
}

.hero-frame .media-overlay .hero-link:hover {
    opacity: 0.9;
    background: rgba(0, 0, 0, 0.2); /* ホバー時の視覚的フィードバック */
}

/* インジケーター */
.hero-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid white;
}

.indicator.active {
    background: white;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 0 auto 20px auto; /* 上部マージンを削除 */
        padding: 0 20px;
    }
    
    /* ヒーロー専用モバイル設定（他セクションに影響しない） */
    .hero-section {
        margin-bottom: 60px; /* モバイルでも十分な間隔を確保 */
        z-index: 10; /* モバイルでも確実に上に配置 */
    }
    
    .main-container {
        margin-top: 0; /* モバイルでも上部マージンを確実に0に */
        z-index: 1; /* ヒーローセクションより下に配置 */
    }
    
    .events-section {
        padding: 20px;
    }
    
    .events-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .hero-container {
        padding: 0 20px;
    }
    
    .hero-band {
        aspect-ratio: 40 / 21; /* 40:21比率に統一 */
    }
    
    .hero-media {
        aspect-ratio: 40 / 21; /* 40:21比率に統一 */
    }
    
    .event-card-image {
        min-height: 150px !important; /* モバイル用の最小高さを調整 */
        max-height: 250px !important; /* 最大高さを調整 */
        height: 200px !important; /* 固定高さを調整 */
    }
}

@media (max-width: 480px) {
    .main-container {
        margin: 0 auto 15px auto; /* 上部マージンを削除 */
        padding: 0 15px;
    }
    
    /* ヒーロー専用小型スマートフォン設定（他セクションに影響しない） */
    .hero-section {
        margin-bottom: 50px; /* 小型スマートフォンでも十分な間隔を確保 */
        z-index: 10; /* 小型スマートフォンでも確実に上に配置 */
    }
    
    .main-container {
        margin-top: 0; /* 小型スマートフォンでも上部マージンを確実に0に */
        z-index: 1; /* ヒーローセクションより下に配置 */
    }
    
    .events-section {
        padding: 15px;
    }
    
    .section-title {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .hero-container {
        padding: 0 15px;
    }
    
    .hero-band {
        aspect-ratio: 40 / 21; /* 40:21比率に統一 */
    }
    
    .hero-media {
        aspect-ratio: 40 / 21; /* 40:21比率に統一 */
    }
    
    .event-card-image {
        min-height: 120px !important; /* 小さな画面用の最小高さを調整 */
        max-height: 180px !important; /* 最大高さを調整 */
        height: 150px !important; /* 固定高さを調整 */
    }
    
    .event-content {
        padding: 15px;
    }
    
    .event-title {
        font-size: 16px;
    }
    
    .hero-indicators {
        bottom: 10px;
    }
    
    .indicator {
        width: 8px;
        height: 8px;
    }
}

/* 1.9:1比率の最適化 */
@media (max-width: 1200px) {
    .hero-section {
        aspect-ratio: 1.9/1; /* 1.9:1比率を維持 */
    }
    
    .event-card-image {
        aspect-ratio: 1.9/1; /* 1.9:1比率を維持 */
    }
}

/* メインコンテナの調整 */
.main-container {
    margin-top: 40px; /* ヒーローセクションとの間隔 */
}

/* フッター */
.site-footer {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: white;
    padding: 60px 0 0;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-top {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-column {
    text-align: left;
}

.footer-column h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ff6ec7, #C67DFF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, #ff6ec7, #C67DFF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    display: inline-block;
    line-height: 1.2;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--gradient-main);
    transform: scale(1.1);
}

.social-link i {
    font-size: 20px;
    color: white;
}

.contact-info {
    color: #cbd5e0;
    line-height: 1.8;
}

.contact-info p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-info i {
    color: #ff6ec7;
    width: 16px;
    font-size: 0.9rem;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column li {
    margin-bottom: 8px;
}

.footer-column a {
    color: #cbd5e0;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.footer-column a:hover {
    color: #ff6ec7;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    color: #cbd5e0;
    font-size: 14px;
}

.contact-item i {
    color: var(--primary);
    font-size: 16px;
    width: 20px;
}

.footer-bottom {
    padding: 30px 0;
    text-align: center;
    color: #cbd5e0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}





/* レスポンシブ */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
    }
    
    .calendar-section {
        position: relative;
        top: 0;
        min-height: 450px; /* タブレット用の最小高さ */
    }
    
    .events-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 640px) {
    .nav-links {
        display: none;
    }
    
    .events-grid {
        grid-template-columns: 1fr;
    }
    
    .calendar-grid {
        font-size: 12px;
    }
    
    .calendar-day {
        height: 60px; /* モバイルでも固定サイズ */
        min-height: 60px;
        max-height: 60px;
    }
    
    .calendar-grid {
        grid-template-rows: repeat(6, 60px); /* 各セル60px固定 */
        height: 360px; /* 6行 × 60px = 360px */
        min-height: 360px;
        max-height: 360px;
    }
}

/* ===================================
ハンバーガーメニュー
=================================== */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: all 0.3s;
    display: block;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* モバイルナビゲーション */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 60px;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 60px);
        background: white;
        flex-direction: column;
        padding: 30px;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 999;
        gap: 1rem;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
}

/* ===================================
   レスポンシブデザイン - 完全版
   =================================== */

/* タブレット (1024px以下) */
@media (max-width: 1024px) {
    /* メインコンテナのレイアウト変更 */
    .main-container {
        grid-template-columns: 1fr;
        padding: 0 15px;
    }
    
    /* カレンダーを上部に配置 */
    .calendar-section {
        order: -1;
        position: relative;
        top: 0;
        margin-bottom: 30px;
        min-height: 400px; /* モバイル用の最小高さ */
    }
    
    .events-section {
        order: 1;
    }
    
    /* イベントグリッドの調整 */
    .events-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    /* ヘッダーの調整 */
    nav {
        padding: 1rem 3%;
    }
}

/* スマートフォン (768px以下) */
@media (max-width: 768px) {
    /* ヘッダー調整 */
    header {
        padding: 0;
    }
    
    nav {
        padding: 0.8rem 15px;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    /* メインコンテンツ */
    main {
        padding: 20px 15px;
        margin-top: 60px;
    }
    
    /* セクションタイトル */
    .section-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    /* イベントグリッド */
    .events-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* イベントカード */
    .event-card {
        border-radius: 12px;
    }
    
    .event-card-image {
        /* アスペクト比は16:9で統一、高さは自動調整 */
    }
    
    .event-title {
        font-size: 16px;
    }
    
    .event-price {
        font-size: 17px;
    }
    
    /* カレンダー調整 */
    .calendar-container {
        padding: 15px;
        min-height: 420px; /* モバイル用の固定高さ */
    }
    
    .calendar-title {
        font-size: 17px;
    }
    
    .calendar-grid {
        gap: 1px;
    }
    
    .calendar-day {
        height: 50px; /* 小さな画面でも固定サイズ */
        min-height: 50px;
        max-height: 50px;
        padding: 3px;
        font-size: 12px;
    }
    
    .calendar-grid {
        grid-template-rows: repeat(6, 50px); /* 各セル50px固定 */
        height: 400px; /* 6行 × 50px = 300px */
        min-height: 300px;
        max-height: 300px;
    }
    
    .calendar-weekday {
        font-size: 11px;
        padding: 5px;
    }
    
    .calendar-event {
        font-size: 9px;
        padding: 1px 2px;
    }
    
    /* イベントリスト */
    .event-list {
        padding: 15px;
    }
    
    .event-list-title {
        font-size: 16px;
    }
    
    .event-list-item {
        padding: 8px;
        margin-bottom: 6px;
    }
    
    .event-list-date {
        font-size: 18px;
        min-width: 35px;
    }
    
    .event-list-name {
        font-size: 13px;
    }
    
    /* フッター調整 */
    .site-footer {
        padding: 40px 0 0;
        margin-top: 60px;
    }
    
    .footer-container {
        padding: 0 15px;
    }
    
    .footer-top {
        grid-template-columns: 1fr;
        gap: 30px;
        padding-bottom: 30px;
    }
    

    
    .footer-logo {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }
    
    .social-links {
        margin-bottom: 20px;
    }
    
    .contact-item {
        font-size: 14px;
    }
    
    .footer-bottom {
        padding: 20px 15px;
    }
    

}

/* 小型スマートフォン (480px以下) */
@media (max-width: 480px) {
    /* ナビゲーション */
    .logo {
        font-size: 1.1rem;
    }
    
    /* メインコンテンツ */
    main {
        padding: 15px 10px;
    }
    
    /* セクション */
    .events-section,
    .calendar-container,
    .event-list {
        padding: 15px;
        border-radius: 12px;
    }
    
    .calendar-container {
        min-height: 360px; /* 小さな画面用の固定高さ */
    }
    
    /* イベントカード */
    .event-card-image {
        /* アスペクト比は16:9で統一、高さは自動調整 */
    }
    
    .event-content {
        padding: 12px;
    }
    
    .event-footer {
        padding: 8px 12px;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .card-actions {
        width: 100%;
    }
    
    .btn-detail {
        width: 100%;
        padding: 10px;
    }
    
    /* カレンダー */
    .calendar-day {
        height: 45px; /* 最小画面でも固定サイズ */
        min-height: 45px;
        max-height: 45px;
        font-size: 11px;
    }
    
    .calendar-grid {
        grid-template-rows: repeat(6, 45px); /* 各セル45px固定 */
        height: 270px; /* 6行 × 45px = 270px */
        min-height: 270px;
        max-height: 270px;
    }
    
    .calendar-day-number {
        font-size: 12px;
    }
    
    /* フッター */
    .contact-item {
        font-size: 13px;
        flex-direction: column;
        gap: 5px;
    }
    
    .contact-item i {
        margin-bottom: 5px;
    }
    

}

/* 横向き対応 */
@media (max-width: 768px) and (orientation: landscape) {
    .calendar-section {
        position: relative;
        min-height: 350px; /* 最小画面用の最小高さ */
    }
    
    .calendar-grid {
        max-height: 300px;
        overflow-y: auto;
    }
}

/* コンテナの最大幅調整 */
@media (min-width: 1440px) {
    .main-container,
    nav,
    .footer-container {
        max-width: 1400px;
    }
}

/* セーフエリア対応（iPhone X以降） */
@supports (padding: env(safe-area-inset-left)) {
    .main-container,
    nav,
    .footer-container {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }
    
    .site-footer {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ===== Media Frame 共通（既存） ===== */
.media-frame{
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 16px;
  margin: 0;
  line-height: 0;
  background: #111;
  box-sizing: border-box;
}
.media-frame.is-40x21{ aspect-ratio: 40/21; width: 100%; }

.media-frame > img{
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
  object-position: var(--pos, center);
  position: relative;
  z-index: 1;
}

.media-frame > .media-overlay{
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  line-height: normal;
  box-sizing: border-box;
}

/* 自動2色グラデ（fill-gradient 用） */
.media-frame.fill-gradient::before{
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, var(--c1,#1b1b1b), var(--c2,#2a2a2a));
}

/* ===== No-Overlap ガード（ヒーロー専用） ===== */
.hero.no-overlap{
  position: relative;
  z-index: 0;            /* ヘッダー等より下でOK */
  isolation: isolate;    /* ここで積層文脈を分離 */
  overflow: clip;        /* 子要素が枠外へ描画できない */
  margin-bottom: clamp(16px, 4vw, 28px);  /* 下のセクションとの空き */
}

/* ヒーローは必ず "全体表示"（縮小時に左右余白が出てもOK） */
.hero.no-overlap .media-frame{ aspect-ratio: 30/21; }
.hero.no-overlap .media-frame > img{
  height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
}
/* 帯UIが枠外へ出ないよう明示 */
.hero.no-overlap .media-overlay{ inset: auto 0 0 0; }

/* 旧グローバル overlay の副作用を無効化（該当CSSを削除できるなら削除推奨） */
:root .overlay{
  position: static !important;
  inset: auto !important;
  left: auto !important; right: auto !important;
  top: auto !important;  bottom: auto !important;
}

/* height 直指定との競合を回避（過去の応急処置が残っていた場合の打ち消し） */
.hero img, .hero figure{ height: auto; } /* ← 基本は auto に戻す（下で img=100% を強制） */

/* ===============================
   HERO: 調整ポイント（セクション／画像を分離）
   =============================== */

/* --- セクション側のサイズ調整（ここだけで"横幅・丸み・間隔"を変えられる） --- */
:root{
  /* デフォルト：最大幅800px（拡大）、左右はビューポート8vwまで広げる */
  --hero-max-w: 800px;
  --hero-side-vw: 8vw;            /* 余白の目安 */
  --hero-radius: 16px;            /* 角丸 */
  --hero-gap-bottom: clamp(8px, 4vw, 10px);
  /* 画像の既定比率（1200x630=40/21） */
  --hero-aspect: 40 / 21;
}

/* プリセット（幅だけ変えたい時にセクションへクラスを足す） */
.hero--sm { --hero-max-w: 640px;  --hero-side-vw: 6vw; }  /* 拡大版 */
.hero--md { --hero-max-w: 800px;  --hero-side-vw: 8vw; }  /* 拡大版 */
.hero--lg { --hero-max-w: 960px;  --hero-side-vw: 10vw; } /* 拡大版 */

/* セクション外枠：横いっぱいにしない／中央寄せ／他セクションに被らない */
.hero-shell{
  /* 確実に最大幅を適用 */
  width: var(--hero-max-w);
  max-width: var(--hero-max-w);
  margin: 12px auto var(--hero-gap-bottom) auto !important;
  isolation: isolate;     /* 積層分離 */
  overflow: clip;         /* はみ出し禁止 */
  z-index: 0;
  display: flex;          /* Flexboxで確実な中央配置 */
  justify-content: center; /* 水平中央配置 */
  align-items: center;    /* 垂直中央配置 */
  position: relative;     /* 相対位置で中央配置を確実にする */
  text-align: left;       /* ヒーロー内のテキストは左寄せ */
}

/* モバイルデバイスでのみビューポート幅を考慮 */
@media (max-width: 768px) {
  .hero-shell{
    width: min(var(--hero-max-w), 100vw - 2 * var(--hero-side-vw));
    margin: 12px auto var(--hero-gap-bottom) auto !important;
  }
}

/* --- 画像フレーム（比率追従） --- */
.hero-frame{
  position: relative;
  width: 100%;
  flex: 0 0 auto;        /* Flexbox内で適切に動作 */
  /* ★セクション自体が画像比率に追従：高さは幅から自動算出 */
  aspect-ratio: var(--hero-aspect);
  border-radius: var(--hero-radius);
  overflow: hidden;
  background: #111;
}

/* 背景（任意）：自動2色グラデ。fill-gradientを付けた時だけ出る */
.hero-frame.fill-gradient::before{
  content:"";
  position:absolute; inset:0; z-index:0;
  background: linear-gradient(90deg, var(--c1,#1b1b1b), var(--c2,#2a2a2a));
}

/* --- 画像の見せ方（セクションと独立に調整） --- */
.hero-frame>img{
  display:block;
  inline-size:100%;
  block-size:100%;
  object-fit: contain;          /* デフォルト：切れない */
  object-position: var(--hero-pos, center);
  z-index:1; position:relative;
}

/* オプション：もしベタ張りが必要な箇所だけ .img-cover を hero-frame に追加 */
.hero-frame.img-cover>img{ object-fit: cover; }

/* 被写体寄せを属性で */
.hero-frame[data-pos="left"]   { --hero-pos: left  center; }
.hero-frame[data-pos="right"]  { --hero-pos: right center; }
.hero-frame[data-pos="top"]    { --hero-pos: center top; }
.hero-frame[data-pos="bottom"] { --hero-pos: center bottom; }

/* 帯UIは枠内に固定 */
.hero-frame>.media-overlay{
  position:absolute; left:0; right:0; bottom:0; z-index:2;
  line-height:normal;
}

/* 旧グローバル .overlay が残っていた場合の保険（可能なら元CSSを削除） */
:root .overlay{
  position: static !important;
  inset: auto !important;
  left:auto !important; right:auto !important;
  top:auto !important;  bottom:auto !important;
}

/* ===============================
   画像だけ縮小するための共通フック
   =============================== */

/* 画像スケールの既定（figure に載る変数） */
.hero-frame, .media-frame { --img-scale: 1; }

/* スケール適用（画像だけ拡大/縮小。レイアウトは変えない） */
.hero-frame > img, .media-frame > img{
  transform: scale(var(--img-scale));
  transform-origin: center;
  will-change: transform;
}

/* ユーティリティ（必要な倍率だけ使う） */
.hero-frame.img-100 > img, .media-frame.img-100 > img { --img-scale: 1;   }
.hero-frame.img-110 > img, .media-frame.img-110 > img { --img-scale: 1.1; }
.hero-frame.img-120 > img, .media-frame.img-120 > img { --img-scale: 1.2; }

/* ヒーロー画像は比率維持で枠にフィット（同比率なら黒は出ない） */
.hero-frame > img{
  width: 100%;
  height: 100%;
  object-fit: contain;          /* ← 切らずにフィット */
  object-position: center;
}

/* よく使う固定スケールのユーティリティ（旧版） */
.hero-frame.img-75{ --img-scale: .75; }  /* 25%縮小（=75%表示） */
.hero-frame.img-50{ --img-scale: .5;  }  /* 50%縮小（=半分）  */
.hero-frame.img-90{ --img-scale: .9;  }  /* 10%縮小           */
.media-frame.img-75{ --img-scale: .75; }  /* 25%縮小（=75%表示） */
.media-frame.img-50{ --img-scale: .5;  }  /* 50%縮小（=半分）  */
.media-frame.img-90{ --img-scale: .9;  }  /* 10%縮小           */