/* ==========================================================================
   HOMAGE INFRATECH - GALLERY PAGE STYLES
   ========================================================================== */

/* --- Filter Tabs --- */
.gallery-filters {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  background-color: var(--bg-light);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 10px 24px;
  border-radius: var(--border-radius-xl);
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active {
  background-color: var(--primary-color);
  color: var(--text-white);
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* --- Masonry/Grid Layout --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.gallery-item {
  position: relative;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  aspect-ratio: 4/3;
  border: 1px solid var(--border-color);
  cursor: pointer;
  background-color: var(--bg-light);
  transition: var(--transition-smooth);
}

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

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

.gallery-item-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(10, 17, 14, 0.9) 0%, rgba(10, 17, 14, 0.3) 70%, rgba(10, 17, 14, 0) 100%);
  opacity: 0;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  z-index: 2;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-emerald-light);
}

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

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

.gallery-icon-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgba(201, 160, 84, 0.9);
  color: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition-smooth);
  z-index: 3;
}

.gallery-item:hover .gallery-icon-wrap {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.gallery-icon-wrap svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.gallery-item-info h4 {
  color: var(--text-white);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.gallery-item-info p {
  color: var(--accent-light);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Lightbox Viewer --- */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(10, 17, 14, 0.98);
  backdrop-filter: blur(15px);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-close {
  position: absolute;
  top: 30px;
  right: 30px;
  background: transparent;
  color: var(--text-white);
  cursor: pointer;
  transition: var(--transition-fast);
  z-index: 3010;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}

.lightbox-close:hover {
  color: var(--accent-color);
  transform: scale(1.1);
}

.lightbox-close svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.lightbox-content-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 90%;
  max-width: 1000px;
  height: 70vh;
}

.lightbox-image-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--border-radius-sm);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
  transform: scale(0.95);
  opacity: 0;
  transition: transform var(--transition-smooth), opacity var(--transition-smooth);
}

.lightbox.active .lightbox-img {
  transform: scale(1);
  opacity: 1;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-white);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  z-index: 3005;
}

.lightbox-nav:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-light);
  color: var(--text-white);
}

.lightbox-nav-prev {
  left: 30px;
}

.lightbox-nav-next {
  right: 30px;
}

.lightbox-nav svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.lightbox-caption {
  margin-top: 30px;
  text-align: center;
  max-width: 600px;
  color: var(--text-white);
}

.lightbox-caption h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--accent-color);
}

.lightbox-caption p {
  color: var(--text-white-muted);
  font-size: 0.9rem;
}

/* --- Responsive Media Queries --- */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .lightbox-nav {
    width: 44px;
    height: 44px;
  }
  .lightbox-nav-prev { left: 10px; }
  .lightbox-nav-next { right: 10px; }
}

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