/*
 * Family tree page styling — adapted from a static HTML mockup the site
 * owner supplied (a saved export of a WordPress "FamilyPress" tree demo).
 * The mockup's icon fonts ("familypress"/"phosphor") weren't part of the
 * export, so relation-badges are plain colored dots and the zoom controls
 * use Font Awesome (already loaded by the layout) instead of icon-font
 * glyphs. Colors/spacing are ported as-is; a design pass is expected later.
 */

/* ---- Root profile card ---- */
.single-tree-root {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 0 20px;
}
.tree-root-thumbnail {
    width: 170px;
    height: 170px;
    position: relative;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    background: var(--accent-color, #BFBFBF);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    font-weight: 600;
    color: #000;
}
.tree-root-thumbnail img {
    position: absolute;
    top: 0;
    left: 50%;
    width: 100%;
    height: auto;
    transform: translateX(-50%);
}
.tree-root-info {
    text-align: center;
    margin-top: 20px;
}
.tree-root-title {
    font-size: 40px;
    font-weight: 500;
    margin-bottom: 10px;
}
.tree-root-info .member-item__date {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    color: #000;
}
.tree-root-info .member-item__info-label {
    display: none;
}
.tree-root-info .member-item__die .member-item__info-content:before {
    content: '-';
    padding: 0 3px;
}
.tree-root-spouse {
    margin-top: 8px;
    font-weight: 500;
}
.tree-root-spouse i {
    color: var(--accent-color, #BFBFBF);
    margin-right: 6px;
}
.tree-root-age {
    margin-top: 8px;
}
.tree-root-age-year {
    font-style: italic;
}
.tree-root-age-year:before {
    content: '(';
}
.tree-root-age-year:after {
    content: ')';
}

.single-tree-root-more {
    max-width: 780px;
    margin: 25px auto 40px;
    text-align: center;
}
.tree-root-content-more {
    display: none;
}
.tree-root-content p {
    margin-bottom: 12px;
}
.tree-root-btn-more {
    position: relative;
    text-align: center;
}
.tree-root-btn-more a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.tree-root-btn-more a:after {
    content: '\f078'; /* fa-chevron-down */
    font-family: 'Font Awesome 6 Free', 'Font Awesome 7 Free';
    font-weight: 900;
    font-size: 12px;
}
.tree-root-btn-more a.active:after {
    content: '\f077'; /* fa-chevron-up */
}

/* ---- Zoom controls ---- */
.haru-fp-tree .buttons {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    z-index: 5;
}
.buttons .zoom-in,
.buttons .zoom-out,
.buttons .reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.08);
    color: #000;
    font-weight: 500;
    text-decoration: none;
    padding: 0 18px;
    height: 44px;
    line-height: 44px;
    margin-right: 8px;
    transition: all .3s;
}
.buttons .zoom-in:hover,
.buttons .zoom-out:hover,
.buttons .reset:hover {
    background-color: var(--accent-color, #BFBFBF);
    transition: all .3s;
}

/* ---- Tree canvas ---- */
.haru-fp-tree {
    position: relative;
}
.haru-fp-tree .haru-fp-tree-wrap {
    background-color: #F5F3F2;
    overflow: hidden;
    user-select: none;
    touch-action: none;
    padding: 20px 0 60px;
    cursor: grab;
}
.haru-fp-tree .haru-fp-tree-wrap:active {
    cursor: grabbing;
}
.haru-fp-tree .childs {
    display: table;
}
.haru-fp-tree .tree {
    width: max-content;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 10px;
    user-select: none;
    touch-action: none;
}

.haru-fp-tree .tree.vertical ul {
    margin: 0;
    padding-top: 20px;
    padding-left: 0;
    position: relative;
}
.haru-fp-tree .tree.vertical li {
    float: left;
    text-align: center;
    list-style-type: none;
    position: relative;
    padding: 20px 8px 0 8px;
    margin: 0;
}
.haru-fp-tree .tree.vertical li:before,
.haru-fp-tree .tree.vertical li:after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    border-top: 1.5px solid #c3c3c3;
    width: 50%;
    height: 20px;
}
.haru-fp-tree .tree.vertical li::after {
    right: auto;
    left: 50%;
    border-left: 1.5px solid #c3c3c3;
}
.haru-fp-tree .tree.vertical li:only-child::after,
.haru-fp-tree .tree.vertical li:only-child::before {
    display: none;
}
.haru-fp-tree .tree.vertical li:only-child {
    padding-top: 0;
}
.haru-fp-tree .tree.vertical li:first-child::before,
.haru-fp-tree .tree.vertical li:last-child::after {
    border: 0 none;
}
.haru-fp-tree .tree.vertical li:last-child::before {
    border-right: 1.5px solid #c3c3c3;
    border-radius: 0 5px 0 0;
}
.haru-fp-tree .tree.vertical li:first-child::after {
    border-radius: 5px 0 0 0;
}
.haru-fp-tree .tree.vertical ul ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    border-left: 1.5px solid #c3c3c3;
    width: 0;
    height: 20px;
    transform: translateX(-50%);
}

.haru-fp-tree .tree.vertical .member-relation {
    margin-bottom: 20px;
    position: relative;
}
.haru-fp-tree .tree.vertical .member-relation:before {
    content: '';
    display: inline-block;
    background-color: #E8E8E8;
    border-radius: 50%;
    position: relative;
    width: 18px;
    height: 18px;
    z-index: 2;
    border: 2px solid #F5F3F2;
}
.haru-fp-tree .tree.vertical .member-relation:after {
    content: "";
    position: absolute;
    background: #c3c3c3;
    height: 40px;
    width: 1px;
    bottom: -17px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}
.haru-fp-tree .tree.vertical .member-relation-spouse:before {
    background-color: #D6D6D6;
}
/* Top-most root's incoming-relation dot has nothing feeding into it. */
.haru-fp-tree .tree.vertical > ul.childs > li.child.root > .member-relation {
    visibility: hidden;
    height: 0;
    margin-bottom: 0;
}
.haru-fp-tree .tree.vertical .single-child.families {
    padding-top: 25px;
}
.haru-fp-tree .tree.vertical .single-child > .child > .member-relation {
    margin-bottom: 30px;
}
.haru-fp-tree .tree.vertical .single-child > .child > .member-relation:after {
    height: 65px;
    top: -6px;
}
.haru-fp-tree .tree.vertical .member-item {
    margin: 0 auto;
}

/* ---- Member card ---- */
.haru-fp-tree .member-item {
    width: 170px;
    position: relative;
    z-index: 1;
}
.haru-fp-tree .member-item:before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: -3px;
    border-radius: 12px;
    z-index: -1;
}
.haru-fp-tree .member-item.male:before {
    background-color: #E8E8E8;
}
.haru-fp-tree .member-item.female:before {
    background-color: #D6D6D6;
}
.haru-fp-tree .member-item.deceased .member-content {
    opacity: 0.75;
}
.haru-fp-tree .member-item .member-content {
    padding: 16px;
    background-color: #fff;
    border-radius: 12px;
}
.haru-fp-tree .member-item--style-1 .member-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    margin: 0 auto;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    background: #e9e9e9;
    font-size: 32px;
    font-weight: 600;
    color: #555;
}
.haru-fp-tree .member-item--style-1 .member-image img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}
.haru-fp-tree .member-item--style-1 .member-info {
    font-size: 15px;
    padding-top: 12px;
    text-align: center;
}
.haru-fp-tree .member-item--style-1 .member-date {
    display: flex;
    justify-content: center;
    color: #444;
    font-size: 13px;
}
.haru-fp-tree .member-item--style-1 .member-date:before {
    content: '(';
}
.haru-fp-tree .member-item--style-1 .member-date:after {
    content: ')';
}
.haru-fp-tree .member-item--style-1 .member-dead:before {
    content: '-';
    padding: 0 3px;
}
.haru-fp-tree .member-item--style-1 .member-title {
    font-size: 16px;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 5px;
    text-transform: none;
}
.haru-fp-tree .member-item--style-1 .member-title a {
    color: #000;
    text-decoration: none;
    transition: all .3s;
}
.haru-fp-tree .member-item--style-1 .member-title a:hover {
    color: var(--primary-color, #1A1A1A);
    transition: all .3s;
}
.haru-fp-tree .member-item--style-1 .member-gender {
    /* Already conveyed by the card's blue/orange background — this text
       label is redundant clutter under the name. */
    display: none;
}
.haru-fp-tree .member-item--style-1 .member-spouse-label {
    display: inline-block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #999;
    margin-bottom: 4px;
}

.tree-page .haru-page {
    padding: 0;
    max-width: none;
}

@media screen and (max-width: 1440px) {
    .tree-root-thumbnail {
        width: 130px;
        height: 130px;
    }
}
@media screen and (max-width: 1024px) {
    .tree-root-title {
        font-size: 32px;
    }
}
@media screen and (max-width: 767px) {
    .tree-root-title {
        font-size: 26px;
    }
     .buttons .zoom-in,
    .buttons .zoom-out,
    .buttons .reset {
        padding: 0 12px;
        font-size: 13px;
    }
    
    .haru-fp-tree .haru-fp-tree-wrap {
        max-height: 65vh;
    }
}
