/* Owner: ClickIt CMO child theme. Consumers: global header's native Menu modules.
 * Divi 5.13 exposes height/overflow on the whole module, but not on its generated
 * dropdown lists. Whole-module overflow clips the closed 38px menu wrapper.
 * Link/Dropdown alternatives require rebuilding the WordPress menu hierarchy.
 * Keep the native menu owner and contain its generated dropdowns here.
 * Remove when equivalent list-level controls and trigger focus styles exist.
 */
#cmo-site-header .et_mobile_menu,
#cmo-site-header .et-menu > li > ul {
  max-height: calc(100vh - 116px);
  max-height: calc(100dvh - 116px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

#cmo-site-header .mobile_menu_bar:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* Owner: ClickIt CMO child theme. Consumers: native Text and Table of Contents links.
 * Divi 5.13's Link Font Focus control generates .et_pb_text_inner:focus a,
 * but keyboard focus belongs to the descendant anchor. The native preset was
 * tested and its ineffective overrides removed. Keep this exception scoped
 * to generated Text and TOC links. TOC List Font Focus likewise targets its
 * nonfocusable .et_pb_table_of_contents__link-text span. The trial was reset.
 * Native Button/Menu/Toggle/Search/Contact focus remains native.
 * Remove when Divi's Link Font Focus control targets a:focus-visible correctly.
 */
#et-boc .et_pb_text_inner a:focus-visible,
#et-boc .et_pb_table_of_contents__link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Owner: ClickIt CMO child theme. Consumers: linked native Image modules.
 * Divi 5.13 Image Focus Border targets .et_pb_image_wrap:focus, but the
 * enclosing anchor receives keyboard focus. The native trial was reset.
 * Two inset rings remain visible inside rounded cards with overflow:hidden
 * and provide contrast against both light and dark image content.
 * Remove when native Image exposes a focus border on the actual anchor.
 */
#et-boc .et_pb_image a:focus-visible .et_pb_image_wrap {
  outline: 2px solid #061427;
  outline-offset: -2px;
}
#et-boc .et_pb_image a:focus-visible img {
  outline: 2px solid #F4B857;
  outline-offset: -4px;
}

/* Owner: ClickIt CMO child theme. Consumer: desktop native Menu dropdowns.
 * Owner-approved match to the live menu: 360px panel, 15px semibold links,
 * 12px/18px link padding and the original soft shadow. Divi 5.13's Dropdown
 * Menu controls expose colors, not separate list width, spacing or typography.
 * Colors remain native; WordPress retains menu labels, hierarchy and links.
 * Remove when equivalent dropdown-level design controls become available.
 */
@media (min-width: 981px) {
  #cmo-site-header .et_pb_menu .et-menu > li > ul {
    width: 360px;
    padding: 12px 0;
    box-shadow: 0 18px 42px rgba(6, 20, 38, 0.18);
  }
  #cmo-site-header .et_pb_menu .et-menu > li > ul > li {
    width: 100%;
    padding: 0;
    display: block;
  }
  #cmo-site-header .et_pb_menu .et-menu > li > ul > li > a {
    width: 100%;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    white-space: normal;
  }
}

/* Owner: child theme; consumers: non-blog native Buttons explicitly marked
 * cmo-aligned-action. Divi 5.13's tested native flex layout emits alignment
 * declarations and et_flex_module, but the Button remains inline-block.
 * This one display declaration enables those existing native alignment values.
 * Heights, responsive sizing, colors, radius, focus and hover remain native.
 * No homepage/blog button carries this class. Remove when native Button flex
 * display works without this correction. */
#main-content .et_pb_button.cmo-aligned-action {
  display: inline-flex;
}

/* Rosie / reCAPTCHA coexistence. Third-party fixed UI is outside Divi layout.
 * Owner: ClickIt CMO child-theme maintainer. Keep the Google badge unmodified.
 * Reserve its bottom 90px only on pages where its badge is present.
 */
body:has(.grecaptcha-badge) .sitegpt-toggle-button[data-sitegpt-id="430938054159499856"] {
  bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important;
}
body:has(.grecaptcha-badge) .sitegpt-tooltip[data-sitegpt-id="430938054159499856"] {
  bottom: calc(168px + env(safe-area-inset-bottom, 0px)) !important;
}
body:has(.grecaptcha-badge) .sitegpt-floating-iframe[data-sitegpt-id="430938054159499856"] {
  bottom: calc(164px + env(safe-area-inset-bottom, 0px)) !important;
  max-height: calc(100dvh - 184px - env(safe-area-inset-bottom, 0px)) !important;
}
@media (max-width: 600px) {
  body:has(.grecaptcha-badge) .sitegpt-floating-iframe[data-sitegpt-id="430938054159499856"] {
    bottom: calc(90px + env(safe-area-inset-bottom, 0px)) !important;
    right: 12px !important;
    width: calc(100% - 24px) !important;
    height: calc(100dvh - 110px - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px)) !important;
    max-height: calc(100dvh - 110px - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px)) !important;
    border-radius: 12px !important;
  }
}
