/* primer-responsive.css — shared tablet/mobile breakpoints for all production pages.
   Loaded AFTER each page's inline <style> block so equal-specificity rules win the
   cascade. React components keep their inline styles (Primer-print.html reuses them
   without this sheet), so overrides of inline-styled properties use !important. */

/* ── base hooks (all viewports) ────────────────────────────────────────── */
.p-nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border: none; background: transparent; color: var(--ink);
  align-items: center; justify-content: center;
  border-radius: 999px; flex-shrink: 0;
}
.p-nav-mobile { display: none; }
.p-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* mobile nav panel (rendered by Nav() only while open) */
.p-nav-mobile-link { font-size: 16px; font-weight: 500; color: var(--ink); padding: 13px 14px; border-radius: 12px; }
.p-nav-mobile-link:hover { background: var(--paper-2); }
.p-nav-mobile-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 14px 14px 6px; }
.p-nav-mobile-sub { display: block; font-size: 14.5px; font-weight: 500; color: var(--muted); padding: 9px 14px; border-radius: 10px; }
.p-nav-mobile-sub:hover { color: var(--ink); background: var(--paper-2); }
.p-nav-mobile-actions { display: flex; gap: 10px; padding: 14px 6px 6px; border-top: 1px solid var(--line); margin-top: 10px; }

/* stacked capabilities (rendered by Features() at <=1024px instead of sticky scroll) */
.p-cap-stack { display: flex; flex-direction: column; gap: 56px; }
.p-cap-stack-frame { height: auto; min-height: 320px; padding: 36px 20px; }
/* viz roots carry fixed inline widths (340-360px); force them fluid here */
.p-cap-stack-frame > * { width: 100% !important; max-width: 420px; }

/* ── tablet ────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .p-container { padding: 0 32px; }
  .p-section { padding: 80px 0; }
  .p-display { font-size: 64px; }
  .p-h2 { font-size: 42px; }
  .p-section-head { flex-direction: column; align-items: flex-start; gap: 18px; margin-bottom: 44px; }

  /* nav: drop social icons and their divider */
  .p-social, .p-nav-divider { display: none; }

  /* hero */
  .p-hero-title { font-size: 48px !important; }

  /* dashboard mockup: keep the 3-panel layout, scroll it horizontally */
  .p-mockup-wrap { padding: 40px 32px 80px; overflow-x: auto; -webkit-overflow-scrolling: touch; justify-content: flex-start; }
  .p-mockup { width: 980px; min-width: 980px; }
  .p-mockup--tilt { transform: none !important; animation: none !important; }

  /* how it works */
  .p-steps { grid-template-columns: repeat(2, 1fr); }

  /* capabilities */
  .p-cap-title { font-size: 30px; }

  /* use cases + consultant comparison */
  .p-use-grid { grid-template-columns: repeat(2, 1fr); }
  .p-compare-row { grid-template-columns: 130px 1fr auto 1fr auto; gap: 16px; }
  .p-compare-old { font-size: 24px; }
  .p-compare-new { font-size: 28px; }

  /* faq */
  .p-faq-grid { grid-template-columns: 1fr !important; gap: 48px !important; }

  /* cta */
  .p-cta { padding: 64px 48px; }
  .p-cta-h { font-size: 48px; }

  /* footer */
  .p-footer { padding: 64px 32px 28px; }
  .p-footer-grid { grid-template-columns: 1fr 1fr; gap: 44px 40px; }

  /* pricing */
  .p-plan-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .p-pricing-hero-title { font-size: 44px !important; }

  /* secondary page heroes (contact, insights, post) */
  .p-page-h1 { font-size: 44px !important; }
}

/* ── nav collapse — below ~730px the full link set overflows the pill ──── */
@media (max-width: 768px) {
  .p-nav-links, .p-nav-login { display: none; }
  /* !important beats the inline display:none the component carries for pages
     that don't load this sheet (print/design canvas) */
  .p-nav-toggle { display: inline-flex !important; }
  .p-nav { padding: 8px 8px 8px 18px; }
  .p-nav.flat { padding: 14px 20px; }
  .p-nav-end { gap: 8px; }
  .p-nav-mobile {
    display: flex; flex-direction: column;
    position: absolute; left: 24px; right: 24px; top: calc(100% - 10px);
    background: var(--paper); border-radius: 20px;
    box-shadow: 0 24px 60px -20px rgba(0,0,0,0.3), 0 0 0 1px var(--hairline);
    padding: 10px;
    max-height: calc(100vh - 120px); overflow-y: auto;
  }
}

/* ── mobile ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .p-container { padding: 0 20px; }
  .p-section { padding: 64px 0; }
  .p-display { font-size: 42px; }
  .p-h2 { font-size: 32px; }
  .p-lead { font-size: 17px; }

  .p-nav-wrap { padding: 14px 16px; }
  .p-nav-wrap.flat { padding: 0; }
  .p-nav-mobile { left: 16px; right: 16px; }

  /* hero */
  .p-hero { padding: 56px 0 24px; }
  .p-hero-title { font-size: 34px !important; margin-bottom: 32px !important; }
  .p-hero-title span { padding: 4px 14px 8px !important; border-radius: 12px !important; }
  .p-input { font-size: 16px; } /* 16px minimum prevents iOS focus zoom */
  .p-input-meta { gap: 12px; flex-wrap: wrap; }
  .p-result-stats { flex-wrap: wrap; gap: 18px 24px; }
  .p-samples { align-items: stretch; }
  .p-sample { white-space: normal; text-align: left; justify-content: flex-start; flex-wrap: wrap; }
  .p-trust { gap: 18px 22px; margin-top: 40px; }

  /* dashboard mockup */
  .p-mockup-wrap { padding: 24px 20px 64px; }
  .p-mockup { width: 900px; min-width: 900px; }
  .p-mockup-body { height: 540px !important; }

  /* grids -> single column */
  .p-steps { grid-template-columns: 1fr; }
  .p-use-grid { grid-template-columns: 1fr; }
  .p-cap-title { font-size: 24px; }

  /* consultant comparison -> stacked card per metric */
  .p-compare-row {
    grid-template-columns: auto 1fr;
    grid-template-areas: "label label" "old arrow" "new new" "mag mag";
    gap: 6px 12px;
    padding: 22px 0;
  }
  .p-compare-label { grid-area: label; margin-bottom: 4px; }
  .p-compare-old { grid-area: old; text-align: left; font-size: 20px; }
  .p-compare-arrow { grid-area: arrow; font-size: 16px; align-self: center; justify-self: start; }
  .p-compare-new { grid-area: new; font-size: 26px; }
  .p-compare-mag { grid-area: mag; justify-self: start; margin-top: 6px; }

  /* cta — heading contains non-breaking segments up to ~23 chars, so size it
     to the available width (viewport minus container + cta padding) */
  .p-cta { padding: 48px 20px; border-radius: 20px; }
  .p-cta-h { font-size: clamp(22px, calc((100vw - 80px) / 12), 34px); }
  .p-cta-actions { flex-direction: column !important; align-items: stretch !important; }
  .p-cta-actions .p-btn { justify-content: center; }
  .p-cta-actions .p-mono { margin-left: 0 !important; text-align: center; }

  /* footer */
  .p-footer { padding: 56px 20px 24px; }
  .p-footer-grid { grid-template-columns: 1fr; gap: 32px; padding-bottom: 40px; }
  .p-footer-meta { flex-direction: column; gap: 8px; }

  /* pricing */
  .p-plan-grid { grid-template-columns: 1fr !important; }
  .p-pricing-hero-title { font-size: 34px !important; }
  .p-cmp-table { min-width: 620px; }
  .p-cmp-head-row, .p-cmp-row { grid-template-columns: 1fr repeat(4, 72px); }

  /* secondary page heroes */
  .p-page-h1 { font-size: 32px !important; }
}
