/* ============================================================
   RESPONSIVE STYLESHEET - Sikh Sanjh Welfare Foundation
   Breakpoints:
     • ≤ 991px : Tablet & below
     • ≤ 767px : Mobile (large)
     • ≤ 575px : Mobile (small)
     • ≤ 380px : Tiny phones
   ============================================================ */


/* ===== TABLET & BELOW (≤ 991px) ===== */
@media (max-width: 991.98px) {

    /* Body scales down slightly on smaller screens */
    body {
        font-size: 17px;
    }

    /* Release sticky about column so it flows naturally */
    .about-sticky {
        position: static;
        top: auto;
    }

    /* Hero image card overlay should not poke outside viewport */
    .hero-card {
        left: 0;
        max-width: 200px;
    }

    /* Section padding breathes a bit less */
    .section {
        padding: clamp(52px, 7vw, 84px) 0;
    }

    /* Footer transparency row stacks cleanly */
    .footer-transparency {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    /* Impact grid reduces card padding */
    .impact-card {
        padding: 32px 28px 28px;
    }

    /* Donate img card no longer offset hard to the left */
    .donate-img-card {
        left: 0;
    }

    /* Contact form a bit tighter */
    .contact-form {
        padding: 30px 28px;
    }

    .sanjh-donation-wpforms .wpforms-field-container,
    .sanjh-contact-wpforms .wpforms-field-container {
        grid-template-columns: 1fr 1fr;
    }

    .sanjh-donation-wpforms .sanjh-donation-name,
    .sanjh-contact-wpforms .sanjh-contact-name,
    .sanjh-contact-wpforms .sanjh-contact-email,
    .sanjh-contact-wpforms .sanjh-contact-type,
    .sanjh-contact-wpforms .sanjh-contact-message {
        grid-column: 1 / -1;
    }

    .sanjh-donation-wpforms .sanjh-donation-country-code,
    .sanjh-contact-wpforms .sanjh-contact-country-code {
        grid-column: 1;
    }

    .sanjh-donation-wpforms .sanjh-donation-phone,
    .sanjh-contact-wpforms .sanjh-contact-phone {
        grid-column: 2;
    }
}


/* ===== MOBILE (≤ 767px) ===== */
@media (max-width: 767.98px) {

    body {
        font-size: 16px;
    }

    /* Navbar toggle icon mobile positioning */
    .navbar {
        padding: 12px 14px;
    }

    .navbar-toggler {
        width: 36px !important;
        height: 36px !important;
        border-width: 2px !important;
    }

    .navbar-toggler-icon {
        background-size: 20px 20px !important;
    }

    /* Top strip - hide dividers if things wrap */
    .topstrip {
        font-size: 0.75rem;
    }

    .topstrip .py-2 {
        gap: 8px !important;
    }

    /* Navbar toggle already handled above */

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

    .brand-tagline {
        font-size: 0.62rem;
        letter-spacing: 0.08em;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
    }

    .brand-mark img {
        width: 40px !important;
        height: 40px !important;
    }

    /* Hero */
    .hero {
        padding: 24px 0 56px;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 2.6rem);
    }

    .hero-lede {
        font-size: 1rem;
        margin-bottom: 26px;
    }

    .hero-eyebrow {
        font-size: 0.7rem;
        margin-bottom: 18px;
    }

    .hero-stats {
        gap: 22px;
        padding-top: 22px;
    }

    .hero-stat-value {
        font-size: 1.4rem;
    }

    .hero-stat-label {
        font-size: 0.68rem;
    }

    /* Hero features compact on mobile */
    .hero-features {
        gap: 10px;
        padding: 18px 0;
    }

    .hero-feature-icon {
        width: 32px;
        height: 32px;
    }

    /* Hero image frame */
    .hero-img-frame {
        aspect-ratio: 4 / 4.4;
        margin-top: 16px;
    }

    .hero-img-caption {
        font-size: 0.72rem;
        padding: 12px 14px;
    }

    .hero-gurmukhi {
        font-size: 0.75rem;
        right: 12px;
        padding: 5px 12px;
    }

    /* Trust strip */
    .trust-strip {
        padding: 20px 0;
    }

    .trust-strip .d-flex {
        gap: 14px !important;
    }

    .trust-mark {
        font-size: 0.76rem;
    }

    .trust-strip-label {
        width: 100%;
        margin-bottom: 6px;
    }

    /* Section heading */
    .section-heading {
        font-size: clamp(1.6rem, 6.5vw, 2.2rem);
    }

    .section-intro {
        font-size: 0.98rem;
    }

    .section-label {
        font-size: 0.7rem;
        letter-spacing: 0.14em;
    }

    /* About section */
    .about-quote-block {
        padding: 20px 22px;
    }

    .about-pull-quote {
        font-size: 1.1rem;
    }

    .about-body {
        font-size: 0.96rem;
    }

    /* Work cards */
    .work-card-body {
        padding: 20px 22px 24px;
    }

    .work-card-title {
        font-size: 1.1rem;
    }

    /* Impact cards */
    .impact-card {
        padding: 28px 24px 24px;
    }

    .impact-value {
        font-size: clamp(2.2rem, 8vw, 2.8rem);
    }

    .impact-label {
        font-size: 0.94rem;
    }

    .impact-desc {
        font-size: 0.84rem;
    }

    .impact-footnote {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        text-align: left;
    }

    /* Story cards */
    .story-card-body {
        padding: 18px 20px 22px;
    }

    /* Donate section */
    .donate-tier {
        padding: 16px 18px;
    }

    .donate-tier-amount {
        font-size: 1.35rem;
    }

    .donate-tier-desc {
        font-size: 0.78rem;
    }

    /* Donate inputs stack vertically */
    .donate-input {
        width: 100% !important;
        max-width: 100% !important;
    }

    section#donate .d-flex.gap-3.mb-3 {
        flex-direction: column;
        gap: 12px !important;
    }

    section#donate .d-flex.gap-3.mb-3 input[style*="max-width"] {
        max-width: 100% !important;
    }

    /* Donate img offset */
    .donate-img-card {
        bottom: -10px;
        left: 12px;
        padding: 14px 18px;
    }

    .donate-img-card-value {
        font-size: 1.35rem;
    }

    /* Newsletter */
    .newsletter-inner {
        padding: 32px 24px;
    }

    .newsletter-heading {
        font-size: 1.35rem;
    }

    /* Newsletter form stacks vertically */
    #newsletter form.d-flex {
        flex-direction: column;
        gap: 12px !important;
    }

    #newsletter form.d-flex .btn-sanjh-primary {
        width: 100%;
        justify-content: center;
    }

    /* Volunteer cards */
    .volunteer-card {
        padding: 24px 22px;
    }

    /* Contact form */
    .contact-form {
        padding: 24px 22px;
    }

    .map-embed {
        height: 220px;
    }

    /* Footer */
    footer {
        padding: 40px 0 0;
        font-size: 0.88rem;
    }

    .footer-brand-mark {
        margin-bottom: 14px;
    }

    .footer-desc {
        font-size: 0.88rem;
    }

    .footer-reg {
        gap: 16px;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .footer-bottom-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .footer-credit {
        gap: 8px;
    }

    .footer-credit-logo {
        height: 18px;
        max-width: 140px;
    }

    .footer-bottom-links {
        gap: 16px;
        flex-wrap: wrap;
    }

    .footer-gurmukhi {
        font-size: 0.76rem;
        padding: 14px 12px;
    }

    /* Buttons full-width where it makes sense */
    .btn-sanjh-lg {
        padding: 12px 22px;
        font-size: 0.88rem;
    }

    /* Trust row inside hero action group */
    .hero-copy .d-flex.flex-wrap.gap-3 {
        gap: 12px !important;
    }

    .hero-copy .d-flex.flex-wrap.gap-3>a {
        flex: 1 1 auto;
        justify-content: center;
        min-width: 160px;
    }
}


/* ===== SMALL MOBILE (≤ 575px) ===== */
@media (max-width: 575.98px) {

    body {
        font-size: 15.5px;
    }

    /* Container fluid reduce side padding */
    .container-fluid.px-4 {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    /* Hide registered-badge text dot on very small - keep single line */
    .topstrip-badge {
        font-size: 0.7rem;
    }

    /* Hero stats two per row */
    .hero-stats {
        gap: 18px 24px;
    }

    .hero-stats>[role="listitem"] {
        flex: 1 1 calc(50% - 12px);
    }

    /* Work / Volunteer / Story cards - add some breathing below each when single column */
    .work-card,
    .volunteer-card,
    .story-card {
        margin-bottom: 4px;
    }

    /* Impact grid: single column removes the right border that looks odd */
    .impact-card {
        border-right: none;
    }

    /* Donate tiers two per row still (fine) or stack */
    .donate-tier-amount {
        font-size: 1.2rem;
    }

    /* Section headings smaller */
    .section-heading {
        font-size: 1.55rem;
        line-height: 1.15;
    }

    /* Newsletter */
    .newsletter-inner {
        padding: 26px 20px;
    }

    /* Contact form inputs a bit compact */
    .form-input-custom,
    .form-textarea-custom,
    .form-select-custom {
        font-size: 0.92rem;
        padding: 11px 13px;
    }

    .phone-field-row {
        gap: 10px;
    }

    .phone-code-select {
        flex-basis: 104px;
        max-width: 104px;
    }

    /* Footer reg labels stack */
    .footer-reg {
        flex-direction: column;
        gap: 12px;
    }

    /* Footer columns */
    .footer-col-title {
        margin-top: 8px;
    }

    /* Offcanvas menu item size */
    .offcanvas-body .nav-link {
        font-size: 1.35rem;
        padding: 11px 0 !important;
    }

    /* Hide hero side card on tiny screens (already hidden d-lg-block, just in case) */
    .hero-card {
        display: none !important;
    }

    /* Image caption inside hero - smaller to not overflow */
    .hero-img-caption {
        font-size: 0.7rem;
        line-height: 1.45;
        left: 10px;
        right: 10px;
        bottom: 10px;
        padding: 10px 12px;
    }
}


/* ===== TINY PHONES (≤ 380px) ===== */
@media (max-width: 380px) {

    body {
        font-size: 15px;
    }

    /* Tiny screen navbar toggle */
    .navbar-toggler {
        width: 34px !important;
        height: 34px !important;
    }

    .navbar-toggler-icon {
        background-size: 18px 18px !important;
    }

    .navbar {
        padding: 10px 12px;
    }

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

    .brand-tagline {
        display: none;
    }

    .container-fluid.px-4 {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .hero-title {
        font-size: 1.9rem;
    }

    .section-heading {
        font-size: 1.4rem;
    }

    /* Donate tiers one per row on tiny phones */
    section#donate .row.g-3 .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .donate-img-card {
        left: 8px;
        padding: 12px 16px;
    }

    .donate-img-card-value {
        font-size: 1.2rem;
    }

    /* Footer bottom line spacing */
    .footer-bottom-links {
        gap: 12px;
    }
}

@media (max-width: 575.98px) {
    .sanjh-donation-wpforms .wpforms-field-container,
    .sanjh-contact-wpforms .wpforms-field-container {
        grid-template-columns: 1fr;
    }

    .sanjh-donation-wpforms .sanjh-donation-name,
    .sanjh-donation-wpforms .sanjh-donation-country-code,
    .sanjh-donation-wpforms .sanjh-donation-phone,
    .sanjh-contact-wpforms .sanjh-contact-name,
    .sanjh-contact-wpforms .sanjh-contact-country-code,
    .sanjh-contact-wpforms .sanjh-contact-phone {
        grid-column: 1;
    }

    .phone-field-row {
        flex-direction: column;
    }

    .phone-code-select {
        flex-basis: auto;
        max-width: none;
    }

    .sanjh-phone-inline {
        flex-direction: column;
    }

    .sanjh-phone-inline > .wpforms-field {
        flex-basis: auto;
        max-width: none;
    }
}


/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
