/* ===================================================================
   Lion Leadership — Shared Mobile / Responsive Layer
   Loaded AFTER each page's inline <style>, so rules here win on ties.
   Scope: mobile navigation (hamburger), footer reflow, and the
   standard mobile guardrails. Desktop layout is left untouched.
   =================================================================== */

/* ---- 1. Global guardrails (all viewports) ---------------------- */

/* Kill accidental horizontal scroll without breaking the sticky nav.
   overflow-x: clip (unlike hidden) does NOT create a scroll container,
   so position: sticky on <nav> keeps working. */
html { overflow-x: clip; }
body { overflow-x: clip; }

/* Media never overflows its container. Logos use more specific
   rules (.nav-logo svg / .footer-logo) so they're unaffected. */
img, video { max-width: 100%; height: auto; }

/* Hamburger button — hidden on desktop, shown on mobile (below). */
.nav-toggle {
  display: none;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 10px;
  margin: 0;
  cursor: pointer;
  width: 44px;          /* >= 44px tap target */
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.nav-toggle:focus-visible {
  outline: 2px solid var(--yellow, #F0D87E);
  outline-offset: 2px;
}
.nav-toggle .nav-toggle-bars,
.nav-toggle .nav-toggle-bars::before,
.nav-toggle .nav-toggle-bars::after {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: rgba(246, 246, 246, 0.85);
  transition: transform 200ms ease, opacity 150ms ease;
}
.nav-toggle .nav-toggle-bars { position: relative; }
.nav-toggle .nav-toggle-bars::before { position: absolute; top: -7px; left: 0; }
.nav-toggle .nav-toggle-bars::after  { position: absolute; top:  7px; left: 0; }

/* Animate bars into an "X" when the menu is open. */
nav.is-open .nav-toggle .nav-toggle-bars { background: transparent; }
nav.is-open .nav-toggle .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
nav.is-open .nav-toggle .nav-toggle-bars::after  { transform: translateY(-7px) rotate(-45deg); }

/* ---- 2. Mobile layout (<= 768px) ------------------------------- */
@media (max-width: 768px) {

  /* Show the hamburger. */
  .nav-toggle { display: inline-flex; }

  /* Closed state: the inline rule already sets .nav-links { display:none }.
     We reveal it as a full-width drop panel only when nav.is-open is set.
     Higher specificity (nav.is-open .nav-links) guarantees the override. */
  nav.is-open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;

    position: absolute;
    top: 100%;               /* drop just below the sticky bar */
    left: 0;
    right: 0;
    width: 100%;

    background: var(--navy, #252B37);
    border-bottom: 2px solid var(--yellow, #F0D87E);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.32);

    padding: 8px 0 14px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }

  /* Each top-level item is a full-width, comfortably tappable row. */
  nav.is-open .nav-links > li {
    width: 100%;
    border-bottom: 1px solid rgba(246, 246, 246, 0.08);
  }
  nav.is-open .nav-links > li:last-child { border-bottom: 0; }

  nav.is-open .nav-links a {
    display: flex;
    align-items: center;
    min-height: 44px;        /* tap target */
    padding: 12px 24px;
    font-size: 14px;
    color: rgba(246, 246, 246, 0.85);
  }

  /* Dropdowns: drop the desktop hover/absolute behavior. Render the
     sub-items inline, indented, always visible inside the open panel. */
  nav.is-open .nav-dropdown { display: block; }
  nav.is-open .nav-dropdown > a::after { content: ''; margin: 0; }
  nav.is-open .nav-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: block;
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.18);
    border: 0;
    box-shadow: none;
  }
  nav.is-open .nav-dropdown-menu a {
    padding-left: 40px;       /* visual nesting */
    font-size: 13px;
    color: rgba(246, 246, 246, 0.65);
  }

  /* The Contact CTA reads as a button-row inside the panel. */
  nav.is-open .nav-links .nav-cta {
    margin: 10px 20px 4px;
    min-height: 44px;
    justify-content: center;
    color: var(--navy, #252B37) !important;
    background: var(--yellow, #F0D87E);
    border-radius: 2px;
  }

  /* Stop iOS from auto-zooming when a form field is focused. */
  input, select, textarea { font-size: 16px; }

  /* ---- Footer reflow ---- */
  /* Bottom row (legal + social, incl. logo/EKG) stacks instead of
     fighting for space on one line. */
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
  .footer-social { flex-wrap: wrap; gap: 14px 16px; }
  .footer-social a { min-height: 32px; display: inline-flex; align-items: center; }
}

/* ---- 3. Small phones (<= 480px) -------------------------------- */
@media (max-width: 480px) {
  /* The 6-col footer grid collapses to 2 cols by 768px in the inline
     CSS; on narrow phones give each column its own full-width row so
     titles and links stop cramping. */
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 28px 24px;
  }
  .footer-tagline { max-width: none; }
}
