/*
 * hbd-locations-map — the full-bleed clinic map, its floating panel, and the single-clinic embed.
 *
 * Every number is a var(--hbd-map-*) from assets/css/tokens.css, where the measurement it came from is
 * named. Breakpoints are the three production switches at: 768 (the panel appears in place of the
 * overlay card), 1024 (the heading grows and the panel moves 40px in) and 1280 (the panel widens to
 * 460) — docs/audit/widgets/locations-map.md §2. Enqueued as `hbd-widget-locations-map` only on pages
 * that render a map.
 */

/* ------------------------------------------------------------------ shell */

/* Full bleed with no gutter of its own: the map runs edge to edge and the panel is positioned inside
   it, so the shared 1280px inner box would only get in the way. */
.hbd-w-locations-map > .hbd-w__inner { max-width: none; padding-inline: 0; }
.hbd-w-locations-map { padding-top: var(--hbd-map-card-top); }
@media (min-width: 768px) { .hbd-w-locations-map { padding-top: var(--hbd-map-pad-top); } }

/* The stage is exactly the map's box, so the panel's insets are the map's insets. Below 768 the map
   is pushed down to leave room for the card that overlaps its top edge. */
/* The 120px is the stage's *padding*, not the map's margin: a top margin on the first child collapses
   out of the stage and takes the panel — which is positioned against the stage's padding box — down
   with it. Measured at 390 before the fix: the head card sat at y164 instead of live's y44. */
.hbd-w-locations-map__stage { position: relative; padding-top: var(--hbd-map-card-pull); }
.hbd-w-locations-map__map { height: var(--hbd-map-h); border-radius: var(--hbd-map-radius); background: var(--hbd-map-placeholder); overflow: hidden; }
@media (min-width: 768px) { .hbd-w-locations-map__stage { padding-top: 0; } }

/* Maps draws its own absolutely positioned furniture inside this box. */
.hbd-w-locations-map__map > div { height: 100%; }

/* No key, or no clinic with coordinates: a flat panel with the reason, never a broken map. */
.hbd-w-locations-map__unavailable { display: flex; align-items: center; justify-content: center; height: 100%; margin: 0; padding: var(--hbd-map-row-pad); font-size: var(--hbd-map-row-address); line-height: var(--hbd-map-row-address-lh); letter-spacing: var(--hbd-map-row-address-ls); color: var(--hbd-text-muted); text-align: center; }
/* Below 768 the card covers the map's top 47px, so the note sits clear of it. */
@media (max-width: 767px) { .hbd-w-locations-map__unavailable { align-items: flex-start; padding-top: calc(var(--hbd-map-card-pull) / 2); } }

/* ------------------------------------------------------------------ panel */

/* One element, two shapes. Below 768 it is the card overlapping the map's top edge; from 768 it floats
   over the map's right side and grows the clinic list. */
.hbd-w-locations-map__panel { position: absolute; top: 0; left: var(--hbd-map-card-inset); right: var(--hbd-map-card-inset); padding: var(--hbd-map-card-pad); background: var(--hbd-white); border-radius: var(--hbd-radius-card); box-shadow: var(--hbd-map-card-shadow); }
@media (min-width: 768px) {
	.hbd-w-locations-map__panel { top: var(--hbd-map-panel-inset-block); bottom: var(--hbd-map-panel-inset-block); left: auto; right: var(--hbd-map-panel-inset); width: var(--hbd-map-panel-w); padding: var(--hbd-map-panel-pad); box-shadow: var(--hbd-map-panel-shadow); }
}

/* The inner column is capped at 600px and the list takes whatever the copy leaves — which is how live
   fits a 3-line heading at 1024 and a 2-line one at 768 into the same panel. */
@media (min-width: 768px) {
	.hbd-w-locations-map__panel-inner { display: flex; flex-direction: column; max-height: var(--hbd-map-panel-inner-h); }
	/* An open clinic card covers the panel; the copy and the list keep their space but stop painting,
	   so nothing behind the card can be read or tabbed into. */
	.hbd-w-locations-map__panel.is-open .hbd-w-locations-map__head,
	.hbd-w-locations-map__panel.is-open .hbd-w-locations-map__list { visibility: hidden; }
}

/* ------------------------------------------------------------------- head */

/* The whole heading is italic from 768 — it is the section's own styling, not a marked-up accent, so
   it lives here. Below 768 live sets it upright and a size smaller. */
.hbd-w-locations-map__heading { margin: 0 0 var(--hbd-map-card-heading-gap); font-size: var(--hbd-map-card-heading); line-height: var(--hbd-map-card-heading-lh); font-weight: 300; letter-spacing: normal; color: var(--hbd-ink); }
.hbd-w-locations-map__text { margin: 0; font-size: var(--hbd-map-card-text); line-height: var(--hbd-map-card-text-lh); color: var(--hbd-ink); }
@media (min-width: 768px) {
	.hbd-w-locations-map__heading { margin-bottom: var(--hbd-map-heading-gap); font-size: var(--hbd-map-heading); line-height: var(--hbd-map-heading-lh); font-style: italic; }
	.hbd-w-locations-map__text { font-size: var(--hbd-map-text); line-height: var(--hbd-map-text-lh); }
}

/* ------------------------------------------------------------------- list */

/* There is no clinic list on a phone at all — live drops it with the panel. */
.hbd-w-locations-map__list { display: none; }
@media (min-width: 768px) {
	.hbd-w-locations-map__list { display: block; position: relative; flex: 1 1 auto; min-height: 0; margin-top: var(--hbd-map-text-gap); overflow-y: auto; }
}
.hbd-w-locations-map__rows { display: flex; flex-direction: column; gap: var(--hbd-map-row-gap); margin: 0; padding: 0 0 var(--hbd-map-list-pad); list-style: none; }

/* A row is a link (so it goes somewhere with JavaScript off) painted as live's inert box. */
.hbd-w-locations-map__row { display: block; padding: var(--hbd-map-row-pad); border: var(--hbd-map-row-border); border-radius: var(--hbd-map-row-radius); color: inherit; text-decoration: none; cursor: pointer; }
.hbd-w-locations-map__row:hover,
.hbd-w-locations-map__row:focus { color: inherit; text-decoration: none; }
.hbd-w-locations-map__row:focus-visible { outline: 2px solid var(--hbd-navy); outline-offset: 2px; }
.hbd-w-locations-map__row:focus:not(:focus-visible) { outline: none; }
.hbd-w-locations-map__row[aria-expanded="true"] { border-color: var(--hbd-navy); }

.hbd-w-locations-map__row-name { margin: 0 0 var(--hbd-map-row-name-gap); font-family: var(--hbd-font-serif-2); font-size: var(--hbd-map-row-name); line-height: var(--hbd-map-row-name-lh); font-weight: 400; letter-spacing: var(--hbd-map-row-name-ls); color: var(--hbd-navy); }
.hbd-w-locations-map__row-address { margin: 0; font-size: var(--hbd-map-row-address); line-height: var(--hbd-map-row-address-lh); letter-spacing: var(--hbd-map-row-address-ls); color: var(--hbd-ink); }
.hbd-w-locations-map__row-line { display: block; }

/* ----------------------------------------------------------------- nudge */

/* In the scroll flow after the last row, yet painted over the middle of the list: sticky, 20px above
   the scrollport's floor. One use scrolls the list to its end and removes it for good (§4). */
.hbd-w-locations-map__nudge { position: sticky; bottom: var(--hbd-map-nudge-inset); display: flex; justify-content: center; height: var(--hbd-map-nudge); margin-top: calc(-1 * var(--hbd-map-nudge)); pointer-events: none; }
.hbd-w-locations-map__nudge-btn,
.hbd-w-locations-map__nudge-btn:hover,
.hbd-w-locations-map__nudge-btn:focus { background: var(--hbd-white); color: var(--hbd-ink); }
.hbd-w-locations-map__nudge-btn { display: flex; align-items: center; justify-content: center; align-self: center; width: var(--hbd-map-nudge-disc); height: var(--hbd-map-nudge-disc); padding: 0; border: 0; border-radius: var(--hbd-radius-pill); box-shadow: var(--hbd-map-nudge-shadow); color: var(--hbd-ink); cursor: pointer; pointer-events: auto; animation: hbd-map-nudge 1.4s infinite; }
.hbd-w-locations-map__nudge-btn:focus-visible { outline: 2px solid var(--hbd-navy); outline-offset: 2px; }
.hbd-w-locations-map__nudge-btn:focus:not(:focus-visible) { outline: none; }
.hbd-w-locations-map__nudge-glyph { width: var(--hbd-map-nudge-glyph); height: auto; }
@keyframes hbd-map-nudge {
	0%, 50%, 100% { transform: translateY(0); }
	25% { transform: translateY(var(--hbd-map-nudge-travel)); }
}
@media (prefers-reduced-motion: reduce) { .hbd-w-locations-map__nudge-btn { animation: none; } }
/* It only does anything with JavaScript, so without it there is nothing to show. */
@media (scripting: none) { .hbd-w-locations-map__nudge { display: none; } }

/* ------------------------------------------------------------ clinic card */

/* Rendered for every clinic and revealed in place of the list — so there is no client-side templating
   and the card's copy is in the page for anything that reads it. It covers the panel's *content box*
   (the panel is the positioned ancestor, so the inset is the panel's own padding), which is how live's
   card ends up the same width as the list it replaced and its two buttons land on the panel's floor.
   There is no list on a phone, so there is no way to open a card either — it is simply not rendered. */
.hbd-w-locations-map__clinic { display: none; }
@media (min-width: 768px) {
	.hbd-w-locations-map__clinic { position: absolute; inset: var(--hbd-map-panel-pad); display: flex; flex-direction: column; background: var(--hbd-white); }
	.hbd-w-locations-map__clinic[hidden] { display: none; }
}

/* Live hangs the close button off the card's top-right corner, past the panel's edge, with no
   background of its own — and Astra paints every bare <button> navy, hover included, so the
   transparent background has to be stated three times to stick. */
.hbd-w-locations-map__close,
.hbd-w-locations-map__close:hover,
.hbd-w-locations-map__close:focus { background: transparent; box-shadow: none; color: var(--hbd-ink); }
.hbd-w-locations-map__close { position: absolute; top: var(--hbd-map-detail-close-inset); right: var(--hbd-map-detail-close-inset); display: flex; align-items: center; justify-content: center; width: var(--hbd-map-detail-close); height: var(--hbd-map-detail-close); padding: 0; border: 0; cursor: pointer; }
/* The 72px box is the hit area; the disc the eye sees is 40px, white, on the card's shadow (client QC
   2026-09-23 — live's ✕ is a bare glyph). A pseudo-element so the hit area and the disc stay separate. */
.hbd-w-locations-map__close::before { content: ''; position: absolute; width: var(--hbd-map-detail-close-disc); height: var(--hbd-map-detail-close-disc); border-radius: var(--hbd-radius-pill); background: var(--hbd-white); box-shadow: var(--hbd-map-detail-close-disc-shadow); }
.hbd-w-locations-map__close:focus-visible { outline: 2px solid var(--hbd-navy); outline-offset: -4px; }
/* Opening a card moves focus to its ✕ so a keyboard user lands inside it; Astra's own button outline
   would then show after a *mouse* click too, which live never draws. */
.hbd-w-locations-map__close:focus:not(:focus-visible) { outline: none; }
.hbd-w-locations-map__close-glyph { position: relative; width: var(--hbd-map-detail-close-glyph); height: var(--hbd-map-detail-close-glyph); }

/* Live's photo is a square-cornered band across the card's content box. */
.hbd-w-locations-map__clinic-media { margin-bottom: var(--hbd-map-detail-photo-gap); }
.hbd-w-locations-map__clinic-media img { display: block; width: 100%; height: var(--hbd-map-detail-photo-h); object-fit: cover; }

.hbd-w-locations-map__clinic-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.hbd-w-locations-map__clinic-name { margin: 0 0 var(--hbd-map-detail-name-gap); font-family: var(--hbd-font-serif-2); font-size: var(--hbd-map-detail-name); line-height: var(--hbd-map-detail-name-lh); font-weight: 400; letter-spacing: normal; color: var(--hbd-navy); }

.hbd-w-locations-map__clinic-address,
.hbd-w-locations-map__clinic-row { display: flex; align-items: flex-start; gap: var(--hbd-map-detail-icon-gap); margin: 0 0 var(--hbd-map-detail-row-gap); font-size: var(--hbd-map-detail-line); line-height: var(--hbd-map-detail-line-lh); color: var(--hbd-ink); }
.hbd-w-locations-map__clinic-address { line-height: var(--hbd-map-detail-address-lh); letter-spacing: var(--hbd-map-row-address-ls); }
.hbd-w-locations-map__clinic-icon { flex: 0 0 var(--hbd-map-detail-icon); width: var(--hbd-map-detail-icon); height: var(--hbd-map-detail-icon); }
/* base.css links are blue; live prints the number in the card's own ink and never underlines it. */
.hbd-w-locations-map__clinic-link { color: inherit; text-decoration: none; }
.hbd-w-locations-map__clinic-link:hover,
.hbd-w-locations-map__clinic-link:focus { color: inherit; text-decoration: underline; }

.hbd-w-locations-map__clinic-label { margin: var(--hbd-map-detail-label-gap) 0 0; font-family: var(--hbd-font-body); font-size: var(--hbd-map-detail-label); line-height: var(--hbd-map-detail-label-lh); font-weight: 400; letter-spacing: var(--hbd-map-row-address-ls); color: var(--hbd-navy); }
.hbd-w-locations-map__clinic-pills { display: flex; flex-wrap: wrap; gap: var(--hbd-map-detail-pill-gap); margin-top: var(--hbd-map-detail-label-gap); }
/* Live's pill is the **mono** face at 12/13.2, uppercase, tracked 2.5%, on sky with 12px/16px of
   padding. `.hbd-pill--sky` is the theme's other sky pill (body face, sentence case, 13px), so all
   four of those come back here. */
.hbd-w-locations-map__clinic-pill { padding: var(--hbd-map-detail-pill-pad); font-family: var(--hbd-font-mono); font-size: var(--hbd-map-detail-pill); line-height: var(--hbd-map-detail-pill-lh); letter-spacing: var(--hbd-map-row-address-ls); text-transform: uppercase; border: 0; }

/* The two buttons are pinned to the card's floor; the space above them flexes. */
.hbd-w-locations-map__clinic-actions { display: flex; flex-direction: column; gap: var(--hbd-map-detail-btn-gap); margin-top: var(--hbd-map-detail-label-gap); }
/* 12px of padding on a 20px line is live's 44px navy button — but only without `.hbd-btn`'s 1px
   transparent border, which would make it 46. The *outline* button really is 46 on live, so the border
   is zeroed on the primary alone and the pair measures live's 44 + 8 + 46 = 98. Same pattern as
   `.hbd-w-location-cards__btn`. */
.hbd-w-locations-map__clinic-btn { padding: var(--hbd-map-detail-btn-pad); }
.hbd-w-locations-map__clinic-btn.hbd-btn--primary { border-width: 0; }

/* The label Maps paints beside the selected pin — live's white chip with the clinic's short name.
   Google renders it inside the marker's own container, so it is styled by class, not by nesting. */
.hbd-w-locations-map__pin-label { padding: var(--hbd-map-row-name-gap) var(--hbd-map-detail-icon-gap); background: var(--hbd-white); border-radius: var(--hbd-radius-xs); box-shadow: var(--hbd-map-panel-shadow); font-family: var(--hbd-font-body); font-size: var(--hbd-map-row-address); line-height: var(--hbd-map-row-address-lh); color: var(--hbd-ink); white-space: nowrap; }

/* The Advanced Marker pin (a Map ID is set): our own element, so the chip is placed here rather than by
   Maps — centred above the pin's head, where the legacy marker's labelOrigin puts it. */
.hbd-w-locations-map__pin { position: relative; line-height: 0; cursor: pointer; }
.hbd-w-locations-map__pin > .hbd-w-locations-map__pin-label { position: absolute; bottom: calc(100% + var(--hbd-map-row-name-gap)); left: 50%; transform: translateX(-50%); }
.hbd-w-locations-map__pin > .hbd-w-locations-map__pin-label[hidden] { display: none; }

/* ---------------------------------------------------------- single embed */

/* `.hbd-map-embed` itself lives in widgets/_base/design.css — `hbd-location-details` draws the same
   block in its middle column and must not have to load this whole stylesheet for two rules. */
.hbd-w-locations-map--single > .hbd-w__inner { max-width: calc(var(--hbd-container) + 2 * var(--hbd-gutter)); padding-inline: var(--hbd-gutter); }

/* ------------------------------------------------------------------ search

   Production's /locations/ panel: a hairline under the heading, then one field and a Search button on
   one row (measured 2026-09-21 — input 297.4 x 38 at x=20, button 99.6 x 38, both 38 tall, the row
   13px under the rule). Home's panel has no search, so every rule here is scoped to the modifier the
   widget adds when the field is on. */
.hbd-w-locations-map__search { display: flex; gap: var(--hbd-lmap-search-gap); align-items: center; padding: var(--hbd-lmap-search-pad); border-top: 1px solid var(--hbd-grey-200); }
.hbd-w-locations-map__search .hbd-w-locations-map__search-input {
	flex: 1 1 auto; min-width: 0;
	/* Astra prints `input[type=text], … { height: 40px }` *inline*, so it is the same 0-1-0 weight as a
	   bare class here and wins on order. The selector is scoped through the form to out-specify it —
	   the same reason header.css has to out-specify Astra's generated mega-menu rules. Production's
	   field is 38 with its 1px border inside, hence border-box. */
	box-sizing: border-box;
	height: var(--hbd-lmap-search-h);
	padding-inline: var(--hbd-lmap-search-input-pad);
	font: inherit; font-size: var(--hbd-lmap-search-fs);
	color: var(--hbd-ink); background: var(--hbd-white);
	border: 1px solid var(--hbd-grey-200); border-radius: var(--hbd-radius-s);
}
.hbd-w-locations-map__search-input:focus { outline: 2px solid var(--hbd-blue); outline-offset: 0; border-color: var(--hbd-blue); }
/* The pill is the shared button; only its height and the border Astra adds are restated. */
.hbd-w-locations-map__search-btn { flex: 0 0 auto; height: var(--hbd-lmap-search-h); border-width: 0; }
.hbd-w-locations-map__search-empty { margin: 0; padding: var(--hbd-lmap-search-pad); font-size: var(--hbd-lmap-search-fs); color: var(--hbd-text); }

/* ------------------------------------------------- layout: column (/locations/)

   Production's /locations/ is one band: a solid panel down the left — 445px wide at 1440, flush to the
   top, bottom and left with no radius, no inset and no shadow — and the map filling the rest. The
   floating card above is home's composition; this is its sibling, selected by the search field being
   on (tpl/default.php says why). Below 1024 the panel stacks over the map, as the floating one does.
   Measured 2026-09-21, docs/audit/templates/shots/locations-live/. */
/* The band is flush under the header on production — no section padding above it — and the panel's
   heading is 24/29, not the page-title step the floating card uses. Both apply at every width. */
.hbd-w-locations-map--column { padding-top: 0; }
.hbd-w-locations-map--column .hbd-w-locations-map__heading { font-size: var(--hbd-lmap-col-heading); line-height: var(--hbd-lmap-col-heading-lh); }

@media (min-width: 1024px) {
	.hbd-w-locations-map--column .hbd-w-locations-map__panel {
		top: 0; bottom: 0; left: 0; right: auto;
		width: var(--hbd-lmap-col-w);
		max-width: 100%;
		padding: 0;
		border-radius: 0;
		box-shadow: none;
	}
	/* The panel's own scroller: the heading and the search stay put while the clinics scroll past. */
	.hbd-w-locations-map--column .hbd-w-locations-map__panel-inner { max-height: 100%; height: 100%; }
	.hbd-w-locations-map--column .hbd-w-locations-map__head { padding: var(--hbd-lmap-col-head-pad); }
	/* The clinic list carries the same inset as the head, and its row cards are production's own
	   20px / 7px / 8px rather than the floating card's (client QC 2026-09-23: the rows had run flush
	   to both edges of the panel). */
	.hbd-w-locations-map--column .hbd-w-locations-map__list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 var(--hbd-lmap-col-list-pad); }
	.hbd-w-locations-map--column .hbd-w-locations-map__rows { gap: var(--hbd-lmap-col-row-gap); padding-bottom: var(--hbd-lmap-col-list-pad); }
	.hbd-w-locations-map--column .hbd-w-locations-map__row { padding: var(--hbd-lmap-col-row-pad); border-radius: var(--hbd-lmap-col-row-radius); }
	.hbd-w-locations-map--column .hbd-w-locations-map__row-name { font-size: var(--hbd-lmap-col-row-name); line-height: var(--hbd-lmap-col-row-name-lh); margin-bottom: var(--hbd-lmap-col-row-name-gap); }
}
