:root {
    --brand-color        : hsla(221,  40%,  14%, 1  );
    --alt-color-lighter  : hsla(  9,  93%, 100%, 1  );
    --alt-color-light    : hsla(  9,  50%,  72%, 1  );
    --alt-color          : hsla(  9,  93%,  72%, 1  );
    --alt-color-dark     : hsla(  9,  93%,  25%,  .7);
    --spacing            : 1rem;
    --spacing-small      : calc(var(--spacing) / 2);
    --spacing-large      : calc(var(--spacing) * 2);
    --border-radius      : 2px;
    --transition-duration: .1s;

    --panel-width                   : 100vw;
    --panel-height                  : 70vh;
    --panel-min-width               : auto;
    --panel-max-width               : auto;
    --panel-unexpanded-translate-x  : 0;
    --panel-unexpanded-translate-y  : -100%;
    --panel-expanded-map-translate-x: 0;
    --panel-expanded-map-translate-y: 35vh;
}

@media all and (min-width: 600px) {
    :root {
        --panel-width                   : 30vw;
        --panel-height                  : 100vh;
        --panel-min-width               : 300px;
        --panel-max-width               : 500px;
        --panel-unexpanded-translate-x  : -100%;
        --panel-unexpanded-translate-y  : 0;
        --panel-expanded-map-translate-x: 15vw;;
        --panel-expanded-map-translate-y: 0;
    }
}

@font-face {
    font-family: Text;
    src: url('../font/OpenSans-regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* {
    box-sizing: border-box !important;
    margin: 0;
    padding: 0;
}

[aria-hidden="true"] {
    display: none;
}

html {
    font-size: 100%;
}

body {
    color: var(--brand-color);
    font: 1.1rem/1.4rem Text, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
}

#body-background {
    position: absolute;
    object-fit: cover;
    width: 100%;
    height: 100%;
}

main {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

nav > form[role="search"] {
    position: fixed;
    top: var(--spacing);
    padding: 0 var(--spacing);
    width: var(--panel-width);
    min-width: var(--panel-min-width);
    max-width: var(--panel-max-width);
    z-index: 2;
}

nav > section {
    z-index: 1;
    position: absolute;
    width: var(--panel-width);
    min-width: var(--panel-min-width);
    max-width: var(--panel-max-width);
    height: var(--panel-height);
    padding: var(--spacing);
    display: flex;
    flex-direction: column;
    background: var(--alt-color);

    transform:
        translateX(var(--panel-unexpanded-translate-x))
        translateY(var(--panel-unexpanded-translate-y));
    transition: var(--transition-duration) transform ease-in-out;
}

    nav[aria-expanded="true"] > section {
        box-shadow: 3px 0 var(--spacing) var(--alt-color-dark);
        transform: translateX(0) translateY(0);
    }

article {
    position: absolute !important;
    width: 100vw;
    height: 100vh;
}

    article > .mapboxgl-canvas-container {
        transform: translateX(0) translateY(0);
        transition: var(--transition-duration) transform ease-in-out;
    }

    nav[aria-expanded="true"] ~ article > .mapboxgl-canvas-container {
        transform:
            translateX(var(--panel-expanded-map-translate-x))
            translateY(var(--panel-expanded-map-translate-y));
    }

footer {
    position: fixed;
    bottom: var(--spacing);
    right: var(--spacing);
    color: var(--alt-color);
    font-size: 1.1em;
    font-weight: bold;
    font-variant: all-small-caps;
    letter-spacing: .1em;
    text-shadow:
        var(--alt-color-lighter)  0    2px,
        var(--alt-color-lighter)  0   -2px,
        var(--alt-color-lighter)  2px  0,
        var(--alt-color-lighter) -2px  0;
}

@media all and (min-width: 600px) {
    footer {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
}

input {
    all: unset;
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    padding: var(--spacing-small) var(--spacing);
    line-height: var(--spacing-large);
    border: 1px var(--alt-color-light) solid;
    border-radius: var(--border-radius);
    background: var(--alt-color-lighter);
}

#map {
    font: inherit;
}

    #map .mapboxgl-ctrl-group {
        border: 1px var(--alt-color-light) solid;
        box-shadow: unset;
    }

    #map .mapboxgl-ctrl-icon {
        border-color: var(--alt-color-light);
    }

    #map .mapboxgl-ctrl-attrib {
        font-size: .6em;
        background: hsla(0, 0%, 100%, .8);
    }
