/* ==========================================================================
   blocks/team-overview — live S3a (docs/BLOCKS.md §4.4, SECTIONS-A §3.2–3.3). Mobile-first.
   Heading group: parts/heading-header (base.css). Trainer rows: parts/trainer-row (trainer-row.css).

   Live (final state)                      390            768            1440
   heading header (h2 + gap + p)          347.63×108.88  500×116.02     500×127.34
   team grid #brxe-uxddaf                  347.63×1107.05 695.56×1104.64 1320×571.53 (2 × 660)
     founders image                        471.47 (m-63)  595.03 (m-6)   571.53 (m-6, cover)
     trainers panel #brxe-heiecc           635.58         509.61         571.53
   team part (header top → grid bottom)    1248.3         1257.92        743.88

   Breakpoints: the grid is 1 column up to 768px (ACSS .grid--m-1 is max-width: 768px, so 2 columns start
   at 769px, not at the 768 tablet breakpoint); the portrait founders image and the wrapping 90%-wide
   buttons are ≤478 (live mobile_portrait), the buttons row wraps ≤767 (Bricks .brxe-block).
   ========================================================================== */

/* ---- Root -------------------------------------------------------------------------------------------
   Nested in a `section` block, the root sits in that block's container: its own children use the
   container's gap, --block-section-gap (live: header, grid and the horses block are siblings in one
   .brxe-container.gap--l). Standalone, the root is a section with its own container. */
.block-team-overview--nested,
.block-team-overview__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.block-team-overview--nested { gap: var(--block-section-gap, var(--space-l)); }
.block-team-overview__inner { gap: var(--space-l); }

/* ---- Team grid (live #brxe-uxddaf: blue panel, radius 3rem, clipped) ------------------------------- */
.block-team-overview__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  background-image: var(--wfx-panel-grad);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

/* ---- Founders card (live #brxe-alzwqv) ------------------------------------------------------------ */
.block-team-overview__founders {
  position: relative;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  width: 100%;
}

/* Cover-fit to the column: at 2 columns the row height comes from the trainers panel; at 1 column the
   image keeps its own ratio (portrait ≤478, landscape above). */
.block-team-overview__founders-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.block-team-overview__founders-image--desktop { display: none; }

/* Text over the sky at the top of the photo (live #brxe-kghmxj). */
.block-team-overview__founders-content {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: 1rem;
  width: 100%;
  padding: 2rem 1rem;
}

.block-team-overview__eyebrow {
  color: var(--tertiary);
}

.block-team-overview__founders-heading {
  margin-bottom: 1rem;                                /* live: ≤478 only */
  color: var(--tertiary);
  font-size: var(--h2);
}

.block-team-overview__founders-buttons {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 1rem var(--content-gap);
  width: 100%;
}

.block-team-overview__founders-button {              /* Buttons v2 sm: live's 32px box (#brxe-lmtfoz / #brxe-qwfdhy) */
  width: 90%;                                         /* live: ≤478 only (294.86 @390) */
}

/* ---- Trainers panel (live #brxe-heiecc) ------------------------------------------------------------ */
.block-team-overview__trainers {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  gap: var(--content-gap);
  width: 100%;
  padding: 3rem;
}

.block-team-overview__trainers-heading {
  width: 100%;
  max-width: 30rem;                                   /* "Our / Racehorse / Trainers" in 3 lines @1440 */
  color: var(--white);
  text-align: center;
}

.block-team-overview__trainer-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

/* ---- ≥479 (live > mobile_portrait) --------------------------------------------------------------- */
@media (min-width: 479px) {
  .block-team-overview__founders-image--desktop { display: block; }
  .block-team-overview__founders-image--mobile { display: none; }
  .block-team-overview__founders-heading { margin-bottom: 0; }
  .block-team-overview__founders-buttons { row-gap: var(--content-gap); }
  .block-team-overview__founders-button { width: auto; }
}

/* ---- ≥768 (Bricks blocks stop wrapping) ---------------------------------------------------------- */
@media (min-width: 768px) {
  .block-team-overview__founders-buttons { flex-wrap: nowrap; }
}

/* ---- ≥769 (ACSS .grid--m-1 ends at max-width: 768px) ---------------------------------------------- */
@media (min-width: 769px) {
  .block-team-overview__grid { grid-template-columns: var(--grid-2); }
  .block-team-overview__grid--single { grid-template-columns: minmax(0, 1fr); }   /* no founders card */
}
