/* The maps of Cherry Haven and the Mountain Terraces: the picture, the district labels, a face for every person, the filter row, the locator on a
   person's page. Colours come from the site tokens; the ring colours say what a person does for you (the People page's own groups).
   Works with no script: the picture, the labels, the markers as links and the list under it. map.js adds the zoom, the filter and the find box. */

.hm { --c-bounties: #FF6A1A; --c-buyfrom: #F5B841; --c-sellto: #7BCB4B; --c-upgrades: #2EC4B6; --c-other: #B8AEA5; --sky: #0b1226; margin: var(--sp-3) 0 var(--sp-6); }
.hm [data-k="bounties"] { --c: var(--c-bounties); }
.hm [data-k="buyfrom"] { --c: var(--c-buyfrom); }
.hm [data-k="sellto"] { --c: var(--c-sellto); }
.hm [data-k="upgrades"] { --c: var(--c-upgrades); }
.hm [data-k="other"] { --c: var(--c-other); }
.hm .vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the bar over the map */
.hm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); margin: 0 0 var(--sp-3); }
.hm-bar .chips { margin: 0; }
.hm-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--c, var(--text-3)); vertical-align: 1px; }
.hm-find { margin-left: auto; }
.hm-btns .hm-find { flex: 0 1 190px; }
.hm-q { height: 44px; width: 190px; max-width: 100%; padding: 0 14px; border-radius: var(--pill); border: 1px solid var(--border-strong); background: transparent; color: var(--text);
  font: 500 14px/1 var(--sans); }
.hm-q::placeholder { color: var(--text-3); }
.hm-q:focus-visible { outline: 2px solid var(--ember-soft); outline-offset: 2px; }
.hm-btns { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0 0 var(--sp-3); }
.hm-b { min-width: 44px; height: 44px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: none; color: var(--text); font: 600 14px/1 var(--sans); cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.hm-frame { position: relative; }
.hm-zoom { position: absolute; z-index: 10; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px; }
.hm-zoom .hm-b { font-size: 22px; padding: 0; width: 44px; background: rgba(13,10,8,.78); backdrop-filter: blur(6px); }
.hm-zoom .hm-b:hover { background: rgba(36,28,23,.92); }
.hm-b:hover { background: var(--surface-2); }
.hm-b[aria-pressed="true"] { background: var(--surface-2); border-color: rgba(255,214,180,.3); }
.hm-b:focus-visible, .hm .chip:focus-visible { outline: 2px solid var(--ember-soft); outline-offset: 2px; }
.hm .chip { height: 44px; }   /* 44 px touch target (the shared .chip is 36 px) */

/* the view: the picture on the sky, markers over it */
.hm-view { position: relative; display: block; overflow: hidden; width: 100%; aspect-ratio: var(--r); background: var(--sky); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.hm-view:focus-visible { outline: 2px solid var(--ember-soft); outline-offset: 2px; }
.hm-stage { position: relative; width: 100%; }
.hm-stage picture, .hm-img-base { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }

/* the district names: quiet labels over each island */
.hm-dl { position: absolute; z-index: 1; transform: translate(-50%, -50%); padding: 3px 9px; border-radius: var(--pill); background: rgba(13,10,8,.62); color: var(--text);
  font: 600 11px/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; pointer-events: none; }

/* a person: a face in a ring the colour of what they do, a 44 px hit area round it */
.hm { --p: 22px; }
.hm[data-zl="2"] { --p: 24px; }
.hm[data-zl="3"] { --p: 32px; }
.hm-pin { position: absolute; z-index: 2; display: block; width: var(--p); height: var(--p); transform: translate(-50%, -50%); border-radius: 6px; color: var(--text); text-decoration: none; }
.hm-pin::before { content: ""; position: absolute; inset: calc((44px - var(--p)) / -2); }
.hm-face { position: relative; display: block; width: 100%; height: 100%; border-radius: 6px; background: var(--surface); overflow: hidden;
  box-shadow: 0 0 0 2px var(--c, var(--c-other)), 0 3px 8px rgba(0,0,0,.65); transition: transform var(--t-mid) var(--ease), box-shadow var(--t-fast) var(--ease); }
.hm-img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.hm-ini { display: grid; place-items: center; width: 100%; height: 100%; font: 800 calc(var(--p) * .6)/1 var(--display); color: var(--text); background: var(--surface-2); }
a.hm-pin:hover { z-index: 6; }
a.hm-pin:hover .hm-face, a.hm-pin:focus-visible .hm-face, .hm-pin.hm-hot .hm-face, .hm-pin.hm-sel .hm-face { transform: scale(1.25); box-shadow: 0 0 0 3px var(--c, var(--c-other)), 0 0 0 6px rgba(255,255,255,.28), 0 4px 12px rgba(0,0,0,.7); }
a.hm-pin:focus-visible { outline: 2px solid var(--ember-soft); outline-offset: 2px; }
.hm-pin.hm-hot, .hm-pin.hm-sel, a.hm-pin:focus-visible { z-index: 7; }

/* the name chip: on hover and focus, and always with Show names or when zoomed right in */
.hm-tip { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%) translateY(4px); z-index: 8; padding: 5px 10px; white-space: nowrap; text-align: center;
  background: rgba(13,10,8,.94); border: 1px solid var(--border-strong); border-radius: 10px; color: var(--text); font: 600 13px/1.25 var(--sans); box-shadow: 0 6px 18px rgba(0,0,0,.5);
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.hm-tip i { display: block; font: 400 12px/1.3 var(--sans); font-style: normal; color: var(--text-2); }
.hm-pin--top .hm-tip { bottom: auto; top: calc(100% + 10px); }
.hm-pin--l .hm-tip { left: -8px; transform: translateY(4px); }
.hm-pin--r .hm-tip { left: auto; right: -8px; transform: translateY(4px); }
a.hm-pin:hover .hm-tip, a.hm-pin:focus-visible .hm-tip, .hm-pin.hm-hot .hm-tip, .hm-pin.hm-sel .hm-tip, .hm-names .hm-pin:not(.hm-dim) .hm-tip, .hm[data-zl="3"] .hm-pin:not(.hm-dim) .hm-tip {
  opacity: 1; visibility: visible; transform: translateX(-50%); }
a.hm-pin--l:hover .hm-tip, a.hm-pin--l:focus-visible .hm-tip, .hm-pin--l.hm-hot .hm-tip, .hm-pin--l.hm-sel .hm-tip, .hm-names .hm-pin--l:not(.hm-dim) .hm-tip, .hm[data-zl="3"] .hm-pin--l:not(.hm-dim) .hm-tip,
a.hm-pin--r:hover .hm-tip, a.hm-pin--r:focus-visible .hm-tip, .hm-pin--r.hm-hot .hm-tip, .hm-pin--r.hm-sel .hm-tip, .hm-names .hm-pin--r:not(.hm-dim) .hm-tip, .hm[data-zl="3"] .hm-pin--r:not(.hm-dim) .hm-tip { transform: none; }

/* filtered out, and found */
.hm-pin.hm-dim { opacity: .2; filter: grayscale(.7); pointer-events: none; }
.hm-pin.hm-hit .hm-face { box-shadow: 0 0 0 3px #fff, 0 0 0 7px var(--c, var(--c-other)); transform: scale(1.3); }
.hm-pin.hm-hit { z-index: 9; }

/* the caption and the list under the map */
.hm-cap { margin: var(--sp-2) 0 0; color: var(--text-2); font-size: 14px; max-width: none; }
.hm-listbox { margin-top: var(--sp-2); }
.hm-who { display: inline-flex; align-items: center; gap: 12px; }
.hm-lf { display: inline-block; width: 28px; height: 28px; flex: none; }
.hm-lf .hm-img, .hm-lf .hm-ini { width: 28px; height: 28px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--border-strong); font-size: 16px; }

/* with the script: the stage is sized and moved in pixels, the view is as tall as the screen allows */
.hm-js .hm-view { max-height: min(86vh, 920px); cursor: grab; touch-action: pan-y; }
.hm-js.hm-on .hm-view { touch-action: none; }
.hm-js .hm-view.hm-drag { cursor: grabbing; }
.hm-js .hm-stage { position: absolute; left: 0; top: 0; width: auto; transform-origin: 0 0; }
.hm-js .hm-stage picture, .hm-js .hm-img-base { width: 100%; height: 100%; }
.hm-js[data-zl="2"] .hm-img-base, .hm-js[data-zl="3"] .hm-img-base { image-rendering: pixelated; }
.hm-js .hm-pin { cursor: pointer; }
.hm:fullscreen { display: flex; flex-direction: column; padding: var(--sp-4); background: var(--bg); margin: 0; }
.hm:fullscreen .hm-frame { flex: 1; min-height: 0; }
.hm:fullscreen .hm-view { height: 100%; max-height: none; aspect-ratio: auto; }
.hm:fullscreen .hm-cap { display: none; }

/* the locator on a person's page: a crop of the same picture, their marker large and pulsing, the rest small and dim; the whole of it is a link */
.hm.hm--loc { margin: var(--sp-2) 0 var(--sp-4); max-width: 420px; }   /* 120 blocks across: 3.5 CSS pixels a block, from a picture of 6 */
.hm-open { display: block; color: inherit; text-decoration: none; border-radius: var(--radius); }
.hm-open:focus-visible { outline: 2px solid var(--ember-soft); outline-offset: 3px; }
.hm-view--loc { aspect-ratio: 12 / 7; transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-mid) var(--ease); }
.hm-open:hover .hm-view--loc { border-color: rgba(255,214,180,.3); box-shadow: 0 12px 32px rgba(0,0,0,.35); }
.hm--loc .hm-stage { position: absolute; left: 50%; top: 50%; width: calc(var(--z) * 100%); transform: translate(calc(var(--cx) * -1%), calc(var(--cy) * -1%)); }
.hm--loc .hm-dl { font-size: 10px; padding: 2px 7px; letter-spacing: .08em; }
.hm--loc .hm-pin { cursor: pointer; }
.hm-pin--n { --p: 14px; opacity: .5; pointer-events: none; }
.hm-pin--n::before { display: none; }
.hm-pin--n .hm-face { box-shadow: 0 0 0 1px var(--c, var(--c-other)); border-radius: 4px; }
.hm-pin--me { --p: 36px; z-index: 5; }
.hm-pin--me .hm-face { box-shadow: 0 0 0 3px var(--c, var(--c-other)), 0 0 0 7px rgba(255,255,255,.22), 0 6px 14px rgba(0,0,0,.6); }
.hm-pin--me::after { content: ""; position: absolute; inset: -3px; border-radius: 9px; border: 2px solid var(--c, var(--c-other)); opacity: 0; pointer-events: none; }
@keyframes hm-pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.4); opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  html:not(.js) .hm--loc .hm-pin--me::after, .hm--loc.hm-go .hm-pin--me::after { animation: hm-pulse 1.5s var(--ease) .3s 1; }
}
@media (prefers-reduced-motion: reduce) { .hm-face, .hm-tip, .hm-b { transition: none; } }
@media (max-width: 719px) {
  .hm-find { margin-left: 0; width: 100%; }
  .hm-q { width: 100%; }
  .hm[data-zl="1"] { --p: 18px; }
  .hm[data-zl="1"] .hm-dl { display: none; }
  .hm-dl { font-size: 10px; padding: 2px 7px; }
}

/* the People page: a card and its marker light together */
.pc.is-hot > .wc, .pc.is-hot > details { border-color: var(--ember); box-shadow: 0 0 0 1px var(--ember), 0 12px 32px rgba(0,0,0,.35); }

/* nothing here may widen a page: the figure and its list stay inside the column (the table scrolls in its own box) */
.hm { max-width: 100%; min-width: 0; overflow-x: clip; }
.hm-listbox { max-width: 100%; min-width: 0; }
