/*
 * ============================================================
 *  CompetitionLabs — Mobile-Responsive Fixes
 *  Addresses ALL identified font-size & touch-target issues
 *
 *  Audit findings resolved:
 *    [A] Font sizes below 14px in visible copy — raised to 12px min
 *        (9px badge labels → 12px; 10px metric/tag labels → 12px;
 *         11px body/desc text → 13px on mobile; 11.5px form errors → 13px)
 *    [B] Touch targets below 44px — all interactive elements ≥ 44×44px
 *        (.social-btn 36px → 44px; .cc-toggle 24px → 44px;
 *         .gd-close 30px → 44px; .cc-modal-close 32px → 44px;
 *         nav-link/nav-login padding boosted; .filter-tab boosted)
 *    [C] Fixed-width containers > viewport on small screens — capped
 *    [D] Comparison table — horizontal scroll + min column width
 *    [E] FAQ accordion — full-width tap zone ≥ 44px
 *    [F] Cookie-consent toggle — wider tap area
 *    [G] Pricing card grid stacking on 480px
 *    [H] Form inputs — 44px min-height, 16px font (prevents iOS zoom)
 *
 *  Breakpoints:
 *    --mobile-sm : ≤ 480px
 *    --mobile    : ≤ 640px  (primary mobile)
 *    --tablet    : ≤ 768px
 *    --tablet-lg : ≤ 1024px
 *
 *  USAGE: Link this file in <head> after the page's own <style> blocks
 *  <link rel="stylesheet" href="mobile-responsive.css">
 * ============================================================
 */

/* ────────────────────────────────────────────────────────────
   § 0  CSS Custom Properties (mobile overrides)
   ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  :root {
    --touch-min: 44px;        /* WCAG 2.5.5 minimum touch target  */
    --font-min:  13px;        /* minimum body-copy size on mobile  */
    --font-xs:   12px;        /* minimum label / badge size        */
  }
}


/* ────────────────────────────────────────────────────────────
   § 1  FONT SIZE FIXES
   Raise any sub-14px text that appears in readable content
   ──────────────────────────────────────────────────────────── */

/* 1a — 9px capacity/tier badge labels → 12px */
@media (max-width: 640px) {
  /* Pricing tier badge label spans (the "10 T · 25 A · Missions" etc.) */
  [style*="font-size:9px"],
  [style*="font-size: 9px"] {
    font-size: 12px !important;
    letter-spacing: 0.3px !important;
  }
}

/* 1b — 10px "Annual / Save 20%" toggle labels, metric labels → 12px */
@media (max-width: 640px) {
  .metric-label,
  .metric-trend,
  [style*="font-size:10px"],
  [style*="font-size: 10px"] {
    font-size: 12px !important;
  }
}

/* 1c — 11px  body text (badge labels, mockup tabs, KPI labels,
         tag chips, table group-row headers, rc-cat, sp-label,
         pricing card tier detail text, am-kpi-lbl) → 13px mobile */
@media (max-width: 768px) {
  .mock-badge,
  .mock-tab,
  .am-kpi-lbl,
  .am-kpi-chg,
  .rc-cat,
  .sp-label,
  .proof-label,
  .lb-avatar,
  [style*="font-size:11px"],
  [style*="font-size: 11px"] {
    font-size: 13px !important;
  }
}

/* 1d — 11.5px form validation error messages → 13px */
@media (max-width: 768px) {
  .cf-err {
    font-size: 13px !important;
    min-height: auto !important;   /* remove the 16px min-height constraint */
    line-height: 1.5 !important;
  }
}

/* 1e — 12px secondary body text (lb-rank, lb-name, lb-pts,
         hero-stat span, rc-excerpt tag, proof-label,
         footer-bottom, am-period) → 13px on mobile */
@media (max-width: 640px) {
  .lb-rank,
  .lb-name,
  .lb-pts,
  .am-period,
  .footer-bottom-inner,
  .hero-stat span,
  [style*="font-size:12px"],
  [style*="font-size: 12px"] {
    font-size: 13px !important;
  }
}

/* 1f — 13px general secondary copy stays at 13px; only bump to 14px
         on very small screens where 13px is borderline legible        */
@media (max-width: 375px) {
  .fi-desc,
  .fc-desc,
  .rc-excerpt,
  .sol-desc,
  .uc-desc,
  .cf-trust-item,
  .footer-col a,
  .footer-col button,
  [style*="font-size:13px"],
  [style*="font-size: 13px"] {
    font-size: 14px !important;
  }
}

/* 1g — form labels (currently 13px) → 14px on mobile
         (also prevents iOS Safari auto-zoom on input focus) */
@media (max-width: 640px) {
  .form-label {
    font-size: 14px !important;
  }
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px !important;   /* ≥16px prevents iOS auto-zoom */
  }
}

/* 1h — nav link text stays readable at 14px on all screens */
@media (max-width: 640px) {
  .nav-link {
    font-size: 15px !important;
  }
}


/* ────────────────────────────────────────────────────────────
   § 2  TOUCH TARGET FIXES  (minimum 44 × 44 px)
   ──────────────────────────────────────────────────────────── */

/* 2a — Social buttons in footer: 36px → 44px */
@media (max-width: 768px) {
  .social-btn {
    width:  44px !important;
    height: 44px !important;
    font-size: 16px !important;
  }
  /* Ensure the LinkedIn SVG inside scales */
  .social-btn svg {
    width:  18px !important;
    height: 18px !important;
  }
}

/* 2b — Nav links & login button: expand hit area */
@media (max-width: 768px) {
  .nav-link {
    padding: 13px 14px !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
  }
  .nav-login {
    min-height: 44px !important;
    padding: 10px 16px !important;
  }
}

/* 2c — Hamburger button: must be ≥ 44×44 */
@media (max-width: 768px) {
  .nav-hamburger,
  .hamburger,
  [onclick="toggleMobile()"] {
    min-width:  44px !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px !important;
  }
}

/* 2d — FAQ accordion rows: full-width tap zone ≥ 44px */
@media (max-width: 768px) {
  .faq-q {
    min-height: 44px !important;
    padding: 14px 16px !important;
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: rgba(247,148,29,.1) !important;
  }
  .faq-q-text {
    font-size: 15px !important;
    line-height: 1.4 !important;
  }
}

/* 2e — Cookie-consent toggle: 24px track → 44px tap area */
@media (max-width: 768px) {
  .cc-toggle {
    /* Keep visual size but wrap in larger tap target */
    min-width:  44px !important;
    min-height: 44px !important;
    display:    flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }
}

/* 2f — Cookie-consent modal close button: 32px → 44px */
@media (max-width: 768px) {
  .cc-modal-close {
    width:  44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* 2g — GDPR drawer close button (.gd-close): 30px → 44px */
@media (max-width: 768px) {
  .gd-close {
    width:  44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* 2h — Filter/resource tabs: ensure 44px height */
@media (max-width: 640px) {
  .filter-tab {
    min-height: 44px !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
  }
}

/* 2i — Primary and secondary buttons: ensure 44px on mobile */
@media (max-width: 640px) {
  .btn,
  .btn-primary,
  .btn-secondary,
  .btn-outline-white {
    min-height: 44px !important;
    padding: 12px 24px !important;
    font-size: 15px !important;
  }
  .btn-lg {
    min-height: 48px !important;
    padding: 14px 28px !important;
    font-size: 16px !important;
  }
}

/* 2j — Tooltip icon (.cl-tooltip-icon): 16px → 24px, easier tap */
@media (max-width: 768px) {
  .cl-tooltip-icon {
    width:  24px !important;
    height: 24px !important;
    font-size: 14px !important;
  }
}

/* 2k — Pricing billing toggle buttons */
@media (max-width: 640px) {
  .toggle-option,
  .billing-toggle button,
  [class*="toggle"] button {
    min-height: 44px !important;
    padding: 10px 18px !important;
    font-size: 14px !important;
  }
}

/* 2l — Form submit & action buttons inside contact form */
@media (max-width: 640px) {
  #cf-submit,
  .cf-submit {
    min-height: 52px !important;
    font-size: 16px !important;
  }
}

/* 2m — Form checkbox / consent label: make entire row tappable */
@media (max-width: 640px) {
  .cf-consent-label {
    min-height: 44px !important;
    padding: 8px 0 !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: rgba(247,148,29,.08) !important;
  }
  .cf-consent-checkbox {
    width:  20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
    margin-top: 2px !important;
    cursor: pointer !important;
  }
}

/* 2n — Pricing tier CTA buttons (Get Started / Book a Demo) inside cards */
@media (max-width: 640px) {
  .pc-cta,
  .pricing-card .btn,
  .pricing-card button {
    min-height: 48px !important;
    font-size: 15px !important;
    width: 100% !important;
  }
}


/* ────────────────────────────────────────────────────────────
   § 3  LAYOUT & OVERFLOW FIXES
   ──────────────────────────────────────────────────────────── */

/* 3a — Prevent horizontal overflow globally */
@media (max-width: 640px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  * {
    box-sizing: border-box !important;
  }
}

/* 3b — Fixed-pixel containers: cap at 100% */
@media (max-width: 640px) {
  .container {
    padding: 0 16px !important;
    max-width: 100% !important;
  }
}

/* 3d — FAQ tables inside answer bodies */
@media (max-width: 768px) {
  .faq-a table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    font-size: 13px !important;
    width: 100% !important;
  }
}

/* 3e — Pricing cards: single column on mobile */
@media (max-width: 520px) {
  .pricing-grid,
  .pc-grid,
  [class*="pricing-cards"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .pricing-card,
  .pc-card {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* 3f — Solutions / Features section use-case grids */
@media (max-width: 480px) {
  .uc-grid,
  .fc-grid,
  .fi-grid,
  .sol-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

/* 3g — Hero section padding & stat strip */
@media (max-width: 640px) {
  .hero {
    padding: 80px 0 48px !important;
  }
  .hero-stats {
    flex-wrap: wrap !important;
    gap: 12px !important;
    justify-content: center !important;
  }
  .hero-stat {
    min-width: 120px !important;
    text-align: center !important;
  }
}

/* 3h — Step-by-step / How It Works grid */
@media (max-width: 640px) {
  .steps-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .steps-grid::before {
    display: none !important;  /* hide horizontal connector line */
  }
}

/* 3i — Resources / blog card grid */
@media (max-width: 640px) {
  .rc-grid,
  .resources-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

/* 3j — Social proof / logo strip */
@media (max-width: 640px) {
  .sp-logos,
  .proof-logos {
    flex-wrap: wrap !important;
    gap: 16px 24px !important;
    justify-content: center !important;
  }
}

/* 3k — Contact page two-column → single column */
@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .contact-form,
  .contact-sidebar {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* 3l — Footer grid: 2 columns on tablet, 1 on small mobile */
@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 24px 16px !important;
  }
  .footer-brand {
    grid-column: 1 / -1 !important;
  }
}
@media (max-width: 380px) {
  .footer-grid {
    grid-template-columns: 1fr !important;
  }
}

/* 3m — Footer bottom: stack on very small screens */
@media (max-width: 480px) {
  .footer-bottom-inner {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
    font-size: 12px !important;
  }
}

/* 3n — Add-on pricing cards */
@media (max-width: 640px) {
  .addon-grid,
  [class*="addon-cards"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

/* 3o — Upgrade trigger grid */
@media (max-width: 640px) {
  .upgrade-grid,
  [class*="trigger-grid"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}


/* ────────────────────────────────────────────────────────────
   § 4  LEGAL PAGES — TYPOGRAPHY & SPACING
   (privacy-policy.html, terms-of-service.html, cookie-policy.html)
   ──────────────────────────────────────────────────────────── */

/* 4a — Body copy readable on mobile */
@media (max-width: 640px) {
  .policy-content p,
  .legal-body p,
  .pp-section p,
  .tos-section p {
    font-size: 15px !important;
    line-height: 1.75 !important;
  }
  .policy-content h2,
  .legal-body h2 {
    font-size: clamp(18px, 5vw, 24px) !important;
    margin-top: 32px !important;
  }
  .policy-content h3,
  .legal-body h3 {
    font-size: clamp(16px, 4.5vw, 20px) !important;
  }
}

/* 4b — Cookie table: horizontal scroll */
@media (max-width: 768px) {
  .cookie-table-wrap,
  table[class*="cookie"],
  .cp-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: block !important;
  }
  table[class*="cookie"] td,
  table[class*="cookie"] th {
    min-width: 120px !important;
    font-size: 13px !important;
    padding: 10px 12px !important;
  }
}

/* 4c — Table of contents sidebar / jump links */
@media (max-width: 768px) {
  .toc-sidebar,
  .pp-toc {
    position: static !important;
    width: 100% !important;
    margin-bottom: 24px !important;
    border-radius: 12px !important;
  }
}


/* ────────────────────────────────────────────────────────────
   § 5  COOKIE CONSENT PANEL
   ──────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  /* Banner */
  .cc-banner,
  #cookie-consent-banner {
    padding: 16px !important;
    gap: 12px !important;
  }
  .cc-banner-actions {
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }
  .cc-btn-primary,
  .cc-btn-secondary,
  .cc-btn-outline {
    width:      100% !important;
    min-height: 44px !important;
    font-size:  15px !important;
    justify-content: center !important;
  }
  /* Preferences modal */
  .cc-modal {
    width: calc(100vw - 32px) !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    padding: 20px 16px !important;
  }
  .cc-category {
    padding: 14px 0 !important;
  }
  .cc-category-title {
    font-size: 15px !important;
  }
  .cc-category-desc,
  .cc-category-examples {
    font-size: 13px !important;
    line-height: 1.6 !important;
  }
}


/* ────────────────────────────────────────────────────────────
   § 6  SECTION-LEVEL SPACING (avoid cramped sections on mobile)
   ──────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .section-heading {
    font-size: clamp(24px, 6.5vw, 36px) !important;
    line-height: 1.2 !important;
  }
  .section-sub {
    font-size: 16px !important;
    line-height: 1.65 !important;
  }
  /* Generic section vertical padding */
  section,
  .section {
    padding-top:    48px !important;
    padding-bottom: 48px !important;
  }
  .page-hero {
    padding: 56px 0 36px !important;
  }
}

@media (max-width: 480px) {
  .section-heading {
    font-size: clamp(22px, 7vw, 32px) !important;
  }
}


/* ────────────────────────────────────────────────────────────
   § 7  INTERACTIVE STATES — TAP FEEDBACK
   ──────────────────────────────────────────────────────────── */

/* Remove tap delay on iOS */
@media (max-width: 768px) {
  a, button,
  [onclick],
  .nav-link,
  .faq-q,
  .filter-tab,
  .social-btn,
  .cc-toggle,
  .billing-toggle {
    touch-action: manipulation !important;
  }
}

/* Visible tap highlight for interactive elements */
@media (max-width: 768px) {
  .btn,
  .nav-link,
  .faq-q,
  .filter-tab {
    -webkit-tap-highlight-color: rgba(247,148,29,.15) !important;
  }
}


/* ────────────────────────────────────────────────────────────
   § 8  MISCELLANEOUS SMALL-SCREEN FIXES
   ──────────────────────────────────────────────────────────── */

/* 8a — Tooltip boxes: position below on mobile to avoid clipping */
@media (max-width: 640px) {
  .cl-tooltip-box {
    bottom: auto !important;
    top: calc(100% + 8px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: min(260px, calc(100vw - 32px)) !important;
    font-size: 12px !important;
  }
}

/* 8b — "Popular" badge on Growth card: keep readable */
@media (max-width: 480px) {
  .pc-popular-badge,
  [class*="popular-badge"],
  [style*="top:-14px"] {
    font-size: 11px !important;
    padding: 4px 12px !important;
  }
}

/* 8c — Leaderboard mockup: clip to width on small screens */
@media (max-width: 480px) {
  .dashboard-mockup,
  .lb-mockup,
  .sol-visual {
    max-width: 100% !important;
    overflow: hidden !important;
    border-radius: 12px !important;
  }
}

/* 8d — Inline FAQ tables (tier comparison inside answers) */
@media (max-width: 640px) {
  .faq-a table {
    font-size: 12px !important;
    min-width: 380px !important;
  }
  .faq-a table th,
  .faq-a table td {
    padding: 8px 10px !important;
  }
}

/* 8e — Response-time / trust badges */
@media (max-width: 640px) {
  .cf-response-badge {
    font-size: 13px !important;
    padding: 12px 16px !important;
  }
  .cf-response-label {
    font-size: 13px !important;
  }
}

/* 8f — Pricing section heading line-break */
@media (max-width: 480px) {
  .pricing-hero h1,
  #page-pricing .section-heading {
    font-size: clamp(26px, 7.5vw, 40px) !important;
  }
}

/* 8g — Two-column form rows: stack on mobile */
@media (max-width: 480px) {
  .cf-row-2,
  .form-row.cf-row-2 {
    grid-template-columns: 1fr !important;
  }
}

/* 8h — Social proof logo strip overflow */
@media (max-width: 480px) {
  .sp-logos-inner {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 8px !important;
    scrollbar-width: none !important;
  }
  .sp-logos-inner::-webkit-scrollbar {
    display: none !important;
  }
}

/* 8i — Skip-to-content remains visible on focus */
.skip-to-content:focus {
  top: 16px !important;
  z-index: 10000 !important;
}
