/* Ayamen R118 — source-level critical fixes. Loaded last. */
:root{--ayamen-r118-blue:#0c436a;--ayamen-r118-orange:#f6921e}

/* Header visibility is owned by ayamen-r118-critical-fixes.js. The legacy
   stickyHeader/hideHeader plugins are removed from serving HTML. Move the
   complete header as one unit so no background strip can remain behind. */
.header{
  transform:translate3d(0,0,0)!important;
  transition:transform .34s cubic-bezier(.22,1,.36,1)!important;
  will-change:transform;
}
body.ayamen-r118-nav-hidden .header{
  transform:translate3d(0,calc(-100% - 3px),0)!important;
  pointer-events:none!important;
}
body.ayamen-r118-nav-visible .header{
  transform:translate3d(0,0,0)!important;
  pointer-events:auto!important;
}
.header[data-header-theme] .header__background,
.header[data-header-theme="light"] .header__background,
.header[data-header-theme="dark"] .header__background,
.header .header__background,
.header .header__content{
  border:0!important;
  border-top:0!important;
  border-bottom:0!important;
  box-shadow:none!important;
}
.header .header__background::before,
.header .header__background::after,
.header .header__content::before,
.header .header__content::after{
  border:0!important;
  box-shadow:none!important;
}
body.ayamen-r118-nav-at-top .header[data-header-theme] .header__background,
body.ayamen-r118-nav-at-top .header[data-header-theme="light"] .header__background,
body.ayamen-r118-nav-at-top .header[data-header-theme="dark"] .header__background{
  background:transparent!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
  border:0!important;
  box-shadow:none!important;
}

/* The user explicitly does not want the large full-screen Landing sliders
   zoomed. Neutralize the historical R95/R115/R117 1.25 scale while preserving
   each slider's own parallax/section transform on its wrapper. */
body.ayamen-landing-r3 :is(
  .js-gallery-carousel,
  .js-exquisite-carousel,
  .l-spaces-carousel,
  .l-gallery__mobile-cards,
  .l-spaces-scrollable
) img,
body.ayamen-landing-r3 .l-gallery__img img{
  scale:1!important;
  transform-origin:center!important;
}

/* Never mirror slider-arrow artwork in Arabic. RTL affects flow, not the glyph. */
html[dir="rtl"] :is(
  .js-exquisite-carousel-prev,.js-exquisite-carousel-next,
  .js-gallery-carousel-prev,.js-gallery-carousel-next,
  .js-services-carousel-prev,.js-services-carousel-next,
  .js-carousel-prev,.js-carousel-next,
  .js-content-animation-prev,.js-content-animation-next,
  .ayr-gallery__prev,.ayr-gallery__next,
  .ayr-plan-prev,.ayr-plan-next,
  [data-ayr-lightbox-prev],[data-ayr-lightbox-next]
) :is(.icon,svg,i),
html[dir="rtl"] :is(.icon-arrow-left-angle,.icon-arrow-right-angle,.icon-arrow-down){
  transform:none!important;
  scale:1!important;
  direction:ltr!important;
}

/* Menu: create a real gap between each link's hit area so adjacent page names
   cannot be tapped accidentally. */
#menu.menu .menu__list{gap:clamp(1.55rem,3vh,2.65rem)!important}
#menu.menu .menu__list>a{
  display:block!important;
  padding-block:.08em!important;
}
@media(max-width:979px){
  #menu.menu .menu__list{gap:clamp(1.05rem,2.4vh,1.6rem)!important}
  #menu.menu .menu__list>a{padding-block:.1em!important}
}

/* --------------------------------------------------------------------------
   R123 — post-watermark-crop image framing
   The production photographs are now physically cropped, so the old R115
   top-biased/1.25 watermark compensation is no longer needed. Keep frames
   full, show the useful lower architectural content, and do not add a second
   artificial crop through CSS scale.
   -------------------------------------------------------------------------- */
:is(
  .background--cover,
  .ayr-hero,
  .ayr-story__image,
  .ayr-gallery,
  .ayr-project-card__media,
  .ayr-project-cta,
  .ayp-card-media,
  .ayp-hero-media,
  .l-content__image,
  .l-services-card__image,
  .l-exquisite-mob-card__image,
  .l-services-gallery__image,
  .l-services-mob-card__image,
  .l-gallery__img,
  .ab-focus-card__image,
  .ab-info__background,
  .ayn-hero,
  .ayc-contact-hero-clean
) img:not([src*="floor_plan"]):not([src*="logo"]):not([src*="footer"]):not([src*="mockup"]){
  object-fit:cover!important;
  object-position:center bottom!important;
  scale:1!important;
  transform-origin:center bottom!important;
}

/* Project-detail photography: the source crop is already final. Prevent the
   legacy hero/story crop zoom from hiding the building again. */
.ayamen-signature-residence .ayr-hero--story-merged .ayr-hero__image,
.ayamen-signature-residence .ayr-story__image img{
  object-fit:cover!important;
  object-position:center bottom!important;
  transform:none!important;
  scale:1!important;
}

.ayr-gallery__item img,
.ayr-essentials__media img,
.ayr-project-card__media img,
.ayr-project-cta__media{
  object-fit:cover!important;
  object-position:center bottom!important;
  scale:1!important;
}

/* Full-screen Landing/section sliders: use the cropped source as-is and bias
   the frame toward the property rather than empty sky. */
body.ayamen-landing-r3 :is(
  .js-gallery-carousel,
  .js-exquisite-carousel,
  .l-spaces-carousel,
  .js-services-carousel,
  .l-gallery__mobile-cards,
  .l-spaces-scrollable
) img,
body.ayamen-landing-r3 .l-gallery__img img{
  object-fit:cover!important;
  object-position:center bottom!important;
  scale:1!important;
  transform-origin:center bottom!important;
}

/* A lightbox should show the entire cropped photograph, not crop it again. */
.ayr-lightbox__stage img{
  object-fit:contain!important;
  object-position:center!important;
  scale:1!important;
  transform:none!important;
}
.ayr-lightbox__thumbs img{
  object-fit:cover!important;
  object-position:center bottom!important;
  scale:1!important;
}

/* Arabic project pages: remove both progress-style indicators requested by
   the user while keeping active section highlighting and navigation intact. */
html[lang="ar"] .ayr-section-nav__progress,
html[lang="ar"] [data-ayr-lightbox-counter]{
  display:none!important;
}
html[lang="ar"] .ayr-lightbox__meta{
  justify-content:flex-start!important;
}

/* --------------------------------------------------------------------------
   R127 — restore original normal navigation
   Full header remains the original Menu / centered logo / right controls.
   It hides only on downward scroll and returns on upward scroll.
   -------------------------------------------------------------------------- */
.header.header--sticky{
  position:fixed!important;
  inset:0 0 auto 0!important;
  width:100%!important;
  z-index:1000!important;
  transform:translate3d(0,0,0)!important;
  transition:transform .34s cubic-bezier(.22,1,.36,1)!important;
  will-change:transform!important;
}
body.ayamen-r127-nav-hidden .header.header--sticky{
  transform:translate3d(0,calc(-100% - 2px),0)!important;
  pointer-events:none!important;
}
body.ayamen-r127-nav-visible .header.header--sticky{
  transform:translate3d(0,0,0)!important;
  pointer-events:auto!important;
}

/* Do not let older R117/R118 body states move the header after R127 owns it. */
body.ayamen-r117-nav-hidden:not(.ayamen-r127-nav-hidden) .header,
body.ayamen-r118-nav-hidden:not(.ayamen-r127-nav-hidden) .header,
body.ayamen-r117-nav-visible:not(.ayamen-r127-nav-hidden) .header,
body.ayamen-r118-nav-visible:not(.ayamen-r127-nav-hidden) .header{
  transform:none;
}

/* Preserve the original desktop header composition. */
@media (min-width:980px){
  .header .header__content{
    position:relative!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
  }
  .header .header__content>.col:first-child{
    position:absolute!important;
    inset-inline-start:clamp(24px,2.4vw,38px)!important;
    top:50%!important;
    width:auto!important;
    max-width:none!important;
    padding:0!important;
    transform:translateY(-50%)!important;
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
  }
  .header .header__content>.col:nth-child(2){
    position:static!important;
    width:auto!important;
    max-width:none!important;
    flex:0 0 auto!important;
    padding:0!important;
  }
  .header .header__content>.col:last-child{
    position:absolute!important;
    inset-inline-end:clamp(24px,2.4vw,38px)!important;
    top:50%!important;
    width:auto!important;
    max-width:min(46vw,680px)!important;
    padding:0!important;
    transform:translateY(-50%)!important;
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
  }
  .header .header__logo{
    position:static!important;
    inset:auto!important;
    transform:none!important;
    margin-inline:auto!important;
  }
}

/* Mobile keeps the original menu button + centered logo layout. */
@media (max-width:979px){
  .header .header__logo{
    position:absolute!important;
    left:50%!important;
    right:auto!important;
    top:50%!important;
    transform:translate(-50%,-50%)!important;
    margin:0!important;
  }
  html[dir="rtl"] .header .header__logo{
    left:50%!important;
    right:auto!important;
    transform:translate(-50%,-50%)!important;
  }
}

/* The logo is never a menu control. Only explicit a[href="#menu"] buttons are. */
.header__logo-link{
  cursor:pointer!important;
  pointer-events:auto!important;
}

/* Keep the requested clean nav with no separator/blue strip. */
.header .header__background,
.header .header__content,
.header .header__background::before,
.header .header__background::after,
.header .header__content::before,
.header .header__content::after{
  border:0!important;
  border-top:0!important;
  border-bottom:0!important;
  box-shadow:none!important;
}
body.ayamen-r127-nav-at-top .header .header__background{
  background:transparent!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
  box-shadow:none!important;
}
