/* ROOM SLIDER + LIGHTBOX */

/* =========================
   ROOM SLIDER
========================= */

.hero__media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    linear-gradient(
      135deg,
      var(--primary-light),
      var(--green-light)
    );
}

.room-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--primary-dark);
}

.room-slider__track {
  position: relative;
  width: 100%;
  height: 100%;
}

.room-slider__item {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.04);
  transition:
    opacity 0.45s ease,
    visibility 0.45s ease,
    transform 0.6s ease;
}

.room-slider__item.is-active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  z-index: 1;
}

.room-slider__item a,
.room-slider__item img {
  display: block;
  width: 100%;
  height: 100%;
}

.room-slider__item img {
  object-fit: cover;
}

/* =========================
   ROOM SLIDER NAV
========================= */

.room-slider__nav {
  position: absolute;
  top: 50%;
  z-index: 5;

  width: 42px;
  height: 42px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;

  color: var(--primary);
  background: rgba(255, 255, 255, 0.92);

  font-size: 0;
  line-height: 1;

  cursor: pointer;

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);

  transform: translateY(-50%);

  transition:
    background 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.room-slider__nav:hover {
  color: var(--primary-dark);
  background: var(--white);
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
  transform: translateY(-50%) scale(1.06);
}

.room-slider__nav--prev {
  left: 14px;
}

.room-slider__nav--next {
  right: 14px;
}

.room-slider__nav i {
  display: none;
}

.room-slider__nav::before {
  content: "";

  width: 12px;
  height: 12px;

  display: block;

  border-top: 3px solid currentColor;
  border-right: 3px solid currentColor;
}

.room-slider__nav--prev::before {
  margin-left: 4px;
  transform: rotate(-135deg);
}

.room-slider__nav--next::before {
  margin-right: 4px;
  transform: rotate(45deg);
}

/* =========================
   ROOM SLIDER DOTS
========================= */

.room-slider__dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 6;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  transform: translateX(-50%);
}

.room-slider__dot {
  width: 8px;
  height: 8px;
  padding: 0;

  border: 0;
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.55);

  cursor: pointer;

  transition:
    width 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}

.room-slider__dot.is-active {
  width: 26px;
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.18);
}

/* =========================
   EMPTY SLIDER
========================= */

.room-slider--empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.room-slider__placeholder {
  padding: 24px;

  color: var(--white);

  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

/* =========================
   LIGHTBOX
========================= */

body.lightbox-open {
  overflow: hidden;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 5000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  background: rgba(0, 0, 0, 0.94);
}

.lightbox__content {
  position: relative;

  width: 100vw;
  height: 100vh;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 18px;
}

/*
  ВАЖНО:
  width/height заставляют картинку занимать почти весь экран.
  max-width/max-height одни сами по себе маленькое изображение НЕ увеличивают.
*/

.lightbox__image,
.lightbox__content img {
  display: block;

  width: calc(100vw - 36px);
  height: calc(100vh - 36px);

  max-width: none;
  max-height: none;

  object-fit: contain;

  border-radius: 10px;

  box-shadow: 0 25px 90px rgba(0, 0, 0, 0.6);
}

.lightbox__caption {
  position: absolute;
  left: 50%;
  bottom: 28px;

  max-width: calc(100vw - 90px);

  padding: 8px 14px;

  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.5);

  border-radius: 999px;

  font-size: 14px;
  font-weight: 600;
  text-align: center;

  transform: translateX(-50%);

  pointer-events: none;
}

/* =========================
   LIGHTBOX BUTTONS
========================= */

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: fixed;
  z-index: 5010;

  width: 52px;
  height: 52px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;

  color: #111;
  background: rgba(255, 255, 255, 0.94);

  font-size: 0;
  line-height: 1;

  cursor: pointer;

  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.4);

  transition:
    background 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  color: #000;
  background: #fff;
  border-color: rgba(255, 255, 255, 0.75);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.48);
}

.lightbox__close {
  top: 18px;
  right: 18px;
}

.lightbox__prev,
.lightbox__next {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__prev {
  left: 18px;
}

.lightbox__next {
  right: 18px;
}

.lightbox__close:hover {
  transform: scale(1.08);
}

.lightbox__prev:hover,
.lightbox__next:hover {
  transform: translateY(-50%) scale(1.08);
}

.lightbox__close i,
.lightbox__prev i,
.lightbox__next i {
  display: none;
}

/* Стрелки без Font Awesome */

.lightbox__prev::before,
.lightbox__next::before {
  content: "";

  width: 16px;
  height: 16px;

  display: block;

  border-top: 4px solid currentColor;
  border-right: 4px solid currentColor;
}

.lightbox__prev::before {
  margin-left: 6px;
  transform: rotate(-135deg);
}

.lightbox__next::before {
  margin-right: 6px;
  transform: rotate(45deg);
}

/* Крестик без Font Awesome */

.lightbox__close::before,
.lightbox__close::after {
  content: "";

  position: absolute;

  width: 24px;
  height: 4px;

  border-radius: 999px;

  background: currentColor;
}

.lightbox__close::before {
  transform: rotate(45deg);
}

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

/* =========================
   ACCESSIBILITY HELPERS
========================= */

.sr-only,
.visually-hidden {
  position: absolute;

  width: 1px;
  height: 1px;

  padding: 0;
  margin: -1px;

  overflow: hidden;

  clip: rect(0, 0, 0, 0);

  white-space: nowrap;

  border: 0;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {

  .room-slider__nav {
    width: 34px;
    height: 34px;
  }

  .room-slider__nav::before {
    width: 10px;
    height: 10px;
    border-width: 2px;
  }

  .room-slider__nav--prev {
    left: 10px;
  }

  .room-slider__nav--next {
    right: 10px;
  }

  .room-slider__dots {
    bottom: 9px;
    gap: 7px;
  }

  .room-slider__dot {
    width: 6px;
    height: 6px;
  }

  .room-slider__dot.is-active {
    width: 20px;
  }

  .lightbox__content {
    padding: 10px;
  }

  .lightbox__image,
  .lightbox__content img {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);

    border-radius: 8px;
  }

  .lightbox__caption {
    bottom: 18px;

    max-width: calc(100vw - 70px);

    padding: 7px 12px;

    font-size: 12px;
  }

  .lightbox__close,
  .lightbox__prev,
  .lightbox__next {
    width: 42px;
    height: 42px;
  }

  .lightbox__close {
    top: 12px;
    right: 12px;
  }

  .lightbox__prev {
    left: 10px;
  }

  .lightbox__next {
    right: 10px;
  }

  .lightbox__prev::before,
  .lightbox__next::before {
    width: 13px;
    height: 13px;
    border-width: 3px;
  }

  .lightbox__close::before,
  .lightbox__close::after {
    width: 20px;
    height: 3px;
  }

}

@media (max-width: 480px) {

  .room-slider__nav {
    width: 30px;
    height: 30px;
  }

  .room-slider__nav::before {
    width: 9px;
    height: 9px;
  }

  .room-slider__dots {
    bottom: 7px;
  }

  .lightbox__content {
    padding: 6px;
  }

  .lightbox__image,
  .lightbox__content img {
    width: calc(100vw - 12px);
    height: calc(100vh - 12px);
  }

  .lightbox__close,
  .lightbox__prev,
  .lightbox__next {
    width: 38px;
    height: 38px;
  }

}
