/* cs-video-split — mixed-weight two-tone heading + flourish beside a video
   embed; sides alternate per instance.
   All rem values follow BB Theme's html { font-size: 10px } base. */

/* Strip BB's default row chrome — both axes, so __inner's own gutter is the
   single source of the side edge (84px at 1440, 24px on mobile, matching the
   site standard; BB's 20px row padding + 20px module margin had inset this
   module to 124/44). */
.fl-row-content-wrap:has(.cs-video-split) {
  padding-block: 0;
  padding-inline: 0;
}
.fl-module-content:has(.cs-video-split) {
  margin-block: 0;
  margin-inline: 0;
}

.cs-video-split {
  position: relative;
  padding-block: var(--cs-space-2xl); /* aligned to the 96px section standard (was 64px) */
  font-family: var(--cs-font-body);
  color: var(--cs-ink);
}

.cs-video-split__inner {
  max-width: var(--cs-container);
  margin: 0 auto;
  padding-inline: var(--cs-gutter);
  display: grid;
  /* Text ~620px / video ~591px per Figma — near-equal split */
  grid-template-columns: minmax(0, 620fr) minmax(0, 591fr);
  align-items: center;
  column-gap: var(--cs-space-2xl);
  row-gap: var(--cs-space-lg);
  position: relative;
  z-index: 1;
}

.cs-video-split--media-right .cs-video-split__content { order: 1; }
.cs-video-split--media-right .cs-video-split__media   { order: 2; }

.cs-video-split--media-left .cs-video-split__inner {
  grid-template-columns: minmax(0, 591fr) minmax(0, 620fr);
}
.cs-video-split--media-left .cs-video-split__media   { order: 1; }
.cs-video-split--media-left .cs-video-split__content { order: 2; text-align: left; }

/* ---------- Channel badge ---------- */
/* Sits centered above the content in every layout; order -1 + full-span
   keeps it out of the two-column grid flow. */
.cs-video-split__channel {
  order: -1;
  grid-column: 1 / -1;
  justify-self: center;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-width: 4.4rem;
  min-height: 4.4rem;
  text-decoration: none;
  transition: transform 0.2s ease;
}

/* The theme's global a:hover underline would stack a second line under the
   already-underlined label span — keep the anchor itself decoration-free. */
.cs-video-split__channel:hover,
.cs-video-split__channel:focus,
.cs-video-split__channel:visited {
  text-decoration: none;
}

.cs-video-split__channel:hover {
  transform: scale(1.05);
}

/* Visible affordance label — link-styled so it reads as clickable.
   --cs-blue-body passes AA at 16px where the raw brand blue does not. */
.cs-video-split__channel-text {
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--cs-blue-body);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.cs-video-split__channel:hover .cs-video-split__channel-text {
  color: var(--cs-blue-dark, #1B5386);
}

.cs-video-split__channel:focus-visible {
  outline: 3px solid var(--cs-blue);
  outline-offset: 3px;
  border-radius: 0.6rem;
}

.cs-video-split__channel-icon {
  display: block;
  width: 6.4rem;
  height: auto;
}

/* ---------- Content ---------- */
.cs-video-split__content {
  display: flex;
  flex-direction: column;
  gap: var(--cs-space-md);
}

.cs-video-split--media-left .cs-video-split__content {
  align-items: flex-end;
}

/* Doubled classes + font-style so BB Global h2 rules lose. */
.cs-video-split .cs-video-split__heading {
  margin: 0;
  font-family: var(--cs-font-display);
  font-size: clamp(3.2rem, 3vw + 1rem, 4.8rem); /* 32px → 48px */
  font-style: normal;
  font-weight: 800;
  line-height: 1.212;
  letter-spacing: var(--cs-tracking-tight);
  color: var(--cs-ink);
  text-wrap: balance;
}

/* Explicit span colors — BB Global Styles' `h2 span` rule recolors bare spans */
.cs-video-split .cs-video-split__heading .cs-video-split__heading-bold,
.cs-video-split .cs-video-split__heading .cs-video-split__heading-regular {
  color: var(--cs-ink);
}

.cs-video-split .cs-video-split__heading .cs-video-split__heading-regular {
  font-weight: 400;
}

.cs-video-split .cs-video-split__heading .cs-video-split__heading-accent {
  color: var(--cs-blue);
}

/* Flourish — reuse the promo-banner starburst, recolored to ink */
.cs-video-split__flourish {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 56rem;
  opacity: 0.85;
}

.cs-video-split__flourish::before {
  content: '';
  flex: 1;
  height: 3px;
  background: var(--cs-ink);
  transform: translateY(0.46rem);
}

.cs-video-split__flourish img {
  display: block;
  height: 8.7rem;
  width: auto;
  margin-left: -2px;
  /* flourish.svg ships white — recolor to ink */
  filter: brightness(0);
}

.cs-video-split--media-left .cs-video-split__flourish {
  transform: scaleX(-1);
}

/* ---------- Video ---------- */
.cs-video-split__frame {
  position: relative;
  aspect-ratio: 591 / 306;
  border-radius: 1rem; /* 10px */
  overflow: hidden;
  background: #383840;
}

.cs-video-split__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.cs-video-split__frame--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-video-split__play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: var(--cs-white);
  font-size: 2rem;
  padding-left: 0.4rem;
}

/* ---------- Full-width framed layout (getting-started "Team Welcome") ---------- */
.cs-video-split--media-full .cs-video-split__inner {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}

.cs-video-split--media-full .cs-video-split__content {
  order: 1;
  align-items: center;
  text-align: center;
}

.cs-video-split--media-full .cs-video-split__media {
  order: 2;
  width: 100%;
  max-width: 110.8rem; /* 1108px per Figma */
}

/* Blue panel around the video, ~50px padding per Figma */
.cs-video-split--media-full .cs-video-split__frame {
  aspect-ratio: auto;
  background: rgba(240, 183, 164, 0.3); /* peach wash per Figma */
  border-radius: var(--cs-radius-lg);
  padding: 5rem;
}

.cs-video-split--media-full .cs-video-split__frame iframe {
  position: static;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1001 / 572;
  border-radius: 2rem;
}

.cs-video-split--media-full .cs-video-split__frame--placeholder {
  aspect-ratio: 1108 / 671;
}

@media (max-width: 900px) {
  .cs-video-split--media-full .cs-video-split__frame {
    padding: 1.6rem;
    border-radius: var(--cs-radius-md);
  }

  /* Resources page only (client 2026-09-15): drop the peach frame padding so
     the video fills the rounded box edge to edge on phones. Page-scoped via
     the body class because it's a per-page design call, not a module one. */
  .page-id-315 .cs-video-split--media-full .cs-video-split__frame {
    padding: 0;
  }
  .page-id-315 .cs-video-split--media-full .cs-video-split__frame iframe {
    border-radius: var(--cs-radius-md); /* the frame's wash is gone — round the video itself */
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  /* Mobile section rhythm: 52px per side so adjacent sections meet at
     104px (client 2026-09-15). */
  .cs-video-split {
    padding-block: var(--cs-space-section-sm);
  }
  .cs-video-split__inner,
  .cs-video-split--media-left .cs-video-split__inner,
  .cs-video-split--media-right .cs-video-split__inner {
    grid-template-columns: minmax(0, 1fr);
  }
  /* Text above the video when stacked, whichever side it sits on desktop */
  .cs-video-split--media-left .cs-video-split__content,
  .cs-video-split--media-right .cs-video-split__content {
    order: 1;
    text-align: left;
    align-items: flex-start;
  }
  .cs-video-split--media-left .cs-video-split__media,
  .cs-video-split--media-right .cs-video-split__media {
    order: 2;
  }
  .cs-video-split__flourish {
    display: none;
  }
}
