/* Area map: an interactive SVG map of hotels, lifts and stations (used on /hakuba/hotels).
   Tokens only. Markup: section.am > .am__layout[data-area-map] > figure.am__map + aside.am__key.
   Behaviour in area-map.js. */

.am { padding: 56px var(--gutter) 64px; background: var(--paper-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.am__inner { max-width: var(--site-w); margin: 0 auto; }
.am__layout {
  display: grid; grid-template-columns: minmax(0, 700px) minmax(0, 330px);
  gap: 40px; justify-content: center; align-items: start; margin-top: 28px;
}
.am__map { margin: 0; position: relative; }
.am__scroll { border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--rule-2); background: var(--paper); }
.am__hint { display: none; }

/* ---- the SVG ---- */
.am-svg { display: block; width: 100%; height: auto; font-family: var(--sans); -webkit-user-select: none; user-select: none; }
.am-ground { fill: var(--paper); }
.am-hill { mix-blend-mode: multiply; opacity: .3; }
.am-ski { fill: var(--accent-soft); opacity: .9; }
.am-ski-edge { fill: none; stroke: var(--accent); stroke-opacity: .28; stroke-width: .8; stroke-dasharray: 3 2.5; }
.am-cont { fill: none; stroke: var(--ink-3); stroke-opacity: .16; stroke-width: .45; }
.am-cont--index { stroke-opacity: .3; stroke-width: .7; }
.am-river { fill: none; stroke: var(--winter); stroke-opacity: .55; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }
.am-river--main { stroke-width: 2.2; stroke-opacity: .5; }
.am-road { fill: none; stroke: var(--ink-4); stroke-opacity: .75; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.am-road--minor { stroke-opacity: .45; stroke-width: .55; }
.am-rail { fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linejoin: round; }
.am-rail-dash { fill: none; stroke: var(--paper); stroke-width: 1.8; stroke-dasharray: 6 6; stroke-linejoin: round; }

.am-lift__line { fill: none; stroke: var(--ink-2); stroke-width: .9; stroke-linecap: round; }
.am-lift--gondola .am-lift__line { stroke: var(--ink); stroke-width: 1.7; }
.am-lift__hit { fill: none; stroke: transparent; stroke-width: 10; stroke-linecap: round; pointer-events: stroke; }
.am-lift { cursor: default; outline: none; }
.am-lift:hover .am-lift__line, .am-lift:focus-visible .am-lift__line, .am-lift.is-tip .am-lift__line { stroke: var(--accent); stroke-width: 2.2; }

.am-sta { fill: var(--paper); stroke: var(--ink); stroke-width: 1.4; }
.am-sta--main { stroke-width: 2; }
.am-sta__in { fill: var(--ink); }
.am-bus { fill: var(--ink); }
.am-bus__glyph { stroke: var(--paper); stroke-width: 1.4; stroke-linecap: round; }

/* type: paper halo so labels read over lines and shading */
.am-labels text, .am-t-sta, .am-t-bus, .am-north text, .am-scale text, .am-credit {
  paint-order: stroke; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round;
}
.am-t-area { font-family: var(--serif); font-style: italic; font-size: 15px; fill: var(--accent-ink); letter-spacing: .01em; }
.am-t-ja { font-family: var(--jp); font-style: normal; font-size: 9.5px; fill: var(--ink-3); letter-spacing: .12em; }
:lang(zh) .am-t-area, :lang(zh) .am-t-river { font-family: var(--jp); font-style: normal; }
:lang(zh) .am-t-place { letter-spacing: .3em; }
.am-t-place { font-size: 8.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; fill: var(--ink-3); }
.am-t-river { font-family: var(--serif); font-style: italic; font-size: 10px; fill: var(--winter); }
.am-t-sta { font-size: 9px; font-weight: 500; fill: var(--ink-2); }
.am-t-sta--main { font-size: 11px; font-weight: 600; fill: var(--ink); }
.am-t-bus { font-size: 9px; font-weight: 600; fill: var(--ink); }
.am-north path { fill: var(--ink); }
.am-north text { font-size: 9px; font-weight: 600; fill: var(--ink); letter-spacing: .1em; }
.am-scale__a { fill: var(--ink); }
.am-scale__b { fill: var(--paper); stroke: var(--ink); stroke-width: .8; }
.am-scale text { font-family: var(--mono); font-size: 8.5px; fill: var(--ink-2); }
.am-credit { font-size: 7.5px; fill: var(--ink-3); }
.am-frame { fill: none; stroke: var(--ink); stroke-opacity: .12; }

/* pins */
.am-pin { cursor: pointer; outline: none; }
.am-pin__dot { fill: var(--accent); stroke: var(--paper); stroke-width: 2; }
.am-pin__ring { fill: none; stroke: var(--accent); stroke-width: 2; opacity: 0; }
.am-pin__no { font-family: var(--mono); font-size: 10px; font-weight: 500; fill: var(--surface); pointer-events: none; }
.am-pin__spot { fill: var(--accent-ink); }
.am-pin__leader { stroke: var(--accent-ink); stroke-width: .9; stroke-opacity: .7; }
.am-pin:hover .am-pin__dot, .am-pin.is-hot .am-pin__dot, .am-pin.is-open .am-pin__dot { fill: var(--accent-ink); }
.am-pin:focus-visible .am-pin__ring, .am-pin.is-hot .am-pin__ring, .am-pin.is-open .am-pin__ring { opacity: 1; }
.am-pin--info:hover .am-sta--main, .am-pin--info.is-open .am-sta--main { fill: var(--accent-soft); stroke: var(--accent); }
.am-pin--info:hover .am-bus, .am-pin--info.is-open .am-bus,
.am-pin--info:focus-visible .am-bus { fill: var(--accent); }
.am-pin--info:focus-visible .am-sta--main { stroke: var(--accent); stroke-width: 3; }

/* ---- key beside the map ---- */
.am__key { font-size: 14px; }
.am__key-group + .am__key-group { margin-top: 18px; }
.am__key-head {
  font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--rule);
}
.am__key ol { list-style: none; margin: 0; padding: 0; }
.am__key li a {
  display: flex; align-items: center; gap: 10px; padding: 5px 0; min-height: 30px;
  color: var(--ink); text-decoration: none; line-height: 1.3;
}
.am__key li a:hover { color: var(--accent); }
.am__key li a:hover .am-badge, .am__key li a.is-hot .am-badge { background: var(--accent-ink); }
.am__legend { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--rule); display: grid; gap: 7px; font-size: 12.5px; color: var(--ink-3); }
.am__legend span { display: flex; align-items: center; gap: 10px; }
.am__legend svg { flex: none; width: 26px; height: 14px; overflow: visible; }

/* the number on the map, on each card and in the key */
.am-badge {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--accent); color: var(--surface);
  font-family: var(--mono); font-size: 11px; font-weight: 500; line-height: 1; text-decoration: none;
  vertical-align: 1px;
}
a.am-badge:hover { background: var(--accent-ink); }
.hp-card__loc .am-badge, .tb-pick__eyebrow .am-badge { margin-right: 8px; letter-spacing: 0; }

/* ---- popover (desktop) / bottom sheet (phone) ---- */
.am-pop {
  position: absolute; z-index: 60; width: 300px;
  background: var(--surface); border: 1px solid var(--rule-2); border-radius: var(--r-card);
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.35);
  overflow: hidden; font-size: 13.5px; color: var(--ink-2);
  opacity: 0; transform: translateY(4px); transition: opacity .16s ease, transform .16s ease;
}
.am-pop.is-in { opacity: 1; transform: none; }
.am-pop[hidden] { display: none; }
.am-pop__media { height: 132px; background: var(--paper-3) center / cover no-repeat; position: relative; }
.am-pop__media .am-badge { position: absolute; left: 12px; top: 12px; }
.am-pop__body { padding: 14px 16px 16px; }
.am-pop__eyebrow { font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.am-pop__name { font-size: 17px; font-weight: 500; color: var(--ink); margin: 4px 0 0; line-height: 1.25; letter-spacing: -.01em; }
.am-pop__name em { display: block; font-style: normal; font-family: var(--jp); font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.am-pop__loc { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.am-pop__copy { margin: 8px 0 0; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.am-pop__copy strong { color: var(--ink); }
.am-pop__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rule); }
.am-pop__price { font-family: var(--mono); font-size: 14px; color: var(--ink); }
.am-pop__price small { font-size: 11px; color: var(--ink-3); }
.am-pop__from { display: block; font-family: var(--sans); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.am-pop__cta { white-space: nowrap; }
.am-pop__close {
  position: absolute; right: 8px; top: 8px; z-index: 1; width: 32px; height: 32px; border-radius: 16px;
  border: 0; background: var(--surface); color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.18); display: none;
}
.am-pop--info .am-pop__body { padding-top: 16px; }
.am-pop--info h3 { font-size: 17px; font-weight: 500; color: var(--ink); margin: 4px 0 8px; letter-spacing: -.01em; }
.am-pop--info p { margin: 0 0 8px; line-height: 1.55; }
.am-pop--info p strong { color: var(--ink); }
.am-pop--info .am-pop__links { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 12px; }
.am-pop--info .am-pop__more { font-size: 12.5px; color: var(--accent); }
.am-pop--info .am-pop__note { font-size: 12px; color: var(--ink-3); }

.am-tip {
  position: absolute; z-index: 61; pointer-events: none; max-width: 260px;
  background: var(--ink); color: var(--paper); font-size: 12px; line-height: 1.35;
  padding: 6px 9px; border-radius: 6px; opacity: 0; transition: opacity .12s ease;
}
.am-tip.is-in { opacity: 1; }

@media (max-width: 1060px) {
  .am__layout { grid-template-columns: minmax(0, 1fr); gap: 24px; max-width: 700px; margin-left: auto; margin-right: auto; }
  .am__key { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
  .am__key-group + .am__key-group { margin-top: 0; }
  .am__key-group { margin-bottom: 16px; }
  .am__legend { grid-column: 1 / -1; margin-top: 4px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .am { padding: 32px 0 36px; }
  .am .tb-section-head { padding: 0 16px; }
  .am__layout { margin-top: 18px; }
  .am__scroll {
    border-radius: 0; border-left: 0; border-right: 0;
    overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    overscroll-behavior-x: contain;
  }
  .am__scroll::-webkit-scrollbar { display: none; }
  .am-svg { width: 620px; max-width: none; }
  .am__hint {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin: 10px 16px 0; font-size: 12px; color: var(--ink-3);
  }
  .am__key { padding: 0 16px; grid-template-columns: minmax(0, 1fr); }
  .am__key li a { min-height: 40px; }
  .am__legend { grid-template-columns: minmax(0, 1fr); }

  .am-pop {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 78vh; overflow-y: auto;
    border-radius: var(--r-feature) var(--r-feature) 0 0; border-bottom: 0;
    transform: translateY(16px);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .am-pop.is-in { transform: none; }
  .am-pop__close { display: block; }
  .am-pop__media { height: 150px; }
  .am-pop__copy { -webkit-line-clamp: 4; }
  .am-pop__cta { min-height: 44px; display: inline-flex; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  .am-pop, .am-tip { transition: none; transform: none; }
  .am__scroll { scroll-behavior: auto; }
}

/* ---- Toyama maps (/toyama/hotels): sea, line types, an inset, region markers ---- */
.am--inline { padding: 0; background: none; border: 0; margin: 8px 0 40px; }
.am-sea { fill: var(--winter); fill-opacity: .13; }
.am-coast { fill: none; stroke: var(--winter); stroke-opacity: .55; stroke-width: .8; stroke-linejoin: round; }
.am-island { fill: var(--paper); stroke: var(--winter); stroke-opacity: .55; stroke-width: .6; }
.am-water { fill: var(--winter); fill-opacity: .16; }
.am-bld { fill: var(--ink-4); fill-opacity: .32; }
.am-road--mw { stroke: var(--ink-3); stroke-opacity: .55; stroke-width: 1.6; }
.am-road--street { stroke-opacity: .5; stroke-width: .7; }
.am-rail--sm { stroke-width: 2.6; }
.am-rail-dash--sm { stroke-width: 1.4; stroke-dasharray: 5 5; }
.am-shin { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.am-shin-in { fill: none; stroke: var(--paper); stroke-width: 1.1; stroke-linejoin: round; }
.am-rail-pvt { fill: none; stroke: var(--ink-2); stroke-width: 1.9; stroke-linejoin: round; stroke-linecap: round; }
.am-rail-gorge { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linejoin: round; }
.am-rail-gorge__tick { fill: none; stroke: var(--ink); stroke-width: 4.6; stroke-dasharray: 1.2 5; stroke-linejoin: round; }
.am-bus-route { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 3; stroke-linecap: round; stroke-linejoin: round; }
.am-walk { stroke: var(--ink-2); stroke-width: 1.4; stroke-dasharray: 1.5 3; stroke-linecap: round; }
.am-sta--sm { stroke-width: 1.1; }
.am-sta--gorge { fill: var(--paper); }
.am-peak { fill: var(--ink-2); }
.am-landmark circle { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; }
.am-landmark path { fill: var(--ink); }
.am-inset-mark rect { fill: none; stroke: var(--accent-ink); stroke-width: 1.2; }
.am-inset-mark path { fill: none; stroke: var(--accent-ink); stroke-opacity: .5; stroke-width: .8; stroke-dasharray: 3 2; }
.am-inset__frame { fill: none; stroke: var(--accent-ink); stroke-width: 1.4; }
.am-inset > .am-ground { fill: var(--paper); }

.am-t-sea { font-family: var(--serif); font-style: italic; font-size: 17px; fill: var(--winter); letter-spacing: .04em; }
.am-t-range { font-size: 9px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; fill: var(--ink-3); }
.am-t-peak { font-size: 8.5px; fill: var(--ink-2); }
.am-t-line { font-size: 8.5px; font-weight: 500; fill: var(--ink-2); letter-spacing: .02em; }
.am-t-line--shin { fill: var(--accent-ink); font-weight: 600; }
.am-t-line--bus { fill: var(--accent); font-weight: 600; }
.am-t-time { font-size: 8.5px; font-family: var(--mono); fill: var(--ink-3); }
.am-t-town { font-size: 10px; font-weight: 600; fill: var(--accent-ink); letter-spacing: .02em; }
.am-t-inset { font-family: var(--serif); font-style: italic; font-size: 15px; fill: var(--accent-ink); }
.am-t-inset-sub { font-size: 8px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; fill: var(--ink-3); }
.am-t-walk { font-size: 8px; font-family: var(--mono); fill: var(--ink-2); }
.am-t-landmark { font-weight: 600; fill: var(--ink); }
.am-labels .am-t-sea, .am-t-peak, .am-t-walk, .am-t-town, .am-t-inset, .am-t-inset-sub {
  paint-order: stroke; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round;
}
:lang(zh) .am-t-sea, :lang(zh) .am-t-inset { font-family: var(--jp); font-style: normal; }
:lang(zh) .am-t-range { letter-spacing: .5em; }

.am-pin__hit { fill: transparent; stroke: none; }
@media (hover: hover) and (pointer: fine) { .am-pin__hit { pointer-events: none; } }

.am-region__box { fill: var(--surface); stroke: var(--accent); stroke-opacity: .55; stroke-width: 1; }
.am-region__dot { fill: var(--accent); stroke: var(--paper); stroke-width: 2; }
.am-region__lead { stroke: var(--accent); stroke-width: 1; stroke-opacity: .7; }
.am-region__name { font-size: 12.5px; font-weight: 600; fill: var(--ink); }
.am-region__sub { font-size: 9.5px; fill: var(--ink-3); }
.am-region:hover .am-region__box, .am-region.is-open .am-region__box { fill: var(--accent-soft); stroke-opacity: 1; }
.am-region:focus-visible .am-region__box { stroke: var(--accent); stroke-opacity: 1; stroke-width: 2.5; }
.am-region:hover .am-region__dot, .am-region.is-open .am-region__dot { fill: var(--accent-ink); }

.am__key-region { display: flex; flex-direction: column; gap: 1px; }
.am__key-region small { font-size: 12px; color: var(--ink-3); }
.am-rdot { flex: none; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--accent); margin: 0 4px 0 3px; }
.am--inline .am__title { font-size: var(--fs-h3-min); font-weight: 500; letter-spacing: -.01em; color: var(--ink); margin: 0; }
.am--inline .am__lede { margin: 6px 0 0; max-width: 680px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.am--inline .am__layout { margin-top: 20px; }
.am__key h4.am__key-head { margin-top: 0; }
@media (max-width: 700px) {
  .am--inline { margin: 0 -16px 32px; }
  .am--inline .am__title, .am--inline .am__lede { padding: 0 16px; }
}
