/*
 * video fern: a 16:9 facade that js/video-fern.js swaps for the player. The
 * label and play button over a poster keep a black scrim and white text in
 * both themes; with no poster they sit on a theme-colored surface.
 */

.cb-video {
  position: relative;
  isolation: isolate;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius, 10px);
  background: var(--bg-elev-2);
}

.cb-video--no-poster {
  background: color-mix(in srgb, var(--accent) 22%, var(--bg-elev));
}

.cb-video__facade {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3, 0.75rem);
  color: white;
  text-decoration: none;
}

.cb-video--no-poster .cb-video__facade {
  color: var(--text);
}

.cb-video__poster {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cb-video__play {
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-on);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.cb-video__play-icon {
  width: 2.25rem;
  height: 2.25rem;
}

.cb-video__facade:hover .cb-video__play {
  transform: scale(1.08);
}

.cb-video__facade:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.cb-video__label {
  max-width: 90%;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.cb-video:not(.cb-video--no-poster) .cb-video__label {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  max-width: none;
  padding: var(--space-6, 1.5rem) var(--space-4, 1rem) var(--space-3, 0.75rem);
  background: linear-gradient(to top, rgb(0 0 0 / 0.75), rgb(0 0 0 / 0));
  text-align: left;
}

.cb-video__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.cb-video-notice {
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--warning);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  .cb-video__play {
    transition: none;
  }

  .cb-video__facade:hover .cb-video__play {
    transform: none;
  }
}
