body {
    font-family: Arial, sans-serif;
    background-color: #f8f1e9;
    margin: 0;
    padding: 0;
}

main {
    max-width: 1200px;
    margin: 80px auto 20px;
    padding: 20px;
}

section {
    margin-bottom: 40px;
}

h2 {
    color: #2a6041;
    font-size: 2em;
    margin-bottom: 20px;
}

.intro {
    text-align: center;
    font-size: 1.2em;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.gallery img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    object-fit: cover;
}

/* Styles pour l'arbre généalogique traditionnel */
#familyTree {
    width: 100%;
    max-width: 100%;
    overflow: auto;
    padding: 50px;
    background-color: #f9f9f9;
    position: relative;
    height: 80vh;
    transform-origin: top center;
    transition: transform 0.3s ease;
}

.tree-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
}

/* Styles des nœuds de personnes */
.person {
    background-color: #fff;
    border: 2px solid #3e6b89;
    border-radius: 8px;
    padding: 10px 20px;
    margin: 5px;
    min-width: 150px;
    max-width: 200px;
    text-align: center;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.person .name {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 3px;
    color: #333;
}

.person .birth-year {
    font-size: 12px;
    color: #666;
}

/* Styles spécifiques pour différents types de personnes */
.person.ancestor {
    background-color: #d6e4ff;
    /* Darker blue for Isaac */
    border-color: #2b5a8c;
    /* Darker blue border */
    border-width: 3px;
    font-size: 16px;
    min-width: 200px;
}

.isaac-wife {
    background-color: yellow;
    border-radius: 10px;
    padding: 10px;
}

.isaac-descendant-spouse {
    background-color: #fff3cd;
    /* jaune pâle */
    border: 1px dashed #f0ad4e;
    border-radius: 5px;
    padding: 4px;
}


.person.parent {
    background-color: #f0f0f5;
    border-color: #2a6041;
}

.person.has-children {
    background-color: #f0fff0;
        border-color: #5b9a5b;
}

.person.grandchild {
    background-color: #fef5e7;
    border-color: #e67e22;
}

.person.has-children::after {
    content: "+";
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #5b9a5b;
    transition: transform 0.3s ease;
}

.person.expanded::after {
    content: "−";
    color: #d46969;
    font-size: 20px;
}

/* Conteneur des unions (mariages) */
.unions-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    margin-top: 30px;
    width: 100%;
}

.union-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    position: relative;
    margin-bottom: 20px;
}

.union-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: relative;
}

/* Lignes de connexion */
.marriage-line {
    flex: 0 0 50px;
    height: 2px;
    background-color: #d46969;
    position: relative;
    margin: 0 10px;
}

.marriage-line::before {
    content: "♥";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #d46969;
    font-size: 18px;
}

.marriage-line.spouse-marriage-line {
    background-color: #4a7baf;
    /* Blue for Isaac's wives */
}

.marriage-line.spouse-marriage-line::before {
    color: #4a7baf;
    /* Blue heart */
}

.marriage-line.parent-marriage-line {
    background-color: #2a6041;
    /* Green for parent union */
}

.marriage-line.parent-marriage-line::before {
    content: "♥";
    /* Red heart */
    color: #d46969;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
}

.small-marriage-line {
    flex: 0 0 30px;
    height: 2px;
    background-color: #d46969;
    position: relative;
    margin: 0 10px;
}

.small-marriage-line::before {
    content: "♥";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #d46969;
    font-size: 14px;
}

/* Conteneur de génération (pour grouper des enfants) */
.generation-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    position: relative;
}

/* Ligne verticale */
.vertical-line {
    width: 2px;
    height: 30px;
    background-color: #888;
    margin-bottom: 10px;
}

/* Ligne pour les enfants */
.children-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    position: relative;
}

.children-row::before {
    content: "";
    position: absolute;
    top: -20px;
    left: 10px;
    right: 10px;
    height: 2px;
    background-color: #888;
}

/* Branche individuelle */
.branch-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 10px;
    position: relative;
}

.branch-container::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 50%;
    width: 2px;
    height: 10px;
    background-color: #888;
    transform: translateX(-50%);
}

/* Conteneur de couple */
.couple-container {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

/* Conteneur des descendants */
.descendants-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
    animation: fadeIn 0.3s ease;
}

/* Contrôles de zoom */
.zoom-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 5px;
    display: flex;
    gap: 5px;
    z-index: 100;
}

.zoom-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ccc;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.zoom-btn:hover {
    background-color: #f5f5f5;
}

/* Styles pour la légende de l'arbre */
.tree-legend {
    position: fixed;
    top: 150px;
    right: 20px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-width: 220px;
}

.tree-legend h3 {
    margin: 0 0 10px;
    font-size: 16px;
    color: #2a6041;
}

.tree-legend ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tree-legend li {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}

.tree-legend .legend-box {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border-radius: 4px;
}

.tree-legend .legend-icon,
.tree-legend .legend-text {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    text-align: center;
    line-height: 20px;
    font-size: 14px;
}

/* Styles spécifiques pour chaque type de légende */
.tree-legend .legend-item.ancestor .legend-box {
    background-color: #d6e4ff;
    /* Darker blue for Isaac */
    border: 3px solid #2b5a8c;
    /* Darker blue border */
}

.tree-legend .legend-item.spouse .legend-box {
    background-color: yellow;
    border: 2px solid #d4697a;
}

.tree-legend .legend-item.has-children .legend-box {
    background-color: #f0fff0;
        border: 2px solid #5b9a5b;
}

.tree-legend .legend-item.grandchild .legend-box {
    background-color: #fef5e7;
    /* Light orange for grandchildren */
    border: 2px solid #e67e22;
    /* Orange border */
}

.tree-legend .legend-item.parent .legend-box {
    background-color: #f0f0f5;
    border: 2px solid #2a6041;
}

.tree-legend .legend-item.expand-collapse .legend-icon {
    color: #5b9a5b;
    font-size: 18px;
}

.tree-legend .legend-item.marriage .legend-icon {
    color: #4a7baf;
    /* Blue for Isaac's wives' unions */
}

.tree-legend .legend-item.parent-union .legend-icon {
    color: #d46969;
    /* Red heart for parent union */
}

.tree-legend .legend-item.birth-year .legend-text {
    color: #666;
    font-size: 12px;
}

/* Styles pour le bouton toggle et le contenu de la légende */
#toggle-legend {
    width: 100%;
    padding: 8px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    margin-bottom: 10px;
}

#toggle-legend:hover {
    background-color: #f5f5f5;
    border-color: #3e6b89;
}

#legend-content {
    transition: opacity 0.3s ease;
}

#legend-content[style*="display: none"] {
    opacity: 0;
}

#legend-content[style*="display: block"] {
    opacity: 1;
}

/* Animation pour les transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Responsive pour l'arbre et la légende */
@media (max-width: 768px) {
    .person {
        min-width: 120px;
        font-size: 12px;
        padding: 6px 10px;
    }

    .children-row {
        gap: 15px;
    }

    .tree-legend {
        position: static;
        margin: 20px auto;
        max-width: 90%;
    }

    .marriage-line.spouse-marriage-line,
    .marriage-line.parent-marriage-line,
    .small-marriage-line {
        flex: 0 0 30px;
    }
}

footer {
    background-color: #2a6041;
    color: white;
    text-align: center;
    padding: 10px;
    position: fixed;
    bottom: 0;
    width: 100%;
}

.France {
    color: red;
}