/* ═══════════════════════════════════════════════════════════════════════════════
   Infinity Gallery — Frontend Styles
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Filter Buttons ────────────────────────────────────────────────────────── */
.infgal-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
  padding: 0 10px;
}

.infgal-filter-btn {
  background: transparent;
  border: 2px solid #476227;
  color: #476227;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.25s ease;
  font-family: inherit;
}

.infgal-filter-btn:hover,
.infgal-filter-btn.active {
  background: #476227;
  color: #fff;
}

/* ── Grid Layout ───────────────────────────────────────────────────────────── */
.infgal-grid {
  display: grid;
  gap: 12px;
}

.infgal-cols-2 { grid-template-columns: repeat(2, 1fr); }
.infgal-cols-3 { grid-template-columns: repeat(3, 1fr); }
.infgal-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Grid Items ────────────────────────────────────────────────────────────── */
.infgal-item {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  aspect-ratio: 4 / 3;
  background: #f0ede8;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.infgal-item.infgal-hidden {
  display: none;
}

.infgal-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.infgal-link {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Hover Overlay ─────────────────────────────────────────────────────────── */
.infgal-hover {
  position: absolute;
  inset: 0;
  background: rgba(45, 74, 20, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.infgal-hover svg {
  width: 36px;
  height: 36px;
  color: #fff;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

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

.infgal-item:hover .infgal-hover {
  opacity: 1;
}

/* ── Empty State ───────────────────────────────────────────────────────────── */
.infgal-empty {
  text-align: center;
  color: #888;
  font-size: 15px;
  padding: 40px 20px;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════════════════════════════════════════════ */

.infgal-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.infgal-lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Image container */
.infgal-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.infgal-lightbox-content img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 0.25s ease;
}

.infgal-lightbox-content img.loading {
  opacity: 0.3;
}

/* Close button */
.infgal-lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 100001;
  line-height: 1;
}

.infgal-lightbox-close:hover {
  background: rgba(255,255,255,0.25);
}

/* Navigation arrows */
.infgal-lightbox-prev,
.infgal-lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 100001;
}

.infgal-lightbox-prev { left: 20px; }
.infgal-lightbox-next { right: 20px; }

.infgal-lightbox-prev:hover,
.infgal-lightbox-next:hover {
  background: rgba(255,255,255,0.25);
}

/* Caption / title */
.infgal-lightbox-caption {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  text-align: center;
  padding: 8px 20px;
  background: rgba(0,0,0,0.5);
  border-radius: 20px;
  max-width: 80vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 100001;
}

/* Counter */
.infgal-lightbox-counter {
  position: fixed;
  top: 24px;
  left: 24px;
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  font-weight: 600;
  z-index: 100001;
}

/* Touch / swipe indicator for mobile */
.infgal-lightbox-overlay {
  touch-action: pan-y;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .infgal-cols-3,
  .infgal-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .infgal-lightbox-prev { left: 8px; width: 40px; height: 40px; font-size: 20px; }
  .infgal-lightbox-next { right: 8px; width: 40px; height: 40px; font-size: 20px; }

  .infgal-filter-btn {
    padding: 6px 14px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .infgal-cols-2,
  .infgal-cols-3,
  .infgal-cols-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .infgal-item {
    border-radius: 2px;
  }
}
