@charset "UTF-8";

/* ====================================
   Variables & Base
   ==================================== */
:root {
    --bg-color: #fcfaf2;   /* 生成り色（サイト背景） */
    --menu-bg-color: #fcfaf2; /* メニュー画面の背景色（必要なら#ffffffにして区別も可） */
    --text-color: #333333; /* 墨色 */
    --accent-color: #c9171e; /* 朱色 */
    --font-base: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", sans-serif;
    --font-mincho: "Shippori Mincho", "Yu Mincho", serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-base);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.8;
    box-sizing: border-box;
    width: 100%;
}

/* メニューが開いているときはスクロールさせない */
body:has(#nav-toggle:checked) {
    overflow: hidden;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s;
}

a:hover {
    opacity: 0.7;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: bottom;
}

/* ====================================
   Header & Navigation (Logic)
   ==================================== */

/* --- ヘッダー（通常時） --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 10000; /* 最前面 */
    
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    
    box-sizing: border-box; 
    
    /* ★削除しました： overflow: hidden; */
    /* これを消すことで、高さが縮んでも中身が切り取られなくなります */
    
    color: #fff;
    transition: all 0.3s ease;
    
    /* スマホでの描画安定化 */
    transform: translateZ(0);
    
    /* 背景が透明でも文字が見えるようにする影 */
    background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 100%);
}

/* --- スクロール時の設定（ここも確認してください） --- */
.header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    color: #333333;
    height: 60px; /* ここで高さが縮みます */
    background-image: none;
}

/* ★追加：スクロール時はロゴ画像を少し小さくして、枠からはみ出さないようにする */
.header.scrolled .header-logo img {
    max-height: 40px; /* 60pxの枠に収まるサイズに */
    transition: all 0.3s ease;
}



/* スマホの時のヘッダー左右の余白 */
@media screen and (max-width: 768px) {
    .header { 
        padding: 0 15px; /* 20pxだと狭いスマホでキツい場合があるので少し減らす */
    }
}

.header-logo {
    font-family: var(--font-mincho);
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    font-weight: 600;
    position: relative;
    z-index: 1001; /* ナビ背景より上に表示 */
}

/* --- ハンバーガーボタン --- */
.nav-toggle {
    display: none;
}

.nav-btn {
    cursor: pointer;
    width: 30px;
    height: 20px;
    position: relative;
    z-index: 1001; /* ナビ背景より上に表示 */
}

.nav-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff; /* 通常時は白線 */
    position: absolute;
    transition: all 0.3s ease; /* 色と動きのアニメーション */
}

.nav-btn span:nth-child(1) { top: 0; }
.nav-btn span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.nav-btn span:nth-child(3) { bottom: 0; }


/* ====================================
   ★ここが重要：メニュー展開時の挙動
   ==================================== */

/* 
   1. ナビゲーション画面（メニュー画面）
   赤城神社のように「完全に別の画面」として表示する設定
*/
.global-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    
    /* 完全に不透明な背景色 */
    background-color: var(--menu-bg-color); 
    
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column; 

    
    /* フェードインの演出 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    
    z-index: 999; /* ヘッダー(1000)より下だが、コンテンツよりはずっと上 */
}

/* チェックが入ったらナビを表示 */
#nav-toggle:checked ~ .global-nav {
    opacity: 1;
    visibility: visible;
}


/* 
   2. メニューが開いている時のヘッダー色変更 
   透過演出をやめ、明確に「黒文字（墨色）」に変える
*/

/* ヘッダー全体（ロゴ含む）を黒にする */
body:has(#nav-toggle:checked) .header {
    color: var(--text-color);
}

/* ハンバーガーボタンの線も黒にする */
#nav-toggle:checked ~ .nav-btn span {
    background: var(--text-color);
}

/* ハンバーガーボタンの変形（×印） */
#nav-toggle:checked ~ .nav-btn span:nth-child(1) { top: 50%; transform: rotate(45deg); }
#nav-toggle:checked ~ .nav-btn span:nth-child(2) { opacity: 0; }
#nav-toggle:checked ~ .nav-btn span:nth-child(3) { top: 50%; transform: rotate(-45deg); }


/* --- ナビゲーションリストのデザイン --- */
.nav-list {
    list-style: none;
    padding: 0;
    text-align: center;
    font-family: var(--font-mincho);
}

.nav-list li {
    margin: 20px 0;
    font-size: 1.2rem;
    
    /* アニメーション用 */
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* メニュー展開時にリストを表示 */
#nav-toggle:checked ~ .global-nav .nav-list li {
    opacity: 1;
    transform: translateY(0);
}

/* 少しずつ遅れて表示させる */
#nav-toggle:checked ~ .global-nav .nav-list li:nth-child(1) { transition-delay: 0.1s; }
#nav-toggle:checked ~ .global-nav .nav-list li:nth-child(2) { transition-delay: 0.15s; }
#nav-toggle:checked ~ .global-nav .nav-list li:nth-child(3) { transition-delay: 0.2s; }
#nav-toggle:checked ~ .global-nav .nav-list li:nth-child(4) { transition-delay: 0.25s; }
#nav-toggle:checked ~ .global-nav .nav-list li:nth-child(5) { transition-delay: 0.3s; }
#nav-toggle:checked ~ .global-nav .nav-list li:nth-child(6) { transition-delay: 0.35s; }
#nav-toggle:checked ~ .global-nav .nav-list li:nth-child(7) { transition-delay: 0.4s; }
#nav-toggle:checked ~ .global-nav .nav-list li:nth-child(8) { transition-delay: 0.45s; }
#nav-toggle:checked ~ .global-nav .nav-list li:nth-child(9) { transition-delay: 0.5s; }


/* ====================================
   Content Sections (以下変更なし)
   ==================================== */

/* Hero Section */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.hero-content {
    position: relative;
    z-index: 1;
    color: #fff;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 0.5em;
    height: 60vh;
    margin-right: -10vw;
}

.hero-title {
    font-family: var(--font-mincho);
    font-size: 3rem;
    margin: 0 0 0 1rem;
    font-weight: 600;
}

.hero-catch {
    font-family: var(--font-mincho);
    font-size: 1.2rem;
    margin: 0;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: var(--font-mincho);
    letter-spacing: 0.1em;
}

.scroll-indicator .line {
    width: 1px;
    height: 60px;
    background: #fff;
    margin-top: 10px;
    animation: scrollAnim 2s infinite;
}

@keyframes scrollAnim {
    0% { transform-origin: top; transform: scaleY(0); }
    50% { transform-origin: top; transform: scaleY(1); }
    51% { transform-origin: bottom; transform: scaleY(1); }
    100% { transform-origin: bottom; transform: scaleY(0); }
}

/* Intro Section */
.intro {
    padding: 120px 0;
    background-color: var(--bg-color);
}

.vertical-layout {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    height: 400px;
    writing-mode: vertical-rl;
    display: flex;
    align-items: center;
    justify-content: center;
}

.intro-text h3 {
    font-family: var(--font-mincho);
    font-size: 1.8rem;
    letter-spacing: 0.2em;
    margin-left: 3rem;
    color: var(--accent-color);
}

.intro-text p {
    font-family: var(--font-mincho);
    font-size: 1rem;
    letter-spacing: 0.15em;
    line-height: 2.5;
}

/* Featured Section */
.featured {
    padding: 100px 5%;
    background: #fff;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

.featured-item {
    display: flex;
    align-items: center;
    margin-bottom: 120px;
    position: relative;
}

.featured-content {
    width: 45%;
    padding: 40px;
    background: var(--bg-color);
    z-index: 10;
    margin-left: -5%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.featured-img {
    width: 60%;
    margin: 0;
}

.featured-img img {
    width: 100%;
    display: block;
    filter: sepia(10%);
}

.featured-item.reverse {
    flex-direction: row-reverse;
}

.featured-item.reverse .featured-content {
    margin-left: 0;
    margin-right: -5%;
}

.en-title {
    display: block;
    font-family: var(--font-mincho);
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 10px;
    letter-spacing: 0.05em;
}

.featured-content h3 {
    font-family: var(--font-mincho);
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 20px;
}

.btn-arrow {
    display: inline-block;
    margin-top: 20px;
    border-bottom: 1px solid var(--text-color);
    padding-bottom: 5px;
    font-size: 0.9rem;
}

/* Access Section */
.access {
    padding: 80px 5%;
    background-color: #f4f4f4;
}

.access-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    align-items: center;
}

.map-area {
    height: 400px;
    background: #ddd;
}

.info-area h3 {
    font-family: var(--font-mincho);
    font-size: 1.5rem;
    margin-top: 0;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 10px;
}

.info-area address {
    font-style: normal;
    margin: 20px 0;
    line-height: 2;
}

.sub-links a {
    display: block;
    margin-top: 10px;
    text-decoration: underline;
    font-size: 0.9rem;
    color: #555;
}

.footer {
    text-align: center;
    padding: 20px;
    background: #111;
    color: #888;
    font-size: 0.8rem;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .header { padding: 0 20px; }
    
    .hero-content {
        margin-right: 0;
        height: auto;
        writing-mode: vertical-rl; 
        font-size: 0.8em;
    }

    .intro { padding: 60px 20px; }
    .vertical-layout {
        writing-mode: horizontal-tb;
        height: auto;
        display: block;
        text-align: center;
    }
    .intro-text h3 {
        margin-left: 0;
        margin-bottom: 20px;
    }

    .featured-item, 
    .featured-item.reverse {
        flex-direction: column;
        margin-bottom: 60px;
    }
    
    .featured-img { width: 100%; }
    
    .featured-content {
        width: 90%;
        margin: -40px auto 0;
        padding: 30px;
    }

    .access-grid {
        grid-template-columns: 1fr;
    }
    .map-area { height: 250px; }
}

/* ====================================
   【追記】スクロール時のヘッダー変化
   ==================================== */

/* スクロールされた状態のヘッダー（.scrolledクラスが付いた時） */
.header.scrolled {
    background-color: rgba(255, 255, 255, 0.95); /* 背景を白く（少し透けさせる） */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* 薄い影をつけて浮き上がらせる */
    color: #333333; /* 文字色を黒（墨色）に変更 */
    height: 60px; /* 少し高さをコンパクトにして邪魔にならないようにする */
    transition: all 0.3s ease; /* アニメーション */
}

/* スクロール時のハンバーガーボタンの線の色 */
.header.scrolled .nav-btn span {
    background-color: #333333; /* 線も黒くする */
}

/* ====================================
   【追記】スクロール連動フェードイン
   ==================================== */

/* 1. 初期状態：透明にして、少し下に配置 */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px); /* 30px下にずらしておく */
    transition: opacity 1s cubic-bezier(0.25, 1, 0.5, 1), transform 1s cubic-bezier(0.25, 1, 0.5, 1);
}

/* 2. 表示状態：不透明にして、元の位置に戻す */
.fade-in-up.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* （オプション）遅れて表示させたい場合用のクラス */
.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }

/* ====================================
   【追記】下層ページ（Sub Page）用スタイル
   ==================================== */

/* ページヘッダー（タイトル背景） */
.page-header {
    position: relative;
    width: 100%;
    height: 40vh; /* 画面の40%くらいの高さ */
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 60px;
    background-color: #333; /* 画像がない時の予備色 */
}

/* 背景画像（共通設定） */
.page-header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://placehold.jp/1920x600.png?text=Page+Header'); /* ここを好きな画像に変える */
    background-size: cover;
    background-position: center;
    opacity: 0.6; /* 画像を少し暗くして文字を見やすく */
}

/* ページタイトル文字 */
.page-title {
    position: relative;
    z-index: 1;
    color: #fff;
    font-family: var(--font-mincho);
    font-size: 2.5rem;
    letter-spacing: 0.2em;
    font-weight: 600;
}

/* コンテンツエリアの枠 */
.page-container {
    max-width: 800px; /* 読みやすい幅に制限 */
    margin: 0 auto 100px; /* 中央寄せ & 下に余白 */
    padding: 0 20px;
}

/* --- 記事の中身（Typography） --- */
.post-content {
    font-family: var(--font-mincho); /* 本文も明朝体で上品に */
}

/* 大見出し */
.post-content h3 {
    font-size: 1.6rem;
    margin-top: 60px;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--accent-color); /* 朱色の下線 */
    color: var(--text-color);
}

/* 小見出し */
.post-content h4 {
    font-size: 1.3rem;
    margin-top: 40px;
    margin-bottom: 20px;
    padding-left: 15px;
    border-left: 4px solid var(--text-color); /* 左に墨色の線 */
}

/* 本文 */
.post-content p {
    font-size: 1rem;
    line-height: 2; /* ゆったりとした行間 */
    margin-bottom: 30px;
    text-align: justify; /* 両端揃え */
}

/* リスト */
.post-content ul, 
.post-content ol {
    margin-bottom: 30px;
    padding-left: 20px;
    background: #f4f4f4;
    padding: 30px 30px 30px 50px; /* 箱のようなデザイン */
}

.post-content li {
    margin-bottom: 10px;
}

/* 画像 */
.post-content figure {
    margin: 40px 0;
}

.post-content figcaption {
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    margin-top: 10px;
}

/* スマホ対応 */
@media screen and (max-width: 768px) {
    .page-header { height: 30vh; }
    .page-title { font-size: 1.8rem; }
    .post-content h3 { font-size: 1.4rem; }
}

/* local.html へのリンクを含む li 要素ごと非表示にする */
li:has(a[href="local.html"]) {
    display: none;
}

/* ※念のため、単独のリンク（フッターなど）も消えるように併記 */
a[href="local.html"] {
    display: none;
}

/* ====================================
   【追加】横から＋ブラー（ぼかし）フェードイン
   ==================================== */

/* 共通：初期状態（見えない・ぼけてる） */
.fade-blur-left, 
.fade-blur-right {
    opacity: 0;
    filter: blur(15px); /* 15pxのぼかし */
    transition: 
        opacity 1.5s ease, 
        transform 1.5s cubic-bezier(0.2, 0, 0.2, 1), 
        filter 1.5s ease;
}

/* 左から出る設定 */
.fade-blur-left {
    transform: translateX(-60px); /* 左に60pxズレておく */
}

/* 右から出る設定 */
.fade-blur-right {
    transform: translateX(60px); /* 右に60pxズレておく */
}

/* 表示された時（in-viewがついた時） */
.in-view.fade-blur-left,
.in-view.fade-blur-right {
    opacity: 1;
    transform: translateX(0); /* 元の位置に戻る */
    filter: blur(0); /* ぼかしをなくす */
}

/* ====================================
   【追加】ハンバーガーメニュー内のSNSアイコン
   ==================================== */

/* SNSアイコンを囲むエリア */
.nav-sns-links {
    display: flex;
    justify-content: center; /* 中央揃え */
    gap: 30px; /* アイコン同士の間隔 */
    margin-top: 20px; /* 上のメニューとの間隔 */
}

/* SNSリンク設定 */
.nav-sns-links a {
    display: block;
    width: 24px;  /* アイコンの幅 */
    height: 24px; /* アイコンの高さ */
    color: var(--text-color); /* メニューの文字色と同じ（墨色）にする */
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* アイコン（SVG）の設定 */
.nav-sns-links svg {
    width: 100%;
    height: 100%;
    fill: currentColor; /* リンクの文字色を引き継ぐ */
}

/* ホバー時の動き */
.nav-sns-links a:hover {
    opacity: 0.6;
    transform: scale(1.1); /* 少し拡大 */
}

/* ====================================
   【修正版】祭礼紹介（イベントリスト）のデザイン
   ==================================== */

   .month-section {
    margin-bottom: 60px;
}

.month-title {
    font-family: var(--font-mincho);
    font-size: 1.6rem;
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* ここを修正：TableではなくGridを使います */
.festival-list {
    display: grid;
    grid-template-columns: 140px 1fr; /* 左側(日付)は140px固定、右側は残り全部 */
    width: 100%;
    border-top: 1px solid #ddd; /* 一番上の線 */
}

.festival-list dt, 
.festival-list dd {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    line-height: 1.8;
    margin: 0; /* 余計な隙間を消す */
}

/* 日付エリア（左側） */
.festival-list dt {
    background: #f9f9f9;
    font-weight: bold;
    color: var(--text-color);
    
    /* グリッド配置の指定（念のため） */
    grid-column: 1; 
}

/* 内容エリア（右側） */
.festival-list dd {
    /* グリッド配置の指定（念のため） */
    grid-column: 2;
}

/* 行事名は少し大きく */
.festival-list strong {
    font-size: 1.1rem;
    color: #000;
}

/* --- スマホ対応（縦並びにする） --- */
@media screen and (max-width: 768px) {
    .festival-list {
        display: block; /* グリッドを解除 */
        border-top: none;
    }
    
    .festival-list dt, 
    .festival-list dd {
        display: block;
        width: 100%;
        border-bottom: none;
    }
    
    .festival-list dt {
        background: var(--accent-color);
        color: #fff;
        padding: 8px 15px;
        margin-top: 20px; /* 前の項目の間隔 */
        border-radius: 4px;
        width: fit-content; /* 文字の長さだけ背景をつける */
    }
    
    .festival-list dd {
        padding: 10px 5px 20px; /* 左の余白を減らして読みやすく */
        border-bottom: 1px dashed #ccc; /* 点線で区切る */
    }
}

/* 月のタイトルをスクロール中に固定する（スティッキー） */
.month-title {
    position: sticky;
    
    /* 修正1: 80px → 60px に変更 */
    /* スクロール時のヘッダーの高さに合わせることで隙間をなくします */
    top: 60px; 
    
    /* 修正2: 背景色をサイトの地色(#fcfaf2)に合わせる */
    /* これで透けずに完全に馴染みます */
    background: var(--bg-color); 
    
    z-index: 10;
    
    /* 見た目の調整 */
    padding-top: 20px; /* 上に少し余白を持たせて窮屈さをなくす */
    margin-top: 0;     /* 外側の余白はなくす */
    margin-bottom: 20px;
    
    /* お好みで：ヘッダーとの境目をなじませる */
    border-bottom: 2px solid var(--accent-color); /* 下線はそのまま */
    opacity: 1; /* 不透明にする */
}

/* ====================================
   【追加】おみくじモーダル（ポップアップ）
   ==================================== */

/* 筒のデザイン（前回のものを流用・調整） */
.omikuji-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    /* ↓ Flexboxで縦並び・中央揃えにする設定 */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px; /* 筒とボタンの間隔（ここを調整すると近づけたり離したりできます） */
}

/* おみくじ筒 */
.omikuji-shaker {
    width: 100px;
    height: 160px;
    background: #c9171e;
    /* margin: 0 auto 30px;  ← 以前の余白設定は削除 */
    margin: 0; /* 余白なし（親のgapで調整するため） */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: var(--font-mincho);
    font-size: 1.5rem;
    writing-mode: vertical-rl;
    border: 3px solid #333;
    transition: transform 0.1s;
}
.shaking { animation: shake 0.5s linear infinite; }
@keyframes shake {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

/* --- モーダル（黒い背景） --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8); /* 背景を暗く */
    z-index: 9999; /* 最前面 */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* 最初は隠す */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* モーダル表示時 */
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* --- モーダルの中身（白い箱） --- */
.modal-content {
    background: #fcfaf2; /* 生成り色 */
    width: 90%;
    max-width: 500px;
    max-height: 90vh; /* 画面からはみ出さない */
    padding: 30px;
    border-radius: 8px;
    position: relative;
    text-align: center;
    overflow-y: auto; /* 縦長ならスクロール */
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

/* 閉じるボタン */
.modal-close {
    position: absolute;
    top: 15px; right: 15px;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
}

/* 画像エリア */
.modal-image-wrap {
    margin: 20px 0;
    border: 1px solid #ddd;
    background: #fff;
    padding: 10px;
}
.modal-image-wrap img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ====================================
   【追加】おみくじ結果の出現エフェクト
   ==================================== */

/* モーダルが開いた瞬間、画像にアニメーションをかける */
.modal-overlay.active .modal-image-wrap img {
    animation: divineReveal 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* アニメーションの内容：
   1. 最初は透明で、少し下にいて、白く光っている
   2. ゆっくりと元の位置に戻りながら、色がはっきりする
*/
@keyframes divineReveal {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95); /* 少し下＆少し小さい */
        filter: brightness(300%) blur(5px); /* 真っ白に光ってボケている */
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1); /* 元の位置＆サイズ */
        filter: brightness(100%) blur(0); /* くっきり表示 */
    }
}

/* ====================================
   【追加】おみくじ筒の登場エフェクト（静かな着地）
   ==================================== */

/* 筒専用のアニメーションクラス */
.shaker-entrance {
    opacity: 0;
    transform: translateY(-30px); /* 最初は少し上にいる */
    animation: softDrop 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: 0.3s; /* ページが開いて0.3秒後に動き出す */
}

@keyframes softDrop {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0); /* 定位置に着地 */
    }
}

/* ついでに、ボタンも少し遅れてフワッと出す */
.btn-entrance {
    opacity: 0;
    transform: translateY(10px);
    animation: simpleFadeUp 1s ease forwards;
    animation-delay: 0.8s; /* 筒が出た後にボタンが出る */
}

@keyframes simpleFadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* ====================================
   【修正】おみくじの揺れ（消えないようにする設定）
   ==================================== */
   .omikuji-shaker.shaking {
    /* 揺れるアニメーションを最優先で適用 */
    animation: shake 0.5s linear infinite !important;
    
    /* ★ここが重要：これがないと、揺れた瞬間に透明になって消えてしまいます */
    opacity: 1 !important;
    
    /* 位置ズレ防止（降りてきた位置に固定） */
}


/* ====================================
   【追加】御由緒ページの古図レイアウト
   ==================================== */

   .old-map-container {
    display: flex;
    align-items: flex-start; /* 上端を揃える */
    gap: 20px;
    margin-bottom: 60px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* タイトル画像（縦長） */
.map-title-img {
    flex-shrink: 0; /* 縮ませない */
    width: 60px; /* タイトルの幅 */
}

/* 地図画像（横長） */
.map-body-img {
    flex-grow: 1; /* 残りの幅いっぱい */
}

.map-caption {
    font-size: 0.9rem;
    color: #666;
    margin-top: 10px;
    text-align: right;
}


/* ====================================
   【追加】画像拡大モーダル（ライトボックス）
   ==================================== */

/* クリックできる画像のスタイル */
.zoomable-img {
    cursor: zoom-in; /* 虫眼鏡カーソルにする */
    transition: transform 0.3s ease;
}

.zoomable-img:hover {
    opacity: 0.9;
    transform: scale(1.02); /* ホバー時に少し浮く */
}

/* モーダルの背景 */
.image-modal-overlay {
    display: none; /* JSで display: flex に上書きされます */
    position: fixed;
    z-index: 99999;
    padding-top: 0; /* 50pxから0に変更（中央揃えにするため不要） */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    
    /* ★修正ポイント：レイアウト設定をここ（ベース）に移動 */
    /* これなら .show が消えてもレイアウトは崩れません */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    opacity: 0;
    transition: opacity 0.5s ease; /* 時間をJSに合わせて少しゆったりに */
}

/* 表示された時のクラス */
.image-modal-overlay.show {
    opacity: 1;
    /* ここにあった layout設定 を上に移動しました */
}

/* 拡大画像 */
.image-modal-content {
    margin: auto;
    display: block;
    width: auto;
    max-width: 90%;
    
    /* ★修正ポイント：高さを少し控えめにして、圧迫感を減らす */
    /* 変更前: max-height: 80vh; */
    max-height: 70vh; 
    
    border: 2px solid #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    animation: zoomIn 0.3s;
    
    /* ぼやけ防止（前回の設定のまま） */
    object-fit: contain; 
}

@keyframes zoomIn {
    from {transform:scale(0)} 
    to {transform:scale(1)}
}

/* キャプション */
#image-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    
    /* ★修正ポイント：高さを固定せず、文字数に合わせる */
    /* 変更前: height: 150px; */
    height: auto; 
    
    /* 少し上に隙間を空ける */
    margin-top: 10px;
    
    font-family: var(--font-mincho);
}

/* 閉じるボタン */
.image-modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.image-modal-close:hover,
.image-modal-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* ====================================
   【追加】その場でじわっと現れるブラーフェード
   （御由緒などの長文用）
   ==================================== */
   .fade-blur-static {
    opacity: 0;
    filter: blur(10px); /* 最初はボヤけている */
    transform: scale(0.98); /* ほんの少しだけ奥にある感じ */
    transition: 
        opacity 1.5s ease, 
        filter 1.5s ease, 
        transform 1.5s ease;
}

/* 表示された時 */
.in-view.fade-blur-static {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
}

/* ====================================
   【追加】トップタイトルのフォント変更
   ==================================== */
   .hero-title {
    /* 筆文字フォントを指定 */
    font-family: "Yuji Syuku", serif;
    
    /* 筆文字は少し小さく見えがちなので、サイズを調整 */
    font-size: 4rem; /* 元が3remなら少し大きく */
    
    /* 文字間を少し広げると風格が出ます */
    letter-spacing: 0.2em;
    
    /* 縦書きの微調整（必要であれば） */
    line-height: 1.4;
}

/* スマホでのサイズ調整 */
@media screen and (max-width: 768px) {
    .hero-title {
        font-size: 3rem;
    }
}

/* タイトルの「冠（かんむり）」部分のデザイン */
.title-prefix {
    font-size: 0.5em; /* メインの文字の半分の大きさ */
    display: block;   /* 改行扱いにする */
    margin-left: 0.5em; /* 縦書きなので、少し左（または上）にずらす調整 */
    opacity: 0.9;     /* 少しだけ色を抑える */
}

/* ====================================
   【修正完了】ご挨拶文：静寂のフェードイン（わびさび演出）
   ==================================== */

/* 1. 動きの質（じわ〜っと出す基本設定） */
.intro-text .fade-in-up {
    transform: translateY(10px); 
    filter: blur(5px); 
    /* ここでは transition を設定しますが、遅延(delay)は0sになります */
    transition: opacity 2.5s ease, transform 2.5s ease, filter 2.5s ease;
}

/* 表示された時の状態 */
.intro-text .fade-in-up.in-view {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* 2. 出てくる間隔（ディレイ）を「強く」指定する */
/* .intro-text を前につけることで、基本設定よりも優先させます */

/* 見出し（赤文字） */
.intro-text h3.fade-in-up { transition-delay: 0.2s; }

/* 本文の遅延設定 */
.intro-text .delay-1 { transition-delay: 0.2s; } /* 四季の花、 */
.intro-text .delay-2 { transition-delay: 0.4s; } /* 春は... */
.intro-text .delay-3 { transition-delay: 0.6s; } /* 夏は... */
.intro-text .delay-4 { transition-delay: 0.8s; } /* 秋は... */
.intro-text .delay-5 { transition-delay: 1.0s; } /* 冬は... */
.intro-text .delay-6 { transition-delay: 1.2s; } /* 最後のまとめ */

/* 行間の調整 */
.intro-text p {
    margin: 0 0 0 0.8em;
    line-height: 1.8;
}
.intro-text p:last-child {
    margin-right: 1.5em;
}

/* ====================================
   【追加】お守り一覧ページのデザイン
   ==================================== */

   .charm-section {
    margin-bottom: 80px;
}

/* 価格の見出し（和風なラインを入れる） */
.charm-price-label {
    font-family: var(--font-mincho);
    font-size: 1.4rem;
    color: var(--text-color);
    border-bottom: 1px solid #ddd;
    border-top: 1px solid #ddd;
    padding: 15px 0;
    margin-bottom: 40px;
    text-align: center;
    letter-spacing: 0.1em;
}

/* お守りを並べるグリッド（重要） */
.charm-grid {
    display: grid;
    /* 最小幅180pxで、入るだけ横に並べる（レスポンシブ対応） */
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 40px 20px; /* 縦の間隔40px、横の間隔20px */
}

/* お守りカード単体 */
.charm-item {
    text-align: center;
    transition: transform 0.3s ease;
}

/* ホバー時に少し浮く */
.charm-item:hover {
    transform: translateY(-5px);
}

/* 画像枠 */
.charm-img-wrap {
    width: 100%;
    aspect-ratio: 3 / 4; /* 縦長（お守りサイズ）に固定 */
    background-color: #f0f0f0;
    margin-bottom: 15px;
    overflow: hidden;
    border: 1px solid #eee;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); /* うっすら影 */
}

.charm-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 枠いっぱいにトリミングして表示 */
    transition: transform 0.5s ease;
}

/* ホバー時に画像が少しズーム */
.charm-item:hover .charm-img-wrap img {
    transform: scale(1.05);
}

/* お守り名 */
.charm-name {
    font-family: var(--font-mincho);
    font-size: 1rem;
    margin: 0;
    line-height: 1.4;
}

/* スマホ対応 */
@media screen and (max-width: 600px) {
    .charm-grid {
        /* スマホでは2列にする（1列だと長くなりすぎるため） */
        grid-template-columns: repeat(2, 1fr); 
        gap: 30px 15px;
    }
    
    .charm-price-label {
        font-size: 1.2rem;
    }
}

/* 価格の見出し（スクロール追従・固定） */
.charm-price-label {
    font-family: var(--font-mincho);
    font-size: 1.4rem;
    color: var(--text-color);
    
    /* ↓↓↓ ここから追加・変更 ↓↓↓ */
    position: sticky;
    top: 60px; /* ヘッダーの高さ分あける */
    background-color: var(--bg-color); /* 背景色をつけて透けないようにする */
    z-index: 10; /* 画像より手前にする */
    margin-top: 0;
    padding: 20px 0; /* 上下の余白 */
    border-bottom: 2px solid var(--accent-color); /* 線を少し太く */
    border-top: none; /* 上の線は邪魔になるので消す */
    box-shadow: 0 5px 10px rgba(0,0,0,0.02); /* うっすら影を落とす */
    /* ↑↑↑ ここまで ↑↑↑ */
    
    margin-bottom: 40px;
    text-align: center;
    letter-spacing: 0.1em;
}

/* ====================================
   【追加】お問い合わせフォームのデザイン
   ==================================== */

   .contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.form-group {
    margin-bottom: 30px;
}

/* ラベル（項目名） */
.form-group label {
    display: block;
    font-family: var(--font-mincho);
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

/* 必須マーク */
.required {
    background: #c9171e;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    margin-left: 8px;
    vertical-align: middle;
    border-radius: 2px;
}

/* 入力エリア（共通） */
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    border: 1px solid #ccc;
    background: #fcfaf2; /* 生成り色 */
    border-radius: 0;
    font-family: var(--font-base);
    transition: border-color 0.3s;
    
    /* スマホなどでデフォルトの見た目をリセット */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}
/* プルダウンの矢印を自作する（和風に見せるため） */
.select-wrap {
    position: relative;
}

.select-wrap::after {
    content: "▼";
    font-size: 0.8rem;
    color: var(--accent-color);
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none; /* 矢印をクリックしても下のセレクトボックスが反応するように */
}

/* フォーカス時の色 */
.contact-form select:focus {
    outline: none;
    border-color: var(--accent-color);
    background: #fff;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color); /* フォーカス時に朱色に */
    background: #fff;
}

/* 送信ボタン */
.form-btn-area {
    text-align: center;
    margin-top: 40px;
}

.btn-submit {
    background: #333;
    color: #fff;
    border: none;
    padding: 15px 60px;
    font-size: 1.2rem;
    font-family: var(--font-mincho);
    cursor: pointer;
    transition: 0.3s;
    letter-spacing: 0.2em;
}

.btn-submit:hover {
    background: var(--accent-color);
}

/* 送信完了画面の中央寄せ */
.contact-success {
    text-align: center;       /* テキストを中央に */
    margin: 50px auto;        /* 上下50px、左右自動（これでブロック自体が真ん中に来る） */
    max-width: 600px;         /* 幅を制限 */
    width: 100%;
    display: flex;            /* フレックスボックス化 */
    flex-direction: column;   /* 縦並び */
    align-items: center;      /* アイテムを中央揃え */
    justify-content: center;
}

.contact-success h3 {
    margin-top: 0;
    margin-bottom: 30px;
    color: var(--accent-color);
}

.contact-success p {
    text-align: center;       /* 文章も中央揃え */
    margin-bottom: 40px;
    line-height: 2;
}

/* スマホ対応 */
@media screen and (max-width: 600px) {
    .contact-form {
        padding: 20px;
        background: transparent; /* スマホでは箱感をなくしてシンプルに */
        box-shadow: none;
        border: none;
    }
}

/* ====================================
   【追加】お問い合わせボタン（ページ上部用）
   ==================================== */
   .contact-btn-area {
    text-align: center;
    margin: 40px 0 60px; /* 上下の余白 */
}

.btn-contact {
    display: inline-block;
    background-color: #333; /* 墨色 */
    color: #fff;
    padding: 15px 50px;
    text-decoration: none;
    font-family: var(--font-mincho);
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    border-radius: 2px; /* 少しだけ角を丸める */
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn-contact:hover {
    background-color: var(--accent-color); /* ホバー時は朱色に */
    opacity: 1; /* 透明度は変えない */
    transform: translateY(-3px); /* 少し浮く */
    color: #fff;
}

/* ====================================
   【修正】ヘッダーロゴ（画像対応版）
   ==================================== */

/* ロゴ画像のサイズ調整 */
.header-logo img {
    height: 50px; /* ヘッダーの高さ(80px)に収まるサイズに */
    width: auto;  /* 横幅は自動 */
    vertical-align: middle; /* 上下中央揃え */
    transition: filter 0.3s ease; /* 色変化のアニメーション */
}

/* スマホでは少し小さくする */
/* スマホでは少し小さくし、幅も制限する */
@media screen and (max-width: 768px) {
    .header-logo img {
        height: 36px;       /* 高さはそのまま */
        width: auto;        /* 幅はなりゆき */
        max-width: 200px;   /* ★追加：これ以上横に広がらないように制限 */
        object-fit: contain; /* 念のため */
    }
    
    /* ロゴの入れ物（h1）の余計な余白を消す */
    .header-logo {
        margin: 0;
        padding: 0;
    }
}

/* 
   ★重要：ロゴの色の自動調整 
   画像ロゴが「白」や「明るい色」の場合、
   背景が白くなった時（スクロール時・メニュー展開時）に見えなくなります。
   以下の設定で、自動的に黒く（暗く）変化させます。
*/

/* 1. スクロールしてヘッダーが白くなった時 */
.header.scrolled .header-logo img {
    /* 画像の色を反転（白→黒）、または真っ黒にする */
    filter: invert(1) brightness(0); 
}

/* 2. ハンバーガーメニューが開いた時 */
body:has(#nav-toggle:checked) .header-logo img {
    /* こちらも黒くする */
    filter: invert(1) brightness(0); 
}

/* ====================================
   【修正】フッターの文字サイズ
   ==================================== */
   .footer small {
    font-size: 1rem; /* 標準サイズに戻す（約16px） */
    
    /* もっと大きくしたい場合は 1.2rem などに上げてください */
    /* font-size: 1.2rem; */
}

/* ====================================
   【追加】個人情報保護方針（アコーディオン）
   ==================================== */
   .privacy-policy-area {
    max-width: 600px;
    margin: 30px auto 0;
    font-size: 0.9rem;
    color: var(--text-color);
}

.privacy-policy-area details {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s;
}

.privacy-policy-area summary {
    padding: 15px;
    cursor: pointer;
    font-weight: bold;
    list-style: none; /* デフォルトの三角を消す */
    position: relative;
    outline: none;
}

/* 独自の矢印をつける */
.privacy-policy-area summary::after {
    content: "+";
    position: absolute;
    right: 20px;
    color: var(--accent-color);
    font-size: 1.2rem;
    transition: transform 0.3s;
}

/* 開いた時の矢印の変化 */
.privacy-policy-area details[open] summary::after {
    transform: rotate(45deg); /* ×印にする */
}

/* 開いた中身 */
.policy-content {
    padding: 0 20px 20px;
    border-top: 1px solid #eee;
    line-height: 1.8;
}

.policy-content h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1rem;
    border-left: 3px solid var(--accent-color);
    padding-left: 10px;
}

.policy-content ul {
    margin: 10px 0 20px;
    padding-left: 20px;
    background: none; /* 既存のリスト背景を消す */
}

/* ====================================
   【追加】トップページ：御朱印セクション（修正版）
   ==================================== */
   .goshuin-area {
    padding: 80px 5%;
    background-color: #fff; /* 背景は白ですっきり */
}

.goshuin-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px; /* 文字と画像の間隔 */
    max-width: 900px;
    margin: 0 auto;
    
    /* 和風な枠線で囲む */
    border: 1px solid #eee;
    padding: 40px;
    background-color: var(--bg-color); /* 生成り色 */
}

/* 文字エリア（縦書き・基本設定） */
.goshuin-text {
    writing-mode: vertical-rl;
    text-orientation: upright;
    
    /* ★ここが重要：高さを自動にし、行を中央揃えにする */
    height: auto; 
    text-align: center; 
    
    margin: 0;
}

.goshuin-text h3 {
    font-family: var(--font-mincho);
    font-size: 1.8rem;
    letter-spacing: 0.2em;
    color: var(--accent-color);
    
    /* マージン調整（左＝次の行との間隔だけ確保） */
    margin: 0 0 0 30px; 
}

.goshuin-text p {
    font-family: var(--font-mincho);
    font-size: 1rem;
    line-height: 2.2;
    color: var(--text-color);
    margin: 0;
}

/* 画像エリア */
.goshuin-img {
    margin: 0;
    width: 300px; /* 画像の幅 */
    box-shadow: 5px 10px 20px rgba(0,0,0,0.1); /* 影をつけて浮かせる */
    transition: transform 0.3s ease;
}

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

/* ホバー時に少し動く */
.goshuin-content:hover .goshuin-img {
    transform: scale(1.02) rotate(1deg); /* 少し拡大して傾く */
}

/* --- スマホ対応 --- */
@media screen and (max-width: 768px) {
    .goshuin-content {
        flex-direction: column-reverse; /* スマホでは画像を上に、文字を下に */
        gap: 30px;
        padding: 30px 20px;
    }
    
    .goshuin-text {
        writing-mode: horizontal-tb; /* スマホでは横書きに戻す */
        width: 100%;
        text-align: center; /* 横書きでも中央揃え */
    }
    
    .goshuin-text h3 {
        margin: 0 0 20px 0; /* 下に余白 */
        display: inline-block;
        border-bottom: 2px solid var(--accent-color);
    }
    
    .goshuin-img {
        width: 100%;
        max-width: 250px;
    }
}

/* ====================================
   【追加】御朱印セクションの「ゆっくり」設定
   （ご挨拶エリアと同じ速度・質感にします）
   ==================================== */

/* 1. 下から出る動き（枠・文字）をゆっくりにする */
.goshuin-area .fade-in-up {
    transition: opacity 2.5s ease, transform 2.5s ease, filter 2.5s ease;
    filter: blur(5px); 
}

.goshuin-area .fade-in-up.in-view {
    filter: blur(0);
}

/* 2. 右から出る動き（画像）もゆっくりにする */
.goshuin-area .fade-blur-right {
    transition: opacity 2.5s ease, transform 2.5s cubic-bezier(0.2, 0, 0.2, 1), filter 2.5s ease;
}

/* 3. 待ち時間（ディレイ）の調整 */
.goshuin-area .delay-1 { transition-delay: 0.5s; } /* 文字 */
.goshuin-area .delay-2 { transition-delay: 1.0s; } /* 画像 */