:root {
    --primary: #0092c8;
    --light-primary: #c3cfe3;
    --lighter-primary: #c9d4e6;
    --text-primary: #e8e8f4;
    --text-light-primary: #141414;
    --secondary: #caba87;
    --light-secondary: #d8c998;
    --lighter-secondary: #e2dfd2;
    --text-secondary: #141414;
    --dark-grey: #434343;
    --light-grey: #dcdcdc;
    --lighter-grey: #fafafa;
    --hover-red: #da4040;
    --red: #e04c4c;
    --dark-white: #eeeeee;
    --primary-border-style: 2px solid var(--primary);
    --secondary-border-style: 2px solid var(--secondary);
    --dark-grey-border-style: 2px solid var(--dark-grey);
    --light-grey-border-style: 1px solid var(--light-grey);
}

@font-face {
    font-family: AgencyFB;
    src: url("../ttf/AgencyFB-Bold.ttf");
}

@font-face {
    font-family: AstoriaRoman;
    src: url("../ttf/AstoriaRoman.ttf");
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: var(--lighter-primary);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11pt;
}

h3 {
    font-size: 13.5pt;
}

.loading-wheel {
    display: flex;
    justify-content: center;
}

.loading-wheel img, .info-panel .loading-wheel img {
    width: 4.6em;
}

.header-container, .subheader-container {
    margin-bottom: 1em;
}

.header-container, .footer-container {
    background: var(--primary);
}

.header-container {
    padding-bottom: 0.8em;
    border-bottom: var(--secondary-border-style);
}

.header, .footer {
    background: var(--dark-grey);
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 8em;
    padding: 0 5em;
    text-align: center;
}

.header > div {
    display: flex;
    align-items: center;
    width: 3em;
}

.header > span > * {
    margin: 0.2rem 0;
}

.header > span ~ div {
    justify-content: flex-end;
}

.header h1, .header h2 {
    width: auto;
    text-align: center;
    font-weight: normal;
    letter-spacing: 0.1em;
}

.subheader-container {
    display: flex;
    justify-content: center;
    gap: 1em 2em;
    flex-wrap: wrap;
}

.subheader {
    display: flex;
    flex-direction: column;
    max-width: 26em;
    align-self: flex-start;
}

.subheader > img {
    max-width: inherit;
}

.footer-container {
    margin-top: 1em;
    padding-top: 0.8em;
    border-top: var(--secondary-border-style);
    z-index: 1;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 2em 3em;
    flex-wrap: wrap;
    padding: 2em 4em;
    color: var(--lighter-primary);
}

.footer h4 {
    color: var(--secondary);
}

.footer a {
    color: var(--lighter-primary);
}

.footer .footer-end {
    align-self: flex-end;
    text-align: right;
}

.footer-icon-links {
    display: flex;
    gap: 0.8em;
}

.footer-icon-links a {
    line-height: 0;
    font-size: 3em;
    text-decoration: none;
}

.footer-icon-links svg {
    width: 1em;
    height: 1em;
}

.footer-icon-links path {
    fill: none;
    stroke: var(--lighter-primary);
    stroke-width: 20;
}

.footer-icon-links a:hover {
    color: var(--light-secondary);
}

.footer-icon-links a:hover path {
    stroke: var(--light-secondary);
}

.container {
    flex-grow: 1;
    width: 80%;
    margin: 0 auto;
}

.centered {
    text-align: center;
}

.button {
    padding: 0.4em 1em;
    cursor: pointer;
    background: var(--primary);
    color: var(--text-primary);
    font: inherit;
    font-weight: bold;
    border: none;
    border-radius: 0.5em;
}

.button:hover {
    filter: grayscale(20%);
}

.button.disabled {
    background: var(--dark-grey);
}

.circle-marker {
    width: 1em;
    height: 1em;
    border-radius: 0.5em;
}

.chart-container {
    margin-top: 1.4em;
}

.chart-container.current {
    display: grid;
    grid-template-columns: auto 1fr;
}

.chart-container.met {
    display: none; /* NOTE: Hidden initially since they're only shown when there's data */
}

.chart-container.met select {
    width: 100%;
    margin-bottom: 0.2em;
    text-align: center;
}

.pollutant-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 22em;
    text-align: center;
    color: initial;
}

.pollutant-status h3 {
    margin-top: 0.5em;
}

.pollutant-status > *:not(h3) {
    display: none;
}

.pollutant-status .status:not(.pollutant-status .gauge) {
    font-size: 15pt;
    font-weight: bold;
}

.pollutant-status .no-detection {
    margin-bottom: 1.4em;
    font-size: 8pt;
}

.pollutant-status .gauge { /* FIXME: Workaround for https://github.com/toorshia/justgage/issues/93 */
    width: 18em;
    height: 10.5em;
}

.pollutant-status select {
    width: 13em;
    text-align: center;
}

.chart { /* NOTE: Flex required for loading wheel and error message */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 32em;
}

.chart .loading-wheel img {
    width: 10em;
}

.chart-footnote {
    margin: 0.6em 0.6em 0;
    padding: 0.4em 0.8em;
    text-align: justify;
    background: var(--light-secondary);
    border-radius: 0.5em;
}

.info-panel {
    margin: 0 2em;
}

.info-panel:last-child {
    margin-bottom: 1.5em;
}

.info-panel h4 {
    margin-bottom: 0.85em;
    font-size: larger;
}

.info-panel p {
    text-align: justify;
}

.info-panel a {
    color: revert;
}

.info-panel ol, .info-panel ul {
    padding-left: 2em;
}

.info-panel li:not(:last-child) {
    margin-bottom: 0.5em;
}

.info-panel img, .info-panel table {
    margin: 1em 0;
}

.info-panel img {
    display: block;
    width: 45%;
    max-width: 45em;
}

.info-panel table {
    width: 100%;
    border-collapse: collapse;
}

.info-panel table * {
    padding: 0.4em;
    border: 1px solid;
}

.info-panel hr {
    margin: 2em 0 !important;
}

.info-panel .footnote {
    text-align: center;
    font-size: 0.95em;
}

.info-panel .document {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.4em 0.8em;
    border-radius: 0.4em;
    color: black;
    font-size: 1.3em;
    text-decoration: none;
}

.info-panel .document:hover {
    background: var(--light-primary);
    filter: brightness(90%);
}

.info-panel .document-icon {
    color: var(--primary);
    font-size: 1.4em;
}

table.fixed {
    table-layout: fixed;
}

.test-logout {
    position: absolute;
}

@media (min-width: 901px) {
    .info-panel .flex {
        display: flex;
        margin: 1em 0;
        gap: 1em;
    }

    .info-panel .flex > div {
        width: 50%;
    }

    .info-panel .flex > div > *:first-child {
        margin-top: 0;
    }

    .info-panel .flex > div > *:last-child {
        margin-bottom: 0;
    }

    .info-panel .flex img {
        width: 100%;
    }
}

@media (max-width: 1280px) {
    .container {
        width: auto;
        margin: 0em 2em;
    }

    .info-panel img {
        width: 40%;
    }
}

@media (max-width: 1024px) {
    .chart-container.current {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .pollutant-status select {
        margin-bottom: 1em;
    }

    .info-panel img {
        width: 50%;
    }
}

@media (max-width: 900px) {
    .header img {
        display: none;
    }

    .info-panel img {
        width: 55%;
    }

    .info-panel .flex > div {
        width: 100% !important; /* NOTE: To override optional inline style */
    }
}

@media (max-width: 768px) {
    .subheader {
        width: calc(100% - 2em);
        margin: 0 2em;
    }

    .container {
        margin: 0;
    }

    .info-panel {
        margin: 0 1.2em;
    }

    .info-panel img {
        width: 100%;
        max-width: 25em;
    }
}
