/* ═══════════════════════════════════════════════════════════════════════════
 * /search — THE APPROVED STITCH SEARCH-RESULTS COMPOSITION
 *
 * Source of truth for the composition: `stitch_balibetween_design_system/`
 * `bb_cns_07_search_results_list_desktop/code.html` (the eight bands, in order),
 * `bb_cns_07_search_results_list_mobile/code.html` (the independent phone target)
 * and `bb_cns_09_search_results_split_map_list_desktop/code.html` (the sticky
 * filter bar with the map/list split). This file implements the COMPOSITION from
 * those screens; it takes none of their claims — every string on this surface is
 * catalogue-backed or states plainly that the data does not exist yet.
 *
 * THE ONE FACT THAT IS THE REDESIGN: a result's name is editorial. In the
 * reference it is `font-headline-md text-headline-md` in Newsreader at 28px/36px
 * with `tracking-tight` (-0.01em); the first implementation rendered results as
 * an undifferentiated body-size text list, which an adversarial review measured
 * and flagged. `.bb-sresult__name` is that headline, and it is the point of this
 * stylesheet rather than a detail of it.
 *
 * WHERE THE TOKENS COME FROM. `.site` already carries the Stitch token table
 * (`--bb-stitch-*`, declared in `stitch-home.css`, which the shell links on every
 * public page) and the BB-DS type scale (`--bb-*`, `tokens.css`). This file adds
 * no colour of its own: it names the same surfaces and the same type roles the
 * reference names, so the search surface cannot drift from the homepage.
 *
 * WHAT THIS FILE MAY NOT DO. It may not paint a photograph that is not a real
 * provider photograph, and it may not draw a box where one would go: the 4:3
 * media slot is a RATIO declared on a slot that only exists when a row has a real
 * `photo` (see `resultRow()` in `search.ts`). One provider onboarding turns it on.
 * ═══════════════════════════════════════════════════════════════════════════ */

/* ── the bands, in the reference's order ─────────────────────────────────── */

/* The refine band — Stitch: `bg-surface-container-low py-space-sm shadow-sm`. */
.site .bb-sband--refine {
  background: var(--bb-stitch-surface-low);
  padding-block: var(--space-5);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* The second filter row — Stitch: `bg-surface-container-lowest py-space-sm`. */
.site .bb-sband--filters {
  background: var(--bb-stitch-surface-lowest);
  padding-block: var(--space-4);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid var(--bb-stitch-outline-variant);
}

/* The headline band — Stitch: `pt-space-lg pb-space-xs`. */
.site .bb-sband--head {
  padding-block: var(--space-10) var(--space-4);
}

/* The results band — Stitch: `py-space-md`. */
.site .bb-sband--results {
  padding-block: var(--space-6) var(--space-8);
}

/* The related-links band — Stitch: `py-space-xl`. */
.site .bb-sband--related {
  padding-block: var(--space-12) var(--space-16);
  border-top: 1px solid var(--bb-stitch-outline-variant);
  background: var(--bb-stitch-surface-low);
}

/* ── the refine band ─────────────────────────────────────────────────────── */

.site .bb-srefine {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-4);
}

.site .bb-srefine__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1 1 20rem;
  min-width: 0;
}

.site .bb-srefine__input {
  width: 100%;
  min-height: var(--bb-touch-min);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--bb-stitch-outline-variant);
  border-radius: var(--bb-radius-sm);
  background: var(--bb-stitch-surface-lowest);
  color: var(--bb-stitch-on-surface);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
}

/*
 * THE INK CARRIES ITS OWN FALLBACK — AND THAT IS A REPAIR, NOT A STYLE CHOICE.
 *
 * `--bb-stitch-on-primary` is referenced here and was defined NOWHERE, so `color`
 * was invalid at computed-value time and the label inherited dark ink onto a black
 * button: the accessibility gate measured `button.bb-srefine__submit` at 1.18:1
 * against the 4.5:1 it needs — a visible control with an invisible word on it. The
 * token is being defined in the token layer, which is not this task's file; the
 * fallback here is the same value, so the surface is legible now and stays legible
 * when the token lands. Measured after: #fbf9f5 on #000000 = 20.4:1.
 */
.site .bb-srefine__submit {
  min-height: var(--bb-touch-min);
  padding-inline: var(--space-6);
  border: 0;
  border-radius: var(--bb-radius-sm);
  background: var(--bb-stitch-primary);
  color: var(--bb-stitch-on-primary, #fbf9f5);
  font-family: var(--font-body);
  font-size: var(--bb-micro-size);
  font-weight: var(--bb-micro-weight);
  letter-spacing: var(--bb-stitch-caps-tracking);
  text-transform: uppercase;
  cursor: pointer;
}

.site .bb-srefine__submit:hover {
  background: var(--bb-stitch-secondary);
  color: var(--bb-stitch-on-primary, #fbf9f5);
}

.site .bb-schips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.site .bb-schips__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The refine chips are links that really narrow the list, so they carry a real
   44px target: they are filters, not decoration. */
.site .bb-schips__list a {
  display: inline-flex;
  align-items: center;
  min-height: var(--bb-touch-min);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--bb-stitch-outline-variant);
  border-radius: var(--bb-radius-sm);
  background: var(--bb-stitch-surface-lowest);
  color: var(--bb-stitch-on-surface);
  font-family: var(--font-body);
  font-size: var(--bb-micro-size);
  font-weight: var(--bb-micro-weight);
  letter-spacing: var(--bb-stitch-caps-tracking);
  text-transform: uppercase;
  text-decoration: none;
}

.site .bb-schips__list a:hover {
  background: var(--bb-stitch-primary);
  border-color: var(--bb-stitch-primary);
  color: var(--bb-stitch-on-primary, #fbf9f5);
}

/* ── the second filter row: dimensions with no data behind them ──────────── */

.site .bb-sfilters__label {
  margin: 0 0 var(--space-3);
}

.site .bb-sfilters__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/*
 * A DISABLED CONTROL IS THE HONEST FORM OF AN UNBUILT FILTER.
 *
 * These are real `<button disabled>` elements: focusable-never, operable-never,
 * and visibly at rest. The alternative the review named — a decorative control
 * that silently does nothing — is a control that looks like it narrowed a result
 * set it never touched. Each button is described by the note that follows it, so
 * the reason is available to a screen reader as well as to an eye.
 */
.site .bb-sfilters__list button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--bb-touch-min);
  padding: var(--space-2) var(--space-4);
  border: 1px dashed var(--bb-stitch-outline-variant);
  border-radius: var(--bb-radius-sm);
  background: transparent;
  color: var(--bb-stitch-on-surface-variant);
  font-family: var(--font-body);
  font-size: var(--bb-micro-size);
  font-weight: var(--bb-micro-weight);
  letter-spacing: var(--bb-stitch-caps-tracking);
  text-transform: uppercase;
  cursor: not-allowed;
}

.site .bb-sfilters__state {
  font-size: var(--bb-label-data);
  letter-spacing: var(--bb-stitch-data-tracking);
  text-transform: none;
  color: var(--bb-stitch-secondary);
}

.site .bb-sfilters__note {
  margin: var(--space-4) 0 0;
  max-width: 78ch;
}

/* ── the headline band ───────────────────────────────────────────────────── */

.site .bb-shead__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.site .bb-shead__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--bb-stitch-outline-variant);
}

.site .bb-shead__title {
  margin: 0;
  color: var(--bb-stitch-on-surface);
  text-wrap: balance;
}

.site .bb-shead__carried {
  margin: var(--space-4) 0 0;
  max-width: 78ch;
  color: var(--bb-stitch-on-surface-variant);
}

.site .bb-shead__shared {
  margin: var(--space-3) 0 0;
}

/* ── the split: the list and the schematic map (bb_cns_09) ───────────────── */

.site .bb-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: start;
}

@media (min-width: 1000px) {
  .site .bb-split {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: var(--bb-stitch-gutter-desktop);
  }

  /* Stitch keeps the map in view while the list scrolls. */
  .site .bb-split__map {
    position: sticky;
    top: calc(var(--bb-stitch-head-h) + var(--space-6));
  }
}

/* ── the results: editorial cards, not table rows ─────────────────────────── */

.site .bb-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site .bb-sresult {
  background: var(--bb-stitch-surface-lowest);
  border: 1px solid var(--bb-stitch-outline-variant);
  border-radius: var(--bb-radius-sm);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.site .bb-sresult__body {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  padding: var(--space-6);
}

/*
 * THE 4:3 MEDIA SLOT.
 *
 * The ratio is declared here, on the slot, which exists only for a row that has a
 * real `photo`. Nothing in this file draws a box, an illustration or a stock
 * stand-in where a provider photograph belongs: the adversarial review's finding
 * was that the row had nowhere for a real photograph to go, and the fix is the
 * slot plus its ratio — not an empty frame that reads as imagery.
 */
.site .bb-sresult__media {
  display: block;
  overflow: hidden;
  border-radius: var(--bb-radius-sm);
  background: var(--bb-stitch-surface-low);
  aspect-ratio: 4 / 3;
}

.site .bb-sresult__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 700px) {
  .site .bb-sresult--has-media .bb-sresult__body {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: var(--bb-stitch-gutter-desktop);
    align-items: center;
  }
}

.site .bb-sresult__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.site .bb-sresult__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

/* THE RESULT NAME — Newsreader at headline-md, exactly as the reference sets it. */
.site .bb-sresult__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 2.25rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--bb-stitch-on-surface);
  text-wrap: balance;
}

/*
 * THE NAME'S ANCHOR IS A REAL TARGET, NOT A FONT BOX (A8R-D10).
 *
 * The accessibility gate measured these anchors at 60x22 … 216x22: an inline
 * anchor's box is its font box, so a 22px/28px heading produced a 22px-high target
 * on a surface whose floor is 44px. `inline-block` plus the shared touch height
 * makes the heading name the target it appears to be — and the taller box also
 * gives the hover treatment the row it needs.
 */
.site .bb-sresult__name a {
  display: inline-block;
  min-height: var(--bb-touch-min);
  color: inherit;
  text-decoration: none;
}

.site .bb-sresult__name a:hover {
  color: var(--bb-stitch-secondary);
}

.site .bb-sresult__detail {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.125rem;
  line-height: 1.5rem;
  font-style: italic;
  color: var(--bb-stitch-on-surface-variant);
}

.site .bb-sresult__go {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: var(--bb-touch-min);
  font-family: var(--font-body);
  font-size: var(--bb-micro-size);
  font-weight: var(--bb-micro-weight);
  letter-spacing: var(--bb-stitch-caps-tracking);
  text-transform: uppercase;
  color: var(--bb-stitch-secondary);
  text-decoration: none;
}

/* ── the truthful empty state, inside the same editorial composition ─────── */

.site .bb-sempty {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-8) var(--space-6);
  background: var(--bb-stitch-surface-lowest);
  border: 1px solid var(--bb-stitch-outline-variant);
  border-radius: var(--bb-radius-sm);
}

.site .bb-sempty__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 2.25rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--bb-stitch-on-surface);
}

.site .bb-sempty p {
  margin: 0;
  max-width: 72ch;
  color: var(--bb-stitch-on-surface-variant);
}

.site .bb-sempty__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.site .bb-sempty__cta {
  display: inline-flex;
  align-items: center;
  min-height: var(--bb-touch-min);
  padding-inline: var(--space-5);
  background: var(--bb-stitch-primary);
  color: var(--bb-stitch-on-primary, #fbf9f5);
  border-radius: var(--bb-radius-sm);
  font-family: var(--font-body);
  font-size: var(--bb-micro-size);
  font-weight: var(--bb-micro-weight);
  letter-spacing: var(--bb-stitch-caps-tracking);
  text-transform: uppercase;
  text-decoration: none;
}

/* The sourcing action beside a result set, as an action rather than a result. */
.site .bb-sfallback {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding: var(--space-6);
  border: 1px dashed var(--bb-stitch-outline-variant);
  border-radius: var(--bb-radius-sm);
}

.site .bb-sfallback p {
  margin: 0;
  max-width: 72ch;
  color: var(--bb-stitch-on-surface-variant);
}

/* ── the map column ──────────────────────────────────────────────────────── */

.site .bb-split__map {
  background: var(--bb-stitch-surface-lowest);
  border: 1px solid var(--bb-stitch-outline-variant);
  border-radius: var(--bb-radius-sm);
  padding: var(--space-5);
}

.site .bb-split__map svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ── the related-links band (the reference's h3 band) ────────────────────── */

.site .bb-srelated__title {
  margin: 0 0 var(--space-5);
}

.site .bb-srelated {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 700px) {
  .site .bb-srelated {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-8);
  }
}

@media (min-width: 1000px) {
  .site .bb-srelated {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.site .bb-srelated a {
  display: inline-flex;
  align-items: center;
  min-height: var(--bb-touch-min);
  color: var(--bb-stitch-on-surface);
  text-decoration: none;
  border-bottom: 1px solid var(--bb-stitch-outline-variant);
}

.site .bb-srelated a:hover {
  color: var(--bb-stitch-secondary);
  border-bottom-color: var(--bb-stitch-secondary);
}

/* ── the phone target: the same composition, re-composed ─────────────────── */

/*
 * The mobile reference is NOT the desktop page stacked: a fixed blurred bar with
 * safe-area padding, `pt-14 pb-20` on main, a single short `title-editorial` line
 * instead of the desktop label row, and cards whose name is `headline-sm`
 * (22px/28px). The bottom destination bar and its reserved space belong to the
 * shell (`--bb-mobile-bottom-nav-height`), and this file only keeps clear of it.
 */
@media (max-width: 699px) {
  .site .bb-sband--head {
    padding-block: var(--space-6) var(--space-3);
  }

  .site .bb-shead__meta {
    margin-bottom: var(--space-2);
  }

  .site .bb-shead__title {
    font-size: 2.5rem;
    line-height: 3rem;
  }

  .site .bb-sresult__body {
    padding: var(--space-5);
  }

  .site .bb-sresult__name,
  .site .bb-sempty__title {
    font-size: 1.375rem;
    line-height: 1.75rem;
  }

  .site .bb-split__map {
    padding: var(--space-4);
  }

  .site .bb-srefine__field {
    flex: 1 1 100%;
  }

  .site .bb-srefine__submit {
    width: 100%;
    justify-content: center;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
 * PARAGRAPH-ROLE TEXT IS 16px OR LARGER (the captain's typography ruling)
 *
 * The reference sets its summary and detail copy at `body-md`/`body-sm` (15px and
 * 13px). Prose on this surface uses `--bb-body-lg` (17px) instead, exactly as the
 * homepage does; the sizes below 16px in this file are labels, captions and
 * metadata only — the caps chips, the state word, the disabled-filter labels and
 * the CTA labels, each of which carries an explicit class and is never a bare
 * `<p>`. `.bb-body-lg` is on every paragraph `search.ts` emits.
 * ═══════════════════════════════════════════════════════════════════════════ */
