/* ============================================================
   CROTONA — Recap video tile + lightbox (v2.17.22)
   Vierkant preview tile (autoplay muted loop, story-crop center)
   met paste-up tape + shadow + hover. Klik = fullscreen lightbox
   met unmuted full video (portrait 9:16 max-height).
   ============================================================ */

.cr-video-tile {
  position: relative;
  display: block;
  width: 240px;
  aspect-ratio: 1 / 1;
  background: var(--crotona-ink);
  border: 3px solid var(--crotona-ink);
  box-shadow: 6px 6px 0 var(--crotona-ink);
  cursor: pointer;
  overflow: hidden;
  transition: transform 220ms cubic-bezier(0.22, 0.61, 0.36, 1),
              box-shadow 220ms cubic-bezier(0.22, 0.61, 0.36, 1);
  transform: rotate(var(--cr-rot, -2deg));
  user-select: none;
  text-decoration: none;
}

/* v2.17.22: variant voor polaroid-stack in homepage hero (absolute positioned) */
.cr-video-tile--in-polaroids {
  position: absolute;
  width: 220px;
  aspect-ratio: 1 / 1;
}

/* v2.17.22: variant voor event-page hero polaroid wrapper - fills 100% */
/* v2.17.24: overflow:visible zodat tape naar buiten kan steken (was gecropt) */
.cr-video-tile--in-ev-polaroid {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  transform: none;
  border: none;
  box-shadow: none;
  overflow: visible;
}
.cr-video-tile--in-ev-polaroid:hover,
.cr-video-tile--in-ev-polaroid:focus-visible {
  transform: none;
  box-shadow: none;
}
/* Event-page polaroid wrapper - unify aspect ratio to 1:1 voor video-tile */
.cr-ev-hero__polaroid--is-video {
  aspect-ratio: 1 / 1;
  overflow: visible;
  padding: 8px !important;  /* strak frame */
}
.cr-ev-hero__polaroid--is-video .cr-video-tile__video {
  border-radius: 0;
}

/* v2.17.29: expliciete class .--has-video ipv :has() (was niet consistent).
   Mobile: video-tile portrait 9:16 full-width bovenaan, 2 polaroids eronder. */
@media (max-width: 767px) {
  .cr-ev-hero__collage--has-video {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    flex-direction: initial;
  }
  .cr-ev-hero__collage--has-video .cr-ev-hero__polaroid--is-video {
    grid-column: 1 / -1;
    order: -1;
    max-width: none;
    width: 100%;
    aspect-ratio: 9 / 16;
    height: auto;
    padding: 8px !important;
    justify-self: stretch;
  }
  .cr-ev-hero__collage--has-video .cr-ev-hero__polaroid:not(.cr-ev-hero__polaroid--is-video) {
    max-width: none;
    width: 100%;
  }
  .cr-ev-hero__collage--has-video .cr-ev-hero__ticket-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .cr-video-tile--in-polaroids {
    width: 170px;
  }
}

.cr-video-tile:hover,
.cr-video-tile:focus-visible {
  transform: rotate(0) translate(-3px, -3px) scale(1.02);
  box-shadow: 9px 9px 0 var(--crotona-bolt);
  outline: none;
}

/* v2.17.28: revert naar simpele absolute inset:0 + object-fit cover
   (v2.17.27 wrapper-frame met min-width/height brak desktop = video te
   ver ingezoomed). Frame-div is nu een passthrough zonder eigen sizing. */
.cr-video-tile__frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
  z-index: 1;
}

.cr-video-tile__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  display: block;
}

/* Paste-up tape boven het frame */
.cr-video-tile__tape {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  background: var(--crotona-bolt);
  color: var(--crotona-ink);
  padding: 5px 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 2px solid var(--crotona-ink);
  box-shadow: 3px 3px 0 var(--crotona-ink);
  z-index: 3;
  white-space: nowrap;
}

/* Play-badge rechtsonder over de video */
.cr-video-tile__play {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  background: var(--crotona-cream);
  border: 2.5px solid var(--crotona-ink);
  box-shadow: 3px 3px 0 var(--crotona-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--crotona-ink);
  z-index: 3;
  transition: transform 220ms ease;
}
.cr-video-tile:hover .cr-video-tile__play {
  transform: scale(1.1) rotate(-8deg);
  background: var(--crotona-bolt);
}
.cr-video-tile__play svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  margin-left: 2px;  /* optical align voor play-triangle */
}

/* Subtiele dark overlay bovenop video voor tape/play-contrast */
.cr-video-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.10) 0%, rgba(0,0,0,0.30) 100%);
  pointer-events: none;
  z-index: 2;
}

/* ============================================================
   Lightbox modal
   ============================================================ */
.cr-video-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(35, 37, 34, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 64px);
  opacity: 0;
  transition: opacity 200ms ease;
}
.cr-video-modal.is-open {
  opacity: 1;
}

.cr-video-modal__stage {
  position: relative;
  width: 100%;
  max-width: min(560px, 100%);
  max-height: 100%;
  border: 3px solid var(--crotona-ink);
  box-shadow: 10px 10px 0 var(--crotona-bolt);
  background: #000;
  transform: rotate(-0.6deg);
}

.cr-video-modal__video {
  display: block;
  width: 100%;
  max-height: 82vh;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  background: #000;
}

.cr-video-modal__close {
  position: absolute;
  top: clamp(12px, 3vw, 24px);
  right: clamp(12px, 3vw, 24px);
  width: 52px;
  height: 52px;
  background: var(--crotona-bolt);
  border: 3px solid var(--crotona-ink);
  box-shadow: 4px 4px 0 var(--crotona-ink);
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
  font-weight: 700;
  color: var(--crotona-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 180ms ease;
  z-index: 10;
}
.cr-video-modal__close:hover,
.cr-video-modal__close:focus-visible {
  transform: rotate(90deg);
  outline: none;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .cr-video-tile {
    width: 200px;
  }
  .cr-video-tile__play {
    width: 38px;
    height: 38px;
    bottom: 8px;
    right: 8px;
  }
  .cr-video-modal__video {
    max-height: 78vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cr-video-tile,
  .cr-video-tile__tape,
  .cr-video-tile__play,
  .cr-video-modal__stage,
  .cr-video-modal__close { transform: none; }
  .cr-video-tile:hover { transform: none; }
}
