/* ========================================================= */
/* Gallery Page Styles */
/* ========================================================= */

:root {
  --primary-blue: #176bb2;
  --primary-blue-dark: #0b4a78;
  --light-gray: #f4f7fb;
  --border-color: #e0e6ed;
  --text-color: #333;
  --white: #fff;
}

/* ========================================================= */
/* Gallery Grid - Uniform Blocks */
/* ========================================================= */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 40px 0;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  aspect-ratio: 4/3;
  background: #f0f0f0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* ========================================================= */
/* Lightbox Overlay */
/* ========================================================= */

.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.lightbox.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-content {
  max-width: 90%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  border: none;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  padding: 10px 18px;
  border-radius: 4px;
  transition: background 0.3s ease, transform 0.2s ease;
  z-index: 10000;
}

.lightbox-close {
  top: 20px;
  right: 30px;
  font-size: 40px;
  line-height: 30px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 30px;
}

.lightbox-prev {
  left: 30px;
}

.lightbox-next {
  right: 30px;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.1);
}

.lightbox-close:hover {
  transform: scale(1.1);
}

.lightbox-caption {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 16px;
  text-align: center;
  max-width: 80%;
}

.lightbox-counter {
  position: absolute;
  top: 20px;
  left: 30px;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
}

/* ========================================================= */
/* CTA Section - Photo Boxes */
/* ========================================================= */

.gallery-cta {
  padding: 80px 0;
  background: var(--light-gray);
  text-align: center;
}

.gallery-cta h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-blue);
  margin: 0 0 15px;
}

.gallery-cta .cta-intro {
  font-size: 1.15rem;
  color: #666;
  margin: 0 0 50px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.gallery-cta .cta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-cta .cta-box {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.gallery-cta .cta-box:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 28px rgba(23, 107, 178, 0.2);
}

.gallery-cta .cta-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
}

.gallery-cta .cta-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-cta .cta-box:hover .cta-image img {
  transform: scale(1.1);
}

.gallery-cta .cta-content {
  padding: 25px 20px;
  text-align: center;
}

.gallery-cta .cta-content h3 {
  margin: 0 0 10px;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-color);
}

.gallery-cta .cta-content p {
  margin: 0 0 20px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #666;
  min-height: 45px;
}

.gallery-cta .cta-content .button-primary {
  display: inline-block;
  background: var(--primary-blue);
  color: var(--white);
  padding: 12px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(23, 107, 178, 0.3);
}

.gallery-cta .cta-content .button-primary:hover {
  background: var(--primary-blue-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(23, 107, 178, 0.4);
}

/* ========================================================= */
/* Tablet Responsive (768px - 1024px) */
/* ========================================================= */

@media (max-width: 1024px) {
  .gallery-grid {
    gap: 20px;
  }

  .gallery-cta .cta-grid {
    gap: 25px;
  }
}

@media (max-width: 768px) {
  /* Gallery grid - smaller blocks */
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
  }

  /* Lightbox controls */
  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .lightbox-close {
    right: 10px;
    top: 10px;
  }

  .lightbox-counter {
    left: 10px;
    top: 10px;
  }

  /* CTA Section */
  .gallery-cta {
    padding: 60px 0;
  }

  .gallery-cta h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
  }

  .gallery-cta .cta-intro {
    font-size: 1.05rem;
    margin-bottom: 35px;
  }

  /* Two columns for CTA boxes on tablet */
  .gallery-cta .cta-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  /* Third CTA box spans full width */
  .gallery-cta .cta-box:last-child {
    grid-column: 1 / -1;
  }
}

/* ========================================================= */
/* Mobile Responsive (< 640px) */
/* ========================================================= */

@media (max-width: 640px) {
  .gallery-cta {
    padding: 40px 0;
  }

  .gallery-cta h2 {
    font-size: 1.6rem;
  }

  /* Single column for CTA on mobile */
  .gallery-cta .cta-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .gallery-cta .cta-box:last-child {
    grid-column: 1;
  }

  .gallery-cta .cta-image {
    height: 180px;
  }

  .gallery-cta .cta-content {
    padding: 20px 15px;
  }

  .gallery-cta .cta-content h3 {
    font-size: 1.25rem;
  }

  .gallery-cta .cta-content p {
    min-height: auto;
    margin-bottom: 15px;
  }
}

@media (max-width: 480px) {
  .gallery-cta h2 {
    font-size: 1.4rem;
  }

  .gallery-cta .cta-intro {
    font-size: 1rem;
  }
}
