/* pin_map block — map beside a synchronised destination list.
   No literal colour: every value is a token. The per-block map height arrives as
   --pin-map-h, set inline by the template. */

.pin-map__head { margin-bottom: 1.6rem; }

/* Map and list are one bordered unit, split 1fr / a fixed rail. The accent
   border is what ties the two halves together as a single object. */
.pin-map__grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  border: 4px solid var(--accent);
}
.pin-map__grid--list-only { grid-template-columns: 1fr; }

.pin-map__canvas {
  height: var(--pin-map-h, 660px);
  background: var(--surface-dark-alt);
  z-index: 1;
}

.pin-map__list {
  background: var(--surface-dark-alt);
  max-height: var(--pin-map-h, 660px);
  overflow-y: auto;
}
.pin-map__grid--list-only .pin-map__list { max-height: none; }

.pin-map__list-head {
  position: sticky; top: 0; z-index: 2;
  margin: 0;
  padding: 1.15rem 1.5rem;
  background: var(--accent);
  color: var(--accent-text, var(--btn-accent-text));
  font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; font-size: var(--fs-min);
}

.pin-map__items { margin: 0; padding: 0; list-style: none; }

/* The whole row is the control. It is a <li> with a click handler rather than a
   <button> because it carries an optional real link inside it, and a button
   cannot contain one. Keyboard users get the link; the row itself is a
   convenience for pointer users, which is why it takes no tab stop. */
.pin-map__item {
  position: relative;
  display: block;
  padding: 1.35rem 1.5rem;
  border-bottom: 2px solid rgba(var(--on-dark-rgb), .12);
  color: var(--white);
  cursor: pointer;
  transition: background var(--transition);
}
.pin-map__item::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0;
  background: var(--accent);
  transition: width var(--transition);
}
.pin-map__item:hover { background: rgba(var(--on-dark-rgb), .07); }
.pin-map__item:hover::before { width: 8px; }
.pin-map__item.is-active { background: var(--surface-blue); }
.pin-map__item.is-active::before { width: 12px; }

.pin-map__n {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-min);
  color: var(--accent-on-dark);
  letter-spacing: .08em;
}
.pin-map__place {
  display: block;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 1.5rem; line-height: 1.15;
  margin: .2rem 0 .35rem;
}
.pin-map__place a { color: inherit; }
.pin-map__dates { display: block; font-weight: 700; color: var(--accent-on-dark); font-size: var(--fs-min); }
.pin-map__subs  { display: block; color: rgba(var(--on-dark-rgb), .85); font-size: var(--fs-min); }

.pin-map__tag {
  display: inline-block; margin-top: .7rem;
  padding: .15rem .7rem;
  background: var(--surface-brand); color: var(--white);
  font-size: var(--fs-min); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
}

.pin-map__note { margin-top: 1.25rem; font-size: var(--fs-min); color: var(--muted); font-weight: 600; }

/* Grounds. The list and map are always dark (the tiles are), so only the band
   around them changes. */
.pin-map--bg-light-grey { background: var(--light); }
.pin-map--bg-navy       { background: var(--surface-dark); }
.pin-map--bg-dark       { background: var(--surface-dark-alt); }
.pin-map--bg-navy .pin-map__head :is(h2, .section-intro),
.pin-map--bg-dark .pin-map__head :is(h2, .section-intro) { color: var(--white); }
.pin-map--bg-navy .pin-map__note,
.pin-map--bg-dark .pin-map__note { color: rgba(var(--on-dark-rgb), .8); }

/* ---- Leaflet furniture ------------------------------------------------------
   Leaflet ships its own stylesheet; these are the only pieces that have to match
   the brand rather than its defaults. Scoped under .pin-map so nothing else on
   the page is affected if Leaflet is ever used elsewhere. */
.pin-map .pin-map-marker {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: var(--accent-text, var(--btn-accent-text));
  border: 3px solid var(--surface-dark-alt);
  font-family: var(--font-display);
  font-size: 1.5rem;
}
.pin-map .pin-map-marker--next {
  background: var(--surface-brand);
  color: var(--white);
  border-color: var(--white);
}
.pin-map .leaflet-popup-content-wrapper,
.pin-map .leaflet-popup-tip { background: var(--surface-dark-alt); color: var(--white); border-radius: 0; }
.pin-map .leaflet-popup-content { margin: 1.1rem 1.2rem; font-size: var(--fs-min); line-height: 1.45; }
.pin-map .pin-map-pop__place { display: block; font-family: var(--font-display); font-size: 1.6rem; line-height: 1; margin-bottom: .5rem; }
.pin-map .pin-map-pop__dates { display: block; color: var(--accent-on-dark); font-weight: 800; margin-bottom: .45rem; }
.pin-map .pin-map-pop__subs  { display: block; color: rgba(var(--on-dark-rgb), .85); }

@media (max-width: 64em) {
  /* The rail cannot hold 420px and a map on a tablet, so they stack. The list
     loses its scroll cap here: inside a stacked column a 660px scroller is a
     scroll trap, and the list is short enough to simply run. */
  .pin-map__grid { grid-template-columns: 1fr; }
  .pin-map__list { max-height: none; }
  .pin-map__canvas { height: min(var(--pin-map-h, 660px), 60vh); }
}
