/**
 * lesson-video-embeds.css — privacy-friendly YouTube blocks (thumbnail first; iframe on demand).
 * Markup: .course-youtube-embed (see constitution-ch01 or lesson-video-embeds.js).
 */

.stylish-chapter .course-youtube-embed {
  margin: 1.5rem 0;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.stylish-chapter .course-youtube-embed__preview {
  position: relative;
  display: block;
  width: 100%;
  max-width: 26.25rem;
  margin: 0 auto;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0.625rem;
  overflow: hidden;
  cursor: pointer;
  background: var(--card, #eef2fa);
  box-shadow: 0 2px 12px rgba(23, 95, 166, 0.08);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
  aspect-ratio: 16 / 9;
}

.stylish-chapter .course-youtube-embed__preview:hover {
  box-shadow: 0 6px 20px rgba(29, 78, 216, 0.15);
}

.stylish-chapter .course-youtube-embed__preview:focus {
  outline: none;
}

.stylish-chapter .course-youtube-embed__preview:focus-visible {
  outline: 2px solid var(--primary, #1d4ed8);
  outline-offset: 3px;
}

.stylish-chapter .course-youtube-embed__thumb {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  vertical-align: middle;
}

.stylish-chapter .course-youtube-embed__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.stylish-chapter .course-youtube-embed__play-icon {
  width: 3.25rem;
  height: 3.25rem;
  filter: drop-shadow(0 2px 8px rgba(23, 95, 166, 0.35));
}

.stylish-chapter .course-youtube-embed__play-bg {
  fill: rgba(255, 255, 255, 0.78);
}

.stylish-chapter .course-youtube-embed__play-triangle {
  fill: var(--primary, #1d4ed8);
}

.stylish-chapter .course-youtube-embed__frame-wrap {
  display: none;
  max-width: 26.25rem;
  margin: 0 auto;
  border-radius: 0.625rem;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.12);
  aspect-ratio: 16 / 9;
}

.stylish-chapter .course-youtube-embed--playing .course-youtube-embed__preview {
  display: none;
}

.stylish-chapter .course-youtube-embed--playing .course-youtube-embed__frame-wrap {
  display: block;
}

.stylish-chapter .course-youtube-embed__iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  vertical-align: middle;
}

.stylish-chapter .course-youtube-embed__caption {
  margin: 0.5rem 0 0;
  font-size: 0.96rem;
  color: var(--muted, #64748b);
}

.stylish-chapter .course-youtube-embed__caption a {
  color: var(--primary, #1d4ed8);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.stylish-chapter .course-youtube-embed__caption a:hover {
  color: #1e40af;
}
