.dai-gallery-slideshow {
  /* ── Surfaces & Colors ── */
  --dai-gallery-accent: var(--color-primary, #fe6503);
  --dai-gallery-accent-hover: var(--color-primary, #e55a00);
  --dai-gallery-surface: var(--color-warm-ivory, #f2eee9);
  --dai-gallery-surface-strong: var(--color-white, #ffffff);
  --dai-gallery-border: var(--color-border, #e2ddd8);
  --dai-gallery-text: var(--color-dark-brown, #241915);
  --dai-gallery-text-muted: #6b5e54;

  /* ── Main Media ── */
  --dai-gallery-media-aspect-ratio: 16 / 10;
  --dai-gallery-media-height: auto;
  --dai-gallery-media-radius: 0px;
  --dai-gallery-media-bleed: 2rem;
  --dai-gallery-slide-gap: 4rem;

  /* ── Thumbnails ── */
  --dai-gallery-thumb-aspect-ratio: 1.2 / 1;
  --dai-gallery-thumb-radius: 0px;
  --dai-gallery-thumb-width: clamp(5rem, 9vw, 7rem);
  --dai-gallery-thumb-gap: 0.5rem;
  --dai-gallery-thumb-opacity: 0.45;
  --dai-gallery-thumb-active-opacity: 1;

  /* ── Shared Transitions ── */
  --dai-gallery-transition: 250ms cubic-bezier(0.215, 0.61, 0.355, 1);

  color: var(--dai-gallery-text);
}

.dai-gallery-slideshow button.dai-gallery-slideshow__thumb {
  padding: 0;
  font: inherit;
  line-height: 1;
}

/* ── Stage ── */
.dai-gallery-slideshow__stage {
  position: relative;
}

.dai-gallery-slideshow__viewport {
  overflow: hidden;
}

.dai-gallery-slideshow__viewport {
  padding: var(--dai-gallery-media-bleed);
  margin: calc(var(--dai-gallery-media-bleed) * -1);
}

.dai-gallery-slideshow__container {
  display: flex;
}

.dai-gallery-slideshow__container {
  position: relative;
  touch-action: pan-y pinch-zoom;
}

.dai-gallery-slideshow__slide {
  flex: 0 0 100%;
  min-width: 0;
}

/* ── Main Media ── */
.dai-gallery-slideshow .dai-gallery-slideshow__media {
  display: block;
  width: 100%;
  position: relative;
  margin: 0;
  padding: 0;
  border: none;
  aspect-ratio: var(--dai-gallery-media-aspect-ratio);
  height: var(--dai-gallery-media-height);
  overflow: hidden;
  border-radius: var(--dai-gallery-media-radius);
  background: var(--dai-gallery-surface);
  cursor: pointer;
  appearance: none;
}

.dai-gallery-slideshow .dai-gallery-slideshow__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.dai-gallery-slideshow .dai-gallery-slideshow__media:focus-visible,
.dai-gallery-slideshow
  button.dai-gallery-slideshow__lightbox-close:focus-visible,
.dai-gallery-slideshow
  button.dai-gallery-slideshow__lightbox-nav:focus-visible {
  outline: 2px solid var(--dai-gallery-accent);
  outline-offset: 3px;
}

body.dai-gallery-lightbox-open {
  overflow: hidden;
}

.dai-gallery-slideshow__lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 2.4vw, 2rem);
  background:
    radial-gradient(circle at top, rgba(254, 101, 3, 0.12), transparent 34%),
    rgba(22, 15, 11, 0.92);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.dai-gallery-slideshow__lightbox[hidden] {
  display: none;
}

.dai-gallery-slideshow.is-lightbox-open .dai-gallery-slideshow__lightbox {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
}

.dai-gallery-slideshow.is-lightbox-closing .dai-gallery-slideshow__lightbox {
  visibility: visible;
  pointer-events: none;
  opacity: 0;
}

.dai-gallery-slideshow__lightbox-shell {
  position: relative;
  width: min(100%, 94rem);
  height: min(100%, 100dvh - 2rem);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(1.25rem) scale(0.985);
  opacity: 0;
}

.dai-gallery-slideshow.is-lightbox-open .dai-gallery-slideshow__lightbox-shell {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.dai-gallery-slideshow.is-lightbox-closing
  .dai-gallery-slideshow__lightbox-shell {
  opacity: 0;
  transform: translateY(1.25rem) scale(0.985);
}

.dai-gallery-slideshow__lightbox-viewport {
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.dai-gallery-slideshow__lightbox-container {
  display: flex;
  height: 100%;
  touch-action: pan-y pinch-zoom;
}

.dai-gallery-slideshow__lightbox-slide {
  flex: 0 0 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dai-gallery-slideshow__lightbox-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: clamp(2.5rem, 4vw, 4rem);
}

.dai-gallery-slideshow__lightbox-media img {
  display: block;
  max-width: 100%;
  max-height: min(100%, 88dvh);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.24);
}

.dai-gallery-slideshow button.dai-gallery-slideshow__lightbox-close,
.dai-gallery-slideshow button.dai-gallery-slideshow__lightbox-nav {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.25rem;
  min-height: 3.25rem;
  padding: 0;
  border: 1px solid
    color-mix(in srgb, var(--dai-gallery-surface-strong) 28%, transparent);
  background: color-mix(in srgb, #000000 34%, transparent);
  color: var(--dai-gallery-surface-strong);
  cursor: pointer;
  backdrop-filter: blur(14px);
  transition:
    background var(--dai-gallery-transition),
    border-color var(--dai-gallery-transition),
    transform var(--dai-gallery-transition),
    opacity var(--dai-gallery-transition);
}

.dai-gallery-slideshow button.dai-gallery-slideshow__lightbox-close {
  top: 0;
  right: 0;
  border-radius: 999px;
}

.dai-gallery-slideshow button.dai-gallery-slideshow__lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px;
}

.dai-gallery-slideshow__lightbox-nav--prev {
  left: 0;
}

.dai-gallery-slideshow__lightbox-nav--next {
  right: 0;
}

.dai-gallery-slideshow button.dai-gallery-slideshow__lightbox-close:hover,
.dai-gallery-slideshow
  button.dai-gallery-slideshow__lightbox-close:focus-visible,
.dai-gallery-slideshow button.dai-gallery-slideshow__lightbox-nav:hover,
.dai-gallery-slideshow
  button.dai-gallery-slideshow__lightbox-nav:focus-visible {
  background: color-mix(in srgb, var(--dai-gallery-text) 80%, transparent);
  border-color: var(--dai-gallery-accent);
}

.dai-gallery-slideshow button.dai-gallery-slideshow__lightbox-nav:hover,
.dai-gallery-slideshow
  button.dai-gallery-slideshow__lightbox-nav:focus-visible {
  transform: translateY(-50%) scale(1.02);
}

.dai-gallery-slideshow button.dai-gallery-slideshow__lightbox-nav[disabled] {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.dai-gallery-slideshow__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
}

.dai-gallery-slideshow__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.dai-gallery-slideshow__icon path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

/* ── Thumbnails ── */
.dai-gallery-slideshow__thumbs {
  margin-top: 1.25rem;
}

.dai-gallery-slideshow__thumbs-viewport {
  overflow: hidden;
}

.dai-gallery-slideshow__thumbs-container {
  display: flex;
  gap: var(--dai-gallery-thumb-gap);
  touch-action: pan-y pinch-zoom;
  width: fit-content;
  margin: 0 auto;
  max-width: 100%;
}

.dai-gallery-slideshow__thumb-slide {
  flex: 0 0 auto;
  min-width: 0;
}

.dai-gallery-slideshow button.dai-gallery-slideshow__thumb {
  position: relative;
  display: block;
  width: var(--dai-gallery-thumb-width);
  padding: 0;
  border: none;
  border-radius: var(--dai-gallery-thumb-radius);
  background: transparent;
  overflow: hidden;
  cursor: pointer;
  opacity: var(--dai-gallery-thumb-opacity);
  transition:
    opacity var(--dai-gallery-transition),
    box-shadow var(--dai-gallery-transition);
}

.dai-gallery-slideshow button.dai-gallery-slideshow__thumb::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--dai-gallery-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dai-gallery-transition);
}

.dai-gallery-slideshow button.dai-gallery-slideshow__thumb img {
  display: block;
  width: 100%;
  aspect-ratio: var(--dai-gallery-thumb-aspect-ratio);
  object-fit: cover;
}

.dai-gallery-slideshow button.dai-gallery-slideshow__thumb.is-active,
.dai-gallery-slideshow button.dai-gallery-slideshow__thumb:hover,
.dai-gallery-slideshow button.dai-gallery-slideshow__thumb:focus-visible {
  opacity: var(--dai-gallery-thumb-active-opacity);
}

.dai-gallery-slideshow button.dai-gallery-slideshow__thumb.is-active::after {
  transform: scaleX(1);
}

/* ── Responsive ── */
@media (max-width: 767px) {
  .dai-gallery-slideshow {
    --dai-gallery-thumb-width: clamp(4.5rem, 24vw, 5.75rem);
    --dai-gallery-thumb-gap: 0.375rem;
    --dai-gallery-media-bleed: 1rem;
    --dai-gallery-slide-gap: 0.75rem;
  }

  .dai-gallery-slideshow .dai-gallery-slideshow__media {
    aspect-ratio: 4 / 5;
  }

  .dai-gallery-slideshow__lightbox {
    padding: 0.75rem;
  }

  .dai-gallery-slideshow__lightbox-shell {
    height: min(100%, 100dvh - 1.5rem);
  }

  .dai-gallery-slideshow__lightbox-media {
    padding: 3.75rem 0.25rem 4.5rem;
  }

  .dai-gallery-slideshow__lightbox-media img {
    max-height: min(100%, 80dvh);
  }

  .dai-gallery-slideshow button.dai-gallery-slideshow__lightbox-close {
    top: 0.25rem;
    right: 0.25rem;
  }

  .dai-gallery-slideshow button.dai-gallery-slideshow__lightbox-nav {
    top: auto;
    bottom: 0.25rem;
    transform: none;
  }

  .dai-gallery-slideshow__lightbox-nav--prev {
    left: 0.25rem;
  }

  .dai-gallery-slideshow__lightbox-nav--next {
    right: 0.25rem;
  }

  .dai-gallery-slideshow button.dai-gallery-slideshow__lightbox-nav:hover,
  .dai-gallery-slideshow
    button.dai-gallery-slideshow__lightbox-nav:focus-visible {
    transform: scale(1.02);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dai-gallery-slideshow button.dai-gallery-slideshow__thumb,
  .dai-gallery-slideshow button.dai-gallery-slideshow__thumb::after,
  .dai-gallery-slideshow__lightbox,
  .dai-gallery-slideshow__lightbox-shell,
  .dai-gallery-slideshow button.dai-gallery-slideshow__lightbox-close,
  .dai-gallery-slideshow button.dai-gallery-slideshow__lightbox-nav {
    transition: none;
  }

  .dai-gallery-slideshow.is-lightbox-open .dai-gallery-slideshow__lightbox,
  .dai-gallery-slideshow.is-lightbox-closing .dai-gallery-slideshow__lightbox {
    opacity: 1;
    visibility: visible;
  }

  .dai-gallery-slideshow.is-lightbox-open
    .dai-gallery-slideshow__lightbox-shell,
  .dai-gallery-slideshow.is-lightbox-closing
    .dai-gallery-slideshow__lightbox-shell {
    opacity: 1;
    transform: none;
  }
}
