@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap');

/* Flare-styled - vertical descendant chart with boxes modeled after Paths mod (paths.css) */

/* Paths styles for dragging */
.outer, #outer {
    position: relative;
    width: 97vw;
    max-width: 100%;
    margin: 0;
    overflow: hidden !important;
}
.inner {
    position: relative;
    float: left;
    min-width: 100%;
    cursor: auto; /* to be changed by jquery */
    user-select: none; /* supported by Chrome and Opera */
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
}
/* bounce draginfo text */
.draginfo {
    position: absolute;
    text-align: left;
    z-index: 100;
    color: #bbb;
    font-size: 1.5em;
    font-weight: bold;
    text-shadow: 1px 1px #777;
    opacity: 0.4;
    filter: alpha(opacity=40); /* for <= IE 8 */
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    /* apply bouncing and then fade out after a few cycles */
    -moz-animation: draginfo 4s ease-in-out 5 alternate forwards, draginfoFade 1.5s ease-in-out 15s forwards;
    -webkit-animation: draginfo 4s ease-in-out 5 alternate forwards, draginfoFade 1.5s ease-in-out 15s forwards;
    animation: draginfo 4s ease-in-out 5 alternate forwards, draginfoFade 1.5s ease-in-out 15s forwards;
}
@-moz-keyframes draginfoFade {
    from { opacity: 0.4; visibility: visible; }
    to { opacity: 0; visibility: hidden; }
}
@-webkit-keyframes draginfoFade {
    from { opacity: 0.4; visibility: visible; }
    to { opacity: 0; visibility: hidden; }
}
@keyframes draginfoFade {
    from { opacity: 0.4; visibility: visible; }
    to { opacity: 0; visibility: hidden; }
}
@-moz-keyframes draginfo {
    from { -moz-transform: translateX(calc(97vw - 12em)); }
    to { -moz-transform: translateX(0); }
}
@-webkit-keyframes draginfo { /* IOS */
    from { -webkit-transform: translate3d(calc(97vw - 12em), 0, 0); }
    to { -webkit-transform: translate3d(0, 0, 0); }
}
@keyframes draginfo {
    from {
        -moz-transform: translate3d(calc(97vw - 12em), 0, 0); /* Firefox bug fix */
        -webkit-transform: translate3d(calc(97vw - 12em), 0, 0); /* IOS/Firefox bug fix */
        transform: translate3d(calc(97vw - 12em), 0, 0);
    }
    to {
        -moz-transform: translateX(0); /* Firefox bug fix */
        -webkit-transform: translate3d(0, 0, 0); /* IOS/Firefox bug fix */
        transform: translateX(0);
    }
}
/* boxes and connectors */
#dboxes {
    --line: #554535; /* connector color */
    box-sizing: border-box;
    font-family: 'Open Sans', sans-serif !important;
    font-size: 12px;
    font-weight: normal;
    line-height: 14px;
    display: block;
    margin: 0 auto;
    padding: 10px 6px 12px 6px;
    /*noinspection CssOverwrittenProperties*/
    background-color: var(--bgr, #f4f4f8);
    border: 1px solid grey;
    border-radius: 5px;
    /*noinspection CssOverwrittenProperties*/
    box-shadow: 4px 4px 4px var(--cl1,  #999999);
}
#dboxes a:link, #dboxes a:visited, #dboxes a:hover, #dboxes a:active {
    text-decoration: none;
    color: var(--cl2, grey);
}
/* SVG connecting lines */
#dboxes svg.dboxes-svg {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 1;
}
#dboxes .edge {
    fill: none;
    stroke: var(--line, #554535);
    stroke-width: 1.3px;
}
#dboxes .union-line {
    stroke: var(--line, #554535);
    stroke-width: 1px;
    /*vector-effect: non-scaling-stroke;*/
    shape-rendering: crispEdges;
}
#dboxes .pers {
    box-sizing: border-box;
    overflow: hidden;
    /*noinspection CssUnresolvedCustomProperty*/
    width: var(--boxw);
    /*noinspection CssUnresolvedCustomProperty*/
    height: var(--boxh);
    padding: 1px 3px;
    border: 1px solid black;
    border-radius: 5px;
    text-align: center;
    background-color: var(--bg2, #e9e9ff);
    box-shadow: 2px 2px 2px var(--cl1, #999999);
    cursor: pointer;
    z-index: 2;
}
#dboxes .pers .name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
#dboxes .pers.sp {
    background-color: var(--bgr, #f4f4f8);
}
#dboxes .pers.start {
    font-weight: bold;
}
#dboxes .pers.ghost {
    background-color: #f0f0ee;
    border: 1.2px dashed #888;
    box-shadow: none;
    opacity: 0.85;
}
#dboxes .pers.ghost a {
    color: #666;
}
#dboxes .pers.ghost .ghost-arrow {
    display: inline-block;
    font-style: normal;
    font-family: "Segoe UI Symbol", "DejaVu Sans", Arial, sans-serif;
    font-weight: 900;
    color: #d32f2f;
    font-size: 1.25em;
    line-height: 1;
    margin: 0 2px;
    -webkit-text-stroke: 0.6px #d32f2f;
    /*text-shadow: 0.3px 0 0 #d32f2f, -0.3px 0 0 #d32f2f, 0 0.3px 0 #d32f2f, 0 -0.3px 0 #d32f2f;*/
    vertical-align: -1px;
}
#dboxes .pers.ghost .sameperson {
    cursor: pointer;
}
#dboxes .pers.highlight-target {
    animation: pulseHighlight 0.6s ease-in-out 3;
    z-index: 10 !important;
}
@keyframes pulseHighlight {
    0% { outline: 3px solid #ff9800; box-shadow: 0 0 12px #ff9800; transform: scale(1); }
    50% { outline: 4px solid #e65100; box-shadow: 0 0 18px #e65100; transform: scale(1.05); }
    100% { outline: 3px solid #ff9800; box-shadow: 0 0 12px #ff9800; transform: scale(1); }
}
#dboxes .pers:hover {
    background-color: var(--bgr, #e9e9e9);
}
#dboxes img.thumb {
    float: left;
    height: 40px;
    max-width: 58px; /* nie może być większy bo musi się ew. zmieścić morelink */
    margin-right: 3px;
    border-radius: 4px;
}
/* link to continue chart below the last generation */
#dboxes .pers .morelink {
    position: absolute;
    bottom: 1px; /* Odstęp od dolnej krawędzi rodzica */
    right: 2px;  /* Odstęp od prawej krawędzi rodzica */
    color: grey;
}
/* parents of the start person */
#dboxes .parlinks {
    position: absolute;
    top: 8px;
    /*noinspection CssUnresolvedCustomProperty*/
    left: var(--cx, 50%);
    /*noinspection CssUnresolvedCustomProperty*/
    transform: translateX(clamp(calc(6px - var(--cx,0px)), -50%, calc(var(--cw,100%) - 6px - var(--cx,0px) - 100%)));
    width: max-content;
    /*noinspection CssUnresolvedCustomProperty*/
    max-width: calc(var(--cw, 100%) - 12px);
    box-sizing: border-box;
    text-align: center;
    margin-bottom: 4px;
    font-size: 11px;
    line-height: 16px;
    z-index: 3;
}
