@charset "UTF-8";

/* =========================================================
   GALLERY video / poster modal patch
   This file is intentionally isolated from style.css so the
   existing KV and page layout are not affected.
   ========================================================= */

body.is-modal-open {
  overflow: hidden;
}

/* video.png is used as the poster image until playback starts. */
.gallery-block__video {
  display: block;
  width: 800px;
  max-width: 100%;
  height: auto;
  margin-top: 40px;
  aspect-ratio: 16 / 9;
  background: #000;
  object-fit: cover;
}

.gallery-poster {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.gallery-poster:first-child {
  width: 370px;
  flex: 0 0 370px;
}

.gallery-poster:last-child {
  width: 372px;
  flex: 0 0 372px;
}

.gallery-poster picture,
.gallery-poster img {
  display: block;
  width: 100%;
}

.gallery-poster img {
  transition: opacity 0.25s ease;
}

@media (hover: hover) {
  .gallery-poster:hover img {
    opacity: 0.78;
  }
}

.image-modal[hidden] {
  display: none;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 48px 64px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.image-modal.is-open {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.image-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
}

.image-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(100%, 1100px);
  max-height: calc(100vh - 96px);
  align-items: center;
  justify-content: center;
}

.image-modal__image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 96px);
  object-fit: contain;
}

.image-modal__close {
  position: fixed;
  top: 28px;
  right: 32px;
  z-index: 2;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.image-modal__close::before,
.image-modal__close::after {
  content: "";
  position: absolute;
  top: 23px;
  left: 5px;
  width: 38px;
  height: 1px;
  background: #fff;
}

.image-modal__close::before {
  transform: rotate(45deg);
}

.image-modal__close::after {
  transform: rotate(-45deg);
}

.image-modal__close:focus-visible,
.gallery-poster:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

@media (max-width: 767px) {
  .gallery-block__video {
    width: 100%;
    height: auto;
    margin-top: 27px;
  }

  .gallery-poster:first-child,
  .gallery-poster:last-child {
    width: 100%;
    flex: none;
  }

  .image-modal {
    padding: 58px 20px 24px;
  }

  .image-modal__dialog,
  .image-modal__image {
    max-height: calc(100dvh - 82px);
  }

  .image-modal__close {
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
  }

  .image-modal__close::before,
  .image-modal__close::after {
    top: 21px;
    left: 5px;
    width: 34px;
  }
}
