/* V754 critical/footer + responsive stability layer. */
body.elahe-custom-footer-enabled .site-footer {
  display: none !important;
}

body.elahe-custom-footer-enabled .elahe-home-footer {
  position: relative;
  box-sizing: border-box;
  width: min(calc(100% - 32px), 1600px);
  max-width: 1600px;
  margin: 36px auto 18px;
  overflow: hidden;
  border-radius: 24px;
}

body.home.elahe-custom-footer-enabled .elahe-home-footer {
  margin-top: 0;
}

.elahe-home-footer__main--menu-only {
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(0, 1.45fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

.elahe-home-footer__nav .elahe-home-footer__menu,
.elahe-home-footer__nav .menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.elahe-home-footer__nav .elahe-home-footer__menu > li,
.elahe-home-footer__nav .menu > li {
  margin: 0;
}

.elahe-home-footer__nav .elahe-home-footer__menu > li > a,
.elahe-home-footer__nav .menu > li > a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  border: 1px solid rgba(176, 141, 87, .20);
  border-radius: 11px;
  background: rgba(255, 255, 255, .04);
  color: rgba(245, 239, 230, .92);
  text-decoration: none;
}

.elahe-home-footer__cta-button {
  min-height: 50px;
}

@media (max-width: 900px) {
  .elahe-home-footer__main--menu-only {
    grid-template-columns: 1fr;
  }

  .elahe-home-footer__nav .elahe-home-footer__menu,
  .elahe-home-footer__nav .menu {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  body.elahe-custom-footer-enabled .elahe-home-footer {
    width: calc(100% - 20px);
    margin: 20px auto 10px;
    border-radius: 20px;
  }

  .elahe-home-footer__nav .elahe-home-footer__menu,
  .elahe-home-footer__nav .menu {
    display: grid;
    grid-template-columns: 1fr;
  }

  .elahe-home-footer__nav .elahe-home-footer__menu > li > a,
  .elahe-home-footer__nav .menu > li > a,
  .elahe-home-footer__cta-button {
    width: 100%;
  }
}


/* -------------------------------------------------------------------------
 * V754 responsive restoration
 * ------------------------------------------------------------------------- */

/* Never allow intrinsic children to force the homepage wider than viewport. */
body.home,
body.home #page,
body.home #content,
body.home #primary,
body.home #main,
body.home .elahe-homepage,
body.home .elahe-parchment-section,
body.home .elahe-parchment-content,
body.elahe-custom-footer-enabled .elahe-home-footer {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

body.home img,
body.home svg,
body.home video,
body.home canvas,
body.home iframe {
  max-width: 100%;
}

body.home img,
body.home video {
  height: auto;
}

body.home .elahe-homepage {
  width: 100% !important;
  max-width: 100% !important;
  margin-inline: 0 !important;
  overflow-x: clip;
}

body.home .elahe-parchment-content > *,
body.home .elahe-home-primary-hero__shell,
body.home .elahe-home-primary-hero__copy,
body.home .elahe-home-primary-hero__visual,
body.home .elahe-home-system-pathways__field,
body.home .elahe-home-system-trust__field,
body.home .elahe-cases__grid,
body.home .elahe-why-banner__grid,
body.home .anx-multiyou,
body.home .anx-services,
body.home .elahe-how__timeline,
body.home .elahe-services__inner,
body.home .elahe-services__grid,
body.home .elahe-faq__inner,
body.home .elahe-journal__hero,
body.home .elahe-journal__cards,
body.home .elahe-final__inner,
body.elahe-custom-footer-enabled .elahe-home-footer__cta,
body.elahe-custom-footer-enabled .elahe-home-footer__main,
body.elahe-custom-footer-enabled .elahe-home-footer__nav,
body.elahe-custom-footer-enabled .elahe-home-footer__bottom {
  min-width: 0;
  max-width: 100%;
}

/* Tablet: collapse layouts before translations or browser zoom can overflow. */
@media (max-width: 960px) {
  body.home .elahe-home-primary-hero__shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.home .elahe-home-primary-hero__copy {
    max-width: 100%;
  }

  body.home .elahe-home-primary-hero__visual {
    min-height: clamp(330px, 66vw, 520px);
  }

  body.elahe-custom-footer-enabled .elahe-home-footer__cta,
  body.elahe-custom-footer-enabled .elahe-home-footer__main--menu-only {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.elahe-custom-footer-enabled .elahe-home-footer__brand {
    grid-column: auto;
  }

  body.elahe-custom-footer-enabled .elahe-home-footer__nav .elahe-home-footer__menu,
  body.elahe-custom-footer-enabled .elahe-home-footer__nav .menu {
    justify-content: flex-start;
  }
}

/* Mobile: one-column reading flow, safe paper gutters and touch-sized controls. */
@media (max-width: 640px) {
  html,
  body {
    overflow-x: hidden !important;
  }

  body.home #page,
  body.home #content,
  body.home #primary,
  body.home #main,
  body.home .elahe-homepage {
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
    padding-inline: 0 !important;
  }

  body.home .elahe-parchment-section {
    width: calc(100% - 12px) !important;
    max-width: calc(100% - 12px) !important;
    margin-inline: auto !important;
    padding-inline: clamp(14px, 4.8vw, 20px) !important;
  }

  body.home .elahe-home-primary-hero__shell {
    width: 100% !important;
    max-width: 100% !important;
  }

  body.home .elahe-home-primary-hero h1,
  body.home .elahe-homepage h2,
  body.home .elahe-homepage h3,
  body.home .elahe-homepage p,
  body.home .elahe-homepage a,
  body.home .elahe-homepage button,
  body.elahe-custom-footer-enabled .elahe-home-footer :is(h2,h3,p,a,button) {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  body.home .elahe-home-primary-hero__actions,
  body.home .elahe-final__actions {
    width: 100%;
  }

  body.home .elahe-home-primary-button,
  body.home .elahe-final__actions .elahe-button,
  body.elahe-custom-footer-enabled .elahe-home-footer__cta-button {
    min-height: 48px;
    max-width: 100%;
  }

  body.home .elahe-home-system-pathways__field,
  body.home .elahe-cases__grid,
  body.home .elahe-why-banner__grid,
  body.home .anx-services,
  body.home .elahe-how__timeline,
  body.home .elahe-services__grid,
  body.home .elahe-journal__principles,
  body.home .elahe-journal__tabs,
  body.home .elahe-journal__cards {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.home .elahe-home-system-trust__field {
    display: flex !important;
    flex-direction: column;
    gap: 13px;
    min-height: 0 !important;
  }

  body.home .elahe-home-system-trust__path {
    display: none !important;
  }

  body.home .elahe-home-system-signal,
  body.home .elahe-home-system-signal.is-navy,
  body.home .elahe-home-system-signal.is-cream,
  body.home .elahe-home-system-signal.is-olive,
  body.home .elahe-home-system-signal.is-rose {
    width: 100%;
    max-width: 100%;
  }

  body.home .anx-multiyou,
  body.home .elahe-services__inner,
  body.home .elahe-faq__inner,
  body.home .elahe-journal__hero,
  body.home .elahe-journal__card.is-featured {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.home .elahe-journal__hero-media,
  body.home .elahe-home-primary-hero__monitor {
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
  }

  body.elahe-custom-footer-enabled .elahe-home-footer {
    width: calc(100% - 12px);
    max-width: calc(100% - 12px);
    margin-inline: auto;
  }

  body.elahe-custom-footer-enabled .elahe-home-footer__cta,
  body.elahe-custom-footer-enabled .elahe-home-footer__main,
  body.elahe-custom-footer-enabled .elahe-home-footer__bottom {
    padding-inline: clamp(16px, 5vw, 22px);
  }

  body.elahe-custom-footer-enabled .elahe-home-footer__nav .elahe-home-footer__menu,
  body.elahe-custom-footer-enabled .elahe-home-footer__nav .menu {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  body.elahe-custom-footer-enabled .elahe-home-footer__nav .elahe-home-footer__menu > li,
  body.elahe-custom-footer-enabled .elahe-home-footer__nav .menu > li,
  body.elahe-custom-footer-enabled .elahe-home-footer__nav .elahe-home-footer__menu > li > a,
  body.elahe-custom-footer-enabled .elahe-home-footer__nav .menu > li > a,
  body.elahe-custom-footer-enabled .elahe-home-footer__cta-button {
    width: 100%;
    max-width: 100%;
  }

  body.elahe-custom-footer-enabled .elahe-home-footer__bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* Very narrow devices: preserve readable gutters without changing design. */
@media (max-width: 380px) {
  .site-header .inside-header,
  .main-navigation .inside-navigation {
    padding-inline: 12px !important;
  }

  body.home .elahe-parchment-section {
    width: calc(100% - 8px) !important;
    max-width: calc(100% - 8px) !important;
    padding-inline: 12px !important;
  }

  body.home .elahe-home-primary-hero h1 {
    font-size: clamp(1.88rem, 9.4vw, 2.3rem);
  }

  body.home .elahe-home-system-signal,
  body.home .elahe-home-system-signal.is-navy,
  body.home .elahe-home-system-signal.is-cream,
  body.home .elahe-home-system-signal.is-olive,
  body.home .elahe-home-system-signal.is-rose {
    padding-inline: 18px;
  }
}
