/* ==========================================================
   BODY STATE
========================================================== */

body.skbt-gallery-modal-open {
  overflow: hidden;
}

/* ==========================================================
   ALBUM MODAL
========================================================== */

.skbt-gallery-modal {
  position: fixed;
  z-index: 99990;

  inset: 0;

  display: none;
}

.skbt-gallery-modal.is-open {
  display: block;
}

.skbt-gallery-modal__backdrop {
  position: absolute;

  inset: 0;

  background: rgba(6, 10, 18, 0.78);

  backdrop-filter: blur(3px);
}

.skbt-gallery-modal__dialog {
  position: absolute;

  top: 50%;
  left: 50%;

  width: min(calc(100% - var(--content-gutter)), var(--content-width));

  max-height: calc(100vh - 70px);

  overflow-y: auto;

  padding: 36px 38px 40px;

  background: #fff;

  border-radius: 8px;

  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);

  transform: translate(-50%, -50%);
}

/* ==========================================================
   MODAL CLOSE
========================================================== */

.skbt-gallery-modal__close {
  position: absolute;

  top: 18px;
  right: 20px;

  display: inline-flex;

  width: 38px;
  height: 38px;

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

  margin: 0;
  padding: 0;

  color: #273142 !important;
  background: transparent !important;

  border: 0 !important;
  border-radius: 50%;

  cursor: pointer;

  box-shadow: none !important;

  transition: color 160ms ease;
}

.skbt-gallery-modal__close svg {
  display: block;

  width: 21px;
  height: 21px;

  fill: none;
  stroke: currentColor;

  stroke-width: 2;
  stroke-linecap: round;
}

.skbt-gallery-modal__close:hover,
.skbt-gallery-modal__close:focus {
  color: var(--color-primary) !important;
  background: transparent !important;

  outline: none;
}

/* ==========================================================
   MODAL HEADER
========================================================== */

.skbt-gallery-modal__header {
  padding-right: 54px;

  margin-bottom: 24px;
}

.skbt-gallery-modal__title-row {
  display: flex;

  align-items: center;

  gap: 12px;

  margin: 0 0 9px !important;
  padding: 0 !important;
}

.skbt-gallery-modal__title-icon {
  display: inline-flex;

  width: 34px;
  height: 34px;

  flex: 0 0 34px;

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

  margin: 0 !important;
  padding: 0 !important;

  color: var(--color-primary);

  transform: none;
}

.skbt-gallery-modal__title-icon svg {
  display: block;

  width: 31px;
  height: 31px;

  flex: 0 0 31px;

  margin: 0 !important;
  padding: 0 !important;

  fill: none;
  stroke: currentColor;

  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skbt-gallery-modal__title {
  display: block;

  margin: 0 !important;
  padding: 0 !important;

  color: var(--color-primary) !important;

  font-family: inherit !important;
  font-size: 27px !important;
  font-weight: 800 !important;

  line-height: 1.2 !important;

  letter-spacing: normal !important;

  transform: none !important;
}

.skbt-gallery-modal__meta {
  display: flex;

  flex-wrap: wrap;
  align-items: center;

  gap: 7px;

  min-height: 17px;

  margin: 0 !important;
  padding: 0 !important;

  color: #858c99;

  font-size: 11px;
  font-weight: 600;

  line-height: 1.4;
}

.skbt-gallery-modal__meta:empty {
  display: none;
}

.skbt-gallery-modal__meta-separator {
  color: var(--color-primary);

  font-weight: 800;
}

.skbt-gallery-modal__description {
  max-width: 760px;

  margin: 10px 0 0 !important;
  padding: 0 !important;

  color: #626b7a;

  font-size: 12.5px !important;
  line-height: 1.55 !important;
}

.skbt-gallery-modal__description:empty {
  display: none;
}

/* ==========================================================
   MODAL PHOTO GRID
========================================================== */

.skbt-gallery-modal__grid {
  display: grid;

  grid-template-columns: repeat(4, minmax(0, 1fr));

  gap: 12px;
}

.skbt-gallery-modal__photo {
  position: relative;

  display: block;

  aspect-ratio: 4 / 3;

  margin: 0;
  padding: 0;

  overflow: hidden;

  background: #eef0f3 !important;

  border: 0 !important;
  border-radius: 4px;

  cursor: zoom-in;

  box-shadow: none !important;
}

.skbt-gallery-modal__photo img {
  display: block;

  width: 100%;
  height: 100%;

  margin: 0 !important;
  padding: 0 !important;

  object-fit: cover;
  object-position: center;

  transition: filter 180ms ease;
}

.skbt-gallery-modal__photo:hover,
.skbt-gallery-modal__photo:focus {
  background: #eef0f3 !important;

  outline: none;
}

.skbt-gallery-modal__photo:hover img,
.skbt-gallery-modal__photo:focus img {
  filter: brightness(0.78) saturate(0.92);
}

/* ==========================================================
   ARTICLE MODAL PHOTO GRID
========================================================== */

.skbt-gallery-modal.is-from-article .skbt-gallery-modal__photo {
  display: flex;

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

  background: #f2f3f5 !important;
}

.skbt-gallery-modal.is-from-article .skbt-gallery-modal__photo img {
  object-fit: contain;
  object-position: center;
}

.skbt-gallery-modal.is-from-article .skbt-gallery-modal__photo:hover,
.skbt-gallery-modal.is-from-article .skbt-gallery-modal__photo:focus {
  background: #f2f3f5 !important;
}

/* ==========================================================
   GALLERY PAGE MODAL
========================================================== */

.skbt-gallery-modal.is-from-gallery .skbt-gallery-modal__photo img {
  object-fit: cover;
  object-position: center;
}

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

.skbt-gallery-lightbox {
  position: fixed;
  z-index: 100000;

  inset: 0;

  display: none;
}

.skbt-gallery-lightbox.is-open {
  display: block;
}

.skbt-gallery-lightbox__backdrop {
  position: absolute;

  inset: 0;

  background: rgba(3, 6, 12, 0.985);
}

.skbt-gallery-lightbox__stage {
  position: absolute;

  top: 50%;
  left: 50%;

  display: flex;

  width: min(calc(100vw - 120px), 1500px);

  height: calc(100vh - 90px);

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

  padding: 34px 74px 50px;

  transform: translate(-50%, -50%);
}

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

.skbt-gallery-lightbox__image {
  display: block;

  width: auto;
  height: auto;

  max-width: 100%;
  max-height: calc(100vh - 110px);

  margin: 0 !important;
  padding: 0 !important;

  object-fit: contain;

  opacity: 1;

  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);

  transition: opacity 160ms ease;
}

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

.skbt-gallery-lightbox__close {
  position: fixed;

  top: 20px;
  right: 24px;

  z-index: 3;

  display: inline-flex;

  width: 44px;
  height: 44px;

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

  margin: 0;
  padding: 0;

  color: #fff !important;
  background: transparent !important;

  border: 0 !important;
  border-radius: 50%;

  cursor: pointer;

  box-shadow: none !important;

  transition: color 160ms ease;
}

.skbt-gallery-lightbox__close svg {
  display: block;

  width: 25px;
  height: 25px;

  fill: none;
  stroke: currentColor;

  stroke-width: 2;
  stroke-linecap: round;
}

.skbt-gallery-lightbox__close:hover,
.skbt-gallery-lightbox__close:focus {
  color: var(--color-primary) !important;
  background: transparent !important;

  outline: none;
}

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

.skbt-gallery-lightbox__arrow {
  position: absolute;

  top: 50%;

  z-index: 3;

  display: inline-flex;

  width: 48px;
  height: 48px;

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

  margin: 0;
  padding: 0;

  color: #fff !important;
  background: transparent !important;

  border: 1px solid rgba(255, 255, 255, 0.55) !important;

  border-radius: 50%;

  transform: translateY(-50%);

  cursor: pointer;

  box-shadow: none !important;

  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.skbt-gallery-lightbox__arrow svg {
  display: block;

  width: 23px;
  height: 23px;

  fill: none;
  stroke: currentColor;

  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skbt-gallery-lightbox__arrow:hover,
.skbt-gallery-lightbox__arrow:focus {
  color: var(--color-primary) !important;
  background: transparent !important;

  border-color: var(--color-primary) !important;

  outline: none;
}

.skbt-gallery-lightbox__arrow--prev {
  left: 8px;
}

.skbt-gallery-lightbox__arrow--next {
  right: 8px;
}

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

.skbt-gallery-lightbox__counter {
  position: fixed;

  bottom: 20px;
  left: 50%;

  padding: 7px 11px;

  color: rgba(255, 255, 255, 0.92);
  background: rgba(10, 25, 47, 0.78);

  border-radius: 4px;

  font-size: 11px;
  font-weight: 700;

  transform: translateX(-50%);
}

/* ==========================================================
   TABLET
========================================================== */

@media (max-width: 900px) {
  .skbt-gallery-modal__dialog {
    width: calc(100% - 40px);

    padding: 32px 26px 30px;
  }

  .skbt-gallery-modal__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .skbt-gallery-lightbox__stage {
    width: calc(100vw - 40px);
    height: calc(100vh - 80px);

    padding: 40px 62px 54px;
  }

  .skbt-gallery-lightbox__image {
    max-height: calc(100vh - 105px);
  }

  .skbt-gallery-lightbox__arrow--prev {
    left: 4px;
  }

  .skbt-gallery-lightbox__arrow--next {
    right: 4px;
  }
}

/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 600px) {
  .skbt-gallery-modal__dialog {
    top: 12px;
    bottom: 12px;
    left: 12px;

    width: calc(100% - 24px);
    max-height: none;

    padding: 28px 16px 24px;

    transform: none;
  }

  .skbt-gallery-modal__close {
    top: 9px;
    right: 9px;
  }

  .skbt-gallery-modal__header {
    padding-right: 36px;

    margin-bottom: 20px;
  }

  .skbt-gallery-modal__title-row {
    align-items: center;

    gap: 9px;
  }

  .skbt-gallery-modal__title-icon {
    width: 28px;
    height: 28px;

    flex: 0 0 28px;

    transform: translateY(1px);
  }

  .skbt-gallery-modal__title-icon svg {
    width: 26px;
    height: 26px;

    flex: 0 0 26px;
  }

  .skbt-gallery-modal__title {
    font-size: 22px !important;
  }

  .skbt-gallery-modal__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 7px;
  }

  .skbt-gallery-lightbox__stage {
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    padding: 54px 12px 68px;

    transform: none;
  }

  .skbt-gallery-lightbox__image {
    max-height: calc(100vh - 125px);
  }

  .skbt-gallery-lightbox__arrow {
    top: auto;
    bottom: 14px;

    width: 42px;
    height: 42px;

    transform: none;
  }

  .skbt-gallery-lightbox__arrow svg {
    width: 20px;
    height: 20px;
  }

  .skbt-gallery-lightbox__arrow--prev {
    left: 14px;
  }

  .skbt-gallery-lightbox__arrow--next {
    right: 14px;
  }

  .skbt-gallery-lightbox__counter {
    bottom: 19px;
  }
}
