/* Scoped CSS for the home gallery section only */
.home-gallery-section {
  padding: 56px 20px;
  background: #f8fafc;
}

.home-gallery-section .section-title {
  text-align: center;
  margin-bottom: 20px;
}

.home-gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.home-gallery-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-gallery-grid img:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

/* Reveal on scroll only when JS applies .hg-reveal */
.home-gallery-grid img.hg-reveal {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 300ms ease, transform 300ms ease;
}
.home-gallery-grid img.hg-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 1200px) {
  .home-gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 900px) {
  .home-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 600px) {
  .home-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .home-gallery-grid img {
    height: 150px;
  }
}

/* Lightbox (scoped) */
.home-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.home-lightbox.open {
  display: flex;
}

.home-lightbox__content {
  position: relative;
  max-width: 92vw;
  max-height: 88vh;
}
.home-lightbox__img {
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

.home-lightbox__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.home-lightbox__btn:hover {
  background: rgba(255, 255, 255, 0.25);
}
.home-lightbox__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.home-lightbox__btn--prev {
  left: -56px;
}
.home-lightbox__btn--next {
  right: -56px;
}

.home-lightbox__close {
  position: absolute;
  top: -48px;
  right: 0;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.home-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.25);
}
.home-lightbox__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* No-scroll when lightbox open */
body.hg-no-scroll {
  overflow: hidden;
}

@media (max-width: 900px) {
  .home-lightbox__btn--prev {
    left: -36px;
  }
  .home-lightbox__btn--next {
    right: -36px;
  }
}
