/* ================================================
   Responsive Design - মোবাইল ফার্স্ট
   Mobile First Approach
   ================================================ */

/* ================================================
   Mobile: 320px - 480px
   ================================================ */

@media (max-width: 480px) {
    :root {
        --font-size-base: 14px;
        --font-size-3xl: 1.75rem;
        --font-size-2xl: 1.5rem;
        --font-size-xl: 1.25rem;
        --spacing-2xl: 2rem;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    /* Navigation */
    .navbar__logo {
        font-size: var(--font-size-xl);
    }

    .navbar__tagline {
        display: none;
    }

    /* Hero */
    .hero {
        padding: var(--spacing-lg) 0;
    }

    .hero__cta {
        margin-top: var(--spacing-md);
    }

    .hero__title {
        font-size: 1.5rem;
    }

    .hero__subtitle {
        font-size: var(--font-size-base);
    }

    /* Sections */
    .problems-section,
    .how-it-works,
    .team-section,
    .about-story,
    .about-values,
    .about-promise {
        padding: var(--spacing-lg) 0;
    }

    .section__subtitle {
        font-size: var(--font-size-sm);
        margin-bottom: var(--spacing-md);
    }

    .about-story__content p,
    .about-promise__text {
        font-size: 0.9375rem;
        line-height: 1.75;
        margin-bottom: var(--spacing-sm);
    }

    /* Grid layouts */
    .about-values__grid,
    .problems-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .team-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    /* Cards */
    .value-card {
        padding: var(--spacing-md);
    }

    /* Problem cards become compact rows: icon | title, text, link */
    .problem-card {
        display: grid;
        grid-template-columns: 48px 1fr;
        column-gap: 0.75rem;
        row-gap: 0.15rem;
        align-items: start;
        text-align: left;
        padding: 0.75rem 1rem;
    }

    .problem-card:hover {
        transform: none;
    }

    .problem-card__icon {
        grid-row: span 3;
        width: 48px;
        height: 48px;
        margin: 0;
    }

    .problem-card__icon svg {
        width: 22px;
        height: 22px;
    }

    .problem-card__title {
        font-size: 1rem;
    }

    .problem-card__description {
        font-size: 0.8125rem;
        margin: 0;
    }

    .problem-card__link {
        justify-self: start;
        padding: 0;
        border: none;
        border-radius: 0;
        margin-top: 0.15rem;
    }

    .problem-card__link:hover {
        background: none;
        color: var(--color-primary);
    }

    .stat-card {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .stat-card__number {
        font-size: 1.5rem;
        margin-bottom: 0;
    }

    .stat-card__label {
        margin: 0;
    }

    .navbar__menu li:not(:last-child) {
        display: none;
    }

    .navbar__mark {
        width: 36px;
        height: 36px;
    }

    /* Text size adjustments */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1rem; }

    /* Buttons */
    .btn {
        width: 100%;
        padding: var(--spacing-md) var(--spacing-sm);
    }

    /* Forms */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea {
        padding: 12px 8px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Footer */
    .footer {
        padding: var(--spacing-lg) 0 var(--spacing-sm);
    }

    .footer__content {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }

    .footer__section:first-child {
        grid-column: 1 / -1;
    }

    .footer__section h4 {
        margin-bottom: var(--spacing-xs);
    }

    .footer__section p {
        margin: 0;
    }

}

/* ================================================
   Small Tablet: 481px - 768px
   ================================================ */

@media (min-width: 481px) and (max-width: 768px) {
    .about-values__grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 var(--spacing-md);
    }

    .problems-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }

    .navbar__menu {
        gap: var(--spacing-sm);
    }

    .navbar__menu li:nth-child(2) {
        display: none;
    }

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

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

    .hero__title {
        font-size: 2rem;
    }

    .section__title {
        font-size: 1.75rem;
    }
}

/* ================================================
   Flow diagram: vertical on tablet & mobile
   ================================================ */

@media (max-width: 768px) {
    .process-steps {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        max-width: 520px;
        margin-left: auto;
        margin-right: auto;
    }

    .step {
        display: grid;
        grid-template-columns: 72px 1fr;
        column-gap: var(--spacing-md);
        text-align: left;
    }

    .step__icon {
        grid-row: span 2;
        margin-bottom: 0;
    }

    .step__title {
        align-self: end;
    }

    .step:not(:last-child)::after {
        top: 80px;
        left: 35px;
        width: 0;
        height: calc(100% - 80px + var(--spacing-lg) - 12px);
        border-top: none;
        border-left: 2px dashed #99CDEB;
    }

    .step:not(:last-child)::before {
        top: auto;
        bottom: calc(-1 * var(--spacing-lg) + 4px);
        left: 30px;
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-top: 10px solid #99CDEB;
        border-bottom: none;
    }
}

@media (max-width: 480px) {
    .process-steps {
        gap: var(--spacing-md);
    }

    .step {
        grid-template-columns: 56px 1fr;
        column-gap: 0.75rem;
    }

    .step__icon {
        width: 56px;
        height: 56px;
    }

    .step__icon svg {
        width: 26px;
        height: 26px;
    }

    .step__title {
        margin-bottom: 0.15rem;
    }

    .step__description {
        margin: 0;
    }

    .step:not(:last-child)::after {
        top: 62px;
        left: 27px;
        height: calc(100% - 62px + var(--spacing-md) - 10px);
    }

    .step:not(:last-child)::before {
        bottom: calc(-1 * var(--spacing-md) + 2px);
        left: 22px;
    }
}

/* ================================================
   Large Tablet/Desktop: 769px+
   ================================================ */

@media (min-width: 769px) {
    .problems-grid {
        grid-template-columns: repeat(3, 1fr);
    }

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

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

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

/* ================================================
   Desktop: 1025px+
   ================================================ */

@media (min-width: 1025px) {
    .navbar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

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

/* ================================================
   Large Desktop: 1441px+
   ================================================ */

@media (min-width: 1441px) {
    .container {
        max-width: 1400px;
    }

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

/* ================================================
   Orientation-specific styles
   ================================================ */

@media (orientation: landscape) and (max-height: 500px) {
    .hero {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .hero__title {
        font-size: 1.5rem;
        margin-bottom: var(--spacing-sm);
    }

    .hero__subtitle {
        display: none;
    }
}

/* ================================================
   Print Styles
   ================================================ */

@media print {
    header,
    footer {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    a {
        color: black;
        text-decoration: underline;
    }

    .container {
        max-width: 100%;
    }

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

/* ================================================
   High DPI / Retina Display
   ================================================ */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .problem-card__icon {
        text-rendering: optimizeLegibility;
    }
}

/* ================================================
   Accessibility: Reduced Motion
   ================================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ================================================
   Touch-friendly adjustments
   ================================================ */

@media (hover: none) and (pointer: coarse) {
    .problem-card {
        cursor: pointer;
    }

    .btn {
        min-height: 48px;
        padding: 12px 20px;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea {
        min-height: 48px;
    }
}
