/* Overrides only the public interface. Existing Elementor design remains authoritative. */
body.lido-ui-fixes .elementor .elementor-image-gallery .gallery-item img {
  height: auto !important;
  max-width: 100%;
}

/* Replace the B&B gallery's negative outside margin with the same internal gap.
   Preserve Elementor's original one/two/three-column responsive breakpoints. */
body.lido-ui-fixes .elementor-270 .elementor-element.elementor-element-5a22475 #gallery-1 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 29px;
  margin: 0;
}
body.lido-ui-fixes .elementor-270 .elementor-element.elementor-element-5a22475 #gallery-1 .gallery-item {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}
@media (min-width: 480px) {
  body.lido-ui-fixes .elementor-270 .elementor-element.elementor-element-5a22475 #gallery-1 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 768px) {
  body.lido-ui-fixes .elementor-270 .elementor-element.elementor-element-5a22475 #gallery-1 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
/* Long legal-policy URLs must wrap within their original text column. */
body.lido-ui-fixes .elementor-535 .elementor-element.elementor-element-5379675 {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.lido-ui-fixes .elementor a.lido-contact-link {
  color: inherit;
  text-underline-offset: .2em;
}
body.lido-ui-fixes .elementor a.lido-contact-link:hover {
  text-decoration: underline;
}
body.lido-ui-fixes :where(a, button, input, select, textarea, [role="button"]):focus-visible {
  outline: 3px solid #087b95 !important;
  outline-offset: 4px;
  box-shadow: 0 0 0 2px #fff;
}
body.lido-ui-fixes .elementor .lido-unavailable-social {
  display: none !important;
}
body.lido-ui-fixes .elementor-widget-video video[data-lido-video] {
  max-width: 100%;
}

/* Posts and archives have no Elementor header; supply usable native navigation. */
body.lido-native-page .site-footer { display: block !important; }
body.lido-native-page:not(.lido-legal-page) .entry-title { display: block !important; }
body.lido-native-page .lido-native-nav {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  max-width: 1140px;
  margin: 0 auto;
  padding: 24px;
}
body.lido-native-page .lido-native-nav img { width: 220px; height: auto; }
body.lido-native-page .lido-native-nav-links { display: flex; flex-wrap: wrap; gap: 20px; }
body.lido-native-page .lido-native-nav a { color: #090042; text-underline-offset: .2em; }

/* HFE's tablet breakpoint is 1024px. Do not change desktop header colors. */
@media (max-width: 1024px) {
  body.lido-ui-fixes .elementor-832 .elementor-element.elementor-element-db0cecf .elementor-heading-title {
    font-size: clamp(36px, 11vw, 112px);
  }
  body.lido-ui-fixes .hfe-nav-menu__breakpoint-tablet .hfe-nav-menu__toggle {
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #fff;
  }
  body.lido-ui-fixes .hfe-nav-menu__breakpoint-tablet .hfe-nav-menu-icon,
  body.lido-ui-fixes .hfe-nav-menu__breakpoint-tablet .hfe-nav-menu-icon svg {
    color: #090042 !important;
    fill: #090042 !important;
  }
  /* A closed, invisible but static menu was increasing the home page width. */
  body.lido-ui-fixes .hfe-nav-menu__breakpoint-tablet .hfe-nav-menu__toggle[aria-expanded="false"] ~ nav.hfe-dropdown {
    display: none !important;
  }
  /* HFE hides closed submenus with height:0 but leaves overflowing children.
     Its keyboard path sets inline visibility without adding sub-menu-open. */
  body.lido-ui-fixes .hfe-nav-menu__breakpoint-tablet nav.hfe-dropdown .sub-menu:not(.sub-menu-open):not([style*="visibility: visible"]),
  body.lido-ui-fixes .hfe-nav-menu__breakpoint-tablet nav.hfe-dropdown .sub-menu[style*="visibility: hidden"] {
    display: none !important;
  }
  body.lido-ui-fixes .hfe-nav-menu__breakpoint-tablet nav.hfe-dropdown {
    background-color: #fff !important;
    max-height: 75vh;
    max-height: 75dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  body.lido-ui-fixes .hfe-nav-menu__breakpoint-tablet nav.hfe-dropdown .hfe-menu-item,
  body.lido-ui-fixes .hfe-nav-menu__breakpoint-tablet nav.hfe-dropdown .hfe-sub-menu-item {
    color: #090042 !important;
  }
  body.lido-ui-fixes .hfe-nav-menu__breakpoint-tablet nav.hfe-dropdown :is(.current-menu-item, .current-menu-ancestor) > .hfe-menu-item,
  body.lido-ui-fixes .hfe-nav-menu__breakpoint-tablet nav.hfe-dropdown a:hover,
  body.lido-ui-fixes .hfe-nav-menu__breakpoint-tablet nav.hfe-dropdown a:focus-visible {
    color: #090042 !important;
    background-color: #edf7fa !important;
    text-decoration: underline;
    text-underline-offset: .2em;
  }
}

/* Self-contained recovery page; the HTTP status remains 404. */
body.lido-ui-fixes .lido-404 {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  color: #090042;
  font-family: Montserrat, system-ui, sans-serif;
}
body.lido-ui-fixes .lido-404-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: clamp(40px, 10vw, 100px);
}
body.lido-ui-fixes .lido-404-nav img { width: 220px; height: auto; }
body.lido-ui-fixes .lido-404-nav-links,
body.lido-ui-fixes .lido-404-actions { display: flex; flex-wrap: wrap; gap: 20px; }
body.lido-ui-fixes .lido-404 a { color: #090042; text-underline-offset: .2em; }
body.lido-ui-fixes .lido-404 h1 { font-size: clamp(30px, 5vw, 54px); line-height: 1.15; }
body.lido-ui-fixes .lido-404 p { max-width: 660px; line-height: 1.7; }
body.lido-ui-fixes .lido-404 .lido-404-button {
  display: inline-block;
  padding: 12px 20px;
  border: 1px solid #090042;
  border-radius: 6px;
  text-decoration: none;
}
body.lido-ui-fixes .lido-404 .lido-404-button-primary { background: #090042; color: #fff; }
body.lido-ui-fixes .lido-404-contact { margin-top: 40px; overflow-wrap: anywhere; }
