/* Better Defaults */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
}

/* Wrapper Setup */

body {
    font: 100%/1.5 sans-serif, system-ui;
    display: flex;
    flex-flow: column;
    gap: 2em;
    max-width: 1200px;
    min-height: 100vh;
    margin: auto;
    padding: 1em;
    background-color: rgb(10, 10, 10);
}

p {
    color: white;
}

h1, h2 {
    color: white;
    text-align: center;
}

h2 {
    color: white;
}

/* Layout */

main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1em;
}

#left-column {
    display: flex;
    flex-flow: column;
    align-items: center;
    gap: 1em;
}

#right-column {
    display: flex;
    flex-flow: column;
    align-items: center;
    gap: 1em;
}

/* Introduction / Hook Section */

header,
.conclusion {
    margin: 3em 0;
    width: 100%;
    display: flex;
    flex-flow: column;
    align-items: center;
    gap: 1em;
}

header p,
.conclusion p {
    max-width: 80ch;
    text-align: justify;
}

/* drop down */
option {
    color: black;
   }

/* Map */

#map {
    width: 100%;
    height: fit-content;
    border-radius: 4px;
    background-color: rgb(20, 20, 20);
}

#new-map {
    max-width: 70ch;
    background-color: rgb(20, 20, 20);
}

/* Tooltip */

#tooltip {
    position: absolute;
    background: white;
    padding: 5px;
    border: 1px solid black;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
}

/* Legend */

#legend, #new-legend {
    width: 100%;
    max-width: 400px;
    margin: auto;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

#legend svg {
    width: 100%;
    height: auto;
}

/* Bar */

#bar-chart-container {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
}


/* Axis' */

.domain,
.tick line {
    stroke: white;
}

.tick text {
    fill: white;
}

/* Static and Dynamic */

.story p {
    padding: .5em 1em;
    text-align: justify;
}

/* Slider */

#slider-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
}

#slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    background: white;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
    position: relative;
}

#slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    border: solid rgb(28, 28, 28) 1px;
    cursor: pointer;
    position: relative;
    transition: transform 0.1s ease-in-out;
}

#slider:active::-webkit-slider-thumb {
    transform: scale(1.2);
}

#slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

#slider-value {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    padding: 3px 6px;
    border-radius: 2px;
    font-size: 0.9em;
    white-space: nowrap;
}

#slider-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 0.9em;
    color: rgb(191, 191, 191);
}

/* Dropdown */

#dataType, #socialDataType {
    background-color: transparent;
    border: 2px solid white;
    border-radius: 2px;
    color: white;
    padding: 0.5em;
    font-size: 1em;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
}

#dataType::after, #socialDataType::after {
    content: '▼';
    color: white;
    font-size: 1em;
    position: absolute;
    right: 0.5em;
    pointer-events: none;
}

.select-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 320px;
}

.select-wrapper select {
    width: 100%;
    padding-right: 0.5em;
}

.select-wrapper::after {
    content: '▼';
    font-size: 1em;
    color: white;
    position: absolute;
    right: 0.5em;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

option {
 color: black;   
}

#desc {
    max-width: 80ch;
    margin: 0 auto; /* centers the container horizontally */
    text-align: justify; /* centers the text inside the container */
}


#mapbox{
    width: auto;
    height: 700px;
}

#mapinfo{
    text-align: center;
}

/* iPhone Stylesheet */
@media print, screen and (max-width: 440px) {
    #slider-container{
        width:90%;
    }
    main{
        grid-template-columns: 1fr;
    }
    #legend{
        width:100%;
    }
    #map, #new-map{
        width:85%;
    }
}

