/* ── Global horizontal overflow prevention ── */
html { overflow-x: hidden; }

/* ── Inline multi-column grids: collapse to single column on mobile ──
   Targets anonymous div[style] grids that have no class to hook into    */
@media (max-width: 768px) {

  div[style*="grid-template-columns:repeat(2"],
  div[style*="grid-template-columns: repeat(2"],
  div[style*="grid-template-columns:repeat(3"],
  div[style*="grid-template-columns: repeat(3"],
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Named grid classes with inline column overrides */
  .tool-grid[style],
  .partner-cards-grid[style] {
    grid-template-columns: 1fr !important;
  }

  /* Role-selection cards in experiment */
  div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* One-Q section: stack text and demo columns */
  .one-q__inner { grid-template-columns: 1fr !important; }

  /* Pricing page "Four reasons" grid: collapse to 1 column */
  .bc-grid { grid-template-columns: 1fr !important; }
  .bc-item { border-right: none !important; border-bottom: 1px solid var(--gray-200) !important; }
  .bc-item:last-child { border-bottom: none !important; }

  /* Demo thumbnail cards: render full screenshot image, no fixed height crop */
  .demo-thumb-card { height: auto !important; }
  .demo-thumb-card img { height: auto !important; width: 100% !important; }

  /* Comparison table section: hide on mobile (too wide to render usefully) */
  #compare-section { display: none !important; }

  /* Geoskop partner strip: stack logos above text on mobile */
  .geoskop-logo-strip { flex-direction: column !important; align-items: flex-start !important; }
  .geoskop-logo-strip > div:last-child { border-left: none !important; padding-left: 0 !important; border-top: 1px solid #ddd; padding-top: 12px; width: 100%; }

  /* Reduce section padding on mobile */
  .section { padding: 48px 0; }
  .hero { padding: 48px 0; }

  /* Prevent images overflowing their containers */
  img { max-width: 100%; }

  /* CTA bands */
  .cta-band { padding: 48px 24px; text-align: center; }
  .cta-band h2 { font-size: clamp(22px, 5vw, 32px); }
  .cta-band p { font-size: 16px; }
  .cta-band .btn { width: 100%; justify-content: center; }

  /* Quote page sidebar collapses */
  .page { grid-template-columns: 1fr !important; }
  .sidebar { display: none; }
}

/* Testimonials: hide page-indicator dots on mobile (prev/next arrows remain) */
@media (max-width: 600px) {
  .testi-dot { display: none !important; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }

  /* Footer links stack */
  .footer__inner { grid-template-columns: 1fr !important; }

  /* Tier grids */
  .tiers-grid { grid-template-columns: 1fr !important; }
}

/* ── 2026-10-22: overflow fixes ── */

/* Dashboard/KV hero image bleeds to 115% by design; clamp it in the tablet
   band (769-1100px) where the bleed pushes the page wider than the viewport.
   Below 769px .hero__graphic is already hidden. */
@media (max-width: 1100px) {
  .hero__graphic img { width: 100% !important; max-width: 100% !important; }
}

/* Inline min-width on flex children (co-design sprint, institutional
   deployment, key-benefit cards) exceeds the container on small phones. */
@media (max-width: 640px) {
  [style*="min-width:340px"],
  [style*="min-width:320px"],
  [style*="min-width: 340px"],
  [style*="min-width: 320px"] {
    min-width: 0 !important;
    /* flex:1 alone would let these share one row once min-width is gone,
       squeezing each to ~120px. Force a full-width basis so they stack. */
    flex-basis: 100% !important;
  }
}

/* partnerships.html lockup: marks + text sit in one flex row with a fixed
   min-width on the text and no shrink on the marks, which together exceed a
   phone viewport. Stack them and bound the logos by height. */
@media (max-width: 640px) {
  .partner-lockup { flex-direction: column !important; align-items: flex-start !important; gap: 16px !important; }
  .partner-lockup__marks {
    flex-shrink: 1 !important;
    flex-wrap: wrap !important;
    max-width: 100% !important;
    border-right: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 14px !important;
    border-bottom: 1px solid var(--gray-300, #D1D5DB) !important;
  }
  .partner-lockup__logo { height: 32px !important; width: auto !important; max-width: 100% !important; }
  .partner-lockup__text { min-width: 0 !important; flex: 1 1 100% !important; }
  .partner-block { padding: 24px 18px !important; }
}

/* contact.html / fr/contact.html: grid children default to min-width:auto,
   so the sidebar and form refuse to shrink below ~357px and the page
   overflows on 320-360px phones. */
@media (max-width: 640px) {
  .contact-inner { grid-template-columns: 1fr !important; }
  .contact-inner > * { min-width: 0 !important; }
  .contact-sidebar, .contact-form-wrap { min-width: 0 !important; }
  .contact-detail, .contact-sidebar__body { overflow-wrap: anywhere; }
  .contact-form-wrap input, .contact-form-wrap textarea, .contact-form-wrap select { max-width: 100% !important; }
}

/* testimonials.html / fr/testimonials.html case studies.
   The block is capped at max-width:80% at every size, and each row is a flex
   pair of a fixed 68px icon column and the text. On a 390px phone that left
   the text in a ~178px column floating in the middle of the screen.
   On phones: drop the cap, shrink the icon, and give the text its own line. */
@media (max-width: 768px) {
  [style*="max-width:80%"] { max-width: 100% !important; }
  [style*="flex-shrink:0; width:68px"] { width: 56px !important; }
  [style*="flex-shrink:0; width:68px"] > img { width: 56px !important; height: 56px !important; }
  [style*="flex-shrink:0; width:68px"] ~ [style*="flex:1"] { flex: 1 1 100% !important; }
}
