/* SECTION BACKGROUND */
.gallery-section {
  padding: 60px;
  max-width: 1320px;
  margin: 0 auto;
}

.soontext {
  font-family: "GraphikLight", sans-serif !important;
  text-align: justify;
}

/* GRID */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

/* CARD */
.gallery-card {
  width: 100%;
  height: 320px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #e4eae4;
  box-shadow: 0 20px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: 0.4s ease;
}

.gallery-card:focus-visible {
  outline: 3px solid #037f41;
  outline-offset: 4px;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-card span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  padding: 18px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent);
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

/* HOVER EFFECT */
.gallery-card:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 30px 40px rgba(0, 0, 0, 0.3);
}

.gallery-card:hover img {
  transform: scale(1.06);
}

.gallery-card:hover span {
  opacity: 1;
  transform: translateY(0);
}

.gallery-card.is-missing {
  background: linear-gradient(135deg, #6f7f78, #3f5a50);
  cursor: default;
}

.gallery-card.is-missing img {
  display: none;
}

.gallery-card.is-missing span {
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  opacity: 1;
  transform: none;
  text-align: center;
}

.gallery-state {
  min-height: 320px;
  grid-column: 1 / -1;
  border-radius: 8px;
  background: rgba(228, 234, 228, 0.76);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
}

.gallery-state p,
.gallery-message {
  color: #3f5a50;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

.gallery-message {
  margin-top: 24px;
}

.gallery-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(3, 127, 65, 0.18);
  border-top-color: #037f41;
  animation: gallerySpin 0.8s linear infinite;
}

.gallery-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 42px;
}

.gallery-pagination button,
.gallery-pagination-ellipsis {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
}

.gallery-pagination button {
  border: 1px solid rgba(3, 127, 65, 0.28);
  background: #fff;
  color: #00512e;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.gallery-pagination button:hover:not(:disabled),
.gallery-pagination button.active {
  background: #037f41;
  color: #fff;
  transform: translateY(-2px);
}

.gallery-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.gallery-pagination-ellipsis {
  color: #3f5a50;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 72px 32px 44px;
  background: rgba(0, 0, 0, 0.88);
}

.gallery-lightbox.show {
  display: flex;
}

.gallery-lightbox img {
  width: auto;
  max-width: 94vw;
  height: auto;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.gallery-lightbox-close {
  position: fixed;
  top: 22px;
  right: 28px;
  z-index: 1;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #00512e;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-close:focus-visible {
  background: #037f41;
  color: #fff;
  transform: scale(1.05);
  outline: none;
}

.gallery-lightbox-open {
  overflow: hidden;
}

body[dir="rtl"] .gallery-lightbox-close {
  right: auto;
  left: 28px;
}

body[dir="rtl"] .gallery-pagination-arrow i {
  transform: scaleX(-1);
}

@keyframes gallerySpin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 1700px) {
  .gallery-section {
    padding: 140px 60px;
  }
}

/* 📲 TABLET */
@media (max-width: 991px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }

  .gallery-section {
    padding: 40px;
  }
}

/* 📱 MOBILE */
@media (max-width: 576px) {
  .gallery-grid {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .gallery-section {
    padding: 20px;
  }

  .gallery-card {
    height: 320px;
    width: min(100%, 330px);
  }

  .gallery-pagination {
    gap: 8px;
    margin-top: 30px;
  }

  .gallery-pagination button,
  .gallery-pagination-ellipsis {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }

  .gallery-lightbox {
    padding: 68px 14px 42px;
  }

  .gallery-lightbox img {
    max-width: 96vw;
    max-height: 78vh;
  }

  .gallery-lightbox-close {
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    font-size: 31px;
  }

  .service-header-title h1,
  .service-header-title h2 {
    font-size: 24px !important;
  }

  body[dir="rtl"] .gallery-lightbox-close {
    left: 16px;
  }
}
