/* ============================================================
   YouTube Modal — Generic, drop-in styles
   Usage: add data-youtube="VIDEO_ID" to any clickable element
   ============================================================ */

/* Trigger cursor */
[data-youtube] {
  cursor: pointer;
}

/* Backdrop */
.yt-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;

  /* Hidden state */
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.yt-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

/* Dialog box */
.yt-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 900px;
  transform: translateY(24px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.yt-modal-backdrop.is-open .yt-modal-dialog {
  transform: translateY(0) scale(1);
}

/* 16:9 aspect ratio wrapper */
.yt-modal-ratio {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.yt-modal-ratio iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Close button */
.yt-modal-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
  color: #fff;
  padding: 0;
  line-height: 1;
}

.yt-modal-close:focus {
  background: rgba(255, 255, 255, 0.12);
}

.yt-modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
}

.yt-modal-close svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* ---- Play icon hint on trigger elements (optional visual cue) ---- */
[data-youtube-play-hint] {
  position: relative;
}

[data-youtube-play-hint]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.2s ease;
}

[data-youtube-play-hint]:hover::after {
  opacity: 1;
}
