body, footer {
background-color:black;
color: white;
font-family: 'Courier New', Courier, monospace;
}

body {
    height: 98vh;
    max-height: 98vh;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
}

footer {
    margin-top: 1%;
    -webkit-justify-content: left;
    justify-content: left;
    /*max-height: 20pt;*/
    margin-bottom: 0;
}

footer > div > a {
    color: white
}

header {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
}

#data-container {
    position: relative;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-grow: 1;
    flex-grow: 1;
    max-height: 100%;
    overflow-y: auto
      
}

#map {
    width: 100%;
    min-width: 210px;
    height: 80vh;
    max-height: 100%;
    background-color: #bdffe8
}

table {
    color: black;
    width: 25em;
    min-width: 240px;
    height: 100%;
    max-height: 100%;
    -webkit-margin-inline-start: 1em;
    margin-inline-start: 1em;
    -webkit-margin-inline-end: 2em;
    margin-inline-end: 2em;
    padding-bottom: 0;
    display: -webkit-flex;
    display: flex;
    overflow-y: auto;
    flex-direction: column;
}

tbody {
    background: gray;
    width: stretch;
    height: 100%;
    max-height: 100%;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-flow: column;
    flex-flow: column;
    overflow-x: hidden;
    padding-right: 1%;
    padding-left: 1%;
    /*padding-top: 5px;*/
    padding-bottom: 0px;
}

thead {
    background: grey;
    width: stretch;
    height: max-content;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-flow: column;
    flex-flow: column;

    overflow-y: visible;

    padding-right: 1%;
    padding-left: 1%;
    padding-top: 5px;
    padding-bottom: 0px;
}

tr {
    -webkit-justify-self: center;
    justify-self: center;
    width: 100%;
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-align-items: center;
    align-items: center;
    font-weight: bold;
}

tr#title-row {
    min-height: 26px;
    margin-top: 1%;
    display: flex;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-justify-items: center;
    justify-items: center;
    font-weight: bold
}

#heading-row, .total-row, #counted-row {
    font-weight: bold;
    background: lightgray;
}

#heading-row {
    margin-top: 1vh;
    margin-bottom: 0.5vh;
}

td {
    font-size: 8pt;
    margin-right: 1.5%;
    margin-left: 1.5%;
}

td#value-headings {
    margin: 0;
}

.key {
    overflow: hidden;
    max-width: 40%;
}

tr#heading-row > td {
    font-size: 10pt;
}

#values, #value-headings {
    width: 50%;
    min-width: 50%;
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    /*justify-content: flex-end*/
}

.value, .percent, #table-title {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: center;
    justify-content: center;
    padding-left: 2.5%;
    padding-right: 2.5%;
    border: 1px solid black;
}

.candidate-row, .selected-row {
    border-radius: 10px;
    border: 1px solid black;
    padding: 1%;
}

.candidate-row > .key,
#values > .percent,
#values > .value,
.selected-row > .key,
#values > .percent,
#values > .value {
    padding-left: 2%;
    padding-right: 2%;
  /*  padding-left: 5px;
    padding-right: 5px;*/
}

.value-series {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column-reverse;
    flex-direction: column-reverse;
    min-width: 30%;
    width: fit-content;
    /*min-width: 50%;*/
    /*width: max-content;*/
    /*margin-left: 0;*/
    /*margin-right: 0;*/
}

.value, .key, .percent, #table-title {
    background: white;
    border-radius: 15px;
    border: 1px solid black;
}

#table-title {
    border: 3px solid black;
    max-height: 100%;
}

td#borderNone {
    border: 0px;
}

#total-rows {
    display: -webkit-flex;
    display: flex;
    -webkit-align-self: flex-end;
    align-self: flex-end;
    min-width: max-content;
    -webkit-flex-flow: column;
    flex-flow: column;
}

.total-row, #counted-row {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-align-self: flex-end;
    align-self: flex-end;
    min-width: max-content;
    width: 30%;
    padding: 1%;
    padding-inline-end: 10px;
    margin-top: 0.5vh

}


.total-row > .value, #counted-row > .value {
    min-width: initial;
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: center;
    justify-content: center;
    padding-left: 1em;
    padding-right: 1em;
}

.total-key {
    font-size: 11pt;
}

.percent, .value {
    min-width: 25%;
}

.value-series > .percent,
.value-series > .value {
    padding-left: 40%;
    padding-right: 40%;
    margin-top: 2.5%;
    margin-bottom: 2.5%
}

.candidate-row:hover {
    border: 2px solid black;
}

.selected-row {
    border-radius: 10px;
    border: 3px solid black;
    padding: 1%;
}

div#selectors-row {
    padding: 10px;
    padding-right: 0;
    padding-top: 0;
    min-height: 20px;
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-align-items: end;
    align-items: end;
    overflow: auto visible;
}

div#language {
    display: -webkit-flex;
    display: flex;
    height: 20px;
    margin-left: 2em;
    margin-right: 2em;
    padding: 0.5em;
    -webkit-align-self: center;
    align-self: center;
    background-color: grey;
}

#sources, #other-data {
    min-height: 18px;
}

#sources-line {
    display: flex
}

#sources-statement {
    margin-left: 0.5em;
    margin-right: 0.5em
}

#language-icon {
    -webkit-margin-inline-end: 0.5em;
    margin-inline-end: 0.5em;
}

#masthead-logo {
    max-height: 27px
}

#masthead-line {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    margin: 0;
}

#view-title {
    -webkit-margin-block: 0.33em;
    margin-block: 0.33em;
    min-height: 22px;
}

h4 > a {
    text-decoration: none;
    color: white;
    display: -webkit-flex;
    display:flex;
    -webkit-align-items: center;
    align-items: center;
}

#loading-screen {
    display: table;
    width: 100%;
    height: 80vh;
    text-align: center;
}

#Loading {
    display: table-cell;
    vertical-align: middle;
}

#loading-screen.hidden, #data-container.hidden, #language.hidden, #language-icon.hidden, #map-style-selector.hidden, .hidden {
    display: none;
}

#map-style-selector {
    background-color: black;
    position: absolute;
}

#table-meta-info {
    flex-direction: column;
}

#title-and-counted {
    -webkit-flex-direction: column;
    flex-direction: column;
}

.maplibregl-ctrl-attrib.maplibregl-compact, .maplibregl-ctrl-attrib.maplibregl-compact-show {
    margin: 0;
    background-color: rgba(255,255,255, 0.5);
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 5px;
    border-radius: 0;
}

#donate {
    background: #0074d4;
    border-radius: 3px;
    padding-inline: 1.5em;
    text-decoration: none;
    font-family: "SF Pro Text",-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue","Ubuntu",sans-serif;
}

@media (orientation: portrait){
    #data-container {
        flex-direction: column;
        overflow: hidden; /* so child scroll areas behave */
        height: 100%
    }

    #map {
        width: 100%;
        height: 65%;        /* top half of data-container */
        min-width: 0;       /* avoid forcing horizontal layout */
        min-height: 25vh;   /* optional: keeps map usable */

    }

    table {
        width: 100%;
        min-width: 0;
        height: 15em;
        /*height: 35%;*/
        margin-inline-start: 0;
        margin-inline-end: 0;
        overflow-y: auto;

        display: flex;
        flex-direction: column;
    }

    thead {
        flex-flow: row;
        flex-wrap: wrap;
    }

    thead, tbody {
        flex: 0 0 auto;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    tbody {
        width: auto;
    }

    #total-rows {
        flex-flow: column;
        /*align-self: stretch;*/
        justify-content: space-between;
        max-width: 50%;
        min-width: fit-content;
    }

    tr#title-row, #counted-row, .total-row {
        /*width: auto;*/
        /*flex: 1 1 0;*/
        min-width: fit-content;
    }

    div#selectors-row {
        -webkit-flex-wrap: wrap;
        flex-wrap: wrap;
        padding: 0;
        margin-bottom: 2.5px;
    }

    div#language {
        margin-left: 0;
        margin-right: 0;
        margin-top: 2.5px;
    }

    #table-meta-info {
        flex-direction: row;
    }

    #title-and-counted {
        max-width: 50%;
        height: 100%;
        flex-flow: wrap;
    }

    .total-key, .total-row > .value {
        width: min-content;
    }

    #table-title {
        max-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

    #counted-key {
        width: min-content;
    }
}