/* METALEX HOME POPUP — isolated styles; no effect on the existing homepage. */
#mxHomePopup[hidden],
#mxHomePopup [hidden] { display: none !important; }

#mxHomePopup, #mxHomePopup * { box-sizing: border-box !important; }

#mxHomePopup {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 2147483647 !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
  padding: 22px !important;
  padding-top: max(22px, env(safe-area-inset-top, 0px)) !important;
  padding-bottom: max(22px, env(safe-area-inset-bottom, 0px)) !important;
  background: rgba(6, 20, 38, var(--mx-popup-dim, .48)) !important;
  -webkit-backdrop-filter: blur(var(--mx-popup-blur, 3px));
  backdrop-filter: blur(var(--mx-popup-blur, 3px));
  isolation: isolate;
  opacity: 0;
  transition: opacity 210ms ease;
}
#mxHomePopup.mx-home-popup-visible { opacity: 1; }

#mxHomePopup .mx-home-popup-panel {
  position: relative !important;
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: none;
  border-radius: var(--mx-popup-radius, 26px);
  background: #fff;
  box-shadow: 0 26px 90px rgba(0, 12, 32, .30), 0 3px 14px rgba(0, 12, 32, .12);
  transform: translateY(9px) scale(.992);
  transition: transform 240ms cubic-bezier(.16,1,.3,1);
}
#mxHomePopup.mx-home-popup-visible .mx-home-popup-panel { transform: translateY(0) scale(1); }

/* Image-only mode is automatically sized to the upload's aspect ratio in JS.
   This ensures tiny original images do not display as tiny popups. */
#mxHomePopup.mx-home-popup-image-only .mx-home-popup-panel {
  width: var(--mx-popup-image-width, 680px);
  height: var(--mx-popup-image-height, 570px);
}
#mxHomePopup .mx-home-popup-media {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}
#mxHomePopup .mx-home-popup-image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0;
  object-fit: contain;
  border: 0;
  border-radius: 0;
}

/* WITT-inspired wide, balanced split-card layout, with Metalex styling. */
#mxHomePopup.mx-home-popup-has-copy .mx-home-popup-panel {
  display: grid;
  grid-template-columns: 46% minmax(0, 54%);
  width: min(var(--mx-popup-split-width, 980px), 100%);
  height: min(var(--mx-popup-split-height, 590px), calc(100dvh - 44px));
}
#mxHomePopup.mx-home-popup-has-copy .mx-home-popup-image {
  object-fit: var(--mx-popup-split-fit, cover);
  object-position: var(--mx-popup-image-position, center center);
}
#mxHomePopup .mx-home-popup-content {
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  overflow: auto;
  overscroll-behavior: contain;
  background: #fff;
  font-family: 'Archivo', Arial, sans-serif;
  line-height: 1.5;
}
#mxHomePopup .mx-home-popup-copy {
  width: 100%;
  padding: 64px clamp(28px, 4vw, 55px) 42px;
  text-align: left;
}
#mxHomePopup .mx-home-popup-eyebrow {
  color: #2b5a9e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  line-height: 1.6;
  text-transform: uppercase;
  margin-bottom: 16px;
}
#mxHomePopup .mx-home-popup-heading {
  color: #0b2545;
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(30px, 3.3vw, 43px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.025em;
  margin: 0 0 16px;
}
#mxHomePopup .mx-home-popup-subtitle {
  color: #00a6b8;
  font-size: clamp(17px, 2vw, 22px);
  font-weight: 700;
  line-height: 1.38;
  margin: 0 0 18px;
}
#mxHomePopup .mx-home-popup-description {
  font-size: 15px;
  line-height: 1.65;
  font-weight: 400;
  color: #46576b;
  margin: 0 0 24px;
}
#mxHomePopup .mx-home-popup-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 45px;
  margin-top: 12px;
  padding: 11px 24px;
  border-radius: 100px;
  text-decoration: none;
  background: #0b2545;
  color: #fff;
  font: 700 14px/1.3 'Archivo', Arial, sans-serif;
  transition: background .2s ease, transform .2s ease;
}
#mxHomePopup .mx-home-popup-cta:hover { background: #2b5a9e; transform: translateY(-1px); }
#mxHomePopup .mx-home-popup-cta:focus-visible { outline: 3px solid #00acc1; outline-offset: 3px; }

/* Quiet close icon inside top-right of the popup, no large floating ring. */
#mxHomePopup .mx-home-popup-close {
  position: absolute !important;
  top: 18px !important;
  right: 18px !important;
  z-index: 3 !important;
  display: grid !important;
  place-items: center !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  transform: none !important;
  background: rgba(242, 245, 248, .93) !important;
  color: #15365f !important;
  box-shadow: none !important;
  cursor: pointer !important;
  -webkit-tap-highlight-color: transparent;
  transition: background .18s ease, color .18s ease;
}
#mxHomePopup .mx-home-popup-close:hover { background: #e1e9ee !important; }
#mxHomePopup .mx-home-popup-close svg { display: block; width: 18px; height: 18px; pointer-events: none; }
/* Keep the icon quiet when focus is initially set by JS. Show a focus ring
   only after the visitor starts navigating with the keyboard. */
#mxHomePopup .mx-home-popup-close:focus-visible { outline: none !important; }
#mxHomePopup.mx-popup-keyboard-mode .mx-home-popup-close:focus-visible {
  outline: 2px solid #00acc1 !important;
  outline-offset: 2px;
}
#mxHomePopup.mx-home-popup-image-only .mx-home-popup-close {
  background: rgba(255,255,255,.91) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.12) !important;
}

@media (max-width: 700px) {
  #mxHomePopup { padding: 14px !important; padding-top: max(14px, env(safe-area-inset-top, 0px)) !important; padding-bottom: max(14px, env(safe-area-inset-bottom, 0px)) !important; }
  #mxHomePopup .mx-home-popup-close { top: 12px !important; right: 12px !important; width: 34px !important; height: 34px !important; min-width: 34px !important; }
  #mxHomePopup .mx-home-popup-close svg { width: 17px; height: 17px; }
  #mxHomePopup.mx-home-popup-has-copy .mx-home-popup-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(180px, 42%) minmax(0, 1fr);
    width: min(440px, 100%);
    height: min(730px, calc(100dvh - 28px));
  }
  #mxHomePopup.mx-home-popup-has-copy .mx-home-popup-image { object-position: var(--mx-popup-image-position, center center); }
  #mxHomePopup .mx-home-popup-copy { padding: 24px 25px 30px; }
  #mxHomePopup .mx-home-popup-heading { font-size: clamp(25px, 7.6vw, 33px); }
  #mxHomePopup .mx-home-popup-subtitle { font-size: 17px; }
  #mxHomePopup .mx-home-popup-description { font-size: 14px; }
}
@media (max-width: 370px) {
  #mxHomePopup .mx-home-popup-copy { padding: 18px 18px 24px; }
  #mxHomePopup.mx-home-popup-has-copy .mx-home-popup-panel { grid-template-rows: minmax(170px, 37%) minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  #mxHomePopup, #mxHomePopup .mx-home-popup-panel, #mxHomePopup .mx-home-popup-cta { transition: none !important; }
}
