html, body {
    height: 100%;
    display: flex;
    flex-direction: column;
}
body > * {
  flex-shrink: 0;
}

div#persons, .stats {
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
    font-size: larger;
    line-height: 150%;
    border: 1px solid lightgrey;
    border-radius: 10px;
    padding: 20px;
    max-width: 800px;
    padding-top: 10px;
    background: #dcbfad;
    box-shadow: rgba(0, 0, 0, 0.25) 0px 54px 55px, rgba(0, 0, 0, 0.12) 0px -12px 30px, rgba(0, 0, 0, 0.12) 0px 4px 6px, rgba(0, 0, 0, 0.17) 0px 12px 13px, rgba(0, 0, 0, 0.09) 0px -3px 5px;
    background-image: url('/general/billie-holiday.png');
    overflow-wrap: break-word;
}

span.relationship-description {
    font-size: smaller;
    font-style: italic;
}

a.select-for-relation {
    font-size: x-small;
    font-family: -apple-system,
                BlinkMacSystemFont,
                "Segoe UI",
                Roboto,
                Oxygen-Sans,
                Ubuntu,
                Cantarell,
                "Helvetica Neue",
                sans-serif;
    text-shadow: none;
    color: black;
    text-decoration: none;
    border: 1px solid black;
    border-radius: 6px;
    padding: 2px;
    position: relative;
    top: -9px;
}

a.select-for-relation:visited {
    color: black;
}

div#outer {
    padding-top: 10px;
    flex-grow: 1;
    position: relative;
    background-color: #ea7e0073;
    background-image: url('/general/black-paper.png');
}

.auth_biography img,
.biography img
 {
    box-shadow: 0px 1px 3px black;
    border: 16px solid white;
    max-width: 70%;
    display: block;
    margin: 0 auto;
}

/*
 This is to prevent img style from impacting the preview window,
 when a user hovers over a link to a person
*/
.biography .preview_window img {
    box-shadow: initial;
    border: initial;
    max-width: initial;
    display: initial;
    margin: initial;
}

.preview_window {
    overflow: hidden;
}

.name-and-era {
    margin: auto;
    text-align: center;
    padding: 10px;
    font-weight: bolder;
    display: flex;
    flex-direction: column;
}

.lifespan-era {
    font-size: smaller;
}

span.distance {
    padding-right: 10px;
}

div.image-container {
    max-width: 200px;
    margin-left: 10px;
    margin-right: 30px;
    float: left;
    border-radius: 19px;
}

.image-container > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    border: 3px solid #2a1002;
}

.extended-family-item {
    clear: both;
}

div#extended-family-block {
    padding-bottom: 20px;
    width: 100%
}

div#extended-family-block img.thumbnail {
    height: 15px;
}

div#control_panel {
    border: 8px outset dimgrey;
    background: cyan;
    padding: 10px;
}

.last-modified {
    font-size: 10px;
    position: absolute;
    bottom:0;
}

figure {
  break-inside: avoid;
}

figcaption {
  font-style: italic;
  font-size: 0.8rem;
  width: 70%;
  margin: 0 auto;
}

.label {
    color: darkslategrey
}

blockquote {
    display: inline-block;
    background: darkgrey;
    margin: 10px;
    padding: 10px;
}

.add-relation-action input[name="relation_name_input"] {
  width: 123px;
  font-size: 16px;
}

form.add-relation-action {
  display: inline;
}


div#search_result_container {
    position: absolute;
    font-size: smaller;
    background: white;
    border: 1px solid grey;
    width: 415px;
    right: 29px;
    z-index: 999; /* put it on top of everything */
    font-size: small;
}

#search_result_container > ul > li:hover,
#search_result_container > ul > li[selected]
{
    background: lightblue;
}

ul#search_result_list {
    list-style: none;
    padding-inline-start: 0;
    display: inline-block;
    width: 100%;
    line-height: 21px;
}

.input-section {
    display: inline-block;
}

.calculated-relatives a,
 .relation-to-other a {
    display: inline-block;
    color: black;
}


ul.descendants-grouped > li,
ul.ancestors-grouped > li {
    display: flex;
    flex-direction: column;
}

ul.descendants-grouped > li > div,
ul.ancestors-grouped > li > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
}

ul.descendants-grouped a > img,
ul.ancestors-grouped a > img {
    height: 170px;
    width: 100%;
    object-fit: cover;
    border-radius: 10px;
    border-width: 3px;
    border-style: solid;
    border-color: rgb(42, 16, 2);
    border-image: initial;
}

.ancestors-grouped a,
.descendants-grouped a {
    display: flex;
    flex-direction: column;
    color: black;
    font-size: 10px;
    width: 170px;
    text-align: center;
    margin: 0px 0px 15px;
    text-decoration: none;
}

ul.calculated-relatives.tree-graphic img.tree-thumbnail {
    height: 50px;
}

ul.calculated-relatives.tree-graphic a {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
}

ul.calculated-relatives.tree-graphic span.name {
    max-width: 250px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

ul.calculated-relatives.tree-graphic a > img{
        padding-left: 5px;
}

span.parents-group {
    display: flex;
    flex-direction: column;
    margin: 2px;
    border: 1px solid grey;
    border-radius: 9px;
}

/*
This section is for how close someone is related to you, when we do a
breadth-based search to find your closest relatives.
*/

a.distance-1 {
    color: black;
}

a.distance-2 {
    color: darkslategrey;
}

a.distance-3 {
    color: grey;
}

a.distance-4 {
    color: #9f9f9f;
}

/*
This section - offsets - is to indicate whether someone is a cousin
at your generation or once-removed, or twice-removed.
*/

a.offset-3 {
    color: #9f9f9f;
}

a.offset-2 {
    color: grey;
}

a.offset-1 {
    color: darkslategrey;
}
a.offset-0 {
    color: black;
    border: 1px solid grey;
    border-radius: 6px;
}

.missing-person {
    background: red;
    color: white;
}

/* handling deeply-nested lists */

ul.tree-graphic, .tree-graphic ul  {
  padding-inline-start: 45px;
}

.tree-graphic ul {
    border-left: 1px solid black;
}

.tree-graphic li {
    list-style: none;
}

/* These stats show at the bottom of the page when auth'd */

.stats {
    padding-top: 10px;
    column-count: 2;
    flex: 0 0 440px;
}

.auth_biography {
    background: darkgrey;
    margin-top: 2px;
}

li.manual-links a {
    display: inline-block;
    color: #842e0f;
    font-size: 14px;
    border: 1px solid #805b45;
    border-radius: 5px;
    text-decoration: none;
    background: linear-gradient(#e5e3b0, #d3d2a1, #c6ba94, #c2b58c, #b9ac84);
    box-shadow: 1px 2px 7px rgba(0, 0, 0, 0.5);
    padding-left: 5px;
    padding-right: 5px;
    transition: 0.2s ease-in-out;
    font-weight: 600;
}


li.manual-links a:hover,
li.manual-links a:focus {
    border: 1px solid white;
}

li.manual-links a:active {
  box-shadow: initial;
  border: 1px solid white;
}

/*
For styling on the HTML ancestry/descendants view
*/

.tree-graphic-exterior ::marker, .tree-graphic-exterior ::before::marker, .tree-graphic-exterior ::after::marker
Specificity: (0,0,1)
 {
    unicode-bidi: isolate;
    font-variant-numeric: tabular-nums;
    text-transform: none;
    text-indent: 0px !important;
    text-align: start !important;
    text-align-last: auto !important;
}

.tree-graphic-exterior details summary {
    cursor: pointer;
}

.tree-graphic-exterior details[open] > summary:first-of-type {
    list-style-type: disclosure-open;
}

.tree-graphic-exterior details > summary:first-of-type {
    display: list-item;
    counter-increment: list-item 0;
    list-style: disclosure-closed;
}

.tree-graphic-exterior summary {
    display: block;
    unicode-bidi: isolate;
}

@media only screen and (max-width: 600px){

    div.image-container {
        border: 1px solid lightgrey;
        display: flex;
        flex-direction: row;
        align-items: center;
        background: white;
        float: initial;
        margin: auto;
    }

    div#persons, .stats {
        margin: 10px;
        font-size: initial;
        line-height: initial;
        border: 1px solid lightgrey;
        border-radius: 10px;
        padding: 10px;
    }

    .auth_biography img,
    .biography img {
        box-shadow: none;
        border: none;
        max-width: 100%;
    }

    figure {
        width: 100%;
        margin: 0 auto;
    }

    figcaption {
        width: 100%;
    }

    ul.tree-graphic, .tree-graphic ul  {
      padding-inline-start: 20px;
    }

    ul.calculated-relatives.tree-graphic a {
        width: 94%;
    }

    ul.calculated-relatives.tree-graphic span.name {
        width: 75%;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }

    ul.calculated-relatives.tree-graphic img.tree-thumbnail {
        height: 40px;
    }

    ul.descendants-grouped,
    ul.ancestors-grouped {
        padding-inline-start: 0;
    }

    ul.descendants-grouped a > img,
    ul.ancestors-grouped a > img {
        height: 110px;
        width: 100%;
    }

    .ancestors-grouped a,
    .descendants-grouped a {
        width: 110px;
    }

}