/* =============================================================================
   video-modal.css — clickable video thumbnail that pops open a video in an
   overlay dialog. Paired with js/video-modal.js.
   ============================================================================ */

.video-trigger {
  position: relative;
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto var(--space-3);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  background: var(--color-surface);
}
.video-trigger img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.video-trigger__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(11, 26, 51, .25);
  transition: background .15s ease;
}
.video-trigger__play svg {
  width: 30px;
  height: 30px;
  padding: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--color-primary);
  fill: var(--color-primary);
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,.25));
}
.video-trigger:hover .video-trigger__play,
.video-trigger:focus-visible .video-trigger__play { background: rgba(11, 26, 51, .4); }
.video-trigger:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(11, 26, 51, .75);
  display: grid;
  place-items: center;
  padding: var(--space-3);
}
.video-modal[hidden] { display: none; }
body.video-modal-open { overflow: hidden; }

.video-modal__dialog {
  position: relative;
  width: min(880px, 100%);
}

.video-modal__close {
  position: absolute;
  top: -2.4rem;
  right: 0;
  background: none;
  border: 0;
  color: #fff;
  font-size: var(--text-2xl, 1.75rem);
  line-height: 1;
  cursor: pointer;
  padding: .25rem .5rem;
}
.video-modal__close:hover { opacity: .8; }
.video-modal__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: var(--radius-sm); }

.video-modal__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.video-modal__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .video-modal__dialog { animation: video-modal-in .14s ease-out; }
  @keyframes video-modal-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
  }
}
