/* ════════════════════════════════════════════════════════════════
   LEGION XII — mobile.css
   Mobile optimisation patch — does NOT override desktop styles.
   Loaded after style.css and subpages.css.
════════════════════════════════════════════════════════════════ */

/* ── 1. NAV — hide old dropdown nav on mobile, show hamburger ──── */
@media (max-width: 640px) {
  .nav__links { display: none !important; }   /* always hidden on mobile */
  .nav__hamburger { display: flex; z-index: 10000; position: relative; }
  .nav__hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .nav__hamburger.open span:nth-child(2) { opacity: 0; }
  .nav__hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
}

/* ── MOBILE FULL-SCREEN MENU ─────────────────────────────── */
/* Always present in DOM; JS sets display/visibility directly */
.mobile-menu {
  display: none;           /* JS overrides this on open */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: #0e1118;
  z-index: 99999;
}

/* When open class is present (added by JS) */
.mobile-menu.open {
  display: flex !important;
}

@media (max-width: 640px) {
  /* Visible state — toggled by JS (already handled above) */

  /* Close button top-right */
  .mobile-menu__close {
    position: absolute;
    top: 18px;
    right: 20px;
    background: none;
    border: none;
    color: var(--parchment);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    z-index: 10001;
  }

  /* Nav container — centered column */
  .mobile-menu__nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
    padding: 0 var(--s6);
  }

  /* Section label ("About Us", "Get Involved") */
  .mobile-menu__group-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--gold);
    text-transform: uppercase;
    margin: 28px 0 10px;
  }

  /* Individual links */
  .mobile-menu__link {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--parchment);
    text-decoration: none;
    text-transform: uppercase;
    padding: 8px 0;
    transition: color 0.15s ease;
  }

  .mobile-menu__link:hover,
  .mobile-menu__link:active {
    color: var(--gold);
  }

  /* Thin gold divider before Follow Us / Give */
  .mobile-menu__divider {
    width: 40px;
    height: 1px;
    background: rgba(201,168,76,0.35);
    margin: 20px 0 16px;
  }

  /* Give CTA button */
  .mobile-menu__give {
    margin-top: 18px;
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--parchment);
    background: var(--crimson);
    padding: 12px 40px;
    border-radius: 4px;
    transition: background 0.15s ease;
  }

  .mobile-menu__give:hover,
  .mobile-menu__give:active {
    background: var(--crimson-bright);
  }
}


/* ── 2. HERO — background & logo on mobile ───────────────────── */
@media (max-width: 768px) {
  /* Remove the scale() zoom that crops the photo on portrait screens.
     Use background-size: contain so the full photo is always visible,
     with a dark fallback colour behind it. */
  .hero__photo-bg {
    transform: none;
    background-size: cover;
    background-position: 60% center;  /* shift left so men are centred */
  }
  /* Prevent the hero text (DRIFTING) from overflowing on narrow screens */
  .line-stop,
  .line-drifting {
    font-size: clamp(3rem, 14vw, 6rem) !important;
  }
}

@media (max-width: 400px) {
  .hero-logo {
    width: clamp(100px, 28vw, 140px);
    height: clamp(100px, 28vw, 140px);
  }
  .hero {
    padding-top: var(--s24);
    padding-bottom: var(--s16);
  }
}

/* ── 3. CHOICE SECTION — divider & spacing fixes ────────────── */
@media (max-width: 960px) {
  .choice__header {
    margin-bottom: var(--s10);
  }

  /* Divider becomes a thin horizontal line with OR centred */
  .choice__divider {
    flex-direction: row;
    padding-top: 0;
    height: auto;
    padding-block: var(--s4);
  }
  .divider-line {
    width: auto;
    height: 1px;
    flex: 1;
  }

  /* Columns get comfortable padding on tablet */
  .choice__col {
    padding: var(--s6);
  }
}

@media (max-width: 640px) {
  .choice__col {
    padding: var(--s5) var(--s4);
  }
  .choice__cta {
    margin-top: var(--s8);
  }
}

/* ── 4. ROADMAP — node & card alignment on mobile ───────────── */
@media (max-width: 960px) {
  .roadmap__item,
  .roadmap__item--right {
    grid-template-columns: auto 1fr;
    gap: var(--s4);
  }

  /* Node always in column 1, card always in column 2 */
  .roadmap__item .roadmap__node,
  .roadmap__item--right .roadmap__node {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    align-self: start;
    margin-top: var(--s1);
  }

  .roadmap__item .roadmap__card,
  .roadmap__item--right .roadmap__card {
    grid-column: 2;
    grid-row: 1;
  }

  .roadmap__node {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }

  .roadmap__card {
    padding: var(--s5) var(--s6);
  }

  .roadmap__track {
    gap: var(--s6);
  }
}

@media (max-width: 480px) {
  /* On very small screens, stack node above card */
  .roadmap__item,
  .roadmap__item--right {
    grid-template-columns: 1fr;
  }
  .roadmap__item .roadmap__node,
  .roadmap__item--right .roadmap__node {
    grid-column: 1;
    grid-row: 1;
  }
  .roadmap__item .roadmap__card,
  .roadmap__item--right .roadmap__card {
    grid-column: 1;
    grid-row: 2;
  }
}

/* ── 5. IMPACT BAR — padding fix on mid-sizes ───────────────── */
@media (max-width: 800px) {
  .impact-bar__item {
    padding: 0 var(--s5);
  }
}

@media (max-width: 640px) {
  .impact-bar__item {
    padding: 0;
  }
}

/* ── 6. PULL-QUOTE — prevent min-width overflow ─────────────── */
@media (max-width: 640px) {
  .pull-quote--with-photo .pull-quote__content p {
    min-width: 0;
    width: 100%;
  }
  .pull-quote--with-photo {
    padding: var(--s5) var(--s4);
  }
}

/* ── 7. STEPS — step number width on very small screens ──────── */
@media (max-width: 400px) {
  .step {
    grid-template-columns: 60px 1fr;
    gap: var(--s4);
  }
  .step__num {
    font-size: var(--text-xl);
  }
}

/* ── 8. FOOTER BRAND — prevent overflow on very small screens ── */
@media (max-width: 400px) {
  .footer__brand {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer__emblem {
    width: 52px;
    height: 52px;
  }
}

/* ── 9. TRAINS SECTION — quote card on mobile ───────────────── */
@media (max-width: 960px) {
  .trains__quote {
    margin-top: var(--s6);
    width: 100%;
  }
}

/* ── 10. GENERAL — prevent any horizontal scroll ────────────── */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* ── SUBPAGE HEROES — remove zoom, fix title on mobile ──────── */
@media (max-width: 768px) {
  /* Remove scale() zoom on all subpage hero backgrounds */
  .au-hero--founding::before,
  .au-hero--martyrs::before,
  .au-hero--plan::before,
  .au-hero--plan .au-hero__face-blur {
    transform: none;
    inset: 0;
  }

  /* Title text: cap size so it never overflows on portrait */
  .au-hero__title {
    font-size: clamp(2.8rem, 13vw, 5.5rem) !important;
  }

  /* Body text sections: comfortable padding on narrow screens */
  .au-letter__inner,
  .au-founders .container,
  .au-martyrs__inner {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  /* Founder grid: single column on mobile */
  .au-founders__grid--three {
    grid-template-columns: 1fr !important;
  }

  /* Constitution articles: more readable on small screens */
  .au-constitution__articles {
    gap: 1.5rem;
  }
}

/* ── 11. PATH SECTION — road SVG on mobile ──────────────────── */
@media (max-width: 640px) {
  .path-section__road {
    display: none;
  }
}

/* ── 12. FAQ TEASER — padding on mobile ─────────────────────── */
@media (max-width: 640px) {
  .faq-teaser {
    padding-block: clamp(var(--s16), 8vw, var(--s24));
  }
  .faq-teaser__preview {
    gap: var(--s5);
    margin-bottom: var(--s10);
  }
}
