/* ===== GALLERY SLIDESHOW COMPONENT ===== */
/* Reusable gallery with prev/next navigation */

.gallery {
  margin-bottom: 2rem;
}

.gallery-images {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--border-radius);
  border: var(--border-size) solid var(--border);
}

.gallery-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

/* Override .text figure { margin: 3rem 0 } from index.css when gallery is inside block content */
.text .gallery-slide {
  margin: 0;
}

.gallery-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.gallery-slide a[data-lightbox] {
  display: block;
  width: 100%;
  height: 100%;
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== GALLERY NAVIGATION ===== */
.gallery-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border: var(--border-size) solid var(--border);
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  border-top: none;
  line-height: 1;
  overflow: hidden;
}

.gallery-btn {
  font-family: var(--font-heading);
  font-size: var(--h4-size);
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  text-transform: uppercase;
  padding: 0.5rem 1rem;
}

.gallery-btn:hover {
  background: var(--sidebar-accent);
  color: var(--accent-text);
}

.gallery-dots {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gallery-dot {
  --dot-size: 0.625rem;
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: 50%;
  border: var(--border-size) solid var(--text);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.gallery-dot.is-active {
  background: var(--text);
}

.gallery-dot:hover:not(.is-active) {
  background: color-mix(in srgb, var(--text) 30%, transparent);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .gallery-images {
    aspect-ratio: 16 / 10;
  }
}
