/* Appliste Review 2026 gallery preview
   Scoped to reviews only via body.ap-single-review. */

body.ap-single-review .ap-gallery-preview {
  width: 100%;
  max-width: 760px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 38px auto;
}

body.ap-single-review .ap-gallery-preview.ap-gallery-count-1 {
  max-width: 760px;
  grid-template-columns: 1fr;
}

body.ap-single-review .ap-gallery-preview.ap-gallery-count-2 {
  max-width: 760px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.ap-single-review .ap-gallery-item {
  position: relative;
  display: block;
  min-width: 0;
  overflow: hidden;
  border: 0 !important;
  border-radius: 18px;
  background: transparent !important;
  box-shadow: none !important;
  text-decoration: none;
  isolation: isolate;
}

body.ap-single-review .ap-gallery-link {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: inherit;
  background: transparent !important;
  box-shadow: none !important;
}

body.ap-single-review .ap-gallery-item img {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  margin: 0 !important;
  border-radius: inherit !important;
  object-fit: cover !important;
  box-shadow: none !important;
  transform: none;
  transition: transform .22s ease, filter .22s ease;
}

body.ap-single-review .ap-gallery-caption {
  display: none !important;
}

body.ap-single-review .ap-gallery-more .ap-gallery-link::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: rgba(2, 6, 23, .46);
  content: "";
}

body.ap-single-review .ap-gallery-more img {
  filter: brightness(.62) saturate(.9);
  transform: none;
}

body.ap-single-review .ap-gallery-more-count {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
  box-shadow: 0 16px 40px rgba(2, 6, 23, .22);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(18px);
}

body.ap-single-review .ap-gallery-hidden {
  display: none !important;
}

html.ap-gallery-lock {
  overflow: hidden;
}

body.ap-single-review .ap-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(2, 6, 23, .86);
  backdrop-filter: blur(18px);
}

body.ap-single-review .ap-gallery-lightbox.is-open {
  display: flex;
}

body.ap-single-review .ap-gallery-lightbox__figure {
  width: min(1180px, calc(100vw - 144px));
  max-height: calc(100vh - 96px);
  display: grid;
  gap: 12px;
  margin: 0;
  justify-items: center;
}

body.ap-single-review .ap-gallery-lightbox__figure img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 150px);
  border-radius: 24px;
  object-fit: contain;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .38);
}

body.ap-single-review .ap-gallery-lightbox__figure figcaption {
  max-width: 760px;
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

body.ap-single-review .ap-gallery-lightbox__close,
body.ap-single-review .ap-gallery-lightbox__nav {
  position: absolute;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(18px);
}

body.ap-single-review .ap-gallery-lightbox__close {
  top: 22px;
  right: 22px;
  width: 46px;
  height: 46px;
  font-size: 28px;
  line-height: 1;
}

body.ap-single-review .ap-gallery-lightbox__nav {
  top: 50%;
  width: 52px;
  height: 52px;
  font-size: 38px;
  line-height: 1;
  transform: translateY(-50%);
}

body.ap-single-review .ap-gallery-lightbox__prev {
  left: 24px;
}

body.ap-single-review .ap-gallery-lightbox__next {
  right: 24px;
}

@media (hover: hover) and (pointer: fine) {
  body.ap-single-review .ap-gallery-item {
    transition: transform .2s ease, box-shadow .2s ease;
  }

  body.ap-single-review .ap-gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(15, 23, 42, .1);
  }

  body.ap-single-review .ap-gallery-item:hover img {
    transform: scale(1.025);
  }

  body.ap-single-review .ap-gallery-more:hover img {
    transform: scale(1.025);
  }
}

@media (max-width: 768px) {
  body.ap-single-review .ap-gallery-preview,
  body.ap-single-review .ap-gallery-preview.ap-gallery-count-1,
  body.ap-single-review .ap-gallery-preview.ap-gallery-count-2 {
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 36px;
    margin-bottom: 36px;
  }

  body.ap-single-review .ap-gallery-preview.ap-gallery-count-1 {
    grid-template-columns: 1fr;
  }

  body.ap-single-review .ap-gallery-preview.ap-gallery-count-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.ap-single-review .ap-gallery-has-more .ap-gallery-item:first-child {
    grid-column: 1 / -1;
  }

  body.ap-single-review .ap-gallery-item {
    border-radius: 16px;
    box-shadow: none;
  }

  body.ap-single-review .ap-gallery-link {
    aspect-ratio: 4 / 3;
  }

  body.ap-single-review .ap-gallery-has-more .ap-gallery-item:first-child .ap-gallery-link {
    aspect-ratio: 16 / 10;
  }

  body.ap-single-review .ap-gallery-more-count {
    min-height: 38px;
    padding: 0 15px;
    font-size: 15px;
  }

  body.ap-single-review .ap-gallery-caption {
    padding: 9px 11px 11px;
    font-size: 11px;
  }

  body.ap-single-review .ap-gallery-lightbox {
    padding: 16px;
  }

  body.ap-single-review .ap-gallery-lightbox__figure {
    width: calc(100vw - 32px);
    max-height: calc(100vh - 120px);
  }

  body.ap-single-review .ap-gallery-lightbox__figure img {
    max-height: calc(100vh - 170px);
    border-radius: 18px;
  }

  body.ap-single-review .ap-gallery-lightbox__close {
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
  }

  body.ap-single-review .ap-gallery-lightbox__nav {
    top: auto;
    bottom: 18px;
    width: 46px;
    height: 46px;
    font-size: 32px;
    transform: none;
  }

  body.ap-single-review .ap-gallery-lightbox__prev {
    left: calc(50% - 56px);
  }

  body.ap-single-review .ap-gallery-lightbox__next {
    right: calc(50% - 56px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.ap-single-review .ap-gallery-item,
  body.ap-single-review .ap-gallery-item img {
    transition: none !important;
  }
}
