/*!
 * Credit
 * Project URL: https://codepen.io/P233/pen/Kzbsi;
 * Project title: CSS Horizontal Family Tree
 * Project Author: Peiwen Lu (https://codepen.io/P233);
 */

*, *:before, *:after {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

body {
    padding-bottom: 50px;
    background-color: #f7fafc;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#wrapper {
    position: relative;
}

.branch {
    position: relative;
    margin-left: 230px;
}
/*.branch .lv3 {
    margin-left: 150px;
}
.branch .lv4 {
    margin-left: 150px;
}
#wrapper .branch .lv2 span.label {
    width: 30px;
}*/
.branch:before {
    content: "";
    width: 30px;
    border-top: 2px solid #ccc;
    position: absolute;
    left: -60px;
    top: 50%;
    margin-top: 1px;
}

.entry {
    position: relative;
    min-height: 140px; /* Ditambah agar label (terutama jika ada pasangan/foto) tidak tumpang tindih */
    padding: 25px 0;   /* Memberikan jarak vertikal lebih luas antar saudara */
}
.entry:before {
    content: "";
    height: 100%;
    border-left: 2px solid #ccc;
    position: absolute;
    left: -30px;
}
.entry:after {
    content: "";
    width: 30px;
    border-top: 2px solid #ccc;
    position: absolute;
    left: -30px;
    top: 50%;
    margin-top: 1px;
}
.entry:first-child:before {
    width: 10px;
    height: 50%;
    top: 50%;
    margin-top: 2px;
    border-radius: 10px 0 0 0;
}
.entry:first-child:after {
    height: 10px;
    border-radius: 10px 0 0 0;
}
.entry:last-child:before {
    width: 10px;
    height: 50%;
    border-radius: 0 0 0 10px;
}
.entry:last-child:after {
    height: 10px;
    border-top: none;
    border-bottom: 2px solid #ccc;
    border-radius: 0 0 0 10px;
    margin-top: -9px;
}
.entry.sole:before {
    display: none;
}
.entry.sole:after {
    width: 30px;
    height: 0;
    margin-top: 1px;
    border-radius: 0;
}

#wrapper span.label {
    display: block;
    font-size: 13px;
    width: 170px;
    overflow: visible; /* Diubah agar foto yang membesar tidak terpotong */
    padding: 10px;
    line-height: 1.4;
    text-align: center;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.2s ease-in-out;
}

#wrapper span.label:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-52%);
    border-color: #cbd5e0;
    z-index: 100;
}

#wrapper span.label img {
    transition: transform 0.3s ease-in-out;
    position: relative;
    z-index: 1;
}

#wrapper span.label:hover img {
    transform: scale(2.75); /* Foto membesar 2.5 kali lipat saat hover */
    z-index: 50; /* Memastikan foto berada di lapisan paling atas saat membesar */
}