/* ============================================================================
   TRAVEL MAP — /map
   ----------------------------------------------------------------------------
   Ported from the client-approved mockup (Docs/mockups/inner-pages/travel-map.html,
   approved 2026-11-13). A full-height explorer instead of a card in a container:
   the index on the left (towns first, then places), the map edge to edge on the
   right. Phone and tablet: the map fills the screen and the index is a bottom sheet.
   Loads after css/public/tokens.css, shell.css, editorial.css and inner.css.
   State classes are set by js/map/travel-map.js.
   ============================================================================ */
.tm { display: grid; grid-template-columns: clamp(360px, 31vw, 480px) minmax(0, 1fr); height: calc(100svh - var(--hdr)); min-height: 520px; border-bottom: 1px solid var(--rule); }
.tm [hidden] { display: none !important; }
.tm-panel { position: relative; z-index: 2; display: flex; flex-direction: column; min-height: 0; background: var(--paper); border-right: 1px solid var(--rule); }
.tm-grab { display: none; }
.tm-head { display: flex; flex-direction: column; padding: 16px 24px 12px; border-bottom: 1px solid var(--rule); }
.tm-head .crumbs { padding: 0; }
.tm-head .kicker { margin-top: 14px; }
.tm-title { font-size: clamp(1.75rem, 2.5vw, 2.7rem); margin: 10px 0 0; min-height: 1.75em; }
.tm-title em { color: var(--red-ink); }
.tm-head .field { margin-top: 10px; }
.tm-head .chips { margin: 12px -24px 0; padding-inline: 24px; }
.tm-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 0 24px; border-bottom: 1px solid var(--rule); }
.tm-bar .label { color: var(--ink-3); }
.tm-bar .sel { height: 44px; font-size: .82rem; }
.tm-bar .tm-note { margin: 0; font-size: .85rem; color: var(--ink-2); }
:where(body.pub-editorial) .tm-all, .tm-all { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.tm-all .ico { width: 18px; height: 10px; }
.tm-all:hover { color: var(--red-ink); }
.tm-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

/* town rows — the homepage's town index, with a photograph */
.trow { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 24px; border-bottom: 1px solid var(--rule); text-decoration: none; }
.trow img, .trow .noimg { width: 56px; height: 56px; object-fit: cover; background: var(--paper-3); }
.trow b { display: block; font-family: var(--f-display); font-weight: 500; font-size: 1.28rem; line-height: 1.1; font-variation-settings: "SOFT" 100; transition: color var(--d-micro); }
.trow small { font-size: .78rem; color: var(--ink-3); }
.trow .n { font-family: var(--f-display); font-weight: 300; font-size: 1.8rem; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; font-variation-settings: "SOFT" 50, "opsz" 144; }
.trow:hover b, .trow:focus-visible b { color: var(--red-ink); }
@media (prefers-reduced-motion: no-preference) {
  .trow b { transition: translate var(--d-ui) var(--e-out), color var(--d-micro); }
  .trow:hover b, .trow:focus-visible b { translate: 6px 0; }
}

/* place rows */
.prow { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 14px; padding: 12px 24px; border-bottom: 1px solid var(--rule); text-decoration: none; transition: background var(--d-micro); }
.prow img, .prow .noimg { width: 72px; height: 72px; object-fit: cover; background: var(--paper-3); }
.prow .label { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--ci); }
.prow .label .feat { color: var(--red-ink); }
.prow b { display: block; margin: 3px 0 2px; font-family: var(--f-display); font-weight: 500; font-size: 1.12rem; line-height: 1.15; font-variation-settings: "SOFT" 100; }
.prow small { display: block; font-size: .8rem; color: var(--ink-3); }
.prow .rt { color: var(--ink-2); }
.prow:hover { background: rgba(23, 20, 15, .04); }
.prow.on { background: var(--paper-2); box-shadow: inset 3px 0 0 var(--red); }
.tm-more { padding: 16px 24px 28px; }
.tm-more .btn { width: 100%; justify-content: center; }
.tm-none { padding: 40px 24px; color: var(--ink-2); }
.tm-none b { display: block; font-family: var(--f-display); font-style: italic; font-weight: 400; font-size: 1.5rem; color: var(--ink); margin-bottom: 6px; font-variation-settings: "SOFT" 100, "WONK" 1; }

/* the map */
.tm-map { position: relative; min-width: 0; background: var(--map-sea); }
#map { position: absolute; inset: 0; background: var(--map-sea); font-family: var(--f-sans); }
/* the stock OpenStreetMap tiles, pulled toward the paper palette so the brand colours can sit on top */
.tm-map .leaflet-tile-pane { filter: grayscale(.2) sepia(.2) saturate(.95); }
.tm-map .leaflet-bar { border: 0; border-radius: 0; box-shadow: 0 12px 30px -14px rgba(23, 20, 15, .6); }
.tm-map .leaflet-bar a { width: 44px; height: 44px; border-radius: 0 !important; background: var(--paper); color: var(--ink); border-bottom: 1px solid var(--rule); font: 400 1.3rem/42px var(--f-sans); text-decoration: none; }
.tm-map .leaflet-bar a:hover { background: var(--ink); color: var(--paper); }
.tm-map .leaflet-control-attribution { background: rgba(244, 238, 227, .86); font-size: .64rem; color: var(--ink-2); }
.tm-map .leaflet-control-attribution a { color: var(--navy); }
.tm-map .leaflet-control-scale-line { border-color: var(--ink-3); background: rgba(244, 238, 227, .7); color: var(--ink-2); font-size: .64rem; }
.tm-map .leaflet-marker-icon:focus-visible { outline: none; }
.tm-map .leaflet-marker-icon:focus-visible .tpin b, .tm-map .leaflet-marker-icon:focus-visible .pdot { outline: 2px solid var(--sky); outline-offset: 3px; }

/* town pins — the homepage map's pin, carrying a count */
.tpin { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 7px; transform: translate(-14px, -50%); white-space: nowrap; cursor: pointer; }
.tpin[data-side="l"] { flex-direction: row-reverse; transform: translate(calc(-100% + 14px), -50%); }
.tpin b { min-width: 28px; height: 28px; padding: 0 7px; display: grid; place-items: center; border-radius: 14px; background: var(--ink); color: var(--paper); font: 700 .76rem/1 var(--f-sans); font-variant-numeric: tabular-nums; box-shadow: 0 0 0 3px var(--paper), 0 8px 16px -6px rgba(0, 0, 0, .6); transition: background var(--d-micro), scale var(--d-ui) var(--e-out); }
.tpin span { padding: 3px 6px 2px; background: rgba(244, 238, 227, .9); font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; line-height: 1.2; color: var(--ink); }
.tpin:hover b, .tpin.on b { background: var(--red); scale: 1.14; }
.tpin:hover span, .tpin.on span { background: var(--ink); color: var(--paper); }

/* place dots — small, coloured by group; they grow when touched instead of crowding the map with 36px icons */
.pdot { position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2.5px var(--paper), 0 3px 8px rgba(0, 0, 0, .4); cursor: pointer; transition: scale var(--d-ui) var(--e-out), background var(--d-micro); }
.pdot::before { content: ""; position: absolute; inset: -14px; }   /* a 44px target around a 16px dot */
.pdot.feat { left: -10px; top: -10px; width: 20px; height: 20px; background: radial-gradient(circle, var(--paper) 0 3px, var(--c) 3.6px); }
.pdot.hover, .pdot:hover { scale: 1.45; }
.pdot.on { scale: 1.5; background: var(--red); }
.pdot.on::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 1.5px solid var(--red); opacity: 0; }
@media (prefers-reduced-motion: no-preference) { .pdot.on::after { animation: tm-ping 1.8s var(--e-out) infinite; } }
@keyframes tm-ping { 0% { opacity: .9; transform: scale(.5); } 100% { opacity: 0; transform: scale(1.7); } }
.leaflet-tooltip.tm-tip { padding: 5px 9px 4px; border: 0; border-radius: 0; background: var(--ink); color: var(--paper); font: 600 .74rem/1.2 var(--f-sans); box-shadow: none; }
.leaflet-tooltip.tm-tip::before { display: none; }

/* overlays on the map */
:where(body.pub-editorial) .tm-back, .tm-back { position: absolute; left: 16px; top: 16px; z-index: 3; display: none; align-items: center; gap: 10px; height: 44px; padding: 0 16px; background: var(--paper); color: var(--ink); font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; box-shadow: 0 12px 30px -14px rgba(23, 20, 15, .6); }
.tm-back.show { display: inline-flex; }
.tm-back .ico { width: 18px; height: 10px; }
.tm-back:hover { background: var(--ink); color: var(--paper); }
.tm-hint { position: absolute; left: 50%; top: 16px; z-index: 3; margin: 0; translate: -50% -8px; padding: 9px 14px 8px; background: var(--ink); color: var(--paper); font-size: .78rem; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .3s, translate .4s var(--e-out); }
.tm-hint.show { opacity: .94; translate: -50% 0; }

/* the place preview — docked, so it never covers the pin it describes or drags the map around like a popup */
.tm-card { position: absolute; left: 16px; bottom: 30px; z-index: 3; display: grid; grid-template-columns: 136px minmax(0, 1fr); width: min(400px, calc(100% - 32px)); background: var(--paper); color: var(--ink); box-shadow: 0 30px 60px -22px rgba(23, 20, 15, .65); }
@media (prefers-reduced-motion: no-preference) { .tm-card { animation: tm-rise .5s var(--e-out); } }
@keyframes tm-rise { from { opacity: 0; translate: 0 18px; } }
.tm-card .ph { height: 100%; min-height: 156px; }
.tm-card.nophoto { grid-template-columns: minmax(0, 1fr); }
.tm-card.nophoto .ph { display: none; }
.tm-card .body { padding: 14px 44px 14px 16px; min-width: 0; }
.tm-card .label { color: var(--ci); }
.tm-card h2 { margin: 5px 0 3px; font-family: var(--f-display); font-weight: 600; font-size: 1.32rem; line-height: 1.06; letter-spacing: -.015em; font-variation-settings: "SOFT" 100; text-wrap: balance; }
.tm-card .tw { margin: 0; font-size: .82rem; color: var(--ink-3); }
.tm-card .acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; }
.tm-card .btn { min-height: 44px; padding: 15px 16px 14px; gap: 10px; font-size: .66rem; }
.tm-card .link-arrow { min-height: 44px; font-size: .82rem; }
.tm-card .link-arrow::after { right: 0; bottom: 10px; }
:where(body.pub-editorial) .tm-x, .tm-x { position: absolute; right: 0; top: 0; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.tm-x:hover { background: rgba(23, 20, 15, .08); }
.tm-x .ico { width: 12px; height: 12px; }

@media (scripting: none) { .tm-head .field, .tm-back, .tm-hint { display: none; } }

/* ---------- phone + tablet: map first, the index is a bottom sheet ---------- */
@media (max-width: 899px) {
  body:has(.tm) .pub-footer { display: none; }
  .tm { display: block; position: relative; height: calc(100svh - var(--hdr) - var(--dock)); min-height: 0; overflow: hidden; }
  .tm-map { position: absolute; inset: 0; }
  .tm-panel { position: absolute; inset: auto 0 0 0; z-index: 4; height: min(84%, 680px); border-right: 0; box-shadow: 0 -18px 40px -22px rgba(23, 20, 15, .55); transform: translateY(calc(100% - 132px)); transition: transform .55s var(--e-out); }
  .tm-panel.open { transform: none; }
  .tm-panel.away { transform: translateY(100%); }
  :where(body.pub-editorial) .tm-grab, .tm-grab { display: grid; place-items: center; width: 100%; height: 28px; flex: none; }
  .tm-grab::before { content: ""; width: 40px; height: 4px; border-radius: 2px; background: var(--ink-3); opacity: .5; }
  .tm-head { padding: 0 16px 10px; }
  .tm-head .crumbs, .tm-head .kicker { display: none; }
  .tm-title { order: 1; font-size: 1.45rem; margin-top: 0; min-height: 0; }
  .tm-head .chips { order: 2; margin: 10px -16px 0; padding-inline: 16px; }
  .tm-head .field { order: 3; margin-top: 8px; }
  .tm-bar, .trow, .prow, .tm-more, .tm-none { padding-inline: 16px; }
  .tm-none { padding-block: 28px; }
  .tm-card { left: 12px; right: 12px; bottom: 12px; width: auto; z-index: 5; grid-template-columns: 112px minmax(0, 1fr); }
  .tm-back { left: 12px; top: 12px; }
  .tm-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tm-panel, .tpin b, .pdot, .tm-hint { transition-duration: .001ms; } }
/* Without script there is no map and nothing can pull the sheet up, so on a phone the index is
   simply the page. Written as an override ((scripting: none)) rather than by gating the sheet on
   (scripting: enabled): a browser too old to know the media feature then keeps the working layout. */
@media (max-width: 899px) and (scripting: none) {
  body:has(.tm) .pub-footer { display: block; }
  .tm { height: auto; overflow: visible; }
  .tm-map, .tm-grab { display: none; }
  .tm-panel { position: static; height: auto; transform: none; box-shadow: none; }
  .tm-head .crumbs { display: block; }
  .tm-scroll { overflow: visible; }
}
