﻿/* ============================================================
   VIBHAGIYA SANRACHNA (ORG CHART) — MOBILE RESPONSIVE FIX
   Apni main CSS ke neeche paste karo
   ============================================================ */

@media (max-width: 991.98px) {

    /* ── Poora org chart vertical flow mein convert ── */
    .org-chart {
        display: flex;
        flex-direction: column;
        align-items: center;
        overflow-x: visible;
        padding: 20px 10px 40px;
        gap: 0;
    }

    /* ── Connector lines band karo ── */
    .level.level-top::after,
    .level.level-middle::after,
    .level.level-branch::after,
    .level.level-branch .branch-col::before {
        display: none !important;
    }

    /* ── Levels reset ── */
    .level {
        position: relative;
        top: 0 !important;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 0;
    }

        /* ── Branch level — vertical stack ── */
        .level.level-branch {
            width: 100% !important;
            min-width: unset !important;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 0;
        }

    /* ── Branch columns — ek ke neeche ek ── */
    .branch-col {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        position: relative;
        top: 0 !important;
    }

    /* ── CEO cards — center karo ── */
    .ceo-card,
    .ceo-card.small {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: relative;
        top: 0 !important;
        margin-bottom: 10px;
        width: 100%;
    }

        /* ── Connector line — simple dot line ── */
        .ceo-card::after {
            content: '';
            display: block;
            width: 2px;
            height: 24px;
            background: linear-gradient(to bottom, #c50313, #f51f30);
            margin: 0 auto;
        }

    /* Last card mein line nahi ── */
    .branch-col:last-child .ceo-card:last-child::after,
    .level.level-branch .branch-col:last-child .ceo-card:last-child::after {
        display: none;
    }

    /* ── Hex stack size ── */
    .hex-stack {
        width: 120px;
        height: 120px;
    }

    /* ── Ribbon — hex ke neeche center mein ── */
    .ribbon {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        display: inline-block;
        min-width: 140px;
        max-width: 200px;
        margin: 6px auto 0;
        text-align: center;
        transform: none !important;
        transform-origin: unset !important;
    }

        .ribbon .title h3 {
            font-size: 13px;
            padding: 2px 0;
        }

    /* ── Middle level gap ── */
    .level.level-middle {
        top: 0 !important;
        margin-bottom: 0;
    }

    /* ── Divider line between branch groups ── */
    .level.level-branch .branch-col + .branch-col {
        border-top: 1px dashed #f0c0c0;
        padding-top: 8px;
        margin-top: 6px;
    }
}

/* ── Very small phones ── */
@media (max-width: 575.98px) {

    .hex-stack {
        width: 100px;
        height: 100px;
    }

    .ribbon {
        min-width: 120px;
        max-width: 170px;
        padding: 7px 12px;
    }

        .ribbon .title h3 {
            font-size: 12px;
        }

    .ceo-card::after {
        height: 20px;
    }
}
