/* ===========================
   VIDEO MODAL STYLES
   =========================== */

/* --- Thumbnail Play Button Overlay --- */
.video-card {
  position: relative;
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
  overflow: hidden;
  border-radius: 8px;
  transition: transform 0.2s ease;
}

.video-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
}

/* --- Play button (circle + triangle) --- */
.video-card::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, background 0.25s ease;
}

.video-card::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0;
  height: 0;
  border-left: 18px solid #fff;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  transform: translateX(6px);
  z-index: 2;
}

.video-card:hover {
  transform: translateY(-2px);
}

.video-card:hover::after {
  background: rgba(0, 0, 0, 0.65);
  transform: scale(1.1);
}

/* --- Video Modal Container --- */
.video-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  transition: opacity 0.3s ease;
}

.video-modal[aria-hidden="false"] {
  display: flex;
  opacity: 1;
}

/* --- Modal Dialog --- */
.video-modal__dialog {
  position: relative;
  width: min(960px, 92vw);
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  animation: modalPop 0.25s ease;
}

@keyframes modalPop {
  from {
    transform: scale(0.95);
    opacity: 0.6;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* --- Aspect Ratio Container --- */
.video-modal__aspect {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-modal__aspect iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --- Close Button --- */
.video-modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.25s ease;
  z-index: 10;
}

.video-modal__close:hover {
  background: rgba(255, 255, 255, 1);
}

/* --- Loader Spinner (optional but nice touch) --- */
.video-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  z-index: 5;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.video-loader.active {
  opacity: 1;
}

.video-loader::after {
  content: "";
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .video-card::after {
    width: 55px;
    height: 55px;
  }

  .video-card::before {
    border-left-width: 14px;
    border-top-width: 10px;
    border-bottom-width: 10px;
  }

  .video-modal__dialog {
    width: 95vw;
  }
}
