/* Treatlly demo-video modal (used only on the homepage now).
 * - Modal opens via [data-video-modal-trigger] buttons.
 * - Includes a Fullscreen button that uses the Fullscreen API.
 * Pair with assets/demo-videos.js + the #hd-video-modal markup at body end.
 */

/* Legacy in-place tile styling (kept for backward compat — no longer used in this site). */
[data-video-tile] { position: relative; }
[data-video-tile] video { display: block; width: 100%; height: 100%; }

[data-replay-overlay] {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(7, 12, 24, 0.55); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease-out;
}
[data-replay-overlay].visible { opacity: 1; pointer-events: auto; }
[data-replay-overlay] button {
  display: inline-flex; align-items: center; gap: 8px;
  background: white; color: #0f172a; font-weight: 600; font-size: 14px;
  border-radius: 9999px; padding: 12px 22px; border: none; cursor: pointer;
  box-shadow: 0 12px 32px -10px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.1) inset;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}
[data-replay-overlay] button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 40px -10px rgba(0,0,0,.45);
}

/* HD modal */
#hd-video-modal {
  position: fixed; inset: 0; z-index: 60;
  display: none; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.92); backdrop-filter: blur(8px);
}
#hd-video-modal.open { display: flex; }
#hd-video-modal .frame {
  position: relative;
  width: min(100%, 1600px);
  max-height: 92vh;
  aspect-ratio: 16/9;
  background: black;
  border-radius: 12px;
}
#hd-video-modal video {
  width: 100%; height: 100%;
  border-radius: 12px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
  background: black;
  object-fit: contain;
}
#hd-video-modal .close,
#hd-video-modal .fullscreen {
  position: absolute; top: -44px;
  height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 0 12px;
  background: rgba(255,255,255,0.1); color: white;
  border: 1px solid rgba(255,255,255,0.18); border-radius: 999px;
  cursor: pointer; font-size: 12px; font-weight: 600;
  transition: background 0.15s ease-out;
}
#hd-video-modal .close { right: 0; width: 36px; padding: 0; }
#hd-video-modal .fullscreen { right: 48px; }
#hd-video-modal .close:hover,
#hd-video-modal .fullscreen:hover { background: rgba(255,255,255,0.22); }

/* When the .frame element is in browser fullscreen mode, hide our custom
   buttons (the OS provides controls), and stretch video to fill. */
#hd-video-modal .frame:fullscreen {
  width: 100vw; max-height: none; aspect-ratio: auto;
  height: 100vh; border-radius: 0;
}
#hd-video-modal .frame:fullscreen video { border-radius: 0; box-shadow: none; }
#hd-video-modal .frame:fullscreen .close,
#hd-video-modal .frame:fullscreen .fullscreen { display: none; }

body.modal-open { overflow: hidden; }
