/* ==========================================================================
   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 every public map - the category / subcategory map, the search-results map, the listing page's map (a street pin, a town pin or
   no pin) 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). A group of buttons is ONE rounded box with 1px dividers, never separate pills. The Directions link and the count
   note on the maps follow the same style. The Radius slider's copy on the results map is NOT one of these: it is page markup under Map / Satellite
   (public/css/ip-radius-slider.css), as it was before the handoff.
   White and 40 x 40 - like Google's own controls (owner 2026-11-21, looking at the blue 28px set on his phone: "instead of the blue ... white just like the Google
   default and change the size to be bigger as well"). Google's own full screen button and its + / - group, measured on its real script (docs section CR.6), are 40px
   boxes 10px from the edge of the map, white, with a small shadow; the white here is the site's own white control look - the surface, the map-control shadow and the
   small corner the radius slider's copy on the map has always had (the same 40px height) - and its states are the outline family's (ip-outline.css: the light blue
   hover, the light blue and the blue text of the selected one, the 2px blue focus ring). Tokens only. The sizes with no token (40px, the 10px edge) are Google's own
   numbers, 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 place the note has before Google's map is 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-map-edge: 10px;
  --ip-map-base: 26px;                                                       /* the bottom edge every bottom control shares: the top of Google's logo box (66 x 26) */
  margin: var(--ip-map-edge);
}

.ip-map-ctl {
  --ip-map-size: 40px;                                                       /* the button: 40 x 40, Google's own */
  display: flex;
  box-sizing: border-box;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--elevation-map-control);
  color: var(--ink);
  font: 400 var(--body-size)/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 */
  margin-bottom: calc(var(--ip-map-base) - 14px);   /* Google lifts a bottom-right control above its 14px footer row: the rest of the way to the shared baseline is margin */
}
.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-4);
}
.ip-map-ctl > .ip-map-btn + .ip-map-btn {
  border-left: 1px solid var(--border);
}
.ip-map-ctl--col > .ip-map-btn + .ip-map-btn {
  border-top: 1px solid var(--border);
  border-left: 0;
}
.ip-map-btn .ph {
  font-size: 20px;
  line-height: 1;
}
/* the states are the outline family's (ip-outline.css): hover on pointer devices only, so it never sticks after a tap on a phone; pressed is the hover fill; the
   selected map type is the light blue with the blue text, after hover and pressed on purpose (a selected one keeps its blue text while hovered) */
@media (hover: hover) {
  .ip-map-btn:hover {
    background: var(--button-outline-hover);
  }
}
.ip-map-btn:active {
  background: var(--button-outline-hover);
}
.ip-map-btn[aria-pressed="true"] {
  background: var(--button-outline-active);
  color: var(--button-outline-active-text);
}
.ip-map-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

/* a link handed to the map as a control (the listing page's Directions): the same white box */
.ip-map-ctl--link {
  align-items: center;
  gap: var(--space-2);
  height: var(--ip-map-size);
  padding: 0 var(--space-4) 0 var(--space-3);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
@media (hover: hover) {
  .ip-map-ctl--link:hover {
    background: var(--button-outline-hover);
    color: var(--ink);
    text-decoration: none;
  }
}
.ip-map-ctl--link:focus {
  color: var(--ink);
  text-decoration: none;
}
.ip-map-ctl--link:active {
  background: var(--button-outline-hover);
}
.ip-map-ctl--link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}
.ip-map-ctl--link .ph {
  font-size: 20px;
  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;
}
/* 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 -
   to the shared baseline, level with the bottom of the + / - group */
.ip-map-note--centre {
  margin-bottom: var(--ip-map-base);
}
/* at the bottom left (the Directions link and, on a map too narrow for the centre, the note): Google lifts a bottom-left control above its logo, 26px high, which
   already is the shared baseline (measured, docs section CR.6) - so these take no bottom margin, and their bottom edge is level with the bottom of the + / - group on the
   other side, and clear of the logo (owner 2026-11-21: "aligned with the plus minus to the bottom") */
.ip-map-at-left {
  margin-bottom: calc(var(--ip-map-base) - 26px);
}
.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%);
}
