/* ATF responsive header + popup. Geometry only; no content or brand changes.
 * Header adapted from d79986b (Staging A); footer intentionally excluded.
 * Activate only after Daniel's final approval. */
@media (min-width: 768px) and (max-width: 1024px) {
  body.atf-responsive-header-popup-active .elementor-location-header.elementor-233 .elementor-element-ab1f12b {
    width: 100% !important;
    max-width: none !important;
    min-height: 90px !important;
    height: auto !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center !important;
    gap: 0 !important;
  }

  body.atf-responsive-header-popup-active .elementor-location-header.elementor-233 .elementor-element-229cd45 {
    display: contents !important;
  }

  body.atf-responsive-header-popup-active .elementor-location-header.elementor-233 :is(
    .elementor-element-3e7a8a6,
    .elementor-element-6ab3f45,
    .elementor-element-546cf0d,
    .elementor-element-e31a65b,
    .elementor-element-c6c34af,
    .elementor-element-00835b1,
    .elementor-element-8d44155,
    .elementor-element-534f020
  ) {
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    inset: auto !important;
  }

  body.atf-responsive-header-popup-active .elementor-location-header.elementor-233 .elementor-element-3e7a8a6 {
    grid-column: 1;
    width: 9.75vw !important;
    justify-self: start;
    align-items: center !important;
  }

  body.atf-responsive-header-popup-active .elementor-location-header.elementor-233 .elementor-element-6ab3f45 {
    width: 8.775vw !important;
  }

  body.atf-responsive-header-popup-active .elementor-location-header.elementor-233 .elementor-element-546cf0d {
    grid-column: 2;
    width: auto !important;
    justify-self: stretch;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  body.atf-responsive-header-popup-active .elementor-location-header.elementor-233 .elementor-element-e31a65b {
    width: auto !important;
    position: relative !important;
    display: flex;
    justify-content: center;
  }

  body.atf-responsive-header-popup-active .elementor-location-header.elementor-233 .elementor-element-e31a65b .elementor-nav-menu--dropdown {
    left: 50% !important;
    width: min(calc(100vw - 24px), 560px) !important;
    max-width: calc(100vw - 24px) !important;
    top: 100% !important;
    translate: -50% 0;
  }

  /* Preserve Elementor's opening animation, including in Staging A where
   * the older shell layer may still supply transform: translateX(-50%). */
  body.atf-responsive-header-popup-active .elementor-location-header.elementor-233 .elementor-element-e31a65b .elementor-menu-toggle.elementor-active + .elementor-nav-menu--dropdown {
    transform: scaleY(1);
  }
  body.atf-responsive-header-popup-active .elementor-location-header.elementor-233 .elementor-element-e31a65b .elementor-menu-toggle:not(.elementor-active) + .elementor-nav-menu--dropdown {
    transform: scaleY(0);
  }

  body.atf-responsive-header-popup-active .elementor-location-header.elementor-233 .elementor-element-c6c34af {
    grid-column: 3;
    width: 35vw !important;
    justify-self: end;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
  }

  body.atf-responsive-header-popup-active .elementor-location-header.elementor-233 .elementor-element-00835b1 {
    width: max-content !important;
    min-width: max-content !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
  }
}


/* Short landscape screens: keep the original frame, title and close icon.
 * The video yields vertical space to the title; native controls stay in view.
 * WordPress' admin bar has a separate reserved area (32 / 46 px).
 */
@media (orientation: landscape) and (max-height: 750px) {
  body.atf-responsive-header-popup-active #elementor-popup-modal-3831 {
    --atf-admin-height: 0px;
    --atf-popup-room: calc(100vh - var(--atf-admin-height) - 24px);
    --atf-popup-room: calc(100dvh - var(--atf-admin-height) - 24px);
    /* Elementor can make admin lightboxes sticky; anchor this viewport frame. */
    position: fixed;
    top: 0;
    height: 100vh;
    height: 100dvh;
    padding: calc(var(--atf-admin-height) + 12px) 12px 12px;
    box-sizing: border-box;
  }
  body.admin-bar.atf-responsive-header-popup-active #elementor-popup-modal-3831 {
    --atf-admin-height: 32px;
  }
  body.atf-responsive-header-popup-active #elementor-popup-modal-3831 .dialog-widget-content {
    position: relative;
    margin: 0;
    max-height: var(--atf-popup-room);
  }
  body.atf-responsive-header-popup-active #elementor-popup-modal-3831 .dialog-message,
  body.atf-responsive-header-popup-active #elementor-popup-modal-3831 .elementor-element-9e5e419 {
    max-height: var(--atf-popup-room);
  }
  body.atf-responsive-header-popup-active #elementor-popup-modal-3831 .elementor-element-9e5e419 > .e-con-inner {
    max-height: var(--atf-popup-room);
    min-height: 0;
  }
  body.atf-responsive-header-popup-active #elementor-popup-modal-3831 .atf-video-modal {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-columns: minmax(0, 1fr);
    max-height: calc(var(--atf-popup-room) - 20px);
    min-height: 0;
  }
  body.atf-responsive-header-popup-active #elementor-popup-modal-3831 .elementor-element-d46b226,
  body.atf-responsive-header-popup-active #elementor-popup-modal-3831 .elementor-element-d46b226 > .elementor-widget-container {
    min-height: 0;
    height: 100%;
  }
  body.atf-responsive-header-popup-active #elementor-popup-modal-3831 .atf-video-mount {
    height: 100%;
    width: auto;
    max-width: 100%;
    margin-inline: auto;
  }
}
@media (orientation: landscape) and (max-height: 750px) and (max-width: 782px) {
  body.admin-bar.atf-responsive-header-popup-active #elementor-popup-modal-3831 {
    --atf-admin-height: 46px;
  }
}
