/*
 * video-block.css — reusable video block (inc/video-block.php,
 * collect_video_block()): poster, play button, end card.
 * Version: 1.0.0
 *
 * Layer on top of cw-design-system.css. Tokens only; the translucent navy
 * scrims are mixed from --color-bg-dark. The mockup's orange play disc is
 * teal here (orange is reserved for the header call-to-action).
 */

.cw-vb{
  position:relative; max-width:1080px; margin: var(--space-10) auto 0; aspect-ratio:16 / 9;
  border-radius: var(--radius-lg); overflow:hidden; border:1px solid var(--color-border);
  box-shadow: var(--shadow-md); background: var(--color-bg-dark);
  scroll-margin-top: calc(var(--cw-nav-h, 78px) + var(--space-3));
}
.cw-vb video, .cw-vb iframe, .cw-vb .cw-vb-poster{ display:block; width:100%; height:100%; border:0; }
.cw-vb video, .cw-vb .cw-vb-poster{ object-fit:cover; }
.cw-vb iframe{ position:absolute; inset:0; }

/* Play overlay — shown by video-block.js once it has taken over the controls */
.cw-vb-play{
  position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap: var(--space-4);
  margin:0; padding:0; border:0; border-radius:0; cursor:pointer; color:#fff; font:inherit;
  background: color-mix(in srgb, var(--color-bg-dark) 35%, transparent);
  transition: background-color var(--duration-2) var(--ease-standard);
}
.cw-vb-play[hidden], .cw-vb-end[hidden]{ display:none; }
.cw-vb-play:hover, .cw-vb-play:focus{ background: color-mix(in srgb, var(--color-bg-dark) 20%, transparent); color:#fff; }
.cw-vb-play:focus-visible{ outline:none; }
.cw-vb-play:focus-visible .cw-vb-play-ic{ box-shadow: var(--shadow-ring), var(--shadow-lg); }
.cw-vb-play-ic{
  display:grid; place-items:center; width: var(--space-20); height: var(--space-20); border-radius:50%;
  background: var(--color-primary); color:#fff; box-shadow: var(--shadow-lg);
}
.cw-vb-play-ic svg{ width: var(--space-8); height: var(--space-8); margin-left: var(--space-1); }
.cw-vb-label{
  font-family: var(--cw-display); font-weight: var(--weight-semibold); font-size: var(--fs-16); line-height: var(--leading-snug);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--color-bg-dark) 78%, transparent);
}

/* End card */
.cw-vb-end{
  position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap: var(--space-4);
  padding: var(--space-6); text-align:center; color:#fff;
  background: color-mix(in srgb, var(--color-bg-dark) 94%, transparent);
}
.cw-vb-end strong{
  font-family: var(--cw-display); font-size: var(--fs-24); font-weight: var(--weight-bold); line-height: var(--leading-snug);
  max-width:22ch; color:#fff;
}
.cw-vb-again{
  margin:0; padding:0; border:0; border-radius: var(--radius-sm); background:none; cursor:pointer;
  font: inherit; font-size: var(--fs-16); color: var(--color-on-dark); text-decoration:underline; text-underline-offset:3px;
}
.cw-vb-again:hover, .cw-vb-again:focus{ background:none; color:#fff; }
.cw-vb-again:focus-visible{ outline:none; box-shadow: var(--shadow-ring); }

.cw-vb-fallback{ position:absolute; inset:0; display:grid; place-items:center; color:#fff; font-family: var(--cw-display); font-weight: var(--weight-semibold); }

/* Inside a hero the block sits under the buttons */
.cw-hero .cw-vb{ margin-top: var(--space-10); }

@media (max-width:640px){
  .cw-vb{ margin-top: var(--space-8); }
  .cw-hero .cw-vb{ margin-top: var(--space-8); }
  .cw-vb-play{ gap: var(--space-3); }
  .cw-vb-play-ic{ width: var(--space-16); height: var(--space-16); }
  .cw-vb-play-ic svg{ width: var(--space-6); height: var(--space-6); }
  .cw-vb-label{ font-size: var(--fs-14); padding: var(--space-1) var(--space-3); }
  .cw-vb-end{ gap: var(--space-2); padding: var(--space-3); }
  .cw-vb-end strong{ font-size: var(--fs-18); }
}
