/* --- GALLERY PAGE SPECIFIC STYLES --- */

/* --- HERO --- */
.gallery-page-hero {
  position: relative;
  background-image: url("../images/hero5.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  height: calc(100vh - 93px);
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  margin-top: 93px;
}

.gallery-page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    var(--rgba-darker-teal-75),
    var(--rgba-primary-25)
  );
}

.gallery-hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 20px;
}

.gallery-hero-content h1 {
  font-size: 4rem;
  margin-bottom: 20px;
  color: var(--white);
  text-shadow: 0 4px 10px var(--rgba-black-5);
}

.gallery-hero-content p {
  font-size: 1.2rem;
  color: var(--rgba-white-9);
  line-height: 1.8;
}

/* --- GALLERY SECTION --- */
.gallery-section {
  background: var(--bg-main);
}

/* --- FILTER BAR --- */
.gallery-filter-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 10px 28px;
  border-radius: 50px;
  border: 2px solid var(--rgba-primary-3);
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.5px;
}

.filter-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-dark);
  background: var(--primary-light);
}

.filter-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white);
  box-shadow: 0 4px 15px var(--rgba-primary-35);
}

/* --- GALLERY GRID --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 1300px;
  margin: 0 auto;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    opacity 0.4s ease,
    transform 0.3s ease,
    box-shadow 0.3s ease;
  display: none; /* hidden by default; JS controls visibility */
  opacity: 0;
}

.gallery-item.gallery-visible {
  opacity: 1;
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    var(--rgba-darker-teal-85) 0%,
    var(--rgba-darker-teal-1) 60%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  gap: 8px;
}

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

.gallery-overlay i {
  color: var(--primary-color);
  font-size: 1.8rem;
}

.gallery-overlay span {
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* --- LOAD MORE --- */
.load-more-wrapper {
  display: none; /* shown by JS */
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 50px;
}

.load-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 40px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 6px 20px var(--rgba-primary-35);
  letter-spacing: 0.5px;
}

.load-more-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px var(--rgba-primary-45);
}

.load-more-btn i {
  font-size: 1.1rem;
}

.load-more-count {
  font-size: 0.88rem;
  color: var(--text-light);
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* --- LIGHTBOX --- */
.lightbox {
  position: fixed;
  inset: 0;
  background: var(--rgba-black-95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

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

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px var(--rgba-black-5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: var(--rgba-white-1);
  border: 1px solid var(--rgba-white-2);
  color: var(--white);
  font-size: 1.4rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.lightbox-close:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--rgba-white-1);
  border: 1px solid var(--rgba-white-2);
  color: var(--white);
  font-size: 1.2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

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

.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

/* --- CTA BANNER (reused from services) --- */
.cta-banner {
  background: linear-gradient(
    135deg,
    var(--primary-dark),
    var(--primary-color)
  );
  padding: 80px 20px;
  text-align: center;
  color: var(--white);
}

.cta-banner h2 {
  font-size: 2.5rem;
  color: var(--white);
  margin-bottom: 20px;
}

.cta-banner p {
  font-size: 1.1rem;
  margin-bottom: 30px;
  color: var(--rgba-white-9);
}

.cta-banner .btn {
  background: var(--text-main);
  color: var(--white);
  border: none;
}

.cta-banner .btn:hover {
  background: var(--white);
  color: var(--text-main);
}

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

@media (max-width: 768px) {
  .gallery-page-hero {
    min-height: 380px;
    height: 55vh;
  }

  .gallery-hero-content h1 {
    font-size: 2.5rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

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

@media (max-width: 480px) {
  .gallery-hero-content h1 {
    font-size: 2rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .filter-btn {
    padding: 8px 18px;
    font-size: 0.85rem;
  }
}
