/* ═══════════════════════════════════════════════════════
   MOBILE-FIRST RESPONSIVE OVERRIDES
   SecurityTransform · v20 · June 2026
   Breakpoints: 480 · 600 · 768 · 1024
   ═══════════════════════════════════════════════════════ */

/* ── Global body fix ── */
html, body {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

/* ── Container fluid padding ── */
.container {
  width: 100%;
  padding-left: clamp(16px, 4vw, 32px);
  padding-right: clamp(16px, 4vw, 32px);
  box-sizing: border-box;
}

/* ════════════════════════════════
   HERO SECTION
   ════════════════════════════════ */
.hero-section,
section.hero,
[class*="hero"] {
  overflow-x: hidden;
}

@media (max-width: 768px) {
  /* Hero grid → stack */
  .hero-grid,
  div[style*="grid-template-columns:1.1fr 1fr"],
  div[style*="grid-template-columns: 1.1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  /* Hero text */
  .hero-content h1,
  .hero h1 {
    font-size: clamp(28px, 7vw, 48px) !important;
    line-height: 1.15 !important;
  }

  /* Hero book image — smaller on mobile */
  .hero-visual img,
  img[src*="book-hero"] {
    width: 220px !important;
    max-width: 70vw !important;
    margin: 0 auto !important;
    display: block !important;
  }

  /* Hero visual — center on mobile */
  .hero-visual {
    display: flex !important;
    justify-content: center !important;
    order: -1 !important;
  }
}

/* ════════════════════════════════
   ALL 2-COLUMN GRIDS → SINGLE COL ON MOBILE
   ════════════════════════════════ */
@media (max-width: 768px) {
  /* Any inline 2-col grid */
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns:repeat(2"],
  .praise-grid,
  .two-col-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* 4-col grids → 2-col on tablet */
  div[style*="grid-template-columns:repeat(4"],
  div[style*="grid-template-columns: repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
  }
}

@media (max-width: 480px) {
  /* 4-col → 1-col on phone */
  div[style*="grid-template-columns:repeat(4"],
  div[style*="grid-template-columns: repeat(4"] {
    grid-template-columns: 1fr !important;
  }

  /* Stat grids */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
}

/* ════════════════════════════════
   PRICING TIER CARDS
   ════════════════════════════════ */
@media (max-width: 900px) {
  .pricing-cards {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
  }
  .tier-card.popular {
    transform: none !important;
  }
}
@media (max-width: 540px) {
  .pricing-cards {
    grid-template-columns: 1fr !important;
  }
}

/* ════════════════════════════════
   PRICING/FEATURE TABLE — horizontal scroll on mobile
   ════════════════════════════════ */
@media (max-width: 768px) {
  .feat-table-wrapper,
  div[style*="overflow-x:auto"] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .feat-table {
    min-width: 640px;
  }
}

/* ════════════════════════════════
   VIDEO EMBEDS
   ════════════════════════════════ */
@media (max-width: 768px) {
  /* Vertical video pair → stack */
  div[style*="grid-template-columns:1fr 1fr"][style*="max-width:720px"],
  div[style*="grid-template-columns: 1fr 1fr"][style*="max-width:720px"] {
    grid-template-columns: 1fr !important;
    max-width: 340px !important;
    margin: 0 auto !important;
  }

  /* Horizontal video — full width */
  div[style*="max-width:900px"] {
    max-width: 100% !important;
  }

  /* Framework page side-by-side videos → stack */
  div[style*="display:flex"][style*="gap:40px"] {
    flex-direction: column !important;
    align-items: center !important;
    gap: 24px !important;
  }
}

/* ════════════════════════════════
   PRAISE & ENDORSEMENT CARDS
   ════════════════════════════════ */
@media (max-width: 768px) {
  /* Praise grid on homepage and /books */
  div[style*="grid-template-columns:1fr 1fr"][style*="max-width:1100px"],
  div[style*="grid-template-columns: 1fr 1fr"][style*="max-width:1100px"] {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* Praiser card footer — stack photo + name */
  div[style*="display:flex"][style*="align-items:center"][style*="gap:16px"],
  div[style*="display:flex"][style*="align-items:center"][style*="gap:14px"] {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }
}

/* ════════════════════════════════
   CONSULTING PAGE
   ════════════════════════════════ */
@media (max-width: 768px) {
  /* Consulting /apply page hero text */
  div[style*="max-width:720px"] h1 {
    font-size: clamp(24px, 6vw, 36px) !important;
  }

  /* Apply page 2-col grid */
  div[style*="grid-template-columns:1fr 1fr"][style*="gap:60px"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  /* Client responsibilities grid */
  div[style*="grid-template-columns:1fr 1fr"][style*="gap:10px"] {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
}

/* ════════════════════════════════
   INSTITUTE CERT CARDS
   ════════════════════════════════ */
.cert-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  max-width: 1300px;
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 1024px) {
  .cert-grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 540px) {
  .cert-grid-4 { grid-template-columns: 1fr !important; }
}

/* ════════════════════════════════
   NAVIGATION — mobile hamburger area
   ════════════════════════════════ */
@media (max-width: 768px) {
  .nav-links {
    gap: 12px !important;
  }
  .nav-links a {
    font-size: 12px !important;
  }
  /* Announcement bar */
  .announcement-bar {
    flex-direction: column !important;
    gap: 6px !important;
    padding: 8px 12px !important;
    text-align: center !important;
  }
}

/* ════════════════════════════════
   TRB — REVIEWER CARDS
   ════════════════════════════════ */
@media (max-width: 768px) {
  .rev-grid,
  div[style*="repeat(auto-fit, minmax(280px"],
  div[style*="repeat(auto-fit,minmax(280px"] {
    grid-template-columns: 1fr !important;
  }
}

/* ════════════════════════════════
   SECTION HEADERS
   ════════════════════════════════ */
@media (max-width: 480px) {
  .section-title {
    font-size: clamp(20px, 6vw, 28px) !important;
  }
  .section-subtitle {
    font-size: 14px !important;
  }
}

/* ════════════════════════════════
   STATS STRIP
   ════════════════════════════════ */
@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .stat-number {
    font-size: clamp(22px, 6vw, 32px) !important;
  }
  .stat-label {
    font-size: 11px !important;
  }
}

/* ════════════════════════════════
   BUTTONS — full width on mobile
   ════════════════════════════════ */
@media (max-width: 480px) {
  .hero-cta,
  div[style*="display:flex"][style*="gap:16px"][style*="flex-wrap:wrap"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .btn, .btn-gold, .btn-cyan {
    text-align: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* ════════════════════════════════
   LARGE FIXED WIDTHS → FLUID
   ════════════════════════════════ */
@media (max-width: 768px) {
  /* Any inline max-width that's too wide */
  div[style*="max-width:1100px"],
  div[style*="max-width:1200px"],
  div[style*="max-width:1300px"],
  div[style*="max-width:900px"],
  div[style*="max-width:1000px"] {
    max-width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
  }
}

/* ════════════════════════════════
   ABOUT PAGE — stat boxes
   ════════════════════════════════ */
@media (max-width: 640px) {
  div[style*="repeat(4,1fr)"][style*="max-width:1000px"],
  div[style*="repeat(4, 1fr)"][style*="max-width:1000px"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
}

/* ════════════════════════════════
   BOOK PAGE — hero + praise
   ════════════════════════════════ */
@media (max-width: 768px) {
  div[style*="grid-template-columns:1fr 1fr"][style*="gap:28px"] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  div[style*="grid-template-columns:1fr 1fr"][style*="gap:24px"] {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
}

/* ════════════════════════════════
   GENERAL OVERFLOW PROTECTION
   ════════════════════════════════ */
/* * max-width removed - breaks mega-menu */
img {
  max-width: 100%;
  height: auto;
}
table {
  max-width: 100%;
}
pre, code {
  overflow-x: auto;
}

/* Mega-menu must not be constrained by max-width rules */
.mega-menu {
  max-width: none !important;
  width: min(1200px, 95vw) !important;
}
