/* Mobile menu (assets/js/mobile-nav.js). Below 768px only; desktop is untouched.
   Two themes: house (navy and gold, Turning Point AI pages) and comic (Fi Studios pages and the game). */

/* Desktop and tablet: nothing from this file shows. */
.mnav-burger, .mnav-panel, .mnav-list, .mbar { display: none; }

@media (max-width: 767.98px) {
  /* ── with scripts: the page's own links give way to the burger ── */
  .mnav-js .mast .mainnav[data-mnav-source] { display: none; }
  .mnav-js .mast .mast-top { padding-right: 60px; }
  .mast[data-mnav] { position: relative; }

  .mnav-burger {
    display: grid; place-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 0; flex-shrink: 0;
    background: transparent; border: 1px solid currentColor; border-radius: 4px; cursor: pointer;
  }
  .mnav-burger span { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 1px; }
  .mnav-burger.mnav-house { position: absolute; top: 12px; right: 20px; color: #D9B65E; }
  .mnav-burger.mnav-house:focus-visible { outline: 2px solid #F2D37A; outline-offset: 3px; }
  .mnav-burger.mnav-comic { color: #111; background: #FFD23F; border: 3px solid #111; border-radius: 0; box-shadow: 3px 3px 0 #111; }
  .mnav-burger.mnav-comic:focus-visible { outline: 3px solid #1F4FBF; outline-offset: 3px; }

  /* the comic header rows make room for the burger */
  .mnav-js .eco[data-mnav] { display: flex; align-items: center; gap: 8px; padding-right: 12px; }
  .mnav-js .eco[data-mnav] nav { flex: 1; min-width: 0; }
  .mbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: #FFF3D6; border-bottom: 2px solid #E63946; }
  .mbar a { color: #111; text-decoration: none; font-weight: 900; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }

  /* ── the panel ── */
  .mnav-panel {
    display: flex; flex-direction: column;
    position: fixed; inset: 0; z-index: 1000; overflow-y: auto; overscroll-behavior: contain;
    visibility: hidden; opacity: 0; transform: translateY(-12px);
    transition: opacity .24s ease, transform .24s ease, visibility 0s linear .24s;
  }
  .mnav-panel.open { visibility: visible; opacity: 1; transform: none; transition: opacity .24s ease, transform .24s ease, visibility 0s; }
  .mnav-lock, .mnav-lock body { overflow: hidden; }

  .mnav-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; min-height: 68px; }
  .mnav-close { position: relative; width: 44px; height: 44px; padding: 0; background: transparent; cursor: pointer; flex-shrink: 0; }
  .mnav-close span { position: absolute; left: 10px; right: 10px; top: 50%; height: 2px; margin-top: -1px; background: currentColor; }
  .mnav-close span:first-child { transform: rotate(45deg); }
  .mnav-close span:last-child { transform: rotate(-45deg); }
  .mnav-links { list-style: none; margin: 0; padding: 8px 20px 32px; }
  .mnav-links a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; text-decoration: none; }

  /* house: navy, gold, Inter capitals */
  .mnav-panel.mnav-house { background: #1C2644; color: #ECE6D9; font-family: Inter, system-ui, sans-serif; }
  .mnav-house .mnav-top { border-bottom: 1px solid #D9B65E; }
  .mnav-house .mnav-title { font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: #D9B65E; }
  .mnav-house .mnav-close { color: #D9B65E; border: 1px solid #D9B65E; border-radius: 4px; }
  .mnav-house .mnav-links li { border-bottom: 1px solid rgba(217, 182, 94, .35); }
  .mnav-house .mnav-links a { color: #ECE6D9; font-family: Inter, system-ui, sans-serif !important; font-size: 17px !important; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
  .mnav-house .mnav-links a.is-current { color: #F2D37A; }
  .mnav-house .mnav-links a.is-current::after { content: "You are here"; font-size: 11px; letter-spacing: .18em; color: #D9B65E; }
  .mnav-house .mnav-links a.is-portal { margin-top: 18px; justify-content: center; border: 1px solid #D9B65E; color: #F2D37A; }
  .mnav-house .mnav-links li:has(a.is-portal) { border-bottom: 0; }
  .mnav-house a:focus-visible, .mnav-house button:focus-visible { outline: 2px solid #F2D37A; outline-offset: 2px; }

  /* comic: cream, ink, Bangers */
  .mnav-panel.mnav-comic { background: #FFF3D6; background-image: radial-gradient(#F3C9A6 1.4px, transparent 1.6px); background-size: 16px 16px; color: #111; font-family: Nunito, system-ui, sans-serif; }
  .mnav-comic .mnav-top { border-bottom: 3px solid #111; background: #FFD23F; }
  .mnav-comic .mnav-title { font-family: Bangers, Impact, sans-serif; font-size: 24px; letter-spacing: .06em; }
  .mnav-comic .mnav-close { color: #111; background: #fff; border: 3px solid #111; box-shadow: 3px 3px 0 #111; }
  .mnav-comic .mnav-links { display: flex; flex-direction: column; gap: 10px; padding-top: 18px; }
  .mnav-comic .mnav-links a { padding: 0 16px; background: #fff; border: 3px solid #111; box-shadow: 4px 4px 0 #111; color: #111;
    font-family: Bangers, Impact, sans-serif; font-size: 26px; letter-spacing: .05em; }
  .mnav-comic .mnav-links a.is-current { background: #FFD23F; }
  .mnav-comic .mnav-links a.is-current::after { content: "YOU ARE HERE"; font-family: Nunito, sans-serif; font-weight: 900; font-size: 11px; letter-spacing: .14em; }
  .mnav-comic .mnav-links a.is-portal { background: #111; color: #FFD23F; }
  .mnav-comic a:focus-visible, .mnav-comic button:focus-visible { outline: 3px solid #1F4FBF; outline-offset: 3px; }

  /* ── without scripts: the links as a simple list ── */
  html:not(.mnav-js) .mast .mainnav { flex-direction: column; align-items: flex-start; gap: 0; }
  html:not(.mnav-js) .mast .mainnav a { padding: 10px 0; }
  html:not(.mnav-js) .mnav-list { display: block; background: #FFF3D6; border-bottom: 3px solid #111; }
  html:not(.mnav-js) .mnav-list ul { list-style: none; margin: 0; padding: 6px 16px 10px; }
  html:not(.mnav-js) .mnav-list a { display: block; padding: 10px 0; color: #111; font-weight: 900; font-size: 16px; text-decoration: none; border-bottom: 1px solid #E8D9B5; }
  html:not(.mnav-js) .mnav-list a[aria-current] { color: #C8202F; }
}

@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
  .mnav-panel, .mnav-panel.open { transition: none; transform: none; }
}
