/* ==========================================================================
   The map controls of the public site (owner handoff "Unified Google Maps Controls", 2026-11-20, docs/IP-Reference.md section CR; registry L36)
   ==========================================================================
   One small set of controls on all five maps - the category / subcategory map, the search-results map, the listing page's pin map and grey area map, and the
   contact box's map - built by public/js/ip-map-controls.js in place of Google's own (which cannot be recoloured or resized, differ from map to map and include a
   camera-tilt widget that overlapped full screen). Every control is the site's link blue (--brand-blue), 28px, with the same small corner (--radius-sm) and the same
   map-control shadow (--elevation-map-control); a group of buttons is ONE rounded box with 1px dividers, never separate pills. The Directions link, the Radius
   slider and the count note on the results map follow the same style. Tokens only: the two translucent whites (the dividers, the radius bar) are mixed from
   --ink-inverse, not new colours. The sizes with no token (28px, the 10px / 3px / 13px / 12px / 230px of the handoff) are the handoff's own, kept here once.
   Loaded by the results pages, the listing page and the contact box's partial. Every selector starts from a class that exists only on these controls (or from
   #map-container, the results map's box, for the places the note and the slider have before Google's map is drawn). Hover, pressed and focus are the handoff's
   proposal (its open item 2, not decided yet): hover --brand-blue-dark, pressed --button-primary-active, focus a 2px white ring inside the control - the proposal's second,
   link-blue ring would be the control's own colour on a blue box, so it is not drawn. */

/* The margin round every control: 10px from the edge of the map and from Google's own logo and footer. Google keeps that margin round its own controls and
   gives none to a control it is handed (measured on Google's own script, docs section CR) - so it is written here, once, for all of them. Where two controls
   share a column or a row the space between them is ONE margin of 8px, on one of the two: the facing side of the other has none (a margin between two
   controls of a flex or a block layout may or may not collapse - this way it does not matter). */
.ip-map-ctl,
.ip-map-note,
.ip-radius.ip-radius--map {
  --ip-map-edge: 10px;
  margin: var(--ip-map-edge);
}

.ip-map-ctl {
  --ip-map-size: 28px;                                                       /* the button: 28 x 28 */
  --ip-map-divider: color-mix(in srgb, var(--ink-inverse) 30%, transparent); /* 1px between the buttons of a group */
  display: flex;
  box-sizing: border-box;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--brand-blue);
  box-shadow: var(--elevation-map-control);
  color: var(--ink-inverse);
  font: 400 13px/1 var(--font-sans);
}
.ip-map-ctl--col {
  flex-direction: column;
  margin-top: 0;      /* Street View is Google's own pegman since 2026-11-21 (owner: native Google): it sits above this group with Google's own 10px margin, so the gap is that one */
}
/* The Terrain box sits 8px right of Map / Satellite (the type box's right margin; the Terrain box has no left one) */
.ip-map-ctl--type {
  margin-right: var(--space-2);
}
.ip-map-ctl--beside {
  margin-left: 0;
}

.ip-map-btn {
  display: flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  height: var(--ip-map-size);
  min-width: var(--ip-map-size);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.ip-map-btn--text {
  padding: 0 var(--space-3);
}
.ip-map-ctl > .ip-map-btn + .ip-map-btn {
  border-left: 1px solid var(--ip-map-divider);
}
.ip-map-ctl--col > .ip-map-btn + .ip-map-btn {
  border-top: 1px solid var(--ip-map-divider);
  border-left: 0;
}
.ip-map-btn .ph {
  font-size: 16px;
  line-height: 1;
}
.ip-map-fs .ph {
  font-size: 15px;
}
/* the map type matching the map is dark and bold; hover is the same dark, so only the weight tells the active one apart */
.ip-map-btn[aria-pressed="true"] {
  background: var(--brand-blue-dark);
  font-weight: 600;
}
.ip-map-btn:hover {
  background: var(--brand-blue-dark);
}
.ip-map-btn:active {
  background: var(--button-primary-active);
}
.ip-map-btn:focus-visible {
  outline: 2px solid var(--focus-ring-inner);
  outline-offset: -2px;
}

/* the Terrain box: a checkbox drawn in white on the blue, then its word */
.ip-map-btn--check {
  gap: var(--space-2);
}
.ip-map-check {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  box-sizing: border-box;
  flex: none;
  width: 14px;
  height: 14px;
  margin: 0;
  border: 2px solid var(--ink-inverse);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
}
.ip-map-check:checked {
  background: var(--ink-inverse);
}
.ip-map-check:checked::after {
  content: "";
  position: absolute;
  top: 0;
  left: 3px;
  width: 3px;
  height: 7px;
  border: solid var(--brand-blue);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.ip-map-check:focus-visible {
  outline: 2px solid var(--focus-ring-inner);
  outline-offset: 2px;
}

/* a link handed to the map as a control (the listing page's Directions): the same blue box, its words 600 */
.ip-map-ctl--link {
  align-items: center;
  gap: var(--space-2);
  height: var(--ip-map-size);
  padding: 0 var(--space-3) 0 10px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.ip-map-ctl--link:hover,
.ip-map-ctl--link:focus {
  background: var(--brand-blue-dark);
  color: var(--ink-inverse);
  text-decoration: none;
}
.ip-map-ctl--link:active {
  background: var(--button-primary-active);
}
.ip-map-ctl--link:focus-visible {
  outline: 2px solid var(--focus-ring-inner);
  outline-offset: -2px;
}
.ip-map-ctl--link .ph {
  font-size: 16px;
  line-height: 1;
}

/* ---- the count note on the results map (owner handoff, section 4; App\Support\MapCountNote) ----
   Warning tokens, the soft-alert pattern: 40px (it is information, not a control), the icon, two lines. With every listing on the map it is one plain white line,
   28px. Before Google's map is drawn it sits at the bottom of the map's box (below); public/js/ip-map-controls.js then hands it to the map as a control. */
.ip-map-note {
  display: flex;
  box-sizing: border-box;
  align-items: center;
  gap: var(--space-2);
  border-radius: var(--radius-sm);
  box-shadow: var(--elevation-map-control);
  white-space: nowrap;
}
/* above the radius slider in the bottom-left column (a map too narrow to hold the note at the bottom centre): 8px between the two, the radius slider's top margin */
.ip-map-note--stacked {
  margin-bottom: 0;
}
/* at the bottom centre: Google's own footer row (the "Keyboard shortcuts" / "Map data" / "Terms" line, 14px high - measured on Google's own script, docs section CR)
   runs along the bottom edge there, where the controls of the sides are lifted above it by Google; this one is lifted by hand, so it never covers the attribution */
.ip-map-note--centre {
  margin-bottom: calc(var(--ip-map-edge) + 14px);
}
.ip-map-note--warn {
  height: 40px;
  padding: 0 var(--space-3) 0 10px;
  border: 1px solid var(--warning-border);
  background: var(--warning-bg);
  color: var(--warning-text);
}
.ip-map-note--warn .ph {
  flex: none;
  font-size: 16px;
  line-height: 1;
  color: var(--warning-icon);
}
.ip-map-note__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ip-map-note__line1 {
  font: 600 13px/1 var(--font-sans);
}
.ip-map-note__line2 {
  font: 400 12px/1 var(--font-sans);
}
.ip-map-note--plain {
  height: 28px;
  padding: 0 var(--space-3);
  background: var(--surface);
  color: var(--ink);
  font: 400 13px/1 var(--font-sans);
}
.ip-map-note--plain .ip-map-note__line1 {
  font-weight: 400;
}
/* before the map is drawn: at the bottom centre of the results map's box (the cover over it holds the loading bars until then) */
#map-container > .ip-map-note {
  position: absolute;
  bottom: 10px;
  left: 50%;
  z-index: 4;
  max-width: calc(100% - 20px);
  margin: 0;
  transform: translateX(-50%);
}
