/* Ayamen Arabic locale layer — R36.1
   Loaded only on /ar/ routes after the complete English R35 cascade.
   Reading flow is RTL. Existing carousel, gallery and horizontal-controller
   geometry remains LTR for the stability baseline. */

html[lang="ar"] {
  direction: rtl;
  color-scheme: light;
}

html[lang="ar"],
html[lang="ar"] body,
html[lang="ar"] button,
html[lang="ar"] input,
html[lang="ar"] textarea,
html[lang="ar"] select {
  font-family: "IBM Plex Sans Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif !important;
  letter-spacing: 0 !important;
  font-kerning: normal;
}

html[lang="ar"] body {
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
}

html[lang="ar"] .page-content-wrapper,
html[lang="ar"] .page-content-wrapper__inner,
html[lang="ar"] .page-content,
html[lang="ar"] main,
html[lang="ar"] section {
  max-width: 100%;
}

/* Natural Arabic shaping and wrapping. Do not apply one global line-height to
   every R35 animation frame; each component is tuned below. */
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6,
html[lang="ar"] p,
html[lang="ar"] label,
html[lang="ar"] li,
html[lang="ar"] .btn__text {
  direction: rtl;
  unicode-bidi: isolate;
  text-align: right;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
  text-transform: none;
}

html[lang="ar"] i,
html[lang="ar"] em,
html[lang="ar"] .ayamen-script-word,
html[lang="ar"] .text-color-primary {
  font-family: inherit !important;
  font-style: normal !important;
}

html[lang="ar"] .whitespace {
  display: inline !important;
  white-space: normal !important;
}

html[lang="ar"] [data-ar-natural-text="true"] {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

/* Arabic-safe heading and whole-label transitions. */
html[lang="ar"] [data-ar-reveal="heading"],
html[lang="ar"] [data-ar-natural-text="true"] {
  transform-origin: right center;
}

html[lang="ar"] [data-ar-reveal="heading"] .char,
html[lang="ar"] [data-ar-natural-text="true"] .char {
  display: inline !important;
  transform: none !important;
  opacity: inherit !important;
  visibility: inherit !important;
}

html[lang="ar"] [data-ar-button="whole-label"] .btn__text {
  display: inline-block;
  transition: transform .45s cubic-bezier(.25,.74,.22,.99), opacity .45s cubic-bezier(.25,.74,.22,.99);
}

html.has-hover[lang="ar"] [data-ar-button="whole-label"]:hover .btn__text {
  transform: translateY(-.08em);
}

/* Header keeps the approved physical composition. */
html[lang="ar"] .header__content,
html[lang="ar"] .header .row,
html[lang="ar"] .header .group--header,
html[lang="ar"] .header .group--center\:md,
html[lang="ar"] .header .btn__content {
  direction: ltr;
}

html[lang="ar"] .header .btn__text,
html[lang="ar"] .header .ayamen-lang-switch {
  direction: rtl;
  unicode-bidi: isolate;
}

html[lang="ar"] .header .ayamen-lang-switch[lang="en"],
html[lang="ar"] .menu .ayamen-lang-switch[lang="en"] {
  direction: ltr;
  font-family: AyamenSans, Helvetica, Arial, sans-serif !important;
}

html[lang="ar"] .header a[href^="tel:"],
html[lang="ar"] .header a[href^="tel:"] .btn__content,
html[lang="ar"] .header a[href^="tel:"] .btn__text {
  direction: ltr !important;
  unicode-bidi: isolate !important;
  white-space: nowrap !important;
  text-align: left !important;
}

/* Full-screen menu. */
html[lang="ar"] .menu__inner,
html[lang="ar"] .menu__list,
html[lang="ar"] .menu__bottom,
html[lang="ar"] .callback-layout,
html[lang="ar"] .callback-layout__form-content {
  direction: rtl;
  text-align: right;
}

html[lang="ar"] .menu__top { direction: ltr; }
html[lang="ar"] .menu__bottom { flex-direction: row-reverse; }
html[lang="ar"] .menu__list a { text-align: right; }

/* Form labels remain RTL; technical values remain LTR. */
html[lang="ar"] input,
html[lang="ar"] textarea,
html[lang="ar"] select {
  direction: rtl;
  text-align: right;
}

html[lang="ar"] input[type="tel"],
html[lang="ar"] input[type="email"],
html[lang="ar"] input[type="url"] {
  direction: ltr !important;
  unicode-bidi: plaintext !important;
  text-align: left !important;
}

html[lang="ar"] .form-control--float .form-label {
  left: auto !important;
  right: 0 !important;
  transform-origin: right center;
}

html[lang="ar"] .ayamen-form-status { text-align: right; }

html[lang="ar"] a[href^="tel:"],
html[lang="ar"] a[href^="mailto:"],
html[lang="ar"] [data-ltr],
html[lang="ar"] .text-ltr,
html[lang="ar"] .pd-availability,
html[lang="ar"] .pd-plan-meta,
html[lang="ar"] .pd-unit-meta,
html[lang="ar"] .pd-stats strong,
html[lang="ar"] .pd-stats span,
html[lang="ar"] .pd-overview-stats strong,
html[lang="ar"] .pd-overview-stats span {
  direction: ltr !important;
  unicode-bidi: isolate !important;
}

/* --------------------------------------------------------------------------
   Mechanical LTR containment
   -------------------------------------------------------------------------- */
html[lang="ar"] .ayamen-ltr-mechanics,
html[lang="ar"] .ayamen-ltr-mechanics.content-animation,
html[lang="ar"] .ayamen-ltr-mechanics .content-animation,
html[lang="ar"] .js-carousel-list,
html[lang="ar"] .mobile-scrollable,
html[lang="ar"] .l-gallery__mobile-cards,
html[lang="ar"] .ayp-index,
html[lang="ar"] .ayp-track,
html[lang="ar"] [data-ayp-track],
html[lang="ar"] .ayp-projects,
html[lang="ar"] .pd-horizontal-shell,
html[lang="ar"] .pd-horizontal-track,
html[lang="ar"] .pd-gallery,
html[lang="ar"] .pd-gallery-track,
html[lang="ar"] .pd-thumbs {
  direction: ltr !important;
  unicode-bidi: isolate;
}

html[lang="ar"] .mobile-scrollable__item,
html[lang="ar"] .l-exquisite-mob-card__content,
html[lang="ar"] .ayp-panel,
html[lang="ar"] .ayp-panel *,
html[lang="ar"] .pd-panel,
html[lang="ar"] .pd-panel *,
html[lang="ar"] .pd-slide,
html[lang="ar"] .pd-slide * {
  direction: rtl;
  unicode-bidi: isolate;
}

html[lang="ar"] .l-services-card__nav,
html[lang="ar"] .l-exquisite-content__nav,
html[lang="ar"] .l-gallery__nav,
html[lang="ar"] .pd-gallery-controls,
html[lang="ar"] .pd-plan-controls,
html[lang="ar"] .pd-progress {
  direction: ltr !important;
}

html[lang="ar"] .pd-progress b {
  direction: rtl !important;
  unicode-bidi: isolate;
}

/* --------------------------------------------------------------------------
   Homepage typography and containment
   -------------------------------------------------------------------------- */
html[lang="ar"] body.ayamen-landing-r3 .intro h1,
html[lang="ar"] body.ayamen-landing-r3 .text-h1-lg {
  line-height: 1.08 !important;
  text-wrap: balance;
}

html[lang="ar"] body.ayamen-landing-r3 .l-content__text,
html[lang="ar"] body.ayamen-landing-r3 [data-ar-natural-text="true"] {
  line-height: 1.58 !important;
  max-width: min(100%, 38rem);
}

html[lang="ar"] body.ayamen-landing-r3 .l-choice__title,
html[lang="ar"] body.ayamen-landing-r3 .l-gallery__title,
html[lang="ar"] body.ayamen-landing-r3 .l-exquisite-content__title {
  line-height: 1.08 !important;
  overflow: visible !important;
  text-wrap: balance;
}

html[lang="ar"] body.ayamen-landing-r3 .l-exquisite-content,
html[lang="ar"] body.ayamen-landing-r3 .l-gallery__content,
html[lang="ar"] body.ayamen-landing-r3 .l-services-card__content {
  min-width: 0 !important;
}

/* Arabic Services: preserve controller mechanics and contiguous card, while
   increasing the text pane and allowing natural title wrapping. */
@media (min-width: 980px) {
  html[lang="ar"] body.ayamen-landing-r3 #services .l-services-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    width: min(1680px, calc(100% - clamp(2.5rem, 6vw, 6rem))) !important;
    min-height: clamp(620px, 72vh, 760px) !important;
    height: clamp(620px, 72vh, 760px) !important;
    gap: 0 !important;
    overflow: hidden !important;
  }

  html[lang="ar"] body.ayamen-landing-r3 #services .l-services-card > .col {
    min-width: 0 !important;
    max-width: none !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html[lang="ar"] body.ayamen-landing-r3 #services .l-services-card > .col:first-child {
    flex: 0 0 58% !important;
    width: 58% !important;
  }

  html[lang="ar"] body.ayamen-landing-r3 #services .l-services-card > .col:last-child {
    flex: 0 0 42% !important;
    width: 42% !important;
  }

  html[lang="ar"] body.ayamen-landing-r3 #services .l-services-card__image,
  html[lang="ar"] body.ayamen-landing-r3 #services .l-services-card__content {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  html[lang="ar"] body.ayamen-landing-r3 #services .l-services-card__content {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    padding: clamp(2rem, 3vw, 3.2rem) clamp(2rem, 3vw, 3.6rem) clamp(2.5rem, 4vw, 4rem) !important;
    direction: rtl !important;
    text-align: right !important;
  }

  html[lang="ar"] body.ayamen-landing-r3 #services .l-services-card__title,
  html[lang="ar"] body.ayamen-landing-r3 #services .l-services-card__text,
  html[lang="ar"] body.ayamen-landing-r3 #services .l-services-card__title .content-animation,
  html[lang="ar"] body.ayamen-landing-r3 #services .l-services-card__text .content-animation,
  html[lang="ar"] body.ayamen-landing-r3 #services .l-services-card__title [data-content-animation-item],
  html[lang="ar"] body.ayamen-landing-r3 #services .l-services-card__text [data-content-animation-item] {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    overflow: visible !important;
    text-align: right !important;
  }

  html[lang="ar"] body.ayamen-landing-r3 #services .l-services-card__title {
    min-height: clamp(170px, 19vh, 220px) !important;
    margin: clamp(6.1rem, 10.5vh, 7.8rem) 0 0 !important;
  }

  html[lang="ar"] body.ayamen-landing-r3 #services .l-services-card__title h3 {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    font-size: clamp(2.75rem, 3.45vw, 4.55rem) !important;
    line-height: 1.1 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    text-align: right !important;
    text-wrap: balance;
  }

  html[lang="ar"] body.ayamen-landing-r3 #services .l-services-card__text {
    min-height: clamp(120px, 14vh, 165px) !important;
    margin: auto 0 0 !important;
  }

  html[lang="ar"] body.ayamen-landing-r3 #services .l-services-card__text p {
    margin: 0 !important;
    font-size: clamp(1.05rem, 1.12vw, 1.3rem) !important;
    line-height: 1.65 !important;
    text-align: right !important;
  }
}

@media (min-width: 980px) and (max-width: 1199px) {
  html[lang="ar"] body.ayamen-landing-r3 #services .l-services-card > .col:first-child {
    flex-basis: 55% !important;
    width: 55% !important;
  }
  html[lang="ar"] body.ayamen-landing-r3 #services .l-services-card > .col:last-child {
    flex-basis: 45% !important;
    width: 45% !important;
  }
  html[lang="ar"] body.ayamen-landing-r3 #services .l-services-card__title h3 {
    font-size: clamp(2.45rem, 4.3vw, 3.65rem) !important;
  }
}

@media (max-width: 979px) {
  html[lang="ar"] #services .mobile-scrollable,
  html[lang="ar"] #services .l-gallery__mobile-cards {
    direction: ltr !important;
  }

  html[lang="ar"] #services .l-exquisite-mob-card--services {
    min-height: 0 !important;
    height: auto !important;
    overflow: hidden !important;
  }

  html[lang="ar"] #services .l-exquisite-mob-card--services .l-exquisite-mob-card__content {
    min-width: 0 !important;
    padding: clamp(1.35rem, 5vw, 2rem) !important;
    direction: rtl !important;
    text-align: right !important;
  }

  html[lang="ar"] #services .l-exquisite-mob-card__content-title,
  html[lang="ar"] #services .l-services-mob-card__content-title {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 0 1rem !important;
    font-size: clamp(2rem, 9vw, 3.25rem) !important;
    line-height: 1.12 !important;
    white-space: normal !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    text-align: right !important;
  }

  html[lang="ar"] #services .l-exquisite-mob-card__content-text,
  html[lang="ar"] #services .l-services-mob-card__content-text {
    width: 100% !important;
    max-width: 100% !important;
    font-size: clamp(1rem, 4.2vw, 1.18rem) !important;
    line-height: 1.68 !important;
    text-align: right !important;
  }
}

/* About values and sticky-project text. */
html[lang="ar"] .ab-values__content,
html[lang="ar"] .ab-values__content-title,
html[lang="ar"] .ab-values__content-text,
html[lang="ar"] .ab-projects__content {
  direction: rtl;
  text-align: right;
  min-width: 0;
}

html[lang="ar"] .ab-values__content-title,
html[lang="ar"] .ab-projects__content h2,
html[lang="ar"] .ab-projects__content h3 {
  line-height: 1.12 !important;
  white-space: normal !important;
  overflow: visible !important;
}

/* --------------------------------------------------------------------------
   Projects listing — live .ayp-* selectors
   -------------------------------------------------------------------------- */
html[lang="ar"] .ayp-index,
html[lang="ar"] .ayp-track,
html[lang="ar"] [data-ayp-track],
html[lang="ar"] .ayp-projects {
  direction: ltr !important;
}

html[lang="ar"] .ayp-panel,
html[lang="ar"] .ayp-intro,
html[lang="ar"] .ayp-project,
html[lang="ar"] .ayp-closing,
html[lang="ar"] .ayp-project__copy,
html[lang="ar"] .ayp-closing__copy,
html[lang="ar"] .ayp-intro__grid {
  direction: rtl !important;
  text-align: right !important;
  min-width: 0;
}

html[lang="ar"] .ayp-kicker,
html[lang="ar"] .ayp-scroll-cue {
  left: auto !important;
  right: clamp(2rem, 5vw, 6rem) !important;
}

html[lang="ar"] .ayp-intro h1,
html[lang="ar"] .ayp-project h2,
html[lang="ar"] .ayp-closing h2 {
  line-height: 1.05 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-wrap: balance;
}

html[lang="ar"] .ayp-project__meta {
  direction: rtl;
}

@media (max-width: 979px) {
  html[lang="ar"] .ayp-track,
  html[lang="ar"] [data-ayp-track] {
    width: 100% !important;
  }
  html[lang="ar"] .ayp-project,
  html[lang="ar"] .ayp-intro,
  html[lang="ar"] .ayp-closing {
    min-width: 0 !important;
    width: 100% !important;
  }
}

/* --------------------------------------------------------------------------
   Project details
   -------------------------------------------------------------------------- */
html[lang="ar"] .pd-horizontal-shell,
html[lang="ar"] .pd-horizontal-track,
html[lang="ar"] .pd-gallery,
html[lang="ar"] .pd-gallery-track,
html[lang="ar"] .pd-thumbs {
  direction: ltr !important;
}

html[lang="ar"] .pd-panel,
html[lang="ar"] .pd-hero-copy,
html[lang="ar"] .pd-overview-copy,
html[lang="ar"] .pd-info-panel,
html[lang="ar"] .pd-section-head,
html[lang="ar"] .pd-unit-panels,
html[lang="ar"] .pd-cta > div,
html[lang="ar"] .pd-cta-copy {
  direction: rtl !important;
  text-align: right !important;
  min-width: 0;
}

/* English drop caps do not suit connected Arabic text. */
html[lang="ar"] .pd-overview-copy > p:first-of-type::first-letter,
html[lang="ar"] .pd-info-panel > p:first-of-type::first-letter {
  float: none !important;
  margin: 0 !important;
  font-size: inherit !important;
  line-height: inherit !important;
  color: inherit !important;
}

html[lang="ar"] .pd-hero h1,
html[lang="ar"] .pd-overview h2,
html[lang="ar"] .pd-info-panel h2,
html[lang="ar"] .pd-section-head h2,
html[lang="ar"] .pd-residences h2,
html[lang="ar"] .pd-cta h2 {
  line-height: 1.08 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-wrap: balance;
}

html[lang="ar"] .pd-filter-row,
html[lang="ar"] .pd-mode-tabs,
html[lang="ar"] .pd-plan-controls,
html[lang="ar"] .pd-unit-tabs {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: .55rem !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: thin;
  overscroll-behavior-inline: contain;
  direction: rtl !important;
  padding-block-end: .45rem;
}

html[lang="ar"] .pd-filter-row button,
html[lang="ar"] .pd-mode-tabs button,
html[lang="ar"] .pd-plan-controls button,
html[lang="ar"] .pd-unit-tabs button {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: max-content !important;
  max-width: none !important;
  min-height: 44px;
  padding: .72rem 1rem !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.35 !important;
  direction: rtl !important;
  text-align: center !important;
}

html[lang="ar"] .pd-filter-row button::before,
html[lang="ar"] .pd-mode-tabs button::before,
html[lang="ar"] .pd-plan-controls button::before,
html[lang="ar"] .pd-unit-tabs button::before {
  pointer-events: none;
}

html[lang="ar"] .pd-info-panel,
html[lang="ar"] .pd-unit-panels,
html[lang="ar"] .pd-section-head,
html[lang="ar"] .pd-mode-panel,
html[lang="ar"] .pd-plan-stage {
  min-width: 0 !important;
}

html[lang="ar"] .pd-info-panel ul {
  padding-inline-start: 1.25rem !important;
  padding-inline-end: 0 !important;
}

html[lang="ar"] .pd-note {
  border-left: 0 !important;
  border-right: 4px solid var(--pd-blue) !important;
}

html[lang="ar"] .pd-expand {
  right: auto !important;
  left: .8rem !important;
}

html[lang="ar"] .pd-lightbox button {
  right: auto !important;
  left: 1rem !important;
}

html[lang="ar"] .pd-cta-nav a:last-child { text-align: left; }

@media (max-width: 900px) {
  html[lang="ar"] .pd-horizontal-shell {
    direction: ltr !important;
    scroll-padding-inline: 0 !important;
  }
  html[lang="ar"] .pd-horizontal-track { direction: ltr !important; }
  html[lang="ar"] .pd-panel {
    direction: rtl !important;
    min-width: 100vw !important;
  }
  html[lang="ar"] .pd-mode-tabs {
    display: flex !important;
    grid-template-columns: none !important;
  }
  html[lang="ar"] .pd-info-panel h2,
  html[lang="ar"] .pd-section-head h2,
  html[lang="ar"] .pd-residences h2,
  html[lang="ar"] .pd-overview h2,
  html[lang="ar"] .pd-cta h2 {
    font-size: clamp(2.35rem, 10vw, 4rem) !important;
  }
}

/* --------------------------------------------------------------------------
   News, articles, footer and legal
   -------------------------------------------------------------------------- */
html[lang="ar"] .ayn-news,
html[lang="ar"] .ayn-article,
html[lang="ar"] .ayn-news-card,
html[lang="ar"] .ayn-article-body,
html[lang="ar"] .ayn-related {
  direction: rtl;
  text-align: right;
  min-width: 0;
}

html[lang="ar"] .ayn-news h1,
html[lang="ar"] .ayn-news h2,
html[lang="ar"] .ayn-news-card h2,
html[lang="ar"] .ayn-article h1,
html[lang="ar"] .ayn-article h2 {
  line-height: 1.12 !important;
  white-space: normal !important;
  overflow: visible !important;
}

html[lang="ar"] .ayn-filters {
  direction: rtl;
  justify-content: flex-start;
  overflow-x: auto;
  max-width: 100%;
}

html[lang="ar"] .ayn-filters button {
  flex: 0 0 auto;
  min-width: max-content;
  text-align: center;
}







html[lang="ar"] .legal {
  direction: rtl;
  text-align: right;
}

html[lang="ar"] .legal h1,
html[lang="ar"] .legal h2 {
  line-height: 1.15 !important;
}

html[lang="ar"] .legal__language {
  display: inline-block;
  margin-inline-start: 1rem;
  direction: ltr;
  unicode-bidi: isolate;
  font-family: AyamenSans, Helvetica, Arial, sans-serif !important;
}

@media (max-width: 979px) {
  html[lang="ar"] .header__content { direction: ltr; }
  html[lang="ar"] .menu__bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
  }
  html[lang="ar"] .menu__bottom .group { align-items: flex-start; }
}

@media (max-width: 567px) {
  html[lang="ar"] body.ayamen-landing-r3 .intro h1,
  html[lang="ar"] body.ayamen-landing-r3 .text-h1-lg {
    line-height: 1.13 !important;
  }
}

/* Arabic project-control labels must determine their own width. The English
   translated fill layer doubles the scrollable box in Chromium, so Arabic
   controls use a direct background transition instead of a clipped pseudo wipe. */
html[lang="ar"] .pd-filter-row button::before,
html[lang="ar"] .pd-mode-tabs button::before,
html[lang="ar"] .pd-plan-controls button::before,
html[lang="ar"] .pd-unit-tabs button::before {
  content: none !important;
  display: none !important;
}

html[lang="ar"] .pd-filter-row button,
html[lang="ar"] .pd-mode-tabs button,
html[lang="ar"] .pd-plan-controls button,
html[lang="ar"] .pd-unit-tabs button {
  transition: color .28s ease, background-color .28s ease, border-color .28s ease, transform .28s ease !important;
}

html[lang="ar"] .pd-filter-row button:hover,
html[lang="ar"] .pd-mode-tabs button:hover,
html[lang="ar"] .pd-plan-controls button:hover,
html[lang="ar"] .pd-unit-tabs button:hover,
html[lang="ar"] .pd-filter-row button[aria-selected="true"],
html[lang="ar"] .pd-mode-tabs button[aria-selected="true"],
html[lang="ar"] .pd-plan-controls button[aria-selected="true"],
html[lang="ar"] .pd-unit-tabs button[aria-selected="true"] {
  background: var(--pd-blue) !important;
  color: #fff !important;
}
