/* Map (world/index.html) and Places (world/locations.html): only the map viewer. Everything else is the blocks. */
@layer pages {
  /* the viewer: the poster is never styled beyond size and position */
  .wm { margin-top: 18px; display: grid; gap: 14px; }
  .wm-v { margin: 0; min-width: 0; }
  .wm-port { position: relative; overflow: hidden; border-radius: var(--r3); background: var(--s1); outline: none; }
  .wm-img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
  html.js .wm-port { aspect-ratio: 2805 / 3840; max-height: 64svh; min-height: 320px; touch-action: none; cursor: grab; }
  html.js .wm-img { position: absolute; inset: 0; height: 100%; object-fit: contain; }
  .wm-v.is-live .wm-img { inset: 0 auto auto 0; width: 2805px; height: 3840px; max-width: none; object-fit: fill; transform-origin: 0 0; }
  .wm-v.is-dragging .wm-port { cursor: grabbing; }
  .wm-port:focus-visible { box-shadow: inset 0 0 0 2px var(--ac); }
  .wm-v figcaption { margin-top: 6px; }
  .wm-v figcaption a { color: var(--tx); font-weight: 600; text-decoration-color: var(--ac); text-underline-offset: 3px; display: inline-block; padding: 12px 0; }

  /* zoom buttons, region chips, the chosen region, go to square */
  .wm-side { display: grid; gap: 12px; min-width: 0; align-content: start; }
  .wm-bar, .wm-go { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .wm .chips { margin-top: 0; }
  .wm .chip:disabled { color: var(--mu); cursor: default; }
  /* a one-word breadcrumb link ("Map" on Places) keeps a 44 px target (integration request: move to 02-layout.css) */
  .crumbs a { min-width: 44px; justify-content: center; }
  .wm-sq { margin-left: auto; color: var(--mu); font-size: 15px; }
  .wm-sq b { color: var(--tx); font: 800 22px/1 var(--disp); }
  .wm-v:not(.is-zoomed) ~ .wm-side .wm-sq { display: none; }
  .wm-l, .wm-go-l { width: 100%; color: var(--mu); font-size: 15px; }
  /* how counties and regions relate, right under the map */
  .wm-key { margin: 0; color: var(--tx2); }
  .wm-go-l { color: var(--tx2); }
  .wm-now { margin: 0; padding: 14px 16px; border-radius: var(--r2); background: var(--s1); color: var(--tx2); }
  .wm-now b { color: var(--tx); margin-right: 4px; }
  .wm-now a { color: var(--ac); font-weight: 600; text-decoration: none; display: inline-block; padding: 10px 0 0; }
  .wm-go select { flex: 0 0 auto; width: 88px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line2); border-radius: var(--r1); background: var(--s1); color: var(--tx); font: 600 16px var(--body); }
  .wm-go select:focus-visible { outline: 2px solid var(--ac); outline-offset: 1px; }

  /* the region rows show a larger picture */
  #regions .item-pic { width: 88px; height: 64px; }

  /* tablets held upright: the viewer takes the full width (the poster sits centred in it), not a narrow column at the left */
  @media (min-width: 600px) and (max-width: 899px) {
    html.js .wm-port { aspect-ratio: auto; height: 64svh; max-height: none; }
  }
  @media (min-width: 900px) {
    .wm { grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; margin-top: 28px; }
    html.js .wm-port { aspect-ratio: auto; height: min(78svh, 820px); max-height: none; }
    .wm-side { position: sticky; top: calc(var(--top-h) + 20px); }
    #regions .item-pic { width: 120px; height: 80px; }
  }
}
