/* ======================================================================
   CVH Responsive — Global breakpoints
   CVH-MEGA-FINAL B10 | 2026-05-08
   Loaded on all CVH pages via cvh_is_cvh_page() check
   Breakpoints: 320 / 480 / 768 / 1024 / 1440
   ====================================================================== */

/* ---- Global overflow & text protection ---- */
*,*::before,*::after {
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

img, video, iframe, embed, object {
  max-width: 100%;
  height: auto;
}

/* ---- #cvh-cd-page global responsive ---- */
#cvh-cd-page {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

#cvh-cd-page .shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Fixed nav compensation — all CVH pages except Home */
#cvh-cd-page > section:first-child,
#cvh-cd-page > div:first-child,
#cvh-cd-page > header:first-child {
  padding-top: max(80px, env(safe-area-inset-top, 0px) + 80px);
}

/* ---- 1440px+ : large desktop ---- */
@media (min-width: 1440px) {
  #cvh-cd-page .shell { padding: 0 40px; }
}

/* ---- 1024px — standard desktop ---- */
@media (max-width: 1024px) {
  #cvh-cd-page .shell { padding: 0 24px; }
}

/* ---- 768px — tablet ---- */
@media (max-width: 768px) {
  #cvh-cd-page .shell { padding: 0 20px; }

  /* 2-col grids → 1-col */
  #cvh-cd-page [style*="grid-template-columns: 1fr 1fr"],
  #cvh-cd-page [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Font scaling */
  #cvh-cd-page h1 { font-size: clamp(28px, 7vw, 48px); }
  #cvh-cd-page h2 { font-size: clamp(22px, 5vw, 40px); }
}

/* ---- 480px — large mobile ---- */
@media (max-width: 480px) {
  #cvh-cd-page .shell { padding: 0 16px; }

  #cvh-cd-page h1 { font-size: clamp(24px, 8vw, 36px); }
  #cvh-cd-page h2 { font-size: clamp(20px, 6vw, 30px); }

  /* Buttons full-width on small screens */
  #cvh-cd-page .btn,
  #cvh-cd-page .cvh-btn {
    width: 100%;
    justify-content: center;
  }

  /* Cards stack vertically */
  #cvh-cd-page [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  #cvh-cd-page [style*="display:flex"][style*="gap"],
  #cvh-cd-page [style*="display: flex"][style*="gap"] {
    flex-wrap: wrap;
  }
}

/* ---- 320px — smallest supported ---- */
@media (max-width: 320px) {
  #cvh-cd-page .shell { padding: 0 12px; }
  #cvh-cd-page { font-size: 14px; }

  #cvh-cd-page h1 { font-size: 22px; }
  #cvh-cd-page h2 { font-size: 18px; }
}

/* ---- Touch targets (WCAG 2.5.5) ---- */
@media (pointer: coarse) {
  #cvh-cd-page a,
  #cvh-cd-page button {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* ---- Reduce motion ---- */
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
