/**
 * HELP4YOU ASBL — Responsive Breakpoint Styles
 * Multi-device QA: 360px, 390px, 414px, 768px, 1024px, 1440px
 */

/* ==========================================================================
   GLOBAL OVERFLOW & VIEWPORT DEFENSE
   ========================================================================== */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after {
  box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6, p, span, a, li, blockquote, td, th {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

img, svg, picture, video, iframe {
  max-width: 100%;
  height: auto;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--space-4);
}

.table-responsive table {
  width: 100%;
  min-width: 100%;
}

/* ==========================================================================
   DESKTOP & LARGE SCREENS (>= 1200px)
   ========================================================================== */
@media (min-width: 1200px) {
  .hero-title {
    font-size: 3.125rem;
  }
}

/* ==========================================================================
   LAPTOP & TABLET HORIZONTAL (<= 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  :root {
    --text-5xl: 2.35rem;
    --text-4xl: 2rem;
    --text-3xl: 1.65rem;
    --space-16: 3.5rem;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
  }

  .credibility-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   TABLET VERTICAL (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  :root {
    --text-5xl: 2rem;
    --text-4xl: 1.75rem;
    --text-3xl: 1.45rem;
    --text-2xl: 1.25rem;
    --space-16: 3rem;
    --space-12: 2rem;
    --header-height: 72px;
  }

  .nav-desktop {
    display: none !important;
  }

  .nav-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .hero-image-wrapper img {
    height: 300px;
  }

  .hero-floating-card {
    position: static;
    margin-top: var(--space-4);
    max-width: 100%;
    left: auto;
    bottom: auto;
  }

  .program-split-panel {
    grid-template-columns: 1fr;
  }

  .program-panel-media {
    min-height: 240px;
  }

  .program-panel-content {
    padding: var(--space-6);
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
    gap: var(--space-3);
  }

  .footer-bottom-links {
    justify-content: center;
  }

  .btn-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 12px;
    align-items: stretch;
  }

  .btn-group .btn,
  .btn-group .btn-pill-primary {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    text-align: center;
    white-space: normal;
    box-sizing: border-box;
  }

  .donation-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .amount-selector {
    grid-template-columns: repeat(2, 1fr);
  }

  .board-grid,
  .former-board-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/* ==========================================================================
   MOBILE PHONES (<= 480px / 360px Minimum Support)
   ========================================================================== */
@media (max-width: 480px) {
  :root {
    --text-5xl: 1.65rem;
    --text-4xl: 1.45rem;
    --text-3xl: 1.3rem;
    --text-2xl: 1.15rem;
    --header-height: 68px;
  }

  .container {
    padding-left: 16px;
    padding-right: 16px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .section {
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
  }

  .hero {
    padding-top: var(--space-6);
    padding-bottom: var(--space-8);
  }

  .hero-title {
    font-size: 1.65rem !important;
    line-height: 1.25 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto;
  }

  .hero-content {
    gap: var(--space-3);
  }

  .hero-image-wrapper img {
    height: 220px;
  }

  .credibility-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .card {
    padding: 16px;
    border-radius: var(--radius-lg);
  }

  .form-control {
    font-size: 16px; /* Prevents auto-zoom on iOS */
    padding: 10px 14px;
  }

  .btn,
  .btn-pill-primary {
    padding: 12px 16px;
    font-size: 0.95rem;
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;
  }

  .amount-selector {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .amount-btn {
    padding: 10px 4px;
    font-size: 1rem;
  }

  .iban-display {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    font-size: 0.95rem;
    text-align: center;
    padding: 12px;
  }

  .iban-display .copy-btn {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9rem;
    min-height: 40px;
  }

  .brand-link img {
    height: 46px;
  }

  .nav-btn-donate {
    padding: 6px 12px;
    font-size: var(--text-xs);
  }
}

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

/* Print Optimization */
@media print {
  .site-header,
  .site-footer,
  .btn,
  .nav-toggle,
  .mobile-nav-drawer {
    display: none !important;
  }

  body {
    background: #FFFFFF;
    color: #000000;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }
}
