/* MODAL VIDEO (EX.ui.openVideo ở sections/shared.js) — gắn thẳng vào <body> nên KHÔNG bọc trong [data-ex-section]. */
.ex-vmodal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 72px 16px;
}
.ex-vmodal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 26, 33, 0.88);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s ease;
}
/* 16:9, vừa cả bề ngang lẫn chiều cao màn (trừ đệm trên/dưới 72px cho nút đóng). */
.ex-vmodal-box {
  position: relative;
  width: min(100%, calc((100vh - 144px) * 16 / 9), 1600px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.ex-vmodal-video {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}
.ex-vmodal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s ease, background-color 0.2s;
}
.ex-vmodal-close:hover { background: rgba(255, 255, 255, 0.22); }
.ex-vmodal-close:focus-visible { outline: 2px solid #9fd477; outline-offset: 2px; }

.ex-vmodal.is-open .ex-vmodal-backdrop,
.ex-vmodal.is-open .ex-vmodal-close { opacity: 1; }
.ex-vmodal.is-open .ex-vmodal-box { opacity: 1; transform: none; }

/* Điện thoại: video sát hai mép, đệm trên đủ chỗ nút đóng. */
@media (max-width: 575px) {
  .ex-vmodal { padding: 72px 0; }
  .ex-vmodal-box { border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ex-vmodal-backdrop,
  .ex-vmodal-box,
  .ex-vmodal-close { transition: none; }
  .ex-vmodal-box { transform: none; }
}
