/* ==========================================================================
   Popup video (nút "XEM VIDEO" / "XEM THÊM VIDEO" / nút play).

   VIẾT TAY. Popup in ở wp_footer, NGOÀI `.tbtc-page`, nên không scope theo class
   đó — mọi selector dùng tiền tố `tbtc-vmodal`.

   Popup form liên hệ dùng lại style `.tbtc-modal` sẵn có trong
   assets/css/pages/_extras.css, không viết lại ở đây.
   ========================================================================== */

.tbtc-vmodal {
  position: fixed;
  inset: 0;
  z-index: 100001; /* trên popup tìm kiếm một bậc */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  font-family: var(--font-sans);
}

.tbtc-vmodal[hidden] {
  display: none;
}

.tbtc-vmodal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 20, 44, 0.86);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.tbtc-vmodal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1040px;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.tbtc-vmodal.is-open .tbtc-vmodal__backdrop {
  opacity: 1;
}

.tbtc-vmodal.is-open .tbtc-vmodal__dialog {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .tbtc-vmodal__backdrop,
  .tbtc-vmodal__dialog {
    transition: none;
  }
}

/* Khung phát giữ đúng tỉ lệ 16:9 ở mọi khổ. */
.tbtc-vmodal__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: var(--r-lg);
  background: #000;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.tbtc-vmodal__frame iframe,
.tbtc-vmodal__frame video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Chưa cấu hình liên kết video thì báo cho người quản trị biết. */
.tbtc-vmodal__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: var(--sp-8);
  color: var(--c-white);
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body-lg);
  text-align: center;
}

.tbtc-vmodal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  z-index: 2;
  top: -52px;
  right: 0;
  width: 40px;
  height: 40px;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none !important;
  color: var(--c-white);
  cursor: pointer;
}

.tbtc-vmodal__close svg {
  width: 20px;
  height: 20px;
  fill: none;
}

.tbtc-vmodal__close:hover {
  border-color: var(--c-white);
  background: rgba(255, 255, 255, 0.24);
}

@media only screen and (max-width: 48em) {
  .tbtc-vmodal {
    padding: var(--gutter);
  }

  /* Khổ nhỏ không đủ chỗ phía trên -> đưa nút đóng vào trong khung. */
  .tbtc-vmodal__close {
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.55);
  }
}
