.detail-gallery {
  --detail-accent: var(--slider-accent, #1ab3cc);
  --detail-accent-rgb: var(--slider-accent-rgb, 26, 179, 204);
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0 96px;
}

.detail-gallery[hidden] {
  display: none;
}

.detail-gallery .detail-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--detail-accent);
  font-family: "Poppins", Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.detail-gallery .detail-eyebrow::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.detail-gallery-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 30px;
}

.detail-gallery-heading h2 {
  margin: 12px 0 0;
  color: #4b3a73;
  font-family: "Poppins", Arial, sans-serif;
  font-size: clamp(29px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.detail-gallery-nav {
  display: flex;
  flex-shrink: 0;
  gap: 10px;
}

.detail-gallery-nav button {
  display: grid;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(75, 58, 115, 0.11);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 22px rgba(75, 58, 115, 0.08);
  color: #4b3a73;
  cursor: pointer;
  font: 800 21px/1 "Mulish", Arial, sans-serif;
  place-items: center;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.detail-gallery-nav button:hover:not(:disabled) {
  border-color: var(--detail-accent);
  color: var(--detail-accent);
  transform: translateY(-2px);
}

.detail-gallery-nav button:disabled {
  cursor: default;
  opacity: 0.32;
}

.detail-gallery-viewport {
  overflow-x: auto;
  padding: 2px 2px 18px;
  outline: none;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.detail-gallery-viewport::-webkit-scrollbar {
  display: none;
}

.detail-gallery-viewport:focus-visible {
  border-radius: 24px;
  box-shadow: 0 0 0 3px rgba(var(--detail-accent-rgb), 0.22);
}

.detail-gallery-track {
  display: flex;
  gap: 18px;
}

.detail-gallery-slide {
  position: relative;
  flex: 0 0 calc((100% - 36px) / 3);
  min-width: 0;
  aspect-ratio: 4 / 3;
  margin: 0;
  overflow: hidden;
  border-radius: 22px;
  background: #ece8f2;
  box-shadow: 0 14px 34px rgba(49, 36, 83, 0.13);
  scroll-snap-align: start;
}

.detail-gallery[data-photo-count="1"] .detail-gallery-slide {
  flex-basis: 100%;
  aspect-ratio: 16 / 8.5;
}

.detail-gallery[data-photo-count="2"] .detail-gallery-slide {
  flex-basis: calc((100% - 18px) / 2);
}

.detail-gallery-slide img,
.detail-gallery-slide video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.detail-gallery-slide img {
  transition: transform 0.45s ease;
}

.detail-gallery-slide video {
  background: #1d172c;
}

.detail-gallery-slide:hover img {
  transform: scale(1.025);
}

.detail-gallery-slide figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 42px 20px 18px;
  background: linear-gradient(transparent, rgba(28, 20, 51, 0.78));
  color: #fff;
  font: 700 14px/1.45 "Mulish", Arial, sans-serif;
}

.detail-gallery-slide.is-video figcaption {
  top: 0;
  bottom: auto;
  padding: 18px 20px 42px;
  background: linear-gradient(rgba(28, 20, 51, 0.78), transparent);
  pointer-events: none;
}

.detail-gallery-status {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 5px;
}

.detail-gallery-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(75, 58, 115, 0.22);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.detail-gallery-dot.is-active {
  width: 26px;
  background: var(--detail-accent);
}

@media (max-width: 860px) {
  .detail-gallery-slide,
  .detail-gallery[data-photo-count="2"] .detail-gallery-slide {
    flex-basis: calc((100% - 18px) / 2);
  }
}

@media (max-width: 640px) {
  .detail-gallery {
    width: min(100% - 32px, 1180px);
    padding: 62px 0 68px;
  }

  .detail-gallery-heading {
    align-items: center;
    margin-bottom: 22px;
  }

  .detail-gallery-heading h2 {
    font-size: 29px;
  }

  .detail-gallery-nav button {
    width: 42px;
    height: 42px;
  }

  .detail-gallery-slide,
  .detail-gallery[data-photo-count="2"] .detail-gallery-slide {
    flex-basis: 86%;
  }

  .detail-gallery[data-photo-count="1"] .detail-gallery-slide {
    flex-basis: 100%;
    aspect-ratio: 4 / 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .detail-gallery *,
  .detail-gallery *::before,
  .detail-gallery *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
