/* mobile-nav.css — Hamburger + off-canvas drawer + mobile-only polish.
 * Loaded after v3.css so it overrides where needed.
 */

/* ── Hamburger button (hidden on desktop, visible ≤880px via media query) ── */
.v3-topnav-burger {
  display: none;
  width: 44px; height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  border-radius: 8px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.v3-topnav-burger:hover { background: rgba(36,36,36,0.06); }
.v3-topnav-burger:focus-visible { outline: 2px solid #fd5924; outline-offset: 2px; }
.v3-topnav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #242424;
  border-radius: 2px;
  transition: transform 0.22s cubic-bezier(0.22,1,0.36,1), opacity 0.15s ease;
}
.v3-topnav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.v3-topnav-burger.open span:nth-child(2) { opacity: 0; }
.v3-topnav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Drawer scrim + sheet ───────────────────────────────────────────────── */
.v3-mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(13,12,16,0.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s linear 0.22s;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.v3-mobile-drawer[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.22s ease, visibility 0s linear 0s;
}
.v3-mobile-drawer-sheet {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(360px, 86vw);
  background: #f6f6f3;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: -20px 0 60px rgba(13,12,16,0.18);
}
.v3-mobile-drawer[aria-hidden="false"] .v3-mobile-drawer-sheet {
  transform: translateX(0);
}

.v3-mobile-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(36,36,36,0.08);
  flex: 0 0 auto;
}
.v3-mobile-drawer-logo {
  display: inline-flex; align-items: center;
}
.v3-mobile-drawer-logo img { height: 36px; display: block; }
.v3-mobile-drawer-close {
  width: 44px; height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #242424;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.v3-mobile-drawer-close:hover { background: rgba(36,36,36,0.06); }
.v3-mobile-drawer-close:focus-visible { outline: 2px solid #fd5924; outline-offset: 2px; }

.v3-mobile-drawer-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 0 24px;
  overflow-y: auto;
}
.v3-mobile-drawer-nav a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 16px 24px;
  font-family: 'Fira Sans', system-ui, sans-serif;
  font-size: 22px;
  letter-spacing: -0.015em;
  font-weight: 500;
  color: #242424;
  text-decoration: none;
  border-bottom: 1px solid rgba(36,36,36,0.06);
  transition: background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.v3-mobile-drawer-nav a:hover { background: rgba(36,36,36,0.03); }
.v3-mobile-drawer-nav a.active { color: #fd5924; font-weight: 600; }
.v3-mobile-drawer-num {
  font-family: 'Fira Mono', ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(36,36,36,0.45);
  min-width: 22px;
}
.v3-mobile-drawer-nav a.active .v3-mobile-drawer-num { color: rgba(253,89,36,0.7); }

.v3-mobile-drawer-foot {
  flex: 0 0 auto;
  padding: 16px 20px 24px;
  border-top: 1px solid rgba(36,36,36,0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.v3-mobile-drawer-cta {
  width: 100%;
  display: block;
  padding: 14px 18px;
  background: #242424;
  color: #f6f6f3;
  border: 0;
  border-radius: 6px;
  font-family: 'Fira Sans', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.v3-mobile-drawer-cta:hover { background: #0d0c10; }
.v3-mobile-drawer-meta {
  font-family: 'Fira Mono', ui-monospace, monospace;
  font-size: 10.5px;
  color: rgba(36,36,36,0.5);
  line-height: 1.5;
  text-align: left;
}

/* Body scroll-lock when drawer is open */
html.v3-nav-open, html.v3-nav-open body {
  overflow: hidden;
  /* prevent layout shift from scrollbar disappearing on desktop preview */
  padding-right: 0;
}

/* ── Visibility breakpoint ─────────────────────────────────────────────── */
@media (max-width: 880px) {
  .v3-topnav-burger { display: inline-flex; }
  /* Hide the desktop Sign-in pill — the CTA lives inside the drawer now. */
  .v3-topnav-actions .signin { display: none; }
  /* Re-balance the topnav so logo and actions sit at the edges. */
  .v3-topnav-inner { grid-template-columns: 1fr auto; padding: 10px 18px; }
  .v3-topnav-logo img { height: 22px; }
}

/* ── Additional mobile polish layered on top of existing v3.css rules ── */
@media (max-width: 720px) {
  /* Big headlines: cap so they don't blow the viewport */
  .v3-hero h1, .v3-rx-hero h1, .v3-cn-hero h1, .v3-cx-hero h1, .v3-pp-hero h1, .v3-ph h1 {
    font-size: clamp(48px, 12vw, 68px) !important;
    line-height: 1.02 !important;
    letter-spacing: -0.03em !important;
    margin-bottom: 24px !important;
  }
  /* Keep the intentional line breaks — "community" gets its own line, etc.
   * `<br>` needs default rendering (no display override) to actually break. */
  .v3-hero h1 br, .v3-rx-hero h1 br, .v3-cn-hero h1 br, .v3-cx-hero h1 br {
    display: initial;
  }
  /* Section h2s — kept impactful, not shrunken to body type */
  .v3-section h2, .v3-pivot h2, .v3-cta h2, .v3-pp h2 {
    font-size: clamp(34px, 8.5vw, 48px) !important;
    line-height: 1.04 !important;
    letter-spacing: -0.025em;
  }
  /* Ledes a touch smaller */
  .v3-section-lede {
    font-size: 15px !important;
    line-height: 1.5;
  }
  /* Operators marquee gets too dense at mobile */
  .v3-operators-track { gap: 24px; }
  /* Section heads stack with proper spacing */
  .v3-section-head { gap: 14px; }
  .v3-section-num { font-size: 11px; }
  /* Footer — single column, tight padding */
  .v3-footer { padding-top: 48px !important; padding-bottom: 32px !important; }
  .v3-footer-meta { flex-direction: column; align-items: flex-start; gap: 12px; }
  /* CTA section block */
  .v3-cta { padding-top: 64px !important; padding-bottom: 64px !important; }
  /* Topnav: a touch tighter still on tiny phones */
  .v3-topnav-inner { padding: 8px 12px; }
  .v3-topnav-logo img { height: 20px; }

  /* === Hero spacing & rhythm on phone ===
   * The hero on phone was cramped: title too tight on small screens, hero-art
   * collage overlapping itself, stat numbers too large, no breathing room
   * between blocks. Settle each row of the hero into its own clear band. */
  .v3-hero { padding-top: 16px !important; padding-bottom: 48px !important; }
  .v3-hero-bar {
    margin-bottom: 24px !important;
    font-size: 10.5px !important;
    gap: 10px !important;
  }
  .v3-hero-lede {
    font-size: 16px !important;
    line-height: 1.55 !important;
    margin: 0 0 24px !important;
  }
  /* Hero CTAs across every page variant — stack vertically on phones so
   * each button gets the full row, lines up neatly with the headline above,
   * and never crops a label mid-word when the copy is long. */
  .v3-hero-actions,
  .v3-ph-cta,
  .v3-cn-hero-cta,
  .v3-cx-hero-cta {
    margin-bottom: 32px !important;
    gap: 10px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100%;
  }
  .v3-hero-actions .primary,
  .v3-hero-actions .secondary,
  .v3-ph-cta .primary,
  .v3-ph-cta .secondary,
  .v3-cn-hero-cta .primary,
  .v3-cn-hero-cta .secondary,
  .v3-cx-hero-cta .primary,
  .v3-cx-hero-cta .secondary {
    width: 100%;
    min-height: 52px;
    padding: 15px 20px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    font-size: 15px !important;
    border-radius: 10px !important;
  }
  .v3-hero-grid {
    gap: 24px !important;
    margin-bottom: 28px !important;
  }
  .v3-hero-stats {
    gap: 20px 14px !important;
    padding-top: 20px !important;
  }
  .v3-hero-stat .n { font-size: 32px !important; line-height: 1.05 !important; }
  .v3-hero-stat .l { font-size: 10px !important; line-height: 1.4 !important; }
}

@media (max-width: 480px) {
  /* Hero stats: collapse 2-col → 1-col only on very narrow screens */
  .v3-hero-stats { gap: 14px; }
  /* Hide the orange-pulse "applications close" stamp on smallest phones */
  .v3-product-pg-media-stamp { font-size: 10px; padding: 4px 8px; }
  /* Buttons should be tappable */
  .v3-cta-btn, .signin, button[class*="-cta"] { min-height: 44px; }
}

/* Print: drawer must not paint anything */
@media print {
  .v3-mobile-drawer, .v3-topnav-burger { display: none !important; }
}

/* Reduced-motion: collapse to fades, no slide */
@media (prefers-reduced-motion: reduce) {
  .v3-mobile-drawer-sheet,
  .v3-topnav-burger span { transition: none; }
}

/* ── Testimonials → horizontal swipe carousel on tablet + mobile ─────────
 * Long quotes don't survive a two-up grid below desktop — cards get cramped
 * and uneven. From ~980px down we swap the grid for a side-scrolling row
 * with snap. Cards widen at tablet (≈ 540px) and tighten on phone (86 vw).
 */
@media (max-width: 980px) {
  .v3-section:has(.v3-testimonials) {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .v3-section:has(.v3-testimonials) .v3-section-head {
    padding-left: 32px;
    padding-right: 32px;
  }

  .v3-testimonials {
    display: flex !important;
    grid-template-columns: none !important;
    flex-wrap: nowrap;
    gap: 16px;
    padding: 4px 32px 28px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 32px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .v3-testimonials::-webkit-scrollbar { display: none; }

  .v3-testimonial {
    flex: 0 0 min(540px, 78%);
    grid-column: auto !important;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    padding: 28px 26px;
    gap: 16px;
    border-radius: 14px;
    box-shadow: 0 1px 0 rgba(36,36,36,0.04), 0 8px 24px rgba(36,36,36,0.04);
  }
  .v3-testimonial:last-child { margin-right: 32px; }

  .v3-testimonial.featured {
    flex: 0 0 min(620px, 86%);
    grid-column: auto !important;
    box-shadow: 0 1px 0 rgba(13,12,16,0.4), 0 8px 24px rgba(13,12,16,0.18);
  }

  .v3-testimonial blockquote {
    font-size: 17px;
    line-height: 1.5;
  }
  .v3-testimonial.featured blockquote {
    font-size: 22px;
    line-height: 1.38;
    letter-spacing: -0.012em;
  }

  .v3-testimonial cite { padding-top: 14px; gap: 12px; }
  .v3-testimonial cite img,
  .v3-testimonial.featured cite img {
    width: 40px; height: 40px;
  }
  .v3-testimonial cite .name { font-size: 13.5px; }
  .v3-testimonial cite .role { font-size: 12px; }

  /* Swipe hint under the section head, before the cards */
  .v3-section:has(.v3-testimonials) .v3-section-lede::after {
    content: 'Swipe to read more →';
    display: block;
    margin-top: 14px;
    font-family: 'Fira Mono', ui-monospace, monospace;
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(36,36,36,0.45);
  }
}

/* Phone tightening — cards bleed closer to the edge, type shrinks a notch. */
@media (max-width: 720px) {
  .v3-section:has(.v3-testimonials) .v3-section-head {
    padding-left: 56px;
    padding-right: 56px;
  }

  .v3-testimonials {
    gap: 14px;
    padding: 4px 16px 24px;
    scroll-padding-left: 16px;
  }

  .v3-testimonial {
    flex: 0 0 88%;
    padding: 24px 22px;
    gap: 14px;
    border-radius: 12px;
  }
  .v3-testimonial:last-child { margin-right: 16px; }
  .v3-testimonial.featured { flex: 0 0 88%; }

  .v3-testimonial blockquote {
    font-size: 16px;
    line-height: 1.5;
  }
  .v3-testimonial.featured blockquote {
    font-size: 19px;
    line-height: 1.4;
  }

  .v3-testimonial .meta { font-size: 10px; letter-spacing: 0.14em; }
  .v3-testimonial cite img,
  .v3-testimonial.featured cite img {
    width: 36px; height: 36px;
  }
  .v3-testimonial cite .name { font-size: 13px; }
  .v3-testimonial cite .role { font-size: 11.5px; }
}
