/* Organigramme hiérarchique */
.org-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    min-height: calc(100vh - 300px);
    overflow: visible;
}

.org-level {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 60px;
    position: relative;
    width: 100%;
}

.org-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 0 12px;
}

.org-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    padding: 22px;
    text-align: center;
    min-width: 220px;
    max-width: 260px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 2;
}

.org-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.org-card img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 18px;
    border: 3px solid #0d6efd;
}

.org-card h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    line-height: 1.3;
}

.org-card span {
    font-size: 15px;
    color: #666;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.org-card .social {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    gap: 14px;
}

.org-card .social a {
    color: #0d6efd;
    font-size: 20px;
    transition: color 0.3s ease;
}

.org-card .social a:hover {
    color: #0a58ca;
}

/* Lignes de connexion */
.org-children {
    display: flex;
    justify-content: center;
    gap: 10px;
    position: relative;
    margin-top: 10px;
}

.org-children::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 5px;
    background: #0d6efd;
}

.org-node::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 5px;
    background: #0d6efd;
}

.org-node:first-child::before,
.org-node:last-child::before {
    content: '';
    position: absolute;
    top: -5px;
    width: 50%;
    height: 2px;
    background: #0d6efd;
}

.org-node:first-child::before {
    right: 50%;
}

.org-node:last-child::before {
    left: 50%;
}

.org-node:not(:first-child):not(:last-child)::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: #0d6efd;
}

/* Niveau racine (DG) - pas de ligne au-dessus */
.org-level:first-child .org-node::after,
.org-level:first-child .org-node::before {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .org-level {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }
    
    .org-children {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }
    
    .org-children::before {
        display: none;
    }
    
    .org-node::after,
    .org-node::before {
        display: none;
    }
    
    .org-card {
        min-width: 180px;
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.org-card {
    animation: fadeInUp 0.5s ease forwards;
}

.org-level:nth-child(1) .org-card {
    animation-delay: 0.1s;
}

.org-level:nth-child(2) .org-card {
    animation-delay: 0.3s;
}

.org-level:nth-child(3) .org-card {
    animation-delay: 0.5s;
}
