/* === Mobile v15 — comprehensive responsive === */

/* ═══ MOBILE v15 — comprehensive grid overrides ═══ */
@media (max-width: 768px) {

    /* ── HERO ──────────────────────────────────────── */
    .hero-home {
        min-height: auto !important;
        height: auto !important;
        padding-top: 90px !important;
        padding-bottom: 50px !important;
        display: block !important;
    }
    .hero-home .hero-content {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
    }
    .hero-home .hero-tag,
    .hero-home .hero-description,
    .hero-home .hero-cta {
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
    }
    .hero-home h1 {
        font-size: clamp(28px, 8vw, 40px) !important;
        white-space: normal !important;
        letter-spacing: 0 !important;
        line-height: 1.15 !important;
    }
    .hero-home .hero-description { font-size: 16px !important; margin-bottom: 28px !important; }
    .hero-home .hero-tag { margin-bottom: 16px !important; }
    .hero-inner {
        min-height: auto !important;
        height: auto !important;
        padding-top: 90px !important;
        padding-bottom: 36px !important;
    }
    .hero-inner h1 { font-size: clamp(24px, 6vw, 34px) !important; }
    .hero-inner .hero-description { font-size: 15px !important; }

    /* ── HERO CTA buttons — full width ─────────────── */
    .hero-cta {
        flex-direction: column !important;
        align-items: stretch !important;
        margin-top: 24px !important;
        gap: 10px !important;
    }
    .hero-cta a, .hero-cta button {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
    }

    /* ── HERO STATS BAR — 2×2+1 grid ───────────────── */
    .hero-stats-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0 !important;
    }
    .hero-stat { padding: 14px 8px !important; }
    .hero-stat-val { font-size: 22px !important; }
    .hero-stat-sep { display: none !important; }
    .hero-stat:last-child:nth-child(odd) { grid-column: 1 / -1 !important; }

    /* ── 1-COLUMN GRIDS (content-heavy) ────────────── */
    .news-grid,
    .why-grid,
    .about-intro-grid,
    .contact-grid,
    .news-layout,
    .single-layout,
    .flagship-grid,
    .platform-grid,
    .client-grid,
    .seg-matrix,
    .stack-tab-grid,
    .org-comparison,
    .method-sla-grid,
    .program-intro,
    .featured-grid,
    .newsletter-form { grid-template-columns: 1fr !important; }
    .org-comparison { flex-direction: column !important; }
    .org-comparison-side { min-width: auto !important; }
    .news-layout, .single-layout { gap: 32px !important; }

    /* ── 2-COLUMN GRIDS (compact icon cards) ────────── */
    .services-grid,
    .members-grid,
    .features-grid,
    .values-grid,
    .segments-circle-grid,
    .method-principles-grid,
    .standards-grid,
    .tech-categories-grid,
    .benefits-grid,
    .steps-grid,
    .segments-teaser-grid,
    .certs-grid,
    .workflow-grid,
    .hours-grid,
    .careers-grid { grid-template-columns: repeat(2, 1fr) !important; }

    /* security-grid and products-grid: 3-item grids — go 1-col to avoid right overflow */
    .security-grid,
    .products-grid { grid-template-columns: 1fr !important; }

    /* security-card: prevent content overflow */
    .security-card { min-width: 0; overflow: hidden; }
    .security-card h4 { white-space: normal; word-break: break-word; }
    .security-features { flex-wrap: wrap; }
    .security-feature { white-space: normal; word-break: break-word; }

    /* Segment matrix overrides 2-col base to 1-col */
    .seg-matrix { grid-template-columns: 1fr !important; }
    .seg-matrix-row:nth-child(odd) { border-right: none !important; }
    .seg-matrix-row:nth-last-child(-n+2) {
        border-bottom: 1px solid rgba(255,255,255,0.04) !important;
    }
    .seg-matrix-row:last-child { border-bottom: none !important; }

    /* ── NEWS grid — always 1 col ───────────────────── */
    .news-grid { grid-template-columns: 1fr !important; }
    .latest-posts-section .news-grid { grid-template-columns: 1fr !important; gap: 16px !important; }

    /* ── SIDEBAR — stack below content ─────────────── */
    .news-layout,
    .single-layout { grid-template-columns: 1fr !important; }
    .single-sidebar { display: none; }

    /* ── SEGMENTS TEASER — 3 col ────────────────────── */
    .segments-teaser-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    .segment-teaser-item { padding: 14px 6px !important; }
    .segment-teaser-name { font-size: 11px !important; }

    /* ── FOOTER ─────────────────────────────────────── */
    .footer-grid { grid-template-columns: 1fr !important; gap: 28px !important; }
    .site-footer { padding: 48px 16px 20px !important; }
    .partners-grid { flex-direction: column !important; gap: 8px !important; }

    /* ── TYPOGRAPHY ─────────────────────────────────── */
    h1 { font-size: clamp(26px, 7vw, 38px) !important; }
    h2 { font-size: clamp(20px, 5vw, 28px) !important; }

    /* ── SECTIONS ───────────────────────────────────── */
    section { padding: 56px 16px !important; }
    .container { padding: 0 16px !important; }
    .cta-section { padding: 56px 16px !important; }

    /* ── PREVENT HORIZONTAL OVERFLOW ───────────────── */
    html, body { overflow-x: hidden !important; max-width: 100vw !important; }
    /* grid children must not overflow their track */
    .security-grid > *, .products-grid > *,
    .stack-tab-col, .stack-tab-grid > * { min-width: 0; overflow: hidden; }

    /* ── HEADER ─────────────────────────────────────── */
    .header { padding: 12px 16px !important; background-color: #061220 !important; }
    .burger { display: block !important; }
    .header-nav { display: none !important; }
    .header-cta.hide-mobile { display: none !important; }
    .hide-mobile { display: none !important; }

    /* ── MOBILE MENU ────────────────────────────────── */
    .mobile-contact-btn {
        display: inline-flex !important;
        width: auto !important;
        padding: 10px 28px !important;
        background: transparent !important;
        color: var(--teal) !important;
        border: 1px solid var(--teal) !important;
        margin-top: 20px !important;
    }

    /* ── SERVICE CARDS — adjust for 2-col ───────────── */
    .service-card { padding: 18px 14px !important; }
    .service-card h3 { font-size: 14px !important; }
    .service-card p { font-size: 13px !important; }
    .service-icon { width: 32px !important; height: 32px !important; margin-bottom: 10px !important; }
    .service-icon svg { width: 16px !important; height: 16px !important; }

    /* ── MEMBER CARDS ───────────────────────────────── */
    .member-name { font-size: 13px !important; }
    .member-spec { font-size: 10px !important; }

    /* ── WHY GRID ───────────────────────────────────── */
    .why-number { font-size: 36px !important; }

    /* ── WORKFLOW ───────────────────────────────────── */
    .workflow-step::after { display: none !important; }

    /* ── GLOSSARY ───────────────────────────────────── */
    .glossary-alpha-bar { flex-wrap: wrap !important; gap: 4px !important; }
    .glossary-alpha-btn { padding: 4px 8px !important; font-size: 12px !important; }
    .glossary-entry { padding: 12px 0 !important; }

    /* ── STANDARDS GRID ─────────────────────────────── */
    .standard-card { padding: 16px 12px !important; }

    /* ── PLATFORM STATS ─────────────────────────────── */
    .platform-stats { grid-template-columns: repeat(2, 1fr) !important; }

    /* ── CONTACT ────────────────────────────────────── */
    .contact-form-wrapper { padding: 20px 16px !important; }
    .info-card { padding: 20px 16px !important; }

    /* ── SINGLE POST ────────────────────────────────── */
    .single-nav { flex-direction: column !important; }
    .single-nav-link.next { text-align: left !important; }

    /* ── SLA TIERS ──────────────────────────────────── */
    .sla-tier { padding: 14px 10px !important; }

    /* ── TABS on services page ──────────────────────── */
    .ig-tabs { overflow-x: auto !important; }
    .ig-tab-btn { font-size: 11px !important; padding: 8px 10px !important; white-space: nowrap !important; }
}

@media (max-width: 480px) {
    .hero-home h1 { font-size: 26px !important; }
    .hero-stat-val { font-size: 20px !important; }
    .services-grid { grid-template-columns: 1fr !important; }
    .service-card h3 { font-size: 15px !important; }
    .service-card p { font-size: 14px !important; }
    .service-icon { width: 36px !important; height: 36px !important; }
    .map-stat-value { font-size: 36px !important; }
}


/* ── Mobile lang switcher in header ─────────────────────────── */
.mobile-lang-header {
    display: none; /* hidden on desktop — desktop uses .header-right */
}

@media (max-width: 768px) {
    /* Show in header */
    .mobile-lang-header {
        display: flex;
        align-items: center;
        gap: 2px;
        margin-right: 4px;
    }
    .mobile-lang-header .lang-sw {
        font-size: 11px;
        padding: 3px 7px;
        border: 1px solid rgba(0,201,167,0.3);
        border-radius: 2px;
        color: rgba(232,240,248,0.6);
        text-decoration: none;
        letter-spacing: 0.5px;
        transition: all 0.2s;
    }
    .mobile-lang-header .lang-sw.active {
        color: var(--teal);
        border-color: var(--teal);
    }
    /* Hide lang switcher inside mobile menu (redundant now) */
    .mobile-lang {
        display: none !important;
    }
    /* Hide desktop lang switcher on mobile */
    .header-right .lang-switcher {
        display: none !important;
    }
}


/* ── 404 Error Page ─────────────────────────────────────────── */
.error-404-section {
    min-height: 70vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
}
.error-404-inner {
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
}
.error-404-code {
    font-size: clamp(80px, 15vw, 160px);
    font-weight: 800;
    line-height: 1;
    color: var(--teal);
    opacity: 0.15;
    letter-spacing: -4px;
    margin-bottom: -20px;
}
.error-404-title {
    font-size: clamp(24px, 4vw, 40px);
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
}
.error-404-desc {
    font-size: 17px;
    color: rgba(232,240,248,0.6);
    line-height: 1.7;
    margin-bottom: 40px;
}
.error-404-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}
@media (max-width: 480px) {
    .error-404-actions { flex-direction: column; align-items: center; }
    .error-404-actions a { width: 100%; text-align: center; }
}

/* ═══ END MOBILE v15 ═══ */
