/* ==========================================================================
   Event Brand page — task-262 / ADR-011
   Editorial-minimal, photo/video-led. One accent (brand --brand-primary), hairline
   rules, sharp corners, big type (Space Grotesk display + Inter text), generous
   whitespace, gradient scrim ON photos. Deliberately NOT the gradient-card / pill /
   multicolor / heavy-shadow "AI website" look.
   App-prefixed (.bd-*) to avoid cross-section conflicts. Mobile-first.
   ========================================================================== */

.bd {
  --bd-accent: var(--brand-primary, #138577);
  --bd-accent-2: var(--brand-secondary, #d4a24c);
  --bd-ink: #14201d;
  --bd-paper: #ffffff;
  --bd-muted: #5d6b66;
  --bd-hairline: #e4e8e6;
  --bd-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --bd-text: 'Inter', system-ui, sans-serif;
  color: var(--bd-ink);
  font-family: var(--bd-text);
  background: var(--bd-paper);
}

.bd *,
.bd *::before,
.bd *::after { box-sizing: border-box; }

.bd-container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.bd-eyebrow {
  font-family: var(--bd-text);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bd-accent);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.bd-eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--bd-accent);
  display: inline-block;
}

.bd-h2 {
  font-family: var(--bd-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}

/* ---------- HERO ---------- */
/* TRUE full-viewport hero that sits UNDER the fixed site navbar.
   The site base wraps content in #main-content { padding-top: var(--navbar-height) }
   (80px desktop / 70px mobile) which would otherwise push the hero photo below the bar.
   We cancel that with a negative top margin equal to the navbar height so the photo
   bleeds to the very top of the viewport, behind the transparent navbar. The hero's own
   top padding (.bd-hero__inner) then clears the bar so the text never sits under it. */
.bd-hero {
  position: relative;
  /* Fill the viewport: 100svh accounts for mobile browser chrome; 100vh is the fallback. */
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  /* Pull up under the fixed navbar (height from the global design-system token). */
  margin-top: calc(-1 * var(--navbar-height, 80px));
  /* Branded default backdrop — looks designed even before a hero photo/video is set.
     A real hero_media/hero_image (object-fit:cover, absolute) paints over this. */
  background:
    radial-gradient(125% 85% at 82% -10%, color-mix(in srgb, var(--bd-accent) 42%, transparent) 0%, rgba(11,21,19,0) 55%),
    linear-gradient(158deg, #0e211c 0%, #0b1513 58%, #07100e 100%);
  color: #fff;
}
/* On phones the navbar is shorter — pull up by the mobile navbar height instead. */
@media (max-width: 900px) {
  .bd-hero { margin-top: calc(-1 * var(--navbar-height-mobile, 70px)); }
}
.bd-hero__media,
.bd-hero__media img,
.bd-hero__media video,
.bd-hero__embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bd-hero__embed { border: 0; }
/* Gradient scrim ON the photo — keeps text legible, gives the editorial mood */
.bd-hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8,16,14,0.15) 0%, rgba(8,16,14,0.0) 30%, rgba(8,16,14,0.78) 100%),
    linear-gradient(90deg, rgba(8,16,14,0.55) 0%, rgba(8,16,14,0.0) 55%);
}
.bd-hero__inner {
  position: relative;
  width: 100%;
  /* Clear the fixed navbar (height token) + breathing room, so the logo/title never
     tuck under the bar on short viewports where the bottom-aligned content grows tall. */
  padding-top: calc(var(--navbar-height, 80px) + 48px);
  padding-bottom: clamp(48px, 8vh, 96px);
}
@media (max-width: 900px) {
  .bd-hero__inner { padding-top: calc(var(--navbar-height-mobile, 70px) + 36px); }
}
.bd-hero__logo {
  height: clamp(52px, 8vw, 88px);
  width: auto;
  margin-bottom: 22px;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.35));
}
.bd-hero__title {
  font-family: var(--bd-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 6rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  max-width: 16ch;
  /* Direct color — inherited #fff from .bd-hero loses to a global `h1{color}` rule
     (inheritance is weaker than any direct selector). Keep the hero title legible. */
  color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.35);
}
.bd-hero__tagline {
  font-size: clamp(1.05rem, 2.2vw, 1.5rem);
  font-weight: 400;
  line-height: 1.4;
  max-width: 46ch;
  color: rgba(255,255,255,0.92);
  margin: 0 0 30px;
}
.bd-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.86);
  margin-bottom: 30px;
}
.bd-hero__meta span { display: inline-flex; align-items: center; gap: 8px; }
.bd-hero__meta i { color: var(--bd-accent-2); }

/* ---------- Buttons ---------- */
.bd-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  font-family: var(--bd-text);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  border-radius: 0;            /* sharp, not pill */
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform .15s ease, background-color .15s ease, color .15s ease;
}
.bd-btn--primary { background: var(--bd-accent); color: #fff; }
.bd-btn--primary:hover { background: #0f6f64; color: #fff; transform: translateY(-2px); }
.bd-btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.55); }
.bd-btn--ghost:hover { border-color: #fff; transform: translateY(-2px); color: #fff; }
.bd-btn--ink { background: var(--bd-ink); color: #fff; }
.bd-btn--ink:hover { background: var(--bd-accent); color: #fff; transform: translateY(-2px); }

/* ---------- Section frame ---------- */
/* Double class (.bd-section.bd-section--X) + .bd ancestor = specificity (0,3,0), which beats the
   global `.events-page section:nth-child(2n)` (0,2,1) in events.css that was tinting even-indexed
   sections (it had hidden the dark closing CTA band). */
.bd .bd-section { padding: clamp(56px, 9vw, 120px) 0; }
.bd .bd-section.bd-section--paper { background: var(--bd-paper); }
.bd .bd-section.bd-section--alt { background: #f6f8f7; }
.bd .bd-section.bd-section--ink { background: var(--bd-ink); color: #fff; }
.bd .bd-section--ink .bd-h2,
.bd .bd-section--ink .bd-eyebrow { color: #fff; }

/* ---------- Stats strip ---------- */
.bd-stats {
  display: grid;
  /* auto-fit so N stats fill the row. Dividers are drawn by the cells (inset shadow),
     NOT by a hairline parent bg — so a wrapped odd cell never shows as an empty grey box. */
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  background: var(--bd-paper);
  border: 1px solid var(--bd-hairline);
}
.bd-stat {
  background: var(--bd-paper);
  padding: clamp(28px, 4vw, 44px) 24px;
  text-align: center;
  box-shadow: inset 1px 0 0 var(--bd-hairline), inset 0 1px 0 var(--bd-hairline);
}
.bd-stat__num {
  font-family: var(--bd-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--bd-accent);
}
.bd-stat__label {
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bd-muted);
}

/* ---------- Lead paragraph ---------- */
.bd-lead {
  max-width: 640px;
  color: var(--bd-muted);
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.6;
  margin: 0 0 32px;
}

/* ---------- Distances (5K · 10K · 21K) ---------- */
.bd-distances {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0;
  border: 1px solid var(--bd-hairline);
}
.bd-distance {
  padding: clamp(26px, 3vw, 40px) clamp(22px, 2.4vw, 32px);
  background: var(--bd-paper);
  box-shadow: inset 1px 0 0 var(--bd-hairline), inset 0 1px 0 var(--bd-hairline);
  transition: background-color .2s ease;
}
.bd-distance:hover { background: #fafcfb; }
.bd-distance__km {
  font-family: var(--bd-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--bd-accent);
}
.bd-distance__km span {
  font-size: 0.85rem; font-weight: 600; color: var(--bd-muted);
  margin-left: 7px; letter-spacing: 0.08em; text-transform: uppercase;
}
.bd-distance__title {
  font-family: var(--bd-display); font-weight: 600; font-size: 1.3rem;
  margin: 16px 0 8px; letter-spacing: -0.01em;
}
.bd-distance__desc { color: #3a4742; font-size: 0.96rem; line-height: 1.55; margin: 0 0 16px; }
.bd-distance__meta { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bd-distance__meta li { display: flex; align-items: center; gap: 9px; font-size: 0.88rem; color: var(--bd-muted); }
.bd-distance__meta i { color: var(--bd-accent-2); width: 16px; text-align: center; }

/* ---------- Brand story ---------- */
.bd-story {
  max-width: 720px;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.7;
  color: #34423d;
}
.bd-story p { margin: 0 0 1.1em; }

/* ---------- Editions archive ---------- */
.bd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 26px;
}
.bd-edition {
  position: relative;
  display: block;
  text-decoration: none;
  color: #fff;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #0b1513;
}
.bd-edition img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.bd-edition:hover img { transform: scale(1.05); }
.bd-edition__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8,16,14,0.05) 30%, rgba(8,16,14,0.85) 100%);
}
.bd-edition__body {
  position: absolute;
  inset: auto 0 0 0;
  padding: 24px;
}
.bd-edition__year {
  font-family: var(--bd-display);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.bd-edition__name { font-size: 0.98rem; font-weight: 500; opacity: 0.92; margin-top: 4px; }
.bd-edition__cta {
  margin-top: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bd-accent-2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Sponsors ---------- */
.bd-sponsors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1px;
  background: var(--bd-hairline);
  border: 1px solid var(--bd-hairline);
}
.bd-sponsor {
  background: var(--bd-paper);
  aspect-ratio: 3 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}
.bd-sponsor img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.62;
  transition: filter .2s ease, opacity .2s ease;
}
.bd-sponsor:hover img { filter: grayscale(0); opacity: 1; }

/* Main sponsors (tier=main or sponsor_type order 0): larger cells, full colour, shown above the
   rest as a prominent row. task-270. */
.bd-sponsors--main {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  max-width: 920px;
  margin: 0 auto 2px;
}
.bd-sponsor--main {
  aspect-ratio: 16 / 9;
  padding: 30px;
}
.bd-sponsor--main img {
  filter: none;
  opacity: 1;
}

/* ---------- Comuni / patrocini ----------
   Institutional band, deliberately distinct from the commercial sponsors grid above:
   centered pill chips (optional crest + name), not a logo wall. */
.bd-comuni {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}
.bd-comune__inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid var(--bd-hairline);
  border-radius: 999px;
  background: var(--bd-paper);
  font-family: var(--bd-display);
  font-weight: 500;
  font-size: 1rem;
  color: var(--bd-ink);
  text-decoration: none;
  transition: border-color .2s ease, transform .2s ease;
}
a.bd-comune__inner:hover { border-color: var(--bd-accent); transform: translateY(-2px); }
.bd-comune__crest {
  height: 40px;
  width: auto;
  max-width: 64px;
  object-fit: contain;
}
.bd-comune__name { line-height: 1.2; }

/* ---------- Instagram reels (task-268) ----------
   Horizontal scroll strip of vertical 9:16 clips that autoplay (muted/loop) on scroll-into-view.
   Re-hosted MP4s — Instagram's own embeds can't autoplay. Sits on an --ink (dark) section. */
.bd-reels {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}
.bd-reel {
  flex: 0 0 auto;
  width: min(72vw, 270px);
  scroll-snap-align: start;
  margin: 0;
  position: relative;
}
.bd-reel__video {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 14px;
  background: #0b1d33;
  display: block;
}
.bd-reel__ig {
  position: absolute;
  left: 10px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(8, 20, 36, .72);
  color: #fff;
  font-size: .82rem;
  text-decoration: none;
  backdrop-filter: blur(4px);
  transition: background .2s ease;
}
.bd-reel__ig:hover { background: var(--bd-accent); }
.bd-reel__caption {
  margin-top: 8px;
  color: rgba(255, 255, 255, .72);
  font-size: .9rem;
  line-height: 1.3;
}

/* ---------- Gallery ----------
   Mobile-first compact grid (NOT one big image at a time):
   2 columns on phones → 3 on small tablets → 4 on desktop, square thumbs, tight gap. */
.bd-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 600px) {
  .bd-gallery { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
@media (min-width: 992px) {
  .bd-gallery { grid-template-columns: repeat(4, 1fr); gap: 14px; }
}
.bd-gallery__item {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #0b1513;
}
.bd-gallery__item img,
.bd-gallery__item video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.bd-gallery__item:hover img { transform: scale(1.06); }
.bd-gallery__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  pointer-events: none;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* ---------- Child brands ---------- */
.bd-children { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.bd-child {
  display: block;
  text-decoration: none;
  color: var(--bd-ink);
  border: 1px solid var(--bd-hairline);
  padding: 30px;
  transition: border-color .2s ease, transform .2s ease;
}
.bd-child:hover { border-color: var(--bd-accent); transform: translateY(-3px); color: var(--bd-ink); }
.bd-child__name { font-family: var(--bd-display); font-weight: 600; font-size: 1.4rem; }
.bd-child__tag { color: var(--bd-muted); margin-top: 6px; font-size: 0.95rem; }

/* ---------- Closing CTA band ---------- */
.bd-cta {
  text-align: center;
}
.bd-cta .bd-h2 { margin-bottom: 26px; }

/* ---------- Route / "Il percorso" ----------
   Full-width map image with a hairline frame + caption, plus optional per-distance
   route-line thumbnails. Editorial: sharp corners, one accent, no card shadows. */
.bd-route__map {
  position: relative;
  border: 1px solid var(--bd-hairline);
  background: var(--bd-paper);
  overflow: hidden;
}
.bd-route__map img {
  display: block;
  width: 100%;
  height: auto;
}
.bd-route__caption {
  margin: 14px 0 0;
  font-size: 0.9rem;
  color: var(--bd-muted);
  display: flex;
  align-items: center;
  gap: 9px;
}
.bd-route__caption i { color: var(--bd-accent-2); }
.bd-route__lines {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 28px;
  background: var(--bd-hairline);
  border: 1px solid var(--bd-hairline);
}
.bd-route__line {
  background: var(--bd-paper);
  padding: 22px 20px;
  text-align: center;
}
.bd-route__line img {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: contain;
  margin-bottom: 14px;
}
.bd-route__line-km {
  font-family: var(--bd-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--bd-accent);
}
.bd-route__line-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bd-muted);
  margin-top: 4px;
}
@media (max-width: 640px) {
  .bd-route__lines { grid-template-columns: 1fr; }
  .bd-route__line img { height: 96px; }
}

/* ---------- Interactive GPX map (live Leaflet, same engine as the event page) ----------
   Full-bleed map framed with a single hairline top/bottom rule, editorial distance toggle
   in the brand accent. No rounded corners, no card shadow — fits the .bd-* aesthetic. */
.bd-route__map-block {
  margin-top: 32px;
  border-top: 1px solid var(--bd-hairline);
  border-bottom: 1px solid var(--bd-hairline);
  background: var(--bd-paper);
}
.bd-route__tabs {
  list-style: none;
  margin: 0;
  padding: 18px 0 16px;
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.bd-route__tab {
  background: none;
  border: 1px solid var(--bd-hairline);
  padding: 8px 18px;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  color: var(--bd-muted);
  transition: border-color .15s, background .15s, color .15s;
}
.bd-route__tab--active {
  background: var(--bd-accent);
  border-color: var(--bd-accent);
  color: #fff;
}
.bd-route__tab-km {
  font-family: var(--bd-display);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.bd-route__tab-dist {
  font-size: 0.72rem;
  opacity: 0.85;
}
.bd-route__leaflet {
  width: 100%;
  display: block;
  background: #e8edf2;
}
.bd-route__leaflet-loading {
  height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bd-route__actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 16px 20px;
  background: #fff;
}
.bd-route__action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bd-accent);
  text-decoration: none;
  border: 1px solid var(--bd-accent);
  transition: background .15s, color .15s;
}
.bd-route__action:hover {
  background: var(--bd-accent);
  color: #fff;
}
@media (max-width: 640px) {
  .bd-route__leaflet-loading { height: 420px; }
}

/* ---------- "Diventa partner" recruitment band ----------
   Gold-accent ink band inviting businesses to sponsor. On-brand: sharp button,
   one accent, no gradient-card/pill. */
.bd-partner-cta {
  text-align: center;
  border-top: 3px solid var(--bd-accent-2);
}
/* Beat the .bd .bd-section--ink .bd-eyebrow (#fff) override (0,3,0) — keep the gold accent. */
.bd .bd-partner-cta .bd-eyebrow {
  justify-content: center;
  color: var(--bd-accent-2);
}
.bd-partner-cta .bd-eyebrow::before { background: var(--bd-accent-2); }
.bd-partner-cta .bd-lead {
  margin: 0 auto 30px;
  text-align: center;
  color: rgba(255, 255, 255, 0.84);
}
.bd-btn--gold { background: var(--bd-accent-2); color: var(--bd-ink); }
.bd-btn--gold:hover { background: #c08f33; color: var(--bd-ink); transform: translateY(-2px); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .bd-edition img,
  .bd-gallery__item img,
  .bd-btn { transition: none; }
  .bd-edition:hover img,
  .bd-gallery__item:hover img { transform: none; }
}

/* ---------- Entrance reveal ----------
   Content is server-rendered and MUST be visible without JS, so we never park it at opacity:0
   waiting on a scroll observer (that left the stats strip blank). Instead a self-contained
   keyframe fades each item in once and ends visible. */
@media (prefers-reduced-motion: no-preference) {
  .bd .animate-on-scroll { animation: bd-reveal .6s ease both; }
}
@keyframes bd-reveal { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Custom staff-built sections (task-263) ----------
   Modern editorial blocks added from /dashboard/brands/. One media (image OR video) + rich text,
   laid out horizontal (2-col grid, media + text) or vertical (media above text). Same .bd-*
   language: one accent, hairline frame, sharp corners, big type. Mobile-first → stacks on phones. */
.bd-customsec {
  display: grid;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}
/* Vertical (default): media on top, text below — single column. */
.bd-customsec--vertical {
  grid-template-columns: 1fr;
  max-width: 900px;
}
/* Horizontal: media + text side-by-side on wide screens; stacks below 860px. */
@media (min-width: 860px) {
  .bd-customsec--horizontal { grid-template-columns: 1fr 1fr; }
}
.bd-customsec--text-only { max-width: 760px; }

.bd-customsec__media {
  position: relative;
  overflow: hidden;
  background: #0b1513;
  border: 1px solid var(--bd-hairline);
}
.bd-customsec__media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}
/* Horizontal media gets a fixed editorial aspect so the two columns balance. */
@media (min-width: 860px) {
  .bd-customsec--horizontal .bd-customsec__media { aspect-ratio: 4 / 3; }
  .bd-customsec--horizontal .bd-customsec__media img,
  .bd-customsec--horizontal .bd-customsec__media .bd-customsec__video {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  }
}
/* Self-hosted autoplay video: cap height + contain so portrait clips don't dominate
   the page and landscape clips still fill width. Centered on a dark stage. */
.bd-customsec__media--video {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b1513;
}
.bd-customsec__video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  background: #0b1513;
}
/* Vertical layout (the reel/phone-video case): size the <video> to its own aspect and drop the dark
   stage, so a portrait clip shows as a clean centered frame instead of being pillarboxed (black side
   bars). task-270. */
.bd-customsec--vertical .bd-customsec__media--video {
  background: transparent;
  border: none;
}
.bd-customsec--vertical .bd-customsec__video {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 80vh;
  margin: 0 auto;
  border-radius: 14px;
}
@media (max-width: 600px) {
  .bd-customsec__video { max-height: 70vh; }
  .bd-customsec--vertical .bd-customsec__video { max-height: 78vh; }
}
/* Drive video embed: 16:9 responsive iframe wrapper (Drive shows player chrome — expected). */
.bd-customsec__video-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
}
.bd-customsec__video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* In a horizontal layout the 16:9 wrapper would over-tall the row; let it fill the cell instead. */
@media (min-width: 860px) {
  .bd-customsec--horizontal .bd-customsec__video-frame { padding-top: 0; height: 100%; }
}

.bd-customsec__body { min-width: 0; }
.bd-customsec__content {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.7;
  color: #34423d;
}
.bd-customsec__content p { margin: 0 0 1.1em; }
.bd-customsec__content p:last-child { margin-bottom: 0; }
.bd-customsec__content a { color: var(--bd-accent); }
.bd-customsec__cta { margin-top: 26px; }

/* On an --ink band (rare, if a caller wraps it dark) keep text legible. */
.bd-section--ink .bd-customsec__content { color: rgba(255,255,255,0.86); }

.bd-customsec--no-mobile { /* hidden on phones when show_on_mobile is off */ }
@media (max-width: 640px) {
  .bd-customsec--no-mobile { display: none; }
}

/* ---------- Responsive ---------- */
/* Stats use auto-fit (see .bd-stats) so they fill the row regardless of count —
   no fixed 4-col override (that left an empty hairline cell when only 3 stats). */
