/* video_embed — sizes and colours follow the RetailSonar design system:
   --radius-box 20px, --radius-tab 8px, --shadow-box 0 3px 4px rgba(0,0,0,.2),
   no borders, Nunito, no grey text, white text on red only in bold,
   10 % red tint (#FF2645) as the highlight instead of grey.
   Selectors below the player start with .video-embed so they beat the blog
   template's .blog-post__body a / p / li / ol rules (grey, 400, underlined, padded). */
.video-embed {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  container-type: inline-size; /* the side-by-side layout follows the module's own width */
}

.video-embed__intro {
  margin-bottom: 24px;
}

.video-embed__player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  isolation: isolate; /* keeps the rounded clip on the iframe in Safari */
  scroll-margin-top: 120px; /* chapter clicks scroll here; clears the sticky site header */
  border-radius: 20px;
  box-shadow: 0 3px 4px rgba(0, 0, 0, 0.2);
  background: #000000;
}

@supports not (aspect-ratio: 16 / 9) {
  .video-embed__player {
    height: 0;
    padding-top: 56.25%;
  }
}

.video-embed__player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ---------- "In this video" chapters ----------
   A white panel (radius-box + shadow-box). Narrow: below the player.
   Wide: next to the player at the player's height, scrolling inside. */
.video-embed .video-embed__side {
  margin-top: 24px;
}

.video-embed .video-embed__chapters {
  padding: 0 8px 8px;
  border-radius: 20px;
  box-shadow: 0 3px 4px rgba(0, 0, 0, 0.2);
  background: #FFFFFF;
}

.video-embed .video-embed__chapters-heading {
  margin: 0;
  padding: 16px 10px 8px;
  font-size: 20px;
  line-height: 1.3;
}

.video-embed .video-embed__chapter-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.video-embed .video-embed__chapter {
  margin: 0;
  padding: 0;
  color: #000000;
  font-size: 15px;
  line-height: 1.4;
}

.video-embed .video-embed__chapter::before,
.video-embed .video-embed__chapter::marker {
  content: none;
}

/* The whole chapter block is one link. */
.video-embed .video-embed__chapter-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  color: #000000;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.video-embed .video-embed__chapter-link--static {
  cursor: default;
}

.video-embed a.video-embed__chapter-link:hover,
.video-embed a.video-embed__chapter-link:focus-visible,
.video-embed a.video-embed__chapter-link.is-active {
  background: rgba(255, 38, 69, 0.1);
  color: #000000;
  text-decoration: none;
}

.video-embed a.video-embed__chapter-link:focus-visible {
  outline: 2px solid #FF2645;
  outline-offset: -2px;
}

.video-embed .video-embed__time {
  flex: 0 0 auto;
  min-width: 48px;
  padding: 2px 8px;
  border-radius: 8px;
  background: #FF2645;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.15s ease;
}

.video-embed a.video-embed__chapter-link:hover .video-embed__time,
.video-embed a.video-embed__chapter-link.is-active .video-embed__time {
  background: #FF7508;
}

.video-embed .video-embed__chapter-text {
  flex: 1 1 auto;
  min-width: 0;
}

.video-embed .video-embed__chapter-title {
  display: block;
  color: #000000;
  font-weight: 800;
}

/* The quote: collapsed, slides open on hover / keyboard focus / the playing chapter.
   (grid-template-rows 0fr -> 1fr animates to the text's real height.) */
.video-embed .video-embed__chapter-desc {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  color: #000000;
  font-weight: 400;
  transition: grid-template-rows 0.25s ease, opacity 0.2s ease;
}

.video-embed .video-embed__chapter-desc-inner {
  display: block;
  overflow: hidden;
  min-height: 0;
}

.video-embed a.video-embed__chapter-link:hover .video-embed__chapter-desc,
.video-embed a.video-embed__chapter-link:focus-visible .video-embed__chapter-desc,
.video-embed a.video-embed__chapter-link.is-active .video-embed__chapter-desc,
.video-embed .video-embed__chapter-link--static .video-embed__chapter-desc {
  grid-template-rows: 1fr;
  opacity: 1;
}

.video-embed a.video-embed__chapter-link:hover .video-embed__chapter-desc-inner,
.video-embed a.video-embed__chapter-link.is-active .video-embed__chapter-desc-inner {
  padding-top: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .video-embed .video-embed__chapter-desc,
  .video-embed .video-embed__chapter-link,
  .video-embed .video-embed__time {
    transition: none;
  }
}

/* Wide: player left, chapters panel right at the player's height (scrolls). */
@container (min-width: 760px) {
  .video-embed--with-chapters .video-embed__body {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
  }

  .video-embed .video-embed__side {
    position: relative;
    margin-top: 0;
  }

  .video-embed .video-embed__chapters {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #FF2645 transparent;
  }

  .video-embed .video-embed__chapters-heading {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #FFFFFF;
  }
}

/* Editor-only notice (never rendered on the live page) */
.video-embed.video-embed--notice {
  padding: 20px 24px;
  margin-top: 16px;
  border-radius: 20px;
  box-shadow: 0 3px 4px rgba(0, 0, 0, 0.2);
  background: #FFFFFF;
  font-family: Nunito, "Nunito Fallback", Calibri, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #000000;
}

.video-embed.video-embed--notice p {
  margin: 0;
  color: #000000;
}

.video-embed.video-embed--notice .video-embed__notice-title {
  margin-bottom: 4px;
  font-weight: 800;
  color: #FF2645;
}
