/* Demo video modal — full-screen overlay with 16:9 video frame.
   Loaded after styles-cg-modal.css to share design tokens. */

.cg-theme .video-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cg-theme .video-trigger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 10px;
  padding-left: 2px;
}

/* Backdrop */
.cg-theme .video-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s,
    visibility 0.25s;
}

.cg-theme .video-modal[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.cg-theme .video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 14, 30, 0.78);
  backdrop-filter: blur(8px);
}

.cg-theme .video-modal-card {
  position: relative;
  width: min(960px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 28px clamp(20px, 3vw, 36px) 28px;
  border-radius: 20px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.98),
    rgba(239, 248, 255, 0.94)
  );
  border: 1px solid rgba(180, 213, 248, 0.78);
  box-shadow: 0 32px 88px rgba(22, 74, 136, 0.36);
  transform: scale(0.96);
  transition: transform 0.25s;
}

.cg-theme .video-modal[aria-hidden="false"] .video-modal-card {
  transform: scale(1);
}

.cg-theme .video-modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 32, 64, 0.08);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    transform 0.15s;
  z-index: 2;
}

.cg-theme .video-modal-close:hover {
  background: rgba(15, 32, 64, 0.16);
  transform: rotate(90deg);
}

.cg-theme .video-modal-header {
  margin-bottom: 18px;
  padding-right: 40px;
}

.cg-theme .video-modal-header .eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--blue);
  text-transform: uppercase;
  font-weight: 600;
}

.cg-theme .video-modal-header h2 {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 26px);
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.cg-theme .video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(8, 28, 64, 0.32);
}

.cg-theme .video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.cg-theme .video-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: #d7e8ff;
  font-size: 15px;
}

.cg-theme .video-fallback a {
  color: #fff;
  text-decoration: underline;
}

.cg-theme .video-modal-note {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
}

.cg-theme .video-modal-note a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}

.cg-theme .video-modal-note a:hover {
  text-decoration: underline;
}

/* Body scroll lock when open */
.cg-theme.video-modal-open {
  overflow: hidden;
}

/* ── Dark theme ── */
.cg-theme.dark .video-modal-card {
  background: rgba(19, 30, 56, 0.94);
  border-color: rgba(120, 150, 200, 0.28);
  box-shadow: 0 32px 88px rgba(0, 0, 0, 0.5);
}

.cg-theme.dark .video-modal-close {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f6ff;
}

.cg-theme.dark .video-modal-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.cg-theme.dark .video-modal-header h2 {
  color: #f1f6ff;
}

.cg-theme.dark .video-modal-note {
  color: #9bb3d6;
}

.cg-theme.dark .video-modal-note a {
  color: #6ea2ff;
}

/* ── Responsive ── */
@media (max-width: 680px) {
  .cg-theme .video-modal-card {
    padding: 20px 14px 18px;
    border-radius: 14px;
  }

  .cg-theme .video-modal-header h2 {
    font-size: 18px;
  }

  .cg-theme .video-modal-note {
    font-size: 13px;
  }

  .cg-theme .video-trigger {
    width: 100%;
    justify-content: center;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cg-theme .video-modal,
  .cg-theme .video-modal-card,
  .cg-theme .video-modal-close {
    transition: none;
  }

  .cg-theme .video-modal-close:hover {
    transform: none;
  }
}
