/* FAMILY BRANCH — HEADER */
.branch-header {
    text-align: center;
    padding-bottom: 20px;
}

.branch-header .branch-breadcrumb {
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: 13px;
    color: #7b746d;
    margin-bottom: 14px;
}

.branch-header h2 {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 34px;
    line-height: 1.15;
    font-weight: 600;
    color: #7d433b;
    text-transform: uppercase;
    margin-bottom: 12px;
}
/* FAMILY BRANCH — PERSON CARDS */
.branch-person {
    text-align: center;
}

.branch-person .img {
    max-width: 200px;
    margin: 0 auto 14px;
}

.branch-person .text {
    text-align: center;
}

.branch-person strong {
    display: block;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 24px;
    line-height: 1.2;
    color: #4A4744;
    margin-bottom: 4px;
}

.branch-person p {
    margin: 0;
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: 14px;
    line-height: 1.5;
    color: #6f6963;
}
/* FOUNDING COUPLE — CONNECTION */
.branch-couple {
    position: relative;
}
/* FAMILY BRANCH — CHILDREN GENERATION CONNECTOR */
.branch-generation-children {
    position: relative;
    padding-top: 55px;
}

.branch-generation-children::before {
    content: "";
    position: absolute;
    top: 20px;
    left: 16.6667%;
    right: 16.6667%;
    height: 1px;
    background: rgba(177, 132, 69, 0.55);
}

.branch-generation-children > .col {
    position: relative;
}

.branch-generation-children > .col::before {
    content: "";
    position: absolute;
    top: -35px;
    left: 50%;
    width: 1px;
    height: 35px;
    background: rgba(177, 132, 69, 0.55);
}
/* SPACE BETWEEN FOUNDERS AND CHILDREN */
.branch-generation-children {
    margin-top: 120px;
}
/* CHILDREN ROW — FORCE SPACE BELOW FOUNDERS */
.children-row {
    padding-top: 165px !important;
}
/* FAMILY BRANCH — CHILDREN GENERATION CONNECTOR */
.children-row {
    position: relative;
}

.children-row::before {
    content: "";
    position: absolute;
    top: 135px;
    left: 16.6667%;
    right: 16.6667%;
    height: 1px;
    background: rgba(177, 132, 69, 0.55);
}

.children-row > .col {
    position: relative;
}
/* CONNECT FOUNDERS TO CHILDREN GENERATION */
.children-row::after {
    content: "";
    position: absolute;
    left: 50%;
    top: -50px;
    width: 1px;
    height: 185px;
    background: rgba(177, 132, 69, 0.55);
}
/* CHILDREN — VERTICAL DROPS FROM GENERATION LINE */
.children-row .branch-person {
    position: relative;
}

.children-row .branch-person::before {
    content: "";
    position: absolute;
    top: -30px;
    left: 50%;
    width: 1px;
    height: 30px;
    background: rgba(177, 132, 69, 0.55);
    transform: translateX(-50%);
}
/* THIRD GENERATION — CHILD BRANCH CONNECTORS */
/* REUSABLE DESCENDANT GROUP */
.branch-descendants {
    position: relative;
    padding-top: 55px;
}

.branch-descendants::before {
    content: "";
    position: absolute;
    top: 20px;
    left: 25%;
    right: 25%;
    height: 1px;
    background: rgba(177, 132, 69, 0.55);
}

.branch-descendants::after {
    content: "";
    position: absolute;
    top: -20px;
    left: 50%;
    width: 1px;
    height: 40px;
    background: rgba(177, 132, 69, 0.55);
}

.branch-descendants .branch-person {
    position: relative;
}

.branch-descendants .branch-person::before {
    content: "";
    position: absolute;
    top: -35px;
    left: 50%;
    width: 1px;
    height: 35px;
    background: rgba(177, 132, 69, 0.55);
    transform: translateX(-50%);
}
/* FOURTH GENERATION — AUDREY DESCENDANT */
.audrey-children {
    position: relative;
    padding-top: 55px;
}

.audrey-children::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 55px;
    background: rgba(177, 132, 69, 0.55);
    transform: translateX(-50%);
}
/* DESCENDANT GROUP — SINGLE CHILD */
.branch-descendants-single::before {
    display: none;
}
/* SINGLE CHILD — keep connector below parent's details */
.branch-descendants-single::after {
    top: 10px;
    height: 45px;
}
.branch-couple-line {
    position: relative;
    width: 100%;
    height: 55px;
    margin-top: -210px;
    pointer-events: none;
    z-index: 1;
}

.branch-couple .branch-person .img {
    position: relative;
    z-index: 2;
}

.branch-couple-horizontal {
    position: absolute;
    top: 0;
    left: 25%;
    width: 50%;
    height: 1px;
    background: rgba(177, 132, 69, 0.55);
}

.branch-couple-vertical {
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 155px;
    background: rgba(177, 132, 69, 0.55);
}
/* PERSON CARD — NAME + YEAR */
.person-info {
    text-align: center;
}

.person-name {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 24px;
    line-height: 1.15;
    font-weight: 600;
    color: #4A4744;
}

.person-years {
    margin-top: 5px;
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: 14px;
    line-height: 1.2;
    color: #8f5a50;
}
/* GENERATION — CONNECT CHILD TO PREVIOUS GENERATION */
.branch-generation-child {
    position: relative;
}

.branch-generation-child::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -45px;
    width: 1px;
    height: 45px;
    background: rgba(177, 132, 69, 0.55);
    transform: translateX(-50%);
}
/* =========================================
   FAMILY TREE — PERSON PROFILE PANEL
   ========================================= */

.person-profile-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;

    background: rgba(35, 27, 22, 0.58);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}

.person-profile-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.person-profile-panel {
    position: absolute;
    top: 0;
    right: 0;

    width: min(560px, 92vw);
    height: 100%;

    overflow-y: auto;

    background: #fbf7ef;
    border-left: 2px solid rgba(177, 132, 69, 0.38);

    box-shadow: -18px 0 40px rgba(35, 27, 22, 0.28);

    padding: 34px 38px 40px;

    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.person-profile-overlay.is-open .person-profile-panel {
    transform: translateX(0);
}


/* CLOSE BUTTON */

.person-profile-close {
    position: absolute;
    top: 18px;
    right: 22px;

    width: 38px;
    height: 38px;

    padding: 0;
    border: 0;
    background: transparent;

    font-family: Georgia, serif;
    font-size: 32px;
    line-height: 1;

    color: #4a4744;
    cursor: pointer;
}


/* HEADER */

.person-profile-header {
    display: flex;
    align-items: center;
    gap: 24px;

    padding-right: 45px;
    padding-bottom: 24px;
}

.person-profile-photo {
    flex: 0 0 130px;
    width: 130px;
    height: 130px;

    border-radius: 50%;
    overflow: hidden;

    background: #eee3cf;
}

.person-profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.person-profile-identity {
    min-width: 0;
}

.person-profile-identity h2 {
    margin: 0 0 5px;

    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 34px;
    line-height: 1.05;
    font-weight: 600;

    color: #3f342d;
}

.person-profile-years {
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: 15px;
    color: #8f5a50;
}


/* FAMILY FACTS */

.person-profile-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 28px;

    padding: 22px 0 26px;

    border-top: 1px solid rgba(177, 132, 69, 0.25);
    border-bottom: 1px solid rgba(177, 132, 69, 0.25);
}

.person-profile-fact {
    display: flex;
    flex-direction: column;
    gap: 4px;

    font-family: "Libre Baskerville", Georgia, serif;
    font-size: 13px;
    line-height: 1.5;

    color: #4a4744;
}

.person-profile-label {
    font-weight: 700;
    color: #6e473d;
}


/* CONTENT SECTIONS */

.person-profile-section {
    padding: 22px 0;

    border-bottom: 1px solid rgba(177, 132, 69, 0.25);
}

.person-profile-section h3 {
    margin: 0 0 12px;

    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 19px;
    line-height: 1.2;
    font-weight: 600;

    color: #7d433b;
    text-transform: uppercase;
}

.person-profile-section p {
    margin: 0;

    font-family: "Libre Baskerville", Georgia, serif;
    font-size: 13px;
    line-height: 1.65;

    color: #4a4744;
}

.person-profile-empty {
    color: #817971 !important;
    font-style: italic;
}


/* PHOTO GRID */

.person-profile-photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.person-profile-photo-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;

    object-fit: cover;

    border: 1px solid rgba(177, 132, 69, 0.22);
}


/* FULL PROFILE LINK */

.person-profile-full {
    padding-top: 24px;
}

.person-profile-full a {
    display: block;

    padding: 13px 18px;

    text-align: center;
    text-decoration: none;

    font-family: "Libre Baskerville", Georgia, serif;
    font-size: 12px;
    letter-spacing: 0.7px;
    text-transform: uppercase;

    color: #fff;
    background: #7d433b;

    border: 1px solid #7d433b;
}

.person-profile-full a:hover {
    color: #7d433b;
    background: transparent;
}


/* MOBILE */

@media (max-width: 549px) {

    .person-profile-panel {
        width: 100%;
        padding: 28px 22px 32px;
    }

    .person-profile-header {
        align-items: flex-start;
        gap: 16px;
    }

    .person-profile-photo {
        flex-basis: 95px;
        width: 95px;
        height: 95px;
    }

    .person-profile-identity h2 {
        font-size: 27px;
    }

    .person-profile-facts {
        grid-template-columns: 1fr;
    }

    .person-profile-photo-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
.open-person-profile {
    cursor: pointer;
}