/* Gallery-only overrides. Intentionally isolated from the rest of the site. */

/* Main display: fixed horizontal ratio matching the source images. */
#galleryTrack {
  display: flex !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  gap: 0 !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory !important;
  scroll-behavior: smooth !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  padding: 0 !important;
}

#galleryTrack::-webkit-scrollbar {
  display: none !important;
}

#galleryTrack > .gallery-slide {
  position: relative !important;
  flex: 0 0 100% !important;
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  aspect-ratio: 1672 / 941 !important;
  height: auto !important;
  min-height: 0 !important;
  scroll-snap-align: start !important;
  scroll-snap-stop: always !important;
  overflow: hidden !important;
  border-radius: 0 !important;
  background: var(--surface-2) !important;
}

#galleryTrack > .gallery-slide > img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  display: block !important;
  object-fit: contain !important;
  object-position: center !important;
  padding: 0 !important;
  margin: 0 !important;
  transform: none !important;
  background: var(--surface-2) !important;
}

/* Keep the caption subtle without changing gallery geometry. */
#galleryTrack > .gallery-slide::after {
  content: "" !important;
  position: absolute !important;
  inset: auto 0 0 0 !important;
  height: 44% !important;
  pointer-events: none !important;
  background: linear-gradient(to top, rgba(5, 8, 9, .78), rgba(5, 8, 9, .26) 62%, transparent) !important;
}

#galleryTrack .gallery-overlay {
  position: absolute !important;
  z-index: 2 !important;
  inset-inline: 18px !important;
  bottom: 16px !important;
}

/* Thumbnails: one small horizontal rail directly under the main image. */
#galleryThumbs {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  width: 100% !important;
  gap: 6px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 10px 0 2px !important;
  margin: 0 !important;
  scrollbar-width: none !important;
  -webkit-overflow-scrolling: touch !important;
}

#galleryThumbs::-webkit-scrollbar {
  display: none !important;
}

#galleryThumbs > .gallery-thumb {
  position: relative !important;
  display: block !important;
  flex: 0 0 70px !important;
  width: 70px !important;
  min-width: 70px !important;
  max-width: 70px !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 1672 / 941 !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  background: var(--surface-2) !important;
  opacity: .68 !important;
  cursor: pointer !important;
  box-shadow: none !important;
}

#galleryThumbs > .gallery-thumb > img {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  object-position: center !important;
  padding: 0 !important;
  margin: 0 !important;
  transform: none !important;
}

#galleryThumbs > .gallery-thumb::after {
  display: none !important;
}

#galleryThumbs > .gallery-thumb.is-active {
  opacity: 1 !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 16%, transparent) !important;
}

#galleryThumbs > .gallery-thumb:active {
  transform: scale(.97) !important;
}

/* Slightly smaller thumbnails on narrow phones; still one horizontal row. */
@media (max-width: 430px) {
  #galleryThumbs > .gallery-thumb {
    flex-basis: 64px !important;
    width: 64px !important;
    min-width: 64px !important;
    max-width: 64px !important;
  }

  #galleryTrack .gallery-overlay {
    inset-inline: 14px !important;
    bottom: 12px !important;
  }
}


/* GALLERY POLISH UPDATE
   - no text above gallery
   - larger thumbnails
   - no three status cards below
   - smoother vertical page scrolling while pointer is over the gallery
*/
.post-hero .gallery-head {
  display: none !important;
}

.post-hero .trust-row {
  display: none !important;
}

.gallery-shell {
  gap: 0 !important;
}

.gallery-frame {
  margin-top: 0 !important;
}

.gallery-controls {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 12px 0 8px !important;
}

.gallery-inline-count {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 76px !important;
  padding: 9px 12px !important;
  border: 1px solid var(--line) !important;
  border-radius: 999px !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: .08em !important;
  flex: 0 0 auto !important;
}

.gallery-swipe-hint {
  font-size: 11px !important;
}

#galleryTrack,
#galleryThumbs {
  overscroll-behavior-x: contain !important;
  overscroll-behavior-y: auto !important;
}

#galleryThumbs {
  gap: 8px !important;
  padding: 10px 0 2px !important;
}

#galleryThumbs > .gallery-thumb {
  flex: 0 0 86px !important;
  width: 86px !important;
  min-width: 86px !important;
  max-width: 86px !important;
  border-radius: 14px !important;
}

@media (min-width: 700px) {
  #galleryThumbs > .gallery-thumb {
    flex-basis: 116px !important;
    width: 116px !important;
    min-width: 116px !important;
    max-width: 116px !important;
  }
}

@media (max-width: 430px) {
  #galleryThumbs > .gallery-thumb {
    flex-basis: 76px !important;
    width: 76px !important;
    min-width: 76px !important;
    max-width: 76px !important;
  }

  .gallery-inline-count {
    min-width: 70px !important;
    padding: 8px 10px !important;
  }
}


/* Clean gallery images: no captions or text overlays */
#galleryTrack > .gallery-slide::after {
  display: none !important;
}

#galleryTrack .gallery-overlay {
  display: none !important;
}
