/* Mobile layout fixes (Claude 2026-12-03, Tim: "mobile sites are scrollable left and right").
   Phones only (max-width 760px); desktop is untouched. Selectors outrank the legacy inline <style> in home.php
   (.container.content-wrapper ... !important) that forced nowrap rows inside the 2-column card grid and pushed
   the cards ~40px past the right edge on 421-760px screens (iPhone Pro Max). Works in every language and RTL. */
@media (max-width: 760px) {
    html { overflow-x: hidden; }

    /* Stat cards: 2 columns, icon above, number + label stacked; labels wrap (long German/Finnish strings). */
    body.site-modern .container.content-wrapper .stats-container,
    body.site-modern .stats-container {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
        padding: 18px 0 8px !important;
    }
    body.site-modern .container.content-wrapper .stats-container .stat-item.datos-actuales {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        flex: initial !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        gap: 10px !important;
        padding: 16px !important;
        min-height: 0 !important;
        text-align: start !important;
        overflow: hidden;
    }
    body.site-modern .container.content-wrapper .stats-container .stat-item.datos-actuales p {
        display: block !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        text-align: start !important;
    }
    body.site-modern .container.content-wrapper .stats-container .stat-emoji {
        width: 40px !important;
        height: 40px !important;
        margin: 0 !important;
        font-size: 1.35rem !important;
        flex: 0 0 auto !important;
    }
    body.site-modern .container.content-wrapper .stats-container .stat-number {
        display: block !important;
        font-size: clamp(1.35rem, 6vw, 1.9rem) !important;
        letter-spacing: -0.03em !important;
        white-space: nowrap !important;
    }
    body.site-modern .container.content-wrapper .stats-container .stat-label {
        display: block !important;
        margin-top: 6px !important;
        font-size: 0.82rem !important;
        line-height: 1.3 !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
        hyphens: auto;
    }

    /* Chart cards: title on its own line, period dropdown full width (no clipped "All (Since Data Be..."). */
    body.site-modern .burn-chart-card-header { flex-wrap: wrap !important; }
    body.site-modern .burn-chart-card-header h3 {
        order: -1;
        flex: 1 1 100% !important;
        text-align: start !important;
    }
    body.site-modern .burn-chart-period {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        min-height: 42px !important;
        font-size: 0.85rem !important;
        text-overflow: ellipsis;
    }

    /* Tap targets and readable text. */
    .site-header .menu-toggle { min-height: 44px; min-width: 44px; justify-content: center; }
    .resource-rail a { width: 40px !important; height: 40px !important; }
    .burn-traction .bt-eyebrow,
    .burn-traction .bt-metric-label,
    .burn-traction .bt-metric-note,
    .burn-traction .bt-platform > span,
    .burn-traction .bt-platform > small,
    .burn-traction .bt-art-caption strong { font-size: 12px !important; }
    .burn-traction .bt-button,
    .burn-traction .bt-text-link { font-size: 13px !important; min-height: 44px; display: inline-flex; align-items: center; }
}

/* Small phones: one card per row, icon beside the text again. */
@media (max-width: 480px) {
    body.site-modern .container.content-wrapper .stats-container,
    body.site-modern .stats-container { grid-template-columns: minmax(0, 1fr) !important; }
    body.site-modern .container.content-wrapper .stats-container .stat-item.datos-actuales {
        flex-direction: row !important;
        align-items: center !important;
        gap: 14px !important;
        padding: 16px 18px !important;
    }
    body.site-modern .container.content-wrapper .stats-container .stat-item.datos-actuales p { flex: 1 1 auto; }
}
