/* ==========================================================================
   AMANI KIDS — RESPONSIVE DESIGN SYSTEM (Mobile-First & Pixel-Perfect)
   Structured breakpoints: 1180px, 960px, 768px, 480px, 360px
   Guarantees: Zero horizontal overflow, zero ugly wrapping, flawless touch UX.
   ========================================================================== */

/* Universal Mobile Hardening & Anti-Overflow */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
  position: relative;
}

@media screen and (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important; /* Prevents auto-zoom on iOS */
  }

  .site-header {
    padding-top: max(0.6rem, var(--sat)) !important;
  }
}

/* --------------------------------------------------------------------------
   1. TABLETS & COMPACT LAPTOPS (≤ 1180px)
   Collapse horizontal navbar to sleek mobile drawer to prevent any text wrap.
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .nav-links {
    display: none !important;
  }

  .nav-support-btn,
  .nav-support-link {
    display: none !important;
  }

  .mobile-nav-toggle,
  .mobile-toggle-btn {
    display: flex !important;
  }

  .site-header {
    padding: 0.75rem 1rem;
  }

  .nav-island {
    padding: 0.5rem 1rem;
    max-width: 100%;
  }

  .programs-editorial-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .program-secondary-card {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .program-secondary-thumb {
    width: 100%;
    height: 200px;
  }

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

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }
}

/* --------------------------------------------------------------------------
   2. MEDIUM TABLETS & PHABLETS (≤ 960px)
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: left;
  }

  .hero-media-wrapper {
    max-width: 580px;
    margin: 0 auto;
    width: 100%;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-tag-top {
    right: 0.5rem;
    top: 1rem;
  }

  .challenge-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .founder-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .story-spotlight-grid {
    grid-template-columns: 1fr;
  }

  .mission-vision-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .story-spotlight-media {
    min-height: 300px;
  }

  .process-steps {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .process-steps::before {
    display: none;
  }

  .process-step-item {
    flex-direction: row;
    text-align: left;
    gap: 1.25rem;
    align-items: flex-start;
  }

  .process-number {
    flex-shrink: 0;
    margin-bottom: 0;
    width: 48px;
    height: 48px;
    font-size: 0.95rem;
  }
  .process-grid {
    max-width: 100%;
  }

  .doors-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .photo-mosaic-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 200px;
    gap: 0.75rem;
  }

  .mosaic-span-2x2 {
    grid-column: span 2;
    grid-row: span 1;
  }
}

/* --------------------------------------------------------------------------
   3. STANDARD MOBILE PHONES (≤ 680px)
   Touch-first, clean padding, single column, readable typography.
   -------------------------------------------------------------------------- */
@media (max-width: 680px) {
  :root {
    --header-height: 64px;
  }

  .site-header {
    padding: 0.5rem 0.65rem;
  }

  .nav-island {
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-pill);
  }

  .brand-symbol {
    width: 34px;
    height: 34px;
  }

  .brand-symbol svg {
    width: 18px;
    height: 18px;
  }

  .brand-name {
    font-size: 0.95rem;
    letter-spacing: 0.02em;
  }

  .brand-sub {
    font-size: 0.58rem;
    letter-spacing: 0.08em;
  }

  .lang-selector {
    padding: 0.15rem 0.3rem;
  }

  .lang-btn {
    padding: 0.2rem 0.45rem;
    font-size: 0.7rem;
  }

  .btn-donate,
  .btn-elite-donate {
    padding: 0.42rem 0.85rem;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
  }

  .mobile-nav-toggle {
    width: 38px;
    height: 38px;
  }

  /* Hero Section Mobile */
  .hero-section {
    padding-top: calc(var(--header-height) + 1.5rem);
    padding-bottom: 3.5rem;
    min-height: auto;
  }

  .hero-headline {
    font-size: clamp(1.85rem, 7.2vw, 2.35rem);
    line-height: 1.18;
    margin-bottom: 1.15rem;
    word-break: normal;
    overflow-wrap: break-word;
  }

  .hero-headline .serif-em {
    font-size: 1.05em;
    line-height: 1.14;
    margin-top: 0.05em;
  }

  .hero-lead-text {
    font-size: 1rem;
    line-height: 1.65;
    margin-bottom: 1.75rem;
  }

  .lead-text {
    font-size: 0.975rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.85rem;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 50px;
    font-size: 0.95rem;
  }

  .hero-image-caption {
    padding: 1.25rem 1rem 1rem;
  }
  .hero-image-caption .caption-body {
    font-size: 0.8125rem;
  }

  /* Trust / Credibility Strip */
  .credibility-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 1.25rem 0.5rem;
  }

  .credibility-divider {
    display: none;
  }

  .credibility-item {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-xs);
    border: 1px solid rgba(229, 224, 213, 0.6);
  }

  .credibility-title {
    font-size: 0.85rem;
  }

  .credibility-sub {
    font-size: 0.72rem;
  }

  /* Challenge Section */
  .challenge-cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .challenge-card {
    padding: 1.35rem 1.2rem;
  }

  /* Impact Strip */
  .impact-strip-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .impact-stat-item {
    padding: 1.25rem 1rem;
  }

  .impact-stat-num {
    font-size: 2.5rem;
  }

  /* Gallery Filters & Mosaic */
  .gallery-filter-bar {
    display: flex;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.5rem;
    width: 100%;
  }

  .gallery-filter-bar::-webkit-scrollbar {
    display: none;
  }

  .gallery-filter-btn {
    white-space: nowrap !important;
    flex-shrink: 0;
    font-size: 0.8125rem;
    padding: 0.45rem 0.85rem;
  }

  .photo-mosaic-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 220px;
    gap: 0.75rem;
  }

  .mosaic-span-2x1,
  .mosaic-span-2x2 {
    grid-column: span 1;
    grid-row: span 1;
  }

  /* Forms & Donation Presets */
  .form-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .donation-preset-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .donation-preset-btn {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
  }

  /* Ultra-Premium App-Like Footer on Mobile */
  .site-footer {
    padding-top: 2.75rem;
    padding-bottom: 6.5rem; /* Generous clearance so mobile bottom app bar never covers footer! */
    border-radius: 2rem 2rem 0 0;
  }

  .footer-compact-grid,
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-brand {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-brand p {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .footer-social-strip {
    text-align: center;
    width: 100%;
  }

  .social-links {
    justify-content: center;
  }

  .footer-contact-card {
    padding: 1.5rem;
    border-radius: 1.25rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 1rem;
    padding-top: 1.5rem;
  }

  .footer-bottom-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.25rem;
  }
}

/* --------------------------------------------------------------------------
   4. COMPACT MOBILE PHONES (≤ 440px)
   iPhone SE, iPhone mini, Galaxy A-series (360px – 430px)
   Ensure the header is clean, never squashed or wrapped.
   -------------------------------------------------------------------------- */
@media (max-width: 440px) {
  html {
    font-size: 15px;
  }

  .site-header {
    padding: 0.4rem 0.5rem;
  }

  .nav-island {
    padding: 0.35rem 0.65rem;
  }

  /* Hide the small "Charlotte, NC" subtext on narrow screens to give breathing room */
  .brand-sub {
    display: none;
  }

  /* On narrow screens, hide the header DONATE button to prevent header clutter.
     The big DONATE button is prominent at the top of the mobile drawer and in the hero! */
  .nav-actions .btn-donate {
    display: none;
  }

  .brand-name {
    font-size: 0.9rem;
  }

  .brand-symbol {
    width: 32px;
    height: 32px;
  }

  .credibility-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

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

  .mobile-drawer {
    width: 100vw;
    border-radius: 0;
    padding: max(1rem, var(--sat)) 1rem max(1.25rem, var(--sab));
  }

  .section-title {
    font-size: 1.75rem;
    text-wrap: balance;
  }
}

/* ==========================================================================
   APPLIED-INSPIRED COMPONENTS RESPONSIVE ADAPTATIONS
   ========================================================================== */

/* Tablets & Below (≤ 960px) */
@media (max-width: 960px) {
  .split-rows-container {
    gap: 4.5rem;
  }

  .split-row {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .split-row.reverse {
    direction: ltr !important;
  }

  .split-row.reverse > * {
    direction: ltr !important;
  }

  .split-media-card img {
    height: 380px;
  }

  .conversion-banner-card {
    padding: 4rem 2.5rem;
  }

  .faq-section {
    padding: 4.5rem 0;
  }

  .action-red-grid {
    grid-template-columns: 1fr;
    gap: 2.25rem;
    text-align: center;
  }

  .action-red-lead {
    margin: 0 auto;
  }

  .action-red-buttons {
    align-items: center;
    width: 100%;
  }

  .btn-action-white,
  .btn-action-outline {
    max-width: 100%;
    width: 100%;
  }
}

/* Standard Mobile (≤ 680px) */
@media (max-width: 680px) {
  .partner-ribbon-section {
    padding: 2.25rem 0;
  }

  .partner-ribbon-grid {
    gap: 0.65rem 0.75rem;
  }

  .partner-pill {
    padding: 0.5rem 0.85rem;
    font-size: 0.78rem;
    gap: 0.5rem;
  }

  .split-layout-section {
    padding: 4rem 0;
  }

  .split-rows-container {
    gap: 3.5rem;
  }

  .split-title {
    font-size: clamp(1.65rem, 6.5vw, 2.1rem);
    margin-bottom: 0.35rem;
  }

  .split-subtitle {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  .split-desc {
    font-size: 0.975rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
  }

  .split-checklist {
    gap: 0.75rem;
    margin-bottom: 1.75rem;
  }

  .split-check-item {
    font-size: 0.9rem;
    gap: 0.65rem;
  }

  .split-check-icon {
    width: 20px;
    height: 20px;
  }

  .split-media-card img {
    height: 260px;
  }

  .split-media-badge {
    position: static;
    margin-top: 0.85rem;
    max-width: 100%;
    border-radius: var(--radius-xs);
    box-shadow: 0 4px 14px rgba(30, 58, 47, 0.1);
  }

  /* Resettlement Challenge Mobile */
  .challenge-cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Quick-fire FAQ Mobile */
  .faq-section {
    padding: 4rem 0;
  }

  .faq-accordion {
    margin-top: 2rem;
    gap: 0;
  }

  .faq-question {
    padding: 1.25rem 0.25rem;
    font-size: 1.05rem;
    gap: 1rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .faq-toggle-icon {
    width: 26px;
    height: 26px;
  }

  .faq-answer-inner {
    padding: 0;
    font-size: 0.94rem;
    line-height: 1.65;
  }

  .faq-item.active .faq-answer-inner {
    padding: 0.2rem 0.25rem 1.25rem 0.25rem;
  }

  /* Conversion Banner Mobile */
  .conversion-banner-section {
    padding: 4rem 0;
  }

  .conversion-banner-card {
    padding: 3rem 1.25rem;
    border-radius: var(--radius-lg);
  }

  .conversion-banner-title {
    font-size: clamp(1.85rem, 7vw, 2.4rem);
    margin-bottom: 1rem;
  }

  .conversion-banner-lead {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
  }

  .conversion-buttons {
    flex-direction: column;
    width: 100%;
    gap: 0.85rem;
    margin-bottom: 2rem;
  }

  .conversion-buttons .btn {
    width: 100%;
    min-height: 48px;
  }

  .conversion-assurances {
    flex-direction: column;
    gap: 0.65rem;
    font-size: 0.75rem;
    padding-top: 1.5rem;
  }
}

/* Small Screens (≤ 440px) */
@media (max-width: 440px) {
  .partner-pill {
    width: 100%;
    justify-content: center;
  }

  .split-title {
    font-size: 1.55rem;
  }

  .split-desc {
    font-size: 0.925rem;
  }

  .split-media-card img {
    height: 220px;
  }

  .conversion-banner-card {
    padding: 2.25rem 1rem;
  }

  .conversion-banner-title {
    font-size: 1.65rem;
  }
}

/* ==========================================================================
   5. ANCHOR SCROLL OFFSET & PORTAL RESPONSIVE OVERRIDES
   Ensures clicking "DONATE" or any section anchor clears fixed header perfectly.
   ========================================================================== */
#donate,
#volunteer,
#partner,
#education,
#navigation,
#youth,
#outreach,
#bisakana {
  scroll-margin-top: calc(var(--header-height, 70px) + 1.25rem);
}

@media (max-width: 960px) {
  .donate-split-grid,
  .volunteer-split-grid,
  .partner-split-grid,
  .featured-event-grid,
  .challenge-grid {
    grid-template-columns: 1fr !important;
    gap: 2.25rem !important;
  }
}

@media (max-width: 680px) {
  .form-row-2 {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .donate-card {
    padding: 1.5rem 1.15rem !important;
    border-radius: 1.35rem !important;
  }

  .donation-amount-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
  }

  .donation-preset-btn {
    padding: 0.65rem 0.5rem !important;
    font-size: 1rem !important;
  }

  .frequency-segmented-control {
    grid-template-columns: 1fr !important;
    border-radius: var(--radius-md) !important;
  }

  .frequency-label-pill {
    padding: 0.55rem 0.75rem !important;
    font-size: 0.8125rem !important;
  }

  .donation-trust-badges {
    flex-direction: column;
    gap: 0.65rem;
    align-items: flex-start;
  }

  /* Zelle Responsive Styles */
  .zelle-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .zelle-steps-strip {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  .zelle-detail-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .btn-copy-zelle {
    width: 100%;
    justify-content: center;
  }
}

/* Universal Anti-Overflow Fallback for Any Residual Inline Grids */
@media (max-width: 768px) {
  div[style*="grid-template-columns: 1fr 1.1fr"],
  div[style*="grid-template-columns: 1.1fr 0.9fr"],
  div[style*="grid-template-columns: 0.9fr 1.1fr"],
  div[style*="grid-template-columns: 1.15fr 0.85fr"],
  div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
  }
}

/* Compact Mobile Header Tuning (≤ 480px) */
@media (max-width: 480px) {
  .site-header {
    padding: 0.4rem 0.5rem !important;
  }

  .nav-island {
    padding: 0.35rem 0.55rem !important;
    gap: 0.4rem !important;
  }

  .site-logo-img {
    height: 28px !important;
    max-width: 105px !important;
  }

  .lang-selector {
    padding: 0.15rem 0.3rem !important;
  }

  .btn-elite-donate,
  .btn-donate {
    padding: 0.38rem 0.65rem !important;
    font-size: 0.72rem !important;
    gap: 0.25rem !important;
    letter-spacing: 0.03em !important;
  }

  .btn-elite-donate svg,
  .btn-donate svg {
    display: none !important;
  }

  .mobile-nav-toggle {
    width: 36px !important;
    height: 36px !important;
  }

  .donate-direct-portal,
  .portal-page-section {
    padding-top: calc(var(--header-height, 64px) + 2.5rem) !important;
    padding-bottom: 3rem !important;
  }

  .volunteer-portal-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }

  .partnership-card-standalone,
  .volunteer-card-standalone {
    padding: 1.75rem 1.25rem !important;
    border-radius: 1.5rem !important;
  }
}


