/* =========================================================
   ВІДЕО-ТИЗЕР + МОДАЛЬНЕ ВІКНО (вертикальне відео 9:16)
   ========================================================= */

/* ---------- тизер-кнопка ---------- */
.video-teaser {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 32px);
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
  cursor: pointer;
}
.video-teaser img {
  transform: rotate(0deg);
	  transition: transform .3s;

}
.video-teaser:hover img { transform: rotate(-2deg) translate(-2px, -2px) }
.video-teaser:focus-visible {  }

/* мініатюра 9:16 */
.video-teaser__thumb {
  position: relative;
  flex: none;
  width: clamp(110px, 22vw, 150px);
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #B5A27C;
  border: 1.5px solid #1D1D1B;
}
.video-teaser__thumb img,
.video-teaser__thumb video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* кнопка Play */
.video-teaser__play {
  position: absolute; left: 50%; top: 50%;
  width: 56px; height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  background: #3DAE5C;
  border: 2px solid #1D1D1B;
  display: grid; place-items: center;
  transition: transform .2s;
}
.video-teaser__play svg { width: 20px; height: 22px; margin-left: 4px; fill: #fff; }
.video-teaser:hover .video-teaser__play { transform: scale(1.1); }

.video-teaser__text { display: flex; flex-direction: column; gap: 8px; }
.video-teaser__kicker { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.video-teaser__title { font-weight: 800; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.1; }
.video-teaser__note { font-family: Caveat, cursive; font-size: 22px; line-height: 1.05; }

/* ---------- модальне вікно ---------- */
.video-modal {
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  max-width: none;
  max-height: none;
}
.video-modal::backdrop {
  background: rgba(29, 29, 27, .82);
}
.video-modal[open] { animation: vm-in .25s ease; }
@keyframes vm-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

.video-modal__frame {
  position: relative;
  /* вписуємо 9:16 і в ширину, і у висоту екрана */
  height: min(88vh, 88dvh, calc((100vw - 32px) * 16 / 9));
  aspect-ratio: 9 / 16;
  background: #000;
  border: 2px solid #1D1D1B;
  box-shadow: 8px 8px 0 #E39A48;
}
.video-modal__video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }

.video-modal__close {
  position: absolute; top: -18px; right: -18px; z-index: 2;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #F2DCAB;
  border: 2px solid #1D1D1B;
  display: grid; place-items: center;
  cursor: pointer;
  padding: 0;
}
.video-modal__close svg { width: 16px; height: 16px; stroke: #1D1D1B; stroke-width: 2.5; stroke-linecap: round; }
.video-modal__close:focus-visible { outline: 3px solid #E39A48; outline-offset: 2px; }

@media (max-width: 575.98px) {
  .video-modal__close { top: 8px; right: 8px; }
}

/* блокуємо скрол сторінки під модалкою */
html:has(.video-modal[open]) { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .video-modal[open] { animation: none; }
  .video-teaser, .video-teaser__play { transition: none; }
}

/* контейнер, куди JS вставляє <video> або <iframe> */
.video-modal__media { width: 100%; height: 100%; }
iframe.video-modal__video { border: 0; }
