/* ============================================================
 * AEREDIUM Mobile Safety Layer
 * Universal defensive rules that prevent broken mobile layouts.
 * Designed to be additive — included AFTER each page's own styles.
 *
 * All content-affecting rules are scoped to (max-width: 900px) so they
 * never affect desktop layout. The site renders identically to before
 * on screens 901px and wider.
 * ============================================================ */

/* Prevent horizontal scrolling at the body level — safe on all viewports */
html, body { overflow-x: hidden; }

/* On mobile only: apply the defensive rules */
@media (max-width: 900px) {
  html, body { max-width: 100%; }

  /* Force every element to honor the viewport */
  * { max-width: 100%; }

  /* SVGs and images become fluid — never wider than their container */
  img, svg, video, iframe, canvas {
    max-width: 100%;
    height: auto;
  }

  svg[width] { width: 100%; max-width: 100%; }

  /* Long words / URLs / addresses don't push the layout */
  p, h1, h2, h3, h4, h5, h6, li, blockquote {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Tables become responsive — wrap in scroll container if too wide */
  table { display: block; max-width: 100%; overflow-x: auto; }

  /* Pre/code blocks scroll horizontally rather than break the layout */
  pre, code {
    white-space: pre-wrap;
    word-wrap: break-word;
  }
}

/* ============================================================
 * INJECTED MOBILE NAV STYLES
 * Used by mobile-nav.js for pages that don't have their own
 * hamburger menu. Self-contained — no dependencies.
 * ============================================================ */

.ae-mobile-nav-btn {
  display: none;
  width: 44px; height: 44px;
  padding: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
}
.ae-mobile-nav-btn span {
  display: block; width: 24px; height: 1.5px;
  background: #fff; margin: 5px auto;
  transition: all 0.25s ease;
}
.ae-mobile-nav-btn[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.ae-mobile-nav-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.ae-mobile-nav-btn[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.ae-mobile-nav-panel {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(3, 14, 26, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  padding: 80px 24px 32px;
  overflow-y: auto;
}
.ae-mobile-nav-panel.open { display: block; }
.ae-mobile-nav-panel a {
  display: block;
  padding: 18px 8px;
  font-size: 18px;
  font-family: 'Outfit', -apple-system, sans-serif;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
}
.ae-mobile-nav-panel a:hover,
.ae-mobile-nav-panel a.active { color: #00CCFF; }

body.ae-menu-open { overflow: hidden; }

/* Show the hamburger on mobile.
   Also hide the legacy nav-cta buttons (White Paper / Contact)
   on mobile so the hamburger has room. They're still accessible
   via the drawer. */
@media (max-width: 900px) {
  .ae-mobile-nav-btn { display: block !important; }
  /* Legacy pages use .nav-cta for their right-side CTAs */
  .main-nav .nav-cta,
  nav.main-nav > a.nav-cta { display: none !important; }
  /* Ensure the nav itself is relatively positioned so the absolute hamburger anchors correctly */
  nav.main-nav, nav.nav, nav.ae-nav { position: relative; }
}

/* On desktop, hide the injected hamburger and panel (page's own nav handles it) */
@media (min-width: 901px) {
  .ae-mobile-nav-btn,
  .ae-mobile-nav-panel { display: none !important; }
}
