/* ==========================================================================
   Our Gallery Styles
   ========================================================================== */

/* Hero Section */
.service-hero {
  position: relative;
  padding: 10rem 2rem 6rem 2rem;
  background-color: var(--primary-bg);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(152, 106, 62, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(152, 106, 62, 0.03) 0%, transparent 50%);
  text-align: center;
  overflow: hidden;
}

.service-hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(152, 106, 62, 0.15) 50%,
    transparent 100%
  );
}

.service-hero-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.service-hero-subtitle {
  color: var(--text-color);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.6;
  opacity: 0.9;
  margin-top: 1rem;
}

/* Gallery Section */
.gallery-section {
  padding: 3rem 3rem;
  background-color: var(--primary-bg);
  width: 100%;
  box-sizing: border-box;
}

.gallery-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  width: 100%;
}

/* Adjust grid for different breakpoints */
@media (min-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

@media (min-width: 1280px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }
}

@media (max-width: 1024px) {
  .gallery-section {
    padding: 2.5rem 1.5rem 4rem 1.5rem;
  }
}

@media (max-width: 768px) {
  .gallery-section {
    padding: 2rem 1rem 3rem 1rem;
    gap: 1.25rem;
  }
}

.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
              box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  cursor: pointer;
  background-color: #fff; /* fallback */
  margin-bottom: 0;
  break-inside: avoid;
}

.gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(152, 106, 62, 0.15);
}

.gallery-img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s ease;
}

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

/* Subtle overlay on hover */
.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(140, 98, 57, 0.2) 0%,
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

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

.gallery-item {
  cursor: zoom-in;
}

/* ==========================================================================
   Lightbox Modal Styles
   ========================================================================== */

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(12, 10, 8, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Close Button (top-right) */
.lightbox-close-btn {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 28px;
  cursor: pointer;
  z-index: 100001;
  transition: transform 0.25s ease, opacity 0.2s ease, color 0.2s ease;
  padding: 0;
}

.lightbox-close-btn:hover {
  transform: scale(1.15) rotate(90deg);
  color: #e2ba7a;
}

/* Navigation Arrows (left & right) */
.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 68px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  z-index: 100001;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.25s ease, transform 0.2s ease, border-color 0.25s ease;
  user-select: none;
}

.lightbox-arrow:hover {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.05);
}

.lightbox-arrow:active {
  transform: translateY(-50%) scale(0.96);
}

.lightbox-arrow-prev {
  left: 24px;
}

.lightbox-arrow-next {
  right: 24px;
}

/* Image Container */
.lightbox-image-wrapper {
  position: relative;
  z-index: 100000;
  max-width: 86vw;
  max-height: 86vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.lightbox-img {
  max-width: 100%;
  max-height: 84vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  user-select: none;
  transform: scale(0.96);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

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

.lightbox-img.changing {
  opacity: 0.3;
  transform: scale(0.98);
}

/* Responsive adjustment for mobile */
@media (max-width: 768px) {
  .lightbox-close-btn {
    top: 16px;
    right: 16px;
    font-size: 26px;
  }

  .lightbox-arrow {
    width: 40px;
    height: 54px;
    font-size: 22px;
  }

  .lightbox-arrow-prev {
    left: 10px;
  }

  .lightbox-arrow-next {
    right: 10px;
  }

  .lightbox-image-wrapper {
    max-width: 94vw;
    max-height: 82vh;
  }

  .lightbox-img {
    max-height: 80vh;
  }
}

