/* ============================================================
   ARBRE GÉNÉALOGIQUE V2 (d3.js)
   ============================================================ */

#arbreContenu2 {
    width: 100%;
    overflow: hidden;
    background: #ffffff;
    position: relative;
}

#arbreContenu2 svg {
    display: block;
    cursor: grab;
}

#arbreContenu2 svg:active {
    cursor: grabbing;
}

#arbreContenu2::after {
    content: "Ctrl + molette pour zoomer · cliquer-glisser pour déplacer";
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 10px;
    color: #aaa;
    pointer-events: none;
}

/* Liens entre nœuds */
.arbre2-lien {
    fill: none;
    stroke: var(--ctfa-brun-bord);
    stroke-width: 1.5px;
}

/* Lien enfant illégitime : tirets longs espacés */
.arbre2-lien-illegitime {
    stroke-dasharray: 8 4;
    stroke-width: 1.5px;
}

/* Lien enfant adoptif : pointillés serrés */
.arbre2-lien-adoptif {
    stroke-dasharray: 2 5;
    stroke-width: 1.5px;
    stroke-linecap: round;
}

/* Nœud : rectangle de fond */
.arbre2-rect {
    fill: #ffffff;
    stroke: var(--ctfa-brun-hover);
    stroke-width: 1.5px;
    transition: filter 0.2s ease;
}

.arbre2-noeud:hover .arbre2-rect {
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.2));
    stroke-width: 2px;
}

/* Personne cible (celle sur laquelle on a lancé la recherche) */
.arbre2-cible {
    stroke-width: 3px;
    stroke: var(--ctfa-brun-fonce);
    filter: drop-shadow(0 0 8px rgba(0,0,0,0.15));
}

/* Femme : fond légèrement teinté */
.arbre2-femme {
    fill: #FFF8F0;
}

/* Nœud-référence : ancêtre commun déjà affiché ailleurs */
.arbre2-reference {
    fill: #F5F5F5;
    stroke-dasharray: 4 3;
    opacity: 0.7;
}

.arbre2-ref-label {
    color: #888;
    font-style: italic;
}

/* Contenu HTML dans foreignObject */
.arbre2-contenu {
    font-family: Arial, sans-serif;
    font-size: 11px;
    line-height: 1.3;
    overflow: hidden;
    padding: 2px;
}

.arbre2-nom {
    font-weight: bold;
    font-size: 12px;
    color: var(--ctfa-texte);
    margin-bottom: 2px;
    text-align: center;
}

.arbre2-dates {
    font-size: 10px;
    color: #888;
    text-align: center;
    margin-bottom: 3px;
}

.arbre2-fonction {
    font-size: 10px;
    color: var(--ctfa-brun-hover);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.arbre2-epoux {
    font-size: 10px;
    font-style: italic;
    color: #666;
    text-align: center;
}

/* Barre d'outils de l'arbre */
.arbre2-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    font-family: Arial, sans-serif;
    font-size: 13px;
    color: var(--ctfa-or);
}

.arbre2-toolbar .boutons {
    margin: 0;
    padding: 4px 10px;
    font-size: 12px;
}

.arbre2-section-titre {
    margin: 0;
    padding: 10px 16px 6px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: var(--ctfa-brun-hover);
    background: var(--ctfa-creme);
    border-top: 1px solid var(--ctfa-border);
    border-bottom: 1px solid var(--ctfa-border);
}

/* Sections des deux arbres : pas de marge entre elles */
.arbre2-section {
    margin: 0;
    padding: 0;
}

/* Trait de raccord entre les deux sections */
.arbre2-pont {
    margin: 0;
    padding: 0;
    background: #ffffff;
}

/* Ligne de raccord dans le SVG (hors zoom) */
.arbre2-raccord {
    stroke: var(--ctfa-brun-bord);
    stroke-width: 1.5px;
    stroke-dasharray: 4 3;
    opacity: 0.6;
}