/* ============================================================
   GolfBet — phone layer (Sept 2026 mobile pass).

   Linked LAST on the marketing pages (index, features,
   affiliates, content-creation, support) so it wins the cascade
   over each page's inline <style> at equal specificity.

   CONTRACT: every layout rule here lives inside
   @media (max-width: 767.98px). Outside that query this file only
   hides the mobile-nav elements that nav.js injects, so desktop
   and tablet render exactly as before.
   Page-specific phone rules live at the end of each page's own
   <style> block.
   ============================================================ */

/* Injected by nav.js — never shown above the phone breakpoint. */
.nav-toggle,
.m-sheet { display: none; }

@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .m-sheet { transition: none !important; }
}

@media (max-width: 767.98px) {
  :root {
    --m-gutter: 20px;
    /* display type that fits a 320px screen */
    --display-hero: clamp(30px, 9.2vw, 44px);
    --display-section: clamp(26px, 7.6vw, 34px);
    --display-title: clamp(19px, 5.4vw, 22px);
    --display-stat: clamp(26px, 7.4vw, 32px);
  }

  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  /* The pages use overflow-x:hidden on html/body, which turns <body> into a
     scroll container and stops nav.bar from sticking. clip hides the same
     overflow without creating a scroll container, so the nav (and the menu
     button) stays reachable while scrolling. Browsers without clip keep the
     old hidden value. */
  html, body { overflow-x: clip; }
  img, video, svg { max-width: 100%; }
  img { height: auto; }

  /* ---------- ticker ---------- */
  .top-ticker { font-size: 10px; }
  .ticker-track { gap: 28px; padding: 8px 0; }

  /* ---------- nav ---------- */
  nav.bar {
    height: 60px;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
  .brand { padding: 0 16px; border-right: none; min-height: 44px; }
  .gmark { width: 32px; height: 32px; }
  .gb-wordmark { font-size: 22px; }

  /* No-JS fallback: links scroll sideways inside the bar. */
  .nav-links {
    margin: 0 8px 0 auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    min-width: 0;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { white-space: nowrap; }
  /* With JS the links move into the sheet. */
  .has-mnav .nav-links { display: none; }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    margin: 0 10px 0 auto;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--rule-strong);
    border-radius: 10px;
    background: transparent;
    color: var(--paper-50);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-toggle:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }
  .nav-toggle-bars { position: relative; display: block; width: 18px; height: 12px; }
  .nav-toggle-bars span {
    position: absolute; left: 0; right: 0;
    height: 2px; border-radius: 2px;
    background: currentColor;
    transition: transform .2s ease, opacity .15s ease, top .2s ease;
  }
  .nav-toggle-bars span:nth-child(1) { top: 0; }
  .nav-toggle-bars span:nth-child(2) { top: 5px; }
  .nav-toggle-bars span:nth-child(3) { top: 10px; }
  .nav-toggle[aria-expanded="true"] { border-color: var(--green-500); color: var(--green-500); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) { top: 5px; transform: rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) { top: 5px; transform: rotate(-45deg); }

  .m-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    top: var(--m-sheet-top, 60px);
    z-index: 49;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: var(--ink-800);
    border-top: 1px solid var(--rule);
    padding: 8px max(var(--m-gutter), env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(var(--m-gutter), env(safe-area-inset-left, 0px));
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease;
  }
  .m-sheet[hidden] { display: none; }
  .m-sheet.is-open { opacity: 1; transform: none; }
  .m-sheet-links { display: flex; flex-direction: column; }
  .m-sheet-links a {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 60px;
    border-bottom: 1px solid var(--rule);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 24px;
    letter-spacing: -0.02em;
    color: var(--paper-50);
  }
  .m-sheet-links a::after {
    content: "→";
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--paper-400);
  }
  .m-sheet-links a.active { color: var(--green-500); }
  .m-sheet-links a.active::after { color: var(--green-500); }
  .m-sheet-links a:focus-visible,
  .m-sheet-actions a:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }
  .m-sheet-actions { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }
  .m-sheet-actions .btn { justify-content: center; width: 100%; }
  .m-sheet-stores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .m-sheet-stores .btn { padding-left: 10px; padding-right: 10px; }
  /* Lock the viewport only: putting overflow on <body> too would make it
     a scroll container and un-stick the sticky nav while the menu is open. */
  html.m-open { overflow: hidden; overscroll-behavior: none; }

  /* ---------- buttons: thumb-sized ---------- */
  .btn { min-height: 48px; justify-content: center; font-size: 15px; }

  /* ---------- sub-page header ---------- */
  header.ph {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: 40px var(--m-gutter) 36px;
  }
  header.ph .crumb { margin-bottom: 16px; flex-wrap: wrap; }
  header.ph .right { max-width: none; }
  header.ph .meta { gap: 10px 20px; margin-top: 18px; }

  /* ---------- section head ---------- */
  .section-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 16px var(--m-gutter);
  }

  /* ---------- metric strip: 2 × 2 ---------- */
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .metric-strip > * { padding: 22px 18px !important; border-left: 1px solid var(--rule) !important; min-width: 0; }
  .metric-strip > :nth-child(odd) { border-left: none !important; }
  .metric-strip > :nth-child(n+3) { border-top: 1px solid var(--rule); }
  .metric-strip > * > :last-child { letter-spacing: 0.1em !important; line-height: 1.45; }

  /* ---------- product screenshots: swipeable row ---------- */
  .screenshot-band { padding: 40px 0 44px; }
  .screenshot-band .shot-copy { padding: 0 var(--m-gutter); margin-bottom: 22px; }
  .screenshot-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 68%;
    gap: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 var(--m-gutter);
    padding: 0 var(--m-gutter) 6px;
    scrollbar-width: none;
  }
  .screenshot-grid::-webkit-scrollbar { display: none; }
  .screenshot-card { scroll-snap-align: start; border-radius: 24px; }
  .screenshot-card img { border-radius: 18px; }
  .screenshot-band .shot-copy h2 { margin-bottom: 12px; }
  .screenshot-band .shot-copy p { font-size: 16px; }
  .screenshot-card .cap { left: 12px; right: 12px; bottom: 12px; flex-direction: column; gap: 2px; }

  /* ---------- closing CTA band ---------- */
  .cta-bar { padding: 64px var(--m-gutter) 72px; }
  .cta-bar p { font-size: 16px; }
  .cta-bar .grp { display: flex; flex-direction: column; align-items: stretch; width: 100%; }

  /* ---------- footer ---------- */
  footer {
    padding: 48px var(--m-gutter) max(28px, env(safe-area-inset-bottom, 0px));
    font-size: 15px;
  }
  .foot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 20px;
    padding-bottom: 28px;
  }
  .foot-brand { grid-column: 1 / -1; }
  .foot-brand .gb-wordmark { font-size: 30px; }
  .foot-grid h4 { margin-bottom: 6px; }
  .foot-grid ul { gap: 0; }
  .foot-grid a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
  .foot-bottom { flex-direction: column; gap: 10px; line-height: 1.6; }
}
