/* Unit gallery slideshow */

:root {
  --gallery-bg: #1a2220;
  --gallery-surface: #f7f4ef;
  --gallery-gold: #c4a87a;
  --gallery-serif: 'Cormorant Garamond', Georgia, serif;
  --gallery-sans: 'Lato', sans-serif;
}

.gallery-hero {
  background: linear-gradient(135deg, #4f6068 0%, #3d5148 100%);
  padding: .75rem;
  text-align: center;
}

.gallery-hero h1 {
  font-family: var(--gallery-serif);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 400;
  color: #fff;
  margin-bottom: 0;
  letter-spacing: 0em;
}

.gallery-hero p {
  font-family: var(--gallery-sans);
  font-size: clamp(0.9rem, 2vw, 1rem);
  color: rgba(255, 255, 255, 0.78);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

.gallery-section {
  background: var(--gallery-surface);
  padding: clamp(.75rem, 4vw, .5rem) clamp(1rem, 3vw, 2rem) clamp(3rem, 5vw, 4.5rem);
}

.gallery-slideshow {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* Main preview */
.gallery-stage {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--gallery-bg);
  box-shadow: 0 24px 60px rgba(26, 34, 32, 0.22);
}

.gallery-preview {
  position: relative;
  aspect-ratio: 16 / 10;
  min-height: 240px;
  overflow: hidden;
}

.gallery-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.55s ease, transform 0.7s ease;
}

.gallery-preview img.is-active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}

.gallery-preview-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.45) 0%, transparent 40%);
  pointer-events: none;
}

.gallery-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.gallery-caption-text {
  font-family: var(--gallery-serif);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: #fff;
  font-weight: 400;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.gallery-counter {
  font-family: var(--gallery-sans);
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Navigation arrows */
.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 48px;
  height: 48px;
  min-width: 44px;
  min-height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--gallery-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: background 0.2s, transform 0.2s;
}

.gallery-nav-btn:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.06);
}

.gallery-nav-btn:active {
  transform: translateY(-50%) scale(0.96);
}

.gallery-nav-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.gallery-nav-btn.prev {
  left: 1rem;
}

.gallery-nav-btn.next {
  right: 1rem;
}

/* Thumbnail strip */
.gallery-thumbs-wrap {
  margin-top: 0;
  position: relative;
}

.gallery-thumbs-label {
  font-family: var(--gallery-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #888;
  margin-top: 32px;
  margin-bottom: 12px;
  display: none;
}

.gallery-thumbs {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.25rem 0 0.75rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--gallery-gold) transparent;
}

.gallery-thumbs::-webkit-scrollbar {
  height: 5px;
}

.gallery-thumbs::-webkit-scrollbar-thumb {
  background: var(--gallery-gold);
  border-radius: 4px;
}

.gallery-thumb {
  flex: 0 0 auto;
  width: clamp(72px, 12vw, 110px);
  aspect-ratio: 4 / 3;
  border: 3px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: #ddd;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  opacity: 0.72;
}

.gallery-thumb:hover {
  opacity: 1;
  transform: translateY(-3px);
}

.gallery-thumb.is-active {
  border-color: var(--gallery-gold);
  opacity: 1;
  box-shadow: 0 6px 20px rgba(196, 168, 122, 0.35);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-cta {
  text-align: center;
  margin-top: 2.5rem;
}

.gallery-cta a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  background: var(--gallery-gold);
  color: #fff;
  font-family: var(--gallery-sans);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 50px;
  transition: background 0.2s, transform 0.2s;
  min-height: 44px;
}

.gallery-cta a:hover {
  background: #b8954f;
  transform: translateY(-2px);
}

@media (max-width: 960px) {
  .gallery-hero {
    margin-top: 80px;
  }
}

@media (max-width: 600px) {
  .gallery-hero {
    margin-top: 64px;
  }

  .gallery-nav-btn {
    width: 40px;
    height: 40px;
  }

  .gallery-nav-btn.prev {
    left: 0.5rem;
  }

  .gallery-nav-btn.next {
    right: 0.5rem;
  }

  .gallery-caption {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .gallery-thumb {
    width: 68px;
  }
}
