/**
 * Macro layout — grids, flows, and every @media breakpoint.
 * Mobile-first: rules with no media query below ARE the mobile layout.
 * Breakpoints mirror tokens.css comments: sm 640 / md 768 / lg 960.
 *
 * LOAD ORDER: this file MUST be linked AFTER components.css. Several
 * selectors here (e.g. .bp-nav-toggle, .bp-nav-list) have the same specificity
 * as their unconditional counterpart in components.css; the @media
 * overrides only win because they come later in source order.
 */

/* ---------- Header ---------- */
.bp-site-header__inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-3);
}

.bp-site-nav { display: flex; align-items: center; }

/* Single <nav>/<ul> in the DOM — burger only toggles visibility of the one list */
.bp-nav-list {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: var(--z-dropdown);
}
.bp-nav-list.bp-is-open { display: flex; }

@media (min-width: 768px) {
  .bp-nav-toggle { display: none; }
  .bp-site-nav { order: 1; }
  .bp-nav-list {
    display: flex !important;
    flex-direction: row;
    position: static;
    gap: var(--space-6);
    background: none;
    border: 0;
    padding: 0;
  }
  .bp-nav-list a { padding: 0; }
}

/* ---------- Hero ---------- */
.bp-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8);
  align-items: center;
}
.bp-hero__cta {
  margin-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.bp-hero__banner-wrap {
  display: flex;
  justify-content: center;
}
@media (max-width: 639px) {
  .bp-hero__banner { max-width: none; }
}
@media (min-width: 960px) {
  .bp-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .bp-hero__banner-wrap { justify-content: flex-end; }
}

/* ---------- Stats ---------- */
/* minmax(0, 1fr), not plain 1fr: grid tracks default to min-width:auto,
   which floors at the longest unbreakable word (e.g. an uppercase label) —
   same class of bug as flex-child overflow, see css-layout skill. */
.bp-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}
@media (min-width: 640px) {
  .bp-stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

/* Below 640px the grid stays 2-up (see above), so each .bp-stat__value only
   gets ~half the container width minus card padding. var(--fs-number)'s
   own floor (2rem, flat from 0 to 640px — 5vw doesn't overtake 2rem until
   the viewport hits 640px) is too wide for that column: the longest value
   on this page, "1.5974x", measures ~116px at 32px/tabular-nums but the
   column at 320px is only ~86px, clipping ~30px of the string with no
   space to wrap on (no break opportunity in "1.5974x"). Scoped override,
   not a change to the shared --fs-number token, so .bp-calculator__result-value
   (also on --fs-number, but never in a 2-col grid this narrow) is untouched.
   clamp(1.25rem, 6vw, 2rem) verified via Playwright at 320/360/375/400px
   against all four locales' stat values (incl. de "90+ Sek.", the longest
   breakable string) with real sub-pixel margin, not just the clip flag. */
@media (max-width: 639px) {
  .bp-stat__value { font-size: clamp(1.25rem, 6vw, 2rem); }
}

/* .bp-stat__label has the same 86px-at-320px column, but a fixed (non-fluid)
   14px font, and de/no/fi carry single-word compound labels with no space
   to break on — "Multiplikator" (de/no) is the worst case, clipped by
   ~37px at 320px pre-fix. Fluid size + slightly tighter tracking closes
   most of that gap (verified worst-case margin: comfortably positive at
   320-639px, all 4 locales); overflow-wrap: anywhere is kept as the actual
   safety net (same pattern already used on .bp-cta-card's button copy above,
   for the same de/fi long-word reason) so a future translation longer than
   "Multiplikator" degrades to a mid-word break instead of clipping again. */
@media (max-width: 639px) {
  .bp-stat__label {
    font-size: clamp(0.75rem, 3vw, 0.875rem);
    letter-spacing: 0.04em;
    overflow-wrap: anywhere;
  }
}

/* ---------- State cards ---------- */
/* Only 2 cards now (Sicher/Gefahr screenshots) — the 3rd state (no
   screenshot available) lives outside this grid as a full-width strip, see
   .bp-state-card--note in components.css. Stays 2-up from sm up instead of
   growing to 3 columns at lg: with only two grid items a 3-column track
   would leave a permanently empty third column. */
.bp-state-shots {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}
@media (min-width: 640px) {
  .bp-state-shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Comparison table ---------- */
/* Card mode is the mobile-first default; table mode kicks in from sm up */
@media (min-width: 640px) {
  .bp-compare-table--cards thead {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }
  .bp-compare-table--cards tr {
    display: table-row;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 0;
  }
  .bp-compare-table--cards tbody tr:hover { background: var(--surface); }
  .bp-compare-table--cards td {
    display: table-cell;
    border-bottom: 1px solid var(--border);
    padding: var(--space-3) var(--space-4);
    text-align: left;
  }
  .bp-compare-table--cards tbody tr:last-child td { border-bottom: 0; }
  .bp-compare-table--cards td::before { content: none; }
}

/* ---------- Calculator ---------- */
@media (min-width: 640px) {
  .bp-calculator { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .bp-calculator__result { grid-column: 1 / -1; }
}

/* ---------- FAQ ---------- */
.bp-faq-list { max-width: 80ch; }

/* ---------- CTA ---------- */
.bp-cta-block__actions {
  margin-top: var(--space-6);
  display: flex;
  justify-content: center;
}

/* ---------- Footer ---------- */
.bp-site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: center;
  text-align: center;
}
@media (min-width: 640px) {
  .bp-site-footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  /* The legal line is long; without these it wins the flex fight and squeezes
     the logo to a third of its intended width (measured: 137px spec vs 50px
     actual at 768). The text must wrap, the mark must not shrink. */
  .bp-site-footer__inner > p:not(.bp-site-footer__brand) {
    min-width: 0;
  }

  .bp-site-footer__brand {
    flex-shrink: 0;
  }
}
