/* ================================================================
   HOSHIKAMI — 神域マップ UI
   テーマ: 神社の境内を巡る 5つの社
   対象 : page-hoshikami.php に追加する shrine-map-section
   ================================================================ */

/* ─────────────────────────────────────────────
   TOKENS（hoshikami-member.css の変数を継承 + 個別追加）
───────────────────────────────────────────── */
:root {
    /* 各社のアクセントカラー */
    --shrine-gold:    #c9a84c;   /* 神命の書  */
    --shrine-moon:    #b8cfe8;   /* 月詠の巡り */
    --shrine-violet:  #9b7fd4;   /* 神託の扉  */
    --shrine-rose:    #d4819a;   /* 魂鏡     */
    --shrine-sakura:  #e8a4b8;   /* 縁結の儀  */

    --shrine-gold-g:   rgba(201,168,76,.35);
    --shrine-moon-g:   rgba(184,207,232,.35);
    --shrine-violet-g: rgba(155,127,212,.35);
    --shrine-rose-g:   rgba(212,129,154,.35);
    --shrine-sakura-g: rgba(232,164,184,.35);
}


/* ─────────────────────────────────────────────
   セクション全体
───────────────────────────────────────────── */
.shrine-map-section {
    padding: 20px 0 0;
}

.shrine-map-eyebrow {
    font-family: var(--hk-font-sub, 'Shippori Mincho', serif);
    font-size: .68rem;
    letter-spacing: .65em;
    color: var(--hk-gold, #c9a84c);
    text-align: center;
    margin: 0 0 14px;
    opacity: .8;
}

.shrine-map-lead {
    font-family: var(--hk-font-sub, 'Shippori Mincho', serif);
    font-size: .85rem;
    letter-spacing: .18em;
    color: var(--hk-mist, #7b6d9a);
    text-align: center;
    margin: -28px 0 48px;
    line-height: 1.9;
}


/* ─────────────────────────────────────────────
   マップラッパー（絶対配置の基準）
───────────────────────────────────────────── */
.shrine-map-wrap {
    position: relative;
    width: 100%;
    height: 560px;
    overflow: hidden;
    background:
        url('../images/back_contents.jpg') center / cover no-repeat;
    border: 1px solid rgba(201,168,76,.14);
    margin-bottom: 0;
}

/* 境内の外枠装飾（二重線） */
.shrine-map-wrap::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(201,168,76,.1);
    pointer-events: none;
    z-index: 0;
}

.shrine-map-wrap::after {
    content: '';
    position: absolute;
    inset: 16px;
    border: 1px solid rgba(201,168,76,.05);
    pointer-events: none;
    z-index: 0;
}


/* ─────────────────────────────────────────────
   SVG 参道ライン（パス・灯篭）
───────────────────────────────────────────── */
.shrine-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* 参道の破線アニメーション */
.shrine-path-line {
    stroke-dasharray: 6 10;
    stroke-dashoffset: 0;
    animation: shrine-path-flow 6s linear infinite;
}

@keyframes shrine-path-flow {
    to { stroke-dashoffset: -80; }
}

/* 石のランタン（円マーカー）のパルス */
.shrine-lantern {
    animation: shrine-lantern-pulse 3s ease-in-out infinite;
}

@keyframes shrine-lantern-pulse {
    0%, 100% { opacity: .4; r: 4; }
    50%       { opacity: .9; r: 5; }
}

/* 中央の石（参拝ポイント） */
.shrine-center {
    animation: shrine-center-glow 4s ease-in-out infinite;
}

@keyframes shrine-center-glow {
    0%, 100% { opacity: .6; }
    50%       { opacity: 1; }
}


/* ─────────────────────────────────────────────
   各社 ── 社ボタン（画像ボタン）
───────────────────────────────────────────── */
.shrine-btn {
    position: absolute;
    width: 162px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 3;
    transition: transform .35s ease, filter .35s ease;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}

/* 装飾トップバー・瓦ライン — 画像ボタンでは不要のため無効化 */
.shrine-btn::before,
.shrine-btn::after {
    display: none;
}

/* ホバー・フォーカス: drop-shadow で PNG の輪郭に沿ったグロー */
.shrine-btn:hover:not([aria-expanded="true"]),
.shrine-btn:focus-visible {
    transform: translateY(-6px);
    filter: drop-shadow(0 0 10px rgba(201,168,76,.80))
            drop-shadow(0 0 22px rgba(201,168,76,.40));
    outline: none;
    z-index: 4;
}

/* 選択中（パネル展開中） */
.shrine-btn[aria-expanded="true"] {
    filter: drop-shadow(0 0 14px rgba(201,168,76,.95))
            drop-shadow(0 0 32px rgba(201,168,76,.55));
    transform: translateY(-4px);
    z-index: 4;
}

/* ── 画像本体 ── */
.shrine-btn-img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
    /* ローディング中のレイアウトずれ防止 */
    aspect-ratio: 1 / 1.3;
    object-fit: contain;
}

/* 旧テキスト要素（念のため非表示） */
.shrine-btn-icon,
.shrine-btn-label,
.shrine-btn-sub,
.shrine-icon,
.shrine-name,
.shrine-name-en {
    display: none;
}


/* ─────────────────────────────────────────────
   各社の位置 & アクセントカラー
───────────────────────────────────────────── */

/* ① 縁結の儀 — 左上 */
.shrine-enmusubi {
    left: 3%;
    top: 25%;
    --sc: var(--shrine-gold);
    --sg: var(--shrine-gold-g);
}

/* ② 月詠の巡り — 右上 */
.shrine-tsukuyomi {
    right: 3%;
    top: 25%;
    --sc: var(--shrine-moon);
    --sg: var(--shrine-moon-g);
}

/* ③ 神託の扉 — 左下 */
.shrine-shintaku {
    left: 3%;
    top: 55%;
    --sc: var(--shrine-violet);
    --sg: var(--shrine-violet-g);
}

/* ④ 魂鏡 — 右下 */
.shrine-tamakagami {
    right: 3%;
    top: 55%;
    --sc: var(--shrine-rose);
    --sg: var(--shrine-rose-g);
}

/* ⑤ 神命の書 — 中央下 */
.shrine-shinmei {
    left: 50%;
    top: 66%;
    transform: translateX(-50%);
    --sc: var(--shrine-sakura);
    --sg: var(--shrine-sakura-g);
}

/* アクティブ時: translateXを維持したままtranslateYを適用 */
.shrine-shinmei:hover:not([aria-expanded="true"]),
.shrine-shinmei:focus-visible {
    transform: translateX(-50%) translateY(-6px);
    filter: drop-shadow(0 0 10px rgba(201,168,76,.80))
            drop-shadow(0 0 22px rgba(201,168,76,.40));
}

.shrine-shinmei[aria-expanded="true"] {
    transform: translateX(-50%) translateY(-4px);
    filter: drop-shadow(0 0 14px rgba(201,168,76,.95))
            drop-shadow(0 0 32px rgba(201,168,76,.55));
}


/* ─────────────────────────────────────────────
   中央の石（参拝中心）
───────────────────────────────────────────── */
.shrine-center-stone {
    position: absolute;
    left: 50%;
    top: 36%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(201,168,76,.06);
    border: 1px solid rgba(201,168,76,.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    color: rgba(201,168,76,.6);
    z-index: 2;
    pointer-events: none;
    animation: shrine-center-glow 4s ease-in-out infinite;
}

.shrine-center-stone::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(201,168,76,.15);
}


/* ─────────────────────────────────────────────
   鳥居（入口）
───────────────────────────────────────────── */
.shrine-torii-gate {
    position: absolute;
    bottom: 3%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.2rem;
    z-index: 2;
    pointer-events: none;
    opacity: .45;
    filter: drop-shadow(0 0 10px rgba(201,168,76,.35));
    animation: shrine-torii-glow 5s ease-in-out infinite;
}

@keyframes shrine-torii-glow {
    0%, 100% { opacity: .35; filter: drop-shadow(0 0 10px rgba(201,168,76,.25)); }
    50%       { opacity: .55; filter: drop-shadow(0 0 18px rgba(201,168,76,.5)); }
}


/* ─────────────────────────────────────────────
   詳細パネル群（マップの下に展開）
───────────────────────────────────────────── */
.shrine-panels {
    position: relative;
}

/* 各パネル — デフォルト：非表示 */
.shrine-panel {
    display: none;
    opacity: 0;
    background: linear-gradient(145deg, rgba(12,16,40,.97) 0%, rgba(20,26,62,.97) 100%);
    border-left: 3px solid var(--sp-color, #c9a84c);
    border-bottom: 1px solid rgba(201,168,76,.15);
    border-right: 1px solid rgba(201,168,76,.08);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(16px);
}

/* 表示時 */
.shrine-panel.is-open {
    display: flex;
    animation: shrine-panel-in .45s ease both;
}

@keyframes shrine-panel-in {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 背景装飾 */
.shrine-panel::after {
    content: '';
    position: absolute;
    right: -60px; top: -60px;
    width: 240px; height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(var(--sp-rgb, 201,168,76),.06) 0%,
        transparent 70%);
    pointer-events: none;
}

/* 閉じるボタン */
.panel-close {
    position: absolute;
    top: 16px; right: 20px;
    width: 30px; height: 30px;
    background: transparent;
    border: 1px solid rgba(201,168,76,.25);
    color: rgba(201,168,76,.6);
    font-size: .8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .3s ease;
    z-index: 2;
    border-radius: 0;
    -webkit-appearance: none;
    line-height: 1;
}

.panel-close:hover {
    background: rgba(201,168,76,.08);
    border-color: rgba(201,168,76,.6);
    color: rgba(201,168,76,.9);
}

/* パネル内部レイアウト */
.panel-inner {
    display: flex;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* 左サイド：大きなアイコン */
.panel-icon-col {
    flex-shrink: 0;
    width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    background: linear-gradient(180deg,
        rgba(var(--sp-rgb, 201,168,76),.06) 0%,
        rgba(var(--sp-rgb, 201,168,76),.02) 100%);
    border-right: 1px solid rgba(var(--sp-rgb, 201,168,76),.12);
    min-height: 160px;
}

.panel-icon-large {
    font-size: 2.6rem;
    line-height: 1;
    filter: drop-shadow(0 0 12px var(--sp-color, #c9a84c));
    display: block;
    margin-bottom: 10px;
}

.panel-icon-num {
    font-family: var(--hk-font-sub, serif);
    font-size: .62rem;
    letter-spacing: .35em;
    color: var(--sp-color, #c9a84c);
    opacity: .6;
}

/* 右サイド：テキスト本体 */
.panel-body {
    flex: 1;
    padding: 32px 60px 32px 36px;
    min-width: 0;
}

.panel-title {
    font-family: var(--hk-font-jp, 'Noto Serif JP', serif);
    font-size: 1.35rem;
    font-weight: 400;
    letter-spacing: .15em;
    color: var(--sp-color, #c9a84c);
    margin: 0 0 4px;
    line-height: 1.4;
}

.panel-subtitle {
    font-family: var(--hk-font-sub, serif);
    font-size: .65rem;
    letter-spacing: .5em;
    color: var(--hk-mist, #7b6d9a);
    margin: 0 0 20px;
}

.panel-desc {
    font-family: var(--hk-font-sub, 'Shippori Mincho', serif);
    font-size: .88rem;
    letter-spacing: .1em;
    color: var(--hk-lavender, #c4b5e8);
    line-height: 2;
    margin: 0 0 28px;
}

/* CTAボタン */
.panel-cta {
    display: inline-block;
    padding: 12px 36px;
    border: 1px solid var(--sp-color, #c9a84c);
    background: transparent;
    color: var(--sp-color, #c9a84c);
    font-family: var(--hk-font-sub, serif);
    font-size: .82rem;
    letter-spacing: .3em;
    text-decoration: none;
    transition: background .3s ease, box-shadow .3s ease, transform .3s ease;
    position: relative;
    overflow: hidden;
}

.panel-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--sp-color, #c9a84c);
    opacity: 0;
    transition: opacity .3s;
}

.panel-cta:hover {
    color: var(--hk-void, #060810);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(var(--sp-rgb, 201,168,76),.4);
}

.panel-cta:hover::before {
    opacity: 1;
}

.panel-cta span {
    position: relative;
    z-index: 1;
}


/* ─────────────────────────────────────────────
   各パネルのカラー設定
───────────────────────────────────────────── */
/* ① 神命の書 */
#panel-shinmei {
    --sp-color: var(--shrine-gold);
    --sp-rgb: 201, 168, 76;
}

/* ② 月詠の巡り */
#panel-tsukuyomi {
    --sp-color: var(--shrine-moon);
    --sp-rgb: 184, 207, 232;
}

/* ③ 神託の扉 */
#panel-shintaku {
    --sp-color: var(--shrine-violet);
    --sp-rgb: 155, 127, 212;
}

/* ④ 魂鏡 */
#panel-tamakagami {
    --sp-color: var(--shrine-rose);
    --sp-rgb: 212, 129, 154;
}

/* ⑤ 縁結の儀 */
#panel-enmusubi {
    --sp-color: var(--shrine-sakura);
    --sp-rgb: 232, 164, 184;
}


/* ─────────────────────────────────────────────
   モバイル（タブレット以下）— PCと同じ絶対配置レイアウト
───────────────────────────────────────────── */
@media (max-width: 900px) {
    /* SP専用背景画像に切り替え（レイアウトはPCと同一） */
    .shrine-map-wrap {
        background:
            url('../images/back_contents_sp.jpg') center top / cover no-repeat;
    }

    /* ボタンを画面幅に合わせて縮小 */
    .shrine-btn {
        width: 136px;
    }
}

@media (max-width: 480px) {
    /* 極小画面向けにマップ高さ・ボタンをさらに縮小 */
    .shrine-map-wrap {
        height: 480px;
    }

    .shrine-btn {
        width: 108px;
    }

    /* ── 詳細パネル内レイアウト（スタック表示） ── */
    .panel-inner {
        flex-direction: column;
    }

    .panel-icon-col {
        width: 100%;
        min-height: auto;
        flex-direction: row;
        padding: 20px 24px;
        border-right: none;
        border-bottom: 1px solid rgba(var(--sp-rgb, 201,168,76),.12);
        gap: 16px;
    }

    .panel-icon-large {
        font-size: 2rem;
        margin-bottom: 0;
    }

    .panel-body {
        padding: 24px;
    }

    .panel-close {
        top: 12px; right: 12px;
    }
}
