/* Site-wide responsive foundation */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    overflow-x: clip;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: clip;
    overflow-x: hidden;
    min-width: 0;
    width: 100%;
}

main {
    width: 100%;
    min-width: 0;
    overflow-x: clip;
    overflow-x: hidden;
}

img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

.max-w-7xl,
section,
footer,
nav,
header {
    min-width: 0;
}

/* Headings without explicit Tailwind size utilities */
h1:not([class*="text-"]) {
    font-size: clamp(2rem, 6vw, var(--heading-size, 3rem));
    line-height: 1.1;
    word-break: break-word;
}

h2:not([class*="text-"]) {
    font-size: clamp(1.5rem, 4.5vw, 2.5rem);
    line-height: 1.15;
}

h3:not([class*="text-"]) {
    font-size: clamp(1.25rem, 3.5vw, 1.875rem);
}

/* Scrollable regions */
.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* ── Mobile (≤640px) ── */
@media (max-width: 640px) {
    .section-header {
        margin-bottom: 2rem !important;
    }

    .section-header h2 {
        font-size: clamp(1.5rem, 5vw, 2rem) !important;
    }

    .section-header p {
        font-size: 1rem !important;
    }

    /* Card & band padding */
    .premium-card.p-8,
    .premium-card.p-10,
    .premium-card.p-12,
    .quote-card.p-10,
    .quote-card.p-14,
    .stat-card.p-8,
    .stat-card.p-10,
    .feature-card.p-8,
    .feature-card.p-10 {
        padding: 1.5rem !important;
    }

    .cta-band.p-12,
    .cta-band.p-16,
    .booking-band,
    .volunteer-band,
    .newsletter-box,
    .donation-panel {
        padding: 2rem 1.5rem !important;
    }

    /* Hero — account for fixed navbar */
    .hero-section .hero-slide-content,
    .hero-section > .relative.max-w-7xl {
        padding-top: 6rem !important;
        padding-bottom: 4.5rem !important;
    }

    .hero-headline,
    .hero-section h1 {
        font-size: clamp(1.875rem, 8vw, 2.75rem) !important;
    }

    .hero-subheadline,
    .hero-section > .relative.max-w-7xl > .max-w-3xl > p {
        font-size: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    .hero-ctas,
    .hero-section .flex.flex-wrap.gap-4 {
        flex-direction: column;
        width: 100%;
    }

    .hero-ctas a,
    .hero-section .flex.flex-wrap.gap-4 a {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1.5rem !important;
        font-size: 1rem !important;
    }

    /* Stats bento — single column on mobile */
    .stats-bento-hero {
        min-height: 180px !important;
    }

    .stats-bento .stats-value.text-5xl {
        font-size: 2.25rem !important;
    }

    .stats-bento .stat-card {
        padding: 1.25rem !important;
    }

    /* About image decorative frame */
    .about-image-frame::before {
        inset: -6px -6px 6px 6px;
    }

    /* Logo / integration strips */
    .integration-logo,
    .logos-strip .logo-item {
        min-width: 0 !important;
        flex: 1 1 calc(50% - 0.75rem);
        max-width: 100%;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        font-size: 0.875rem !important;
    }

    .logos-strip {
        gap: 0.75rem !important;
    }

    /* Contact & split layouts */
    .grid.lg\:grid-cols-2.gap-16 {
        gap: 2.5rem !important;
    }

    /* Footer */
    footer {
        margin-top: 3rem !important;
    }

    footer .py-16 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    footer .gap-12 {
        gap: 2rem !important;
    }

    /* Navbar */
    .nav-site-name {
        max-width: 9rem;
        font-size: 1rem !important;
    }

    #navbar .h-20 {
        height: 4rem;
    }

    /* Vision pillars wrap */
    .pillar-tag {
        padding: 0.5rem 1rem !important;
        font-size: 0.875rem !important;
    }

    /* Donation amount buttons */
    .donation-amount {
        padding: 0.625rem 1rem !important;
        font-size: 1rem !important;
    }

    /* Testimonials featured card */
    .testimonials-featured {
        padding: 1.5rem !important;
    }

    /* CTA split stacks on mobile */
    .cta-split {
        grid-template-columns: 1fr !important;
    }
}

/* ── Very small phones ── */
@media (max-width: 380px) {
    .nav-site-name {
        max-width: 6.5rem;
        font-size: 0.875rem !important;
    }
}

/* ── Touch devices: disable hover transforms ── */
@media (hover: none), (pointer: coarse) {
    .tilt-card {
        transform: none !important;
    }

    .hover-fx-on .premium-card:hover,
    .hover-fx-on .feature-card:hover,
    .hover-fx-on .event-card:hover {
        transform: none;
    }
}

/* ── Safe area (notched phones) ── */
@supports (padding: max(0px)) {
    .cookie-consent {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .whatsapp-float {
        bottom: max(1.5rem, env(safe-area-inset-bottom));
        right: max(1.5rem, env(safe-area-inset-right));
    }
}
