/* Race-page preview dots and thumbnail strips for gallery and lightbox.
   Arrow chrome lives in arrow-controls.css; linked-location dots live in location-banners.css. */

/* ─── SHARED PREVIEW CONTROLS ─── */

.gallery-carousel__caption,
.gallery-carousel__label,
.gallery-carousel__count {
  display: none;
  min-height: 0;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

:is(.gallery-carousel__peek, .lightbox__peek) {
  --sftl-preview-thumb-size: 74px;
  --sftl-preview-thumb-radius: 13px;
  --sftl-preview-thumb-img-radius: 10px;
  --sftl-preview-hotspot-width: 34px;
  --sftl-preview-hotspot-height: 74px;
  --sftl-preview-hotspot-radius: 12px;
  position: absolute;
  left: 50%;
  right: auto;
  top: auto;
  bottom: var(--sftl-preview-peek-bottom);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: max-content;
  max-width: min(560px, calc(100vw - 48px));
  min-height: 0;
  padding: 0;
  margin: 0;
  overflow: visible;
  pointer-events: auto;
  z-index: var(--sftl-preview-peek-z);
}

.gallery-carousel__peek {
  --sftl-preview-peek-bottom: clamp(2px, 0.9vh, 10px);
  --sftl-preview-peek-z: 20;
  --sftl-preview-dots-gap: 10px;
  --sftl-preview-dots-z: 24;
  --sftl-preview-dot-size: 9px;
  --sftl-preview-dot-min-size: 9px;
  --sftl-preview-dot-hover-opacity: 1;
  --sftl-preview-strip-z: 23;
  --sftl-preview-thumb-transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  --sftl-preview-thumb-img-position: top center;
  --sftl-preview-hotspot-z: 24;
  --sftl-preview-hotspot-hover-transform: translateY(-1px);
  --sftl-preview-hotspot-active-transform: translateY(-1px) scale(0.985);
  isolation: isolate;
}

.lightbox__peek {
  --sftl-preview-peek-bottom: clamp(13px, 2vh, 22px);
  --sftl-preview-peek-z: 10004;
  --sftl-preview-dots-gap: 12px;
  --sftl-preview-dots-z: 10007;
  --sftl-preview-dot-size: 10px;
  --sftl-preview-dot-min-size: 10px;
  --sftl-preview-dot-hover-opacity: 0.94;
  --sftl-preview-strip-z: 10006;
  --sftl-preview-thumb-overflow: hidden;
  --sftl-preview-hotspot-z: 10007;
  --sftl-preview-hotspot-hover-transform: translateY(-1px) scale(0.985);
  --sftl-preview-hotspot-active-transform: translateY(-1px) scale(0.985);
}

:is(.gallery-carousel__peek .gallery-carousel__dots, .lightbox__peek .lightbox__dots) {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 10px 14px;
  margin: 0;
  left: auto;
  bottom: auto;
  transform: none;
  z-index: var(--sftl-preview-dots-z);
  gap: var(--sftl-preview-dots-gap);
  background: transparent;
  border: 0;
  box-shadow: none;
  pointer-events: auto;
}

.gallery-carousel__peek .gallery-carousel__dots {
  padding-block: 2px;
}

:is(.gallery-carousel__dot, .lightbox__dot) {
  padding: 0;
  width: var(--sftl-preview-dot-size);
  height: var(--sftl-preview-dot-size);
  min-width: var(--sftl-preview-dot-min-size);
  min-height: var(--sftl-preview-dot-min-size);
  border-radius: 50%;
  border: 1.5px solid rgba(200, 191, 176, 0.42);
  cursor: pointer;
  opacity: 0.42;
  background: rgba(200, 191, 176, 0.045);
  box-shadow:
    0 1px 5px rgba(0, 0, 0, 0.48);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.gallery-carousel__dot {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
}

:is(.gallery-carousel__dot, .lightbox__dot):is(:hover, :focus-visible) {
  transform: scale(1.18);
  outline: none;
  opacity: var(--sftl-preview-dot-hover-opacity);
}

.gallery-carousel__peek:is(:hover, :focus-within) .gallery-carousel__dot:not(.is-active):not(.is-previewed),
.lightbox__peek:is(:hover, :focus-within) .lightbox__dot:not(.is-active):not(.is-previewed) {
  opacity: 0.50;
  background: rgba(200, 191, 176, 0.060);
  border-color: rgba(200, 191, 176, 0.48);
  box-shadow:
    0 1px 5px rgba(0, 0, 0, 0.50);
}

:is(.gallery-carousel__dot, .lightbox__dot).is-active {
  opacity: 1;
  background: rgba(245, 236, 214, 0.92);
  border-color: rgba(255, 248, 232, 0.98);
  box-shadow:
    0 0 0 1px rgba(255, 248, 232, 0.24),
    0 0 9px rgba(245, 236, 214, 0.38),
    0 0 20px rgba(200, 191, 176, 0.28),
    0 1px 6px rgba(0, 0, 0, 0.52);
}

:is(.gallery-carousel__dot, .lightbox__dot).is-previewed:not(.is-active) {
  opacity: 0.88;
  background: rgba(200, 191, 176, 0.14);
  border-color: rgba(245, 236, 214, 0.70);
  box-shadow:
    0 0 0 1px rgba(245, 236, 214, 0.10),
    0 0 8px rgba(245, 236, 214, 0.20),
    0 0 18px rgba(200, 191, 176, 0.12),
    0 1px 5px rgba(0, 0, 0, 0.45);
}

.gallery-carousel__peek .gallery-carousel__strip,
.lightbox__strip {
  position: relative;
  width: max-content;
  max-width: min(560px, calc(100vw - 48px));
  max-height: 0;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  transform: translateY(12px) scale(0.99);
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  transition:
    max-height 0.22s ease,
    opacity 0.20s ease,
    visibility 0.20s ease,
    transform 0.22s ease;
  opacity: 0;
  z-index: var(--sftl-preview-strip-z);
}

:is(
  .gallery-carousel__peek:is(.is-peeking, :hover, :focus-within) .gallery-carousel__strip,
  .gallery-carousel__strip:is(:hover, :focus-within),
  .lightbox__peek:is(.is-peeking, :hover, :focus-within) .lightbox__strip,
  .lightbox__strip:is(:hover, :focus-within)
) {
  max-height: 92px;
  transform: translateY(0) scale(1);
  overflow: visible;
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.58));
}

:is(.gallery-carousel__thumbs, .lightbox__thumbs) {
  display: inline-flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: min(410px, calc(100vw - 112px));
  padding: 0;
  margin: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.gallery-carousel__thumbs {
  box-sizing: border-box;
  z-index: 9;
}

.gallery-carousel__peek .gallery-carousel__thumb,
.lightbox__thumb {
  position: relative;
  width: var(--sftl-preview-thumb-size);
  height: var(--sftl-preview-thumb-size);
  flex: 0 0 var(--sftl-preview-thumb-size);
  border-radius: var(--sftl-preview-thumb-radius);
  border: 1px solid rgba(238, 229, 211, 0.34);
  padding: 3px;
  opacity: 0.96;
  background: rgba(5, 6, 12, 0.48);
  cursor: pointer;
  overflow: var(--sftl-preview-thumb-overflow, visible);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.56),
    0 0 14px rgba(200, 191, 176, 0.09);
  transition: var(--sftl-preview-thumb-transition, all);
}

:is(.gallery-carousel__thumb, .lightbox__thumb) img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--sftl-preview-thumb-img-position, 50% 50%);
  border-radius: var(--sftl-preview-thumb-img-radius);
  display: block;
  filter: brightness(1.18) contrast(1.08) saturate(1.04);
  opacity: 1;
}

.gallery-carousel__thumb:is(:hover, :focus-visible) {
  opacity: 1;
  border-color: rgba(238, 229, 211, 0.62);
  transform: translateY(-2px) scale(1.03);
  outline: none;
}

.gallery-carousel__peek .gallery-carousel__thumb.is-active,
.lightbox__thumb.is-active {
  transform: translateY(-2px) scale(1.035);
  opacity: 1;
  border-color: rgba(245, 236, 214, 0.92);
  box-shadow:
    0 0 0 1px rgba(245, 236, 214, 0.28),
    0 0 16px rgba(245, 236, 214, 0.38),
    0 0 34px rgba(200, 191, 176, 0.30),
    0 12px 30px rgba(0, 0, 0, 0.60);
}

.gallery-carousel__peek .gallery-carousel__thumb.is-active.is-previewed {
  border-color: rgba(232, 222, 199, 0.88);
  box-shadow:
    0 0 0 1px rgba(232, 222, 199, 0.22),
    0 0 12px rgba(232, 222, 199, 0.32),
    0 0 28px rgba(200, 191, 176, 0.24),
    0 10px 26px rgba(0, 0, 0, 0.48);
}

.gallery-carousel__peek .gallery-carousel__thumb.is-previewed:not(.is-active),
.lightbox__thumb.is-previewed:not(.is-active) {
  transform: none;
  opacity: 1;
  border-color: rgba(245, 244, 238, 0.62);
  box-shadow:
    inset 0 0 0 1px rgba(245, 244, 238, 0.44),
    0 0 10px rgba(245, 244, 238, 0.12),
    0 12px 28px rgba(0, 0, 0, 0.56);
}

.gallery-carousel__peek .gallery-carousel__strip-hotspot,
.lightbox__strip-hotspot {
  flex: 0 0 var(--sftl-preview-hotspot-width);
  width: var(--sftl-preview-hotspot-width);
  height: var(--sftl-preview-hotspot-height);
  min-width: var(--sftl-preview-hotspot-width);
  min-height: var(--sftl-preview-hotspot-height);
  border: 0;
  padding: 0;
  margin: 0;
  border-radius: var(--sftl-preview-hotspot-radius);
  background: transparent;
  pointer-events: auto;
  transition: opacity 0.18s ease, color 0.18s ease, background 0.18s ease, transform 0.18s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  opacity: 0.18;
  color: rgba(245, 236, 214, 0.82);
  z-index: var(--sftl-preview-hotspot-z);
}

.gallery-carousel__peek .gallery-carousel__strip:is(:hover, :focus-within) .gallery-carousel__strip-hotspot,
.lightbox__strip:is(:hover, :focus-within) .lightbox__strip-hotspot {
  opacity: 0.58;
}

.gallery-carousel__peek .gallery-carousel__strip:is(:hover, :focus-within) .gallery-carousel__strip-hotspot:is(:disabled, [aria-disabled="true"]),
.gallery-carousel__peek .gallery-carousel__strip-hotspot:is(:disabled, [aria-disabled="true"]):hover {
  opacity: 0.14;
  color: rgba(200, 191, 176, 0.38);
  background: transparent;
}

.gallery-carousel__peek .gallery-carousel__strip-hotspot:is(:hover, :focus-visible),
.gallery-carousel__peek .gallery-carousel__strip-hotspot:not(:disabled):active,
.lightbox__strip-hotspot:is(:hover, :focus-visible),
.lightbox__strip-hotspot:not(:disabled):active {
  opacity: 1;
  color: rgba(255, 249, 236, 0.98);
  background: rgba(5, 6, 12, 0.42);
}

.gallery-carousel__peek .gallery-carousel__strip-hotspot:is(:hover, :focus-visible),
.lightbox__strip-hotspot:is(:hover, :focus-visible) {
  transform: var(--sftl-preview-hotspot-hover-transform);
}

.gallery-carousel__peek .gallery-carousel__strip-hotspot:not(:disabled):active,
.lightbox__strip-hotspot:not(:disabled):active {
  transform: var(--sftl-preview-hotspot-active-transform);
}

.gallery-carousel__peek .gallery-carousel__strip-hotspot:disabled,
.gallery-carousel__peek .gallery-carousel__strip-hotspot[aria-disabled="true"],
.lightbox__strip-hotspot:disabled,
.lightbox__strip-hotspot[aria-disabled="true"] {
  cursor: default;
  background: transparent;
  transform: none;
  opacity: 0.18;
  color: rgba(200, 191, 176, 0.46);
}

.gallery-carousel__peek .gallery-carousel__strip-hotspot:disabled,
.gallery-carousel__peek .gallery-carousel__strip-hotspot[aria-disabled="true"] {
  filter: grayscale(0.25);
}

.lightbox__strip-hotspot:is(:hover, :focus-visible),
.lightbox__strip-hotspot:not(:disabled):active {
  outline: none;
}

@media (max-width: 760px) {
  .gallery-carousel__peek {
    --sftl-preview-peek-bottom: clamp(2px, 1.8vh, 14px);
    --sftl-preview-thumb-img-radius: 9px;
  }

  .lightbox__peek {
    --sftl-preview-dot-size: 9px;
    --sftl-preview-dot-min-size: 9px;
  }

  .lightbox__peek:is(.is-peeking, :hover, :focus-within) .lightbox__strip {
    max-height: 72px;
  }

  .lightbox__thumbs {
    max-width: min(300px, calc(100vw - 92px));
    gap: 7px;
  }
}
