/* ALTAHANY_GALLERY_RESPONSIVE_FINAL_V10_84_8 */

:root{
  --ath-public-max:1180px;
  --ath-public-gutter:clamp(12px,3vw,28px);
  --ath-card-radius:22px;
}

/* One predictable centered page axis for every public section. */
body:not(.admin-body) #main-content{
  width:100%;
  min-width:0;
  overflow-x:clip;
}

body:not(.admin-body) #main-content > section,
body:not(.admin-body) #main-content > article,
body:not(.admin-body) #main-content > div{
  margin-inline:auto;
}

body:not(.admin-body) :where(
  .container,
  .page-shell,
  .section-container,
  .content-container,
  .ath-gallery-shell,
  .ath-customer-hub,
  .ath-account-page,
  .ath-auth-modern,
  .ath-album-browser,
  .ath-selected-album,
  .services-container,
  .home-section-inner,
  .footer-inner
){
  width:min(var(--ath-public-max),calc(100% - (var(--ath-public-gutter) * 2)));
  margin-inline:auto!important;
  min-width:0;
}

/* Center grid rows while preserving readable text direction. */
body:not(.admin-body) :where(
  .ath-photo-grid,
  .ath-album-grid,
  .services-grid,
  .related-grid,
  .similar-grid,
  .recommended-grid,
  .suggested-grid,
  .ath-list-grid,
  .ath-customer-grid
){
  justify-content:center;
  align-items:stretch;
  margin-inline:auto;
  min-width:0;
}

body:not(.admin-body) :where(
  .section-heading,
  .ath-gallery-hero,
  .ath-auth-modern__head,
  .ath-account-heading,
  .ath-panel-head
){
  margin-inline:auto;
}

/* Hero always owns one stable viewport; no slide can shrink it. */
#heroSlider.hero-slider{
  position:relative!important;
  display:block!important;
  width:100%!important;
  min-width:100%!important;
  height:clamp(430px,68svh,760px)!important;
  min-height:430px!important;
  max-height:760px!important;
  overflow:hidden!important;
  contain:layout paint style;
  isolation:isolate;
  background:#17130f;
}

#heroSlider.hero-slider > .slide{
  position:absolute!important;
  inset:0!important;
  display:block!important;
  width:100%!important;
  min-width:100%!important;
  max-width:100%!important;
  height:100%!important;
  min-height:100%!important;
  max-height:100%!important;
  flex:0 0 100%!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  transform:none!important;
  scale:1!important;
}

#heroSlider.hero-slider > .slide:not(.active){
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
}

#heroSlider.hero-slider > .slide.active{
  opacity:1!important;
  visibility:visible!important;
  pointer-events:auto!important;
  z-index:2!important;
}

#heroSlider :where(.slide-media,.slide-media-video){
  position:absolute!important;
  inset:0!important;
  display:block!important;
  width:100%!important;
  min-width:100%!important;
  max-width:none!important;
  height:100%!important;
  min-height:100%!important;
  max-height:none!important;
  object-fit:cover!important;
  object-position:center center!important;
  background-size:cover!important;
  background-position:center center!important;
  background-repeat:no-repeat!important;
  transform:none!important;
}

/* Album carousel: every slide keeps identical geometry. */
.ath-album-swiper{
  width:100%!important;
  min-width:0!important;
  overflow:hidden!important;
  contain:layout paint;
}

.ath-album-swiper .swiper-wrapper{
  align-items:stretch!important;
  box-sizing:border-box!important;
}

.ath-album-swiper .swiper-slide{
  height:auto!important;
  min-width:0!important;
  flex-shrink:0!important;
  box-sizing:border-box!important;
}

.ath-album-choice{
  display:grid!important;
  grid-template-rows:auto 1fr;
  height:100%!important;
  min-height:100%!important;
}

.ath-album-choice-media{
  position:relative;
  display:block!important;
  width:100%!important;
  aspect-ratio:4/3!important;
  min-height:170px!important;
  overflow:hidden!important;
  background:#eee7dc;
}

.ath-album-choice-media img{
  position:absolute!important;
  inset:0!important;
  display:block!important;
  width:100%!important;
  min-width:100%!important;
  max-width:none!important;
  height:100%!important;
  min-height:100%!important;
  max-height:none!important;
  object-fit:cover!important;
  object-position:center!important;
  opacity:1!important;
  visibility:visible!important;
  transform:none!important;
}

/* Selected cover and photo cards reserve space before network completion. */
.ath-selected-album .ath-album-cover{
  position:relative!important;
  min-height:0!important;
  aspect-ratio:16/10!important;
  overflow:hidden!important;
  background:#eee7dc;
}

.ath-selected-album :where(.ath-cover-button,.ath-cover-button img){
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
}

.ath-selected-album .ath-cover-button img{
  display:block!important;
  object-fit:contain!important;
  object-position:center!important;
  background:#171513;
}

.ath-photo-grid{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:clamp(10px,2vw,18px)!important;
}

.ath-photo-card{
  min-width:0;
  overflow:hidden;
  background:#fff;
  border-radius:var(--ath-card-radius);
  contain:layout paint style;
}

.ath-photo-open{
  position:relative!important;
  display:block!important;
  width:100%!important;
  height:auto!important;
  aspect-ratio:4/3!important;
  overflow:hidden!important;
  background:#eee7dc!important;
}

.ath-photo-open img{
  position:absolute!important;
  inset:0!important;
  display:block!important;
  width:100%!important;
  min-width:100%!important;
  max-width:none!important;
  height:100%!important;
  min-height:100%!important;
  max-height:none!important;
  object-fit:cover!important;
  object-position:center!important;
  opacity:1!important;
  visibility:visible!important;
  transform:none!important;
}

/* Suggested, related and preview images must never collapse or remain hidden. */
body:not(.admin-body) :where(
  .related-images,
  .related-grid,
  .similar-images,
  .similar-grid,
  .recommended-images,
  .recommended-grid,
  .suggested-images,
  .suggested-grid,
  .ath-album-preview-strip
){
  opacity:1!important;
  visibility:visible!important;
}

body:not(.admin-body) :where(
  .related-images,
  .related-grid,
  .similar-images,
  .similar-grid,
  .recommended-images,
  .recommended-grid,
  .suggested-images,
  .suggested-grid
){
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr))!important;
  gap:14px!important;
  width:100%!important;
}

body:not(.admin-body) :where(
  .related-images img,
  .related-grid img,
  .similar-images img,
  .similar-grid img,
  .recommended-images img,
  .recommended-grid img,
  .suggested-images img,
  .suggested-grid img,
  .ath-album-preview-strip img
){
  display:block!important;
  opacity:1!important;
  visibility:visible!important;
  width:100%!important;
  min-width:1px!important;
  height:100%!important;
  min-height:90px!important;
  object-fit:cover!important;
  object-position:center!important;
  background:#eee7dc;
}

/* Lightbox keeps one stable stage for every image. */
.ath-lightbox,
.ath-v10833-viewer,
.ath-rescue-lightbox{
  contain:layout paint style;
}

.ath-lightbox figure,
.ath-v10833-stage,
.ath-rescue-lightbox{
  min-width:0!important;
  min-height:0!important;
}

.ath-lightbox figure{
  width:min(94vw,1400px)!important;
  height:min(82dvh,900px)!important;
  display:grid!important;
  place-items:center!important;
}

.ath-lightbox figure img,
.ath-v10833-stage img,
.ath-rescue-lightbox img{
  display:block!important;
  width:auto!important;
  min-width:1px!important;
  max-width:96%!important;
  height:auto!important;
  min-height:1px!important;
  max-height:92%!important;
  object-fit:contain!important;
  object-position:center!important;
  opacity:1!important;
  visibility:visible!important;
  transform-origin:center center!important;
}

/* Below-fold performance without hiding content. */
body:not(.admin-body) :where(
  .ath-album-card,
  .ath-photo-card,
  .service-card,
  .related-card,
  .suggested-card
){
  content-visibility:auto;
  contain-intrinsic-size:320px 280px;
}

/* Correct physical arrow positions in both Arabic and English. */
#heroSlider .slider-arrow.prev,
.ath-lightbox .ath-prev{
  left:clamp(8px,2vw,22px)!important;
  right:auto!important;
}

#heroSlider .slider-arrow.next,
.ath-lightbox .ath-next{
  right:clamp(8px,2vw,22px)!important;
  left:auto!important;
}

@media(max-width:980px){
  .ath-photo-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }

  .ath-selected-album{
    grid-template-columns:1fr!important;
  }
}

@media(max-width:720px){
  :root{
    --ath-public-gutter:8px;
  }

  #heroSlider.hero-slider{
    height:clamp(410px,70svh,640px)!important;
    min-height:410px!important;
  }

  .ath-photo-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:9px!important;
  }

  .ath-selected-album .ath-album-cover{
    aspect-ratio:4/3!important;
  }

  body:not(.admin-body) :where(
    .related-images,
    .related-grid,
    .similar-images,
    .similar-grid,
    .recommended-images,
    .recommended-grid,
    .suggested-images,
    .suggested-grid
  ){
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:9px!important;
  }
}

@media(max-width:430px){
  .ath-photo-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  .ath-album-choice-media{
    min-height:145px!important;
  }
}

@media(prefers-reduced-motion:reduce){
  #heroSlider > .slide{
    transition:none!important;
  }
}
