/**
 * NARITA TIME — 店舗マップ 世界基準化アドオン（map-page.css の後に読み込む）
 *
 * 設計書 6.5 の ①〜⑤ を再構築。既存 map-page.css / shop-discovery.js のロジックは
 * 壊さず、見た目と演出だけを世界基準へ引き上げる（重ねるだけ）。
 *   ① 絵文字→SVGアイコン（mask不要・inline SVG / currentColor で3色追従）
 *   ② マーカーのホバー強化（内側要素のみ変形＝Leaflet の位置transformと非干渉）
 *   ③ リスト⇄ピン 相互ハイライト（.is-selected / .is-active）
 *   ④ 地図タイル彩度調整（やりすぎ厳禁）
 *   ⑤ ピン初回登場（JSが marker-pane を1度だけフェード）
 * 品を保つ上限：定常は穏やか、登場は初回1回。reduced-motion で全停止。
 *
 * @package naritatime
 */

/* ============================================================
   ① 絵文字 → SVG アイコン（currentColor で3色に追従）
   ============================================================ */
.ntm-ic { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.ntm-map-search-icon svg { color: var(--ntm-slate-soft); }
.ntm-map-locate-btn svg { vertical-align: -3px; margin-right: .35em; }
.ntm-map-empty-notice-icon svg { color: var(--ntm-terracotta); }
.ntm-map-list-divider-label svg { color: var(--ntm-slate); margin-right: .3em; vertical-align: -2px; }

/* ============================================================
   ④ 地図タイルの彩度調整（完全に3色世界へ・やりすぎない）
   ============================================================ */
.ntm-map-stage .leaflet-tile-pane { filter: saturate(.82) brightness(1.02); }

/* ============================================================
   ② マーカーのホバー強化（掲載店ピンは常時静か → ホバーで浮き上がり）
      ※ Leaflet が .leaflet-marker-icon に位置 transform を当てるため、
        変形は必ず「内側の svg / .ntm-action-marker」にのみ適用する。
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
    .ntm-map-marker:not(.ntm-map-marker--action) > svg,
    .ntm-action-marker {
        transition: transform .3s var(--ntm-ease-out);
        transform-origin: center bottom;
    }
    .ntm-map-marker:not(.ntm-map-marker--action):hover > svg,
    .ntm-map-marker--action:hover .ntm-action-marker {
        transform: scale(1.12) translateY(-4px);
    }
}

/* ============================================================
   ③ リスト⇄ピン 相互ハイライト
   ============================================================ */
/* 選択中ピン：テラコッタの脈動リング（操作時のみ） */
.ntm-map-marker.is-selected { z-index: 1000 !important; }
.ntm-map-marker.is-selected::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 34%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 2px solid var(--ntm-terracotta);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
    .ntm-map-marker.is-selected::after { animation: ntmMapSelRing 1.4s var(--ntm-ease-out) infinite; }
}
@media (prefers-reduced-motion: reduce) {
    .ntm-map-marker.is-selected::after { opacity: .9; transform: scale(1.3); }
}
@keyframes ntmMapSelRing {
    0%   { transform: scale(.55); opacity: .9; }
    100% { transform: scale(1.9); opacity: 0; }
}

/* ピン hover で対応するリスト行（テラコッタ縦ライン＝Facts と同思想） */
.ntm-map-list-item.is-active {
    background: var(--ntm-paper);
    box-shadow: inset 3px 0 0 var(--ntm-terracotta);
}

/* ============================================================
   ⑤ ピン初回登場（JS が .leaflet-marker-pane の opacity を1度だけ操作。
      reduced-motion 時は JS 側でスキップ。ここではトランジションの保険）
   ============================================================ */
/* ============================================================
   ★ ド派手：全幅シネマティック・ヒーロー（成田の真骨頂）
   ============================================================ */
.ntm-map-hero {
    position: relative;
    min-height: clamp(360px, 52vh, 560px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
    background: var(--ntm-indigo-deep);
}
.ntm-map-hero-bg {
    position: absolute;
    inset: -6% 0;
    background-size: cover;
    background-position: center;
    filter: saturate(.9) brightness(.62);
    animation: ntmMapHeroKB 18s ease-out forwards;
}
@keyframes ntmMapHeroKB { from { transform: scale(1.08); } to { transform: scale(1); } }
.ntm-map-hero-ov {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(19, 27, 46, .45), rgba(19, 27, 46, .35) 45%, rgba(19, 27, 46, .72));
}
.ntm-map-hero-in { position: relative; z-index: 2; color: #fff; padding: 0 var(--ntm-padding-pc); }
.ntm-map-hero-eyebrow {
    font-family: var(--ntm-font-en-italic);
    font-style: italic;
    font-size: 1rem;
    letter-spacing: .4em;
    text-transform: uppercase;
    color: var(--ntm-sand);
}
.ntm-map-hero-title {
    font-family: var(--ntm-font-serif);
    font-weight: 700;
    font-size: clamp(2rem, 5.5vw, 3.6rem);
    line-height: 1.4;
    letter-spacing: .06em;
    color: #fff; /* :where(h1..h6) の indigo を上書き */
    margin: 1rem 0 .8rem;
    text-shadow: 0 2px 40px rgba(0, 0, 0, .45);
}
.ntm-map-hero-sub {
    font-family: var(--ntm-font-serif);
    font-size: clamp(.95rem, 1.7vw, 1.15rem);
    line-height: 1.95;
    color: rgba(255, 255, 255, .9) !important; /* body.ntm-theme p の墨黒を上書き */
    text-shadow: 0 1px 20px rgba(0, 0, 0, .5);
}
.ntm-map-hero-scroll {
    display: block;
    width: 1px;
    height: 46px;
    margin: 1.8rem auto 0;
    background: linear-gradient(180deg, #fff, transparent);
    position: relative;
    overflow: hidden;
}
.ntm-map-hero-scroll::after {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 40%;
    background: var(--ntm-terracotta);
    animation: ntmMapScrollDot 2.2s infinite cubic-bezier(.7, 0, .3, 1);
}
@keyframes ntmMapScrollDot { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(230%); } }

/* ★ ド派手：企画開催中ピン（成田の主役）をより強く灯す */
.ntm-action-marker-svg {
    filter: drop-shadow(0 0 8px rgba(194, 83, 58, .7)) drop-shadow(0 0 3px rgba(232, 181, 71, .85));
}

@media (prefers-reduced-motion: reduce) {
    .ntm-map-stage .leaflet-marker-pane { opacity: 1 !important; transition: none !important; }
    .ntm-map-hero-bg { animation: none; transform: none; }
    .ntm-map-hero-scroll::after { animation: none; }
}
