/* ============================================================
   CROPGENE — GALLERY STYLES
   ============================================================ */

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.gallery-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  aspect-ratio: 4/3;
  background-color: var(--color-gray-100);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-default);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--duration-normal) var(--ease-default);
}

.gallery-item:hover .gallery-item__overlay {
  background-color: rgba(0,0,0,0.25);
}

.gallery-item__zoom {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background-color: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: all var(--duration-normal) var(--ease-default);
}

.gallery-item:hover .gallery-item__zoom {
  opacity: 1;
  transform: scale(1);
}

.gallery-item__zoom svg {
  width: 20px;
  height: 20px;
  color: var(--color-dark);
}

.gallery-item__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  color: var(--color-white);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-default);
}

.gallery-item:hover .gallery-item__caption {
  opacity: 1;
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background-color: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--ease-default);
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox__image {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.lightbox__close {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background-color: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  transition: background-color var(--duration-fast) var(--ease-default);
}

.lightbox__close:hover {
  background-color: rgba(255,255,255,0.2);
}

.lightbox__close svg {
  width: 24px;
  height: 24px;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background-color: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  transition: background-color var(--duration-fast) var(--ease-default);
}

.lightbox__nav:hover {
  background-color: rgba(255,255,255,0.2);
}

.lightbox__nav svg {
  width: 24px;
  height: 24px;
}

.lightbox__nav--prev {
  left: var(--space-6);
}

.lightbox__nav--next {
  right: var(--space-6);
}

.lightbox__caption {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.8);
  font-size: var(--text-sm);
  text-align: center;
  max-width: 80%;
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  .lightbox__nav {
    width: 40px;
    height: 40px;
  }

  .lightbox__nav--prev { left: var(--space-3); }
  .lightbox__nav--next { right: var(--space-3); }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}
