/* Image Gallery Overlay */
.gallery-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 10000;
  flex-direction: column;
}

.gallery-overlay.gallery-open {
  display: flex;
}

/* Main image area */
.gallery-main {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.gallery-main-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Caption */
.gallery-caption {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10002;
  color: #fff;
  font-family: "Raleway", Arial, sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-align: center;
  padding: 0.4rem 1.25rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* Controls wrapper - fades in/out */
.gallery-controls {
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.gallery-controls.gallery-controls-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Close button */
.gallery-close {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 10002;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
}

.gallery-close svg {
  width: 28px;
  height: 28px;
  stroke: #fff;
  stroke-width: 2;
  transition: opacity 0.2s;
}

.gallery-close:hover svg {
  opacity: 0.7;
}

/* Navigation arrows */
.gallery-prev,
.gallery-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10002;
  background: none;
  border: none;
  cursor: pointer;
  padding: 1rem;
  line-height: 1;
}

.gallery-prev {
  left: 1rem;
}

.gallery-next {
  right: 1rem;
}

.gallery-prev svg,
.gallery-next svg {
  width: 36px;
  height: 36px;
  stroke: #fff;
  stroke-width: 2;
  transition: opacity 0.2s;
}

.gallery-prev:hover svg,
.gallery-next:hover svg {
  opacity: 0.7;
}

.gallery-nav-disabled {
  opacity: 0.25;
  cursor: default;
}

.gallery-nav-disabled:hover svg {
  opacity: 1;
}

/* Thumbnail strip */
.gallery-thumbnails {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
}

.gallery-thumbnail {
  width: 60px;
  height: 42px;
  object-fit: cover;
  object-position: center;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 3px;
  opacity: 0.5;
  transition: opacity 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.gallery-thumbnail:hover {
  opacity: 0.8;
}

.gallery-thumbnail-active {
  opacity: 1;
  border-color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
  .gallery-prev,
  .gallery-next {
    padding: 0.5rem;
  }

  .gallery-prev svg,
  .gallery-next svg {
    width: 28px;
    height: 28px;
  }

  .gallery-thumbnail {
    width: 48px;
    height: 34px;
  }

  .gallery-caption {
    font-size: 0.8rem;
    bottom: 5rem;
  }
}
