:root {
    --gold: #c9a44a;
}

/* ========================================= */

/* Layout */
.org-chart {
    display: flex;
    justify-content: center;
    position: relative;
}

.node {
    position: relative;
    text-align: center;
}

/* Staff card */
.staff-card {
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    width: 240px;
    margin: 0 auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2; /* cards above connectors */
}

.staff-card img {
    width: 100%;
    border-radius: 6px;
}

/* Parent vertical connector spacing */
.node.has-children > .staff-card {
    margin-bottom: 28px; /* tight spacing */
}

/* Children wrapper */
.children {
    display: flex;
    justify-content: center;
}

/* Sibling group */
.child-group {
    display: flex;
    gap: 2rem;
    position: relative;
    padding-top: 28px; /* space for SVG */
}

/* SVG connector layer */
.child-group svg {
    position: absolute;
    top: 0;
    left: 0;
    overflow: visible;
    z-index: 1; /* behind cards */
    pointer-events: none;
}

/* ============================================================
   MOBILE (max-width: 600px)
   - Keep the exact desktop layout
   - Keep SVG connectors visible
   - Shrink cards slightly
   - Allow horizontal scrolling
   ============================================================ */

@media (max-width: 600px) {

    /* Allow horizontal scrolling of the entire chart */
    .org-chart {
        overflow-x: auto;
        padding-bottom: 1rem; /* breathing room for scrollbars */
    }

    /* Keep children horizontal — DO NOT change flex-direction */
    .child-group {
        gap: 1rem; /* tighter spacing on mobile */
    }

    /* Slightly smaller cards */
    .staff-card {
        width: 170px;
        padding: 0.75rem;
    }

    .staff-card img {
        width: 100%;
        height: auto;
    }

    .staff-card h3 {
        font-size: 1rem;
    }

    .staff-card p {
        font-size: 0.85rem;
    }

    /* Keep parent spacing proportional */
    .node.has-children > .staff-card {
        margin-bottom: 20px;
    }

    /* Ensure SVG stays visible */
    .child-group svg {
        display: block;
    }

    /* Remove old vertical pseudo-connector (from earlier attempts) */
    .node.has-children > .staff-card::after {
        content: none;
    }
}