/* SECTION-02 only. Kept after style.css so legacy gallery rules cannot
   change the approved gallery composition. */
#gallery.gallery-section {
  padding: 48px 0 64px;
  background: #fff;
  overflow: hidden;
  scroll-margin-top: 72px;
}

#gallery .gallery-heading {
  padding: 0 20px;
  margin: 0 auto 42px;
  text-align: center;
  color: #0b1422;
}

#gallery .gallery-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

#gallery .gallery-title-row h2 {
  margin: 0;
  font-family: var(--font-ar, "Cairo", sans-serif);
  font-size: clamp(27px, 2.5vw, 40px);
  font-weight: 900;
  line-height: 1.45;
  letter-spacing: -0.015em;
}

#gallery .gallery-title-line {
  width: 48px;
  height: 3px;
  flex: 0 0 48px;
  background: #ef1723;
}

#gallery .gallery-heading p {
  margin: 8px 0 0;
  color: #66707d;
  font-size: clamp(14px, 1.15vw, 18px);
  line-height: 1.75;
}

#gallery .gallery-window {
  width: 100%;
  overflow: hidden;
  direction: ltr;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 2.5%, #000 97.5%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 2.5%, #000 97.5%, transparent);
}

#gallery .gallery-window.is-dragging { cursor: grabbing; }

#gallery .gallery-motion-track {
  display: flex;
  width: max-content;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

#gallery .gallery-sequence {
  display: flex;
  flex: none;
  gap: 16px;
  padding-inline-end: 16px;
}

#gallery .gallery-card {
  box-sizing: border-box;
  flex: 0 0 clamp(330px, 24vw, 460px);
  width: clamp(330px, 24vw, 460px);
  height: auto;
  aspect-ratio: 1.9 / 1;
  padding: 0;
  border: 0;
  border-radius: 22px;
  overflow: hidden;
  background: #e8edf1;
  box-shadow: 0 9px 25px rgba(16, 31, 48, .12);
  cursor: pointer;
}

#gallery .gallery-card:focus-visible {
  outline: 3px solid #e91420;
  outline-offset: 4px;
}

#gallery .gallery-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

#galleryLightbox.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 10, 15, .88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#galleryLightbox.gallery-lightbox[hidden] { display: none; }

#galleryLightbox .gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
}

#galleryLightbox .gallery-lightbox-dialog {
  position: relative;
  width: min(90vw, 1180px);
  height: min(84vh, 780px);
  display: grid;
  place-items: center;
}

#galleryLightbox .gallery-lightbox-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.85);
  border-radius: 22px;
  background: #15191e;
  box-shadow: 0 22px 70px rgba(0,0,0,.55);
  touch-action: none;
  cursor: grab;
}

#galleryLightbox .gallery-lightbox-stage.is-panning { cursor: grabbing; }

#galleryLightbox .gallery-lightbox-stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
}

#galleryLightbox button {
  border: 0;
  color: #fff;
  background: rgba(10,12,17,.83);
  cursor: pointer;
}

#galleryLightbox button:focus-visible {
  outline: 3px solid #f01623;
  outline-offset: 3px;
}

#galleryLightbox .gallery-lightbox-close {
  position: absolute;
  z-index: 3;
  top: 12px;
  left: 12px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 31px;
  line-height: 1;
}

#galleryLightbox .gallery-lightbox-prev,
#galleryLightbox .gallery-lightbox-next {
  position: absolute;
  z-index: 3;
  top: 50%;
  width: 42px;
  height: 54px;
  border-radius: 12px;
  font-size: 36px;
  line-height: 1;
  transform: translateY(-50%);
}

#galleryLightbox .gallery-lightbox-prev { left: 12px; }
#galleryLightbox .gallery-lightbox-next { right: 12px; }

#galleryLightbox .gallery-lightbox-zoom {
  position: absolute;
  z-index: 3;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 22px;
  background: rgba(10,12,17,.85);
}

#galleryLightbox .gallery-lightbox-zoom button {
  min-width: 41px;
  height: 40px;
  padding: 0 9px;
  font-size: 24px;
  background: transparent;
}

#galleryLightbox .gallery-lightbox-zoom [data-zoom-reset] {
  min-width: 58px;
  font-family: var(--font-en, Arial, sans-serif);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 767px) {
  #gallery.gallery-section { padding: 50px 0 64px; }
  #gallery .gallery-heading { margin-bottom: 30px; padding: 0 17px; }
  #gallery .gallery-title-row { gap: 9px; }
  #gallery .gallery-title-row h2 {
    font-size: clamp(23px, 6vw, 30px);
    line-height: 1.5;
  }
  #gallery .gallery-title-line {
    width: 20px;
    flex-basis: 20px;
    height: 2.5px;
  }
  #gallery .gallery-heading p {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.65;
  }
  #gallery .gallery-sequence { gap: 14px; padding-inline-end: 14px; }
  #gallery .gallery-card {
    flex-basis: min(80vw, 360px);
    width: min(80vw, 360px);
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
  }
  #galleryLightbox.gallery-lightbox { padding: 10px; }
  #galleryLightbox .gallery-lightbox-dialog {
    width: min(94vw, 650px);
    height: min(76vh, 670px);
  }
  #galleryLightbox .gallery-lightbox-stage { border-radius: 17px; }
  #galleryLightbox .gallery-lightbox-prev { left: 6px; }
  #galleryLightbox .gallery-lightbox-next { right: 6px; }
  #galleryLightbox .gallery-lightbox-zoom { right: 8px; bottom: 8px; }
}
