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

*:not(dialog) {
    margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        interpolate-size: allow-keywords;
    }
}

body {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 3rem;
    line-height: 1.5;
    color: #333;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    font-family: "EB Garamond";
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

input,
button,
textarea,
select {
    font: inherit;
    outline: none;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

p {
    text-wrap: pretty;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    text-wrap: balance;
}

/* ---- */

a {
    color: inherit;

    &[href^="http"]:after {
        content: "";
        display: inline-block;
        width: 12px;
        height: 12px;
        margin-left: 4px;
        background-size: contain;
        background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiMwMDAwMDAiPjxwYXRoIGZpbGw9IiMwMDAwMDAiIGQ9Ik0yMyAxdjhoLTJWOGgtMVY3aC0xdjFoLTF2MWgtMXYxaC0xdjFoLTF2MWgtMXYxaC0xdjFoLTF2MWgtMXYxaC0xdjFIOXYxSDh2LTFIN3YtMUg2di0xaDF2LTFoMXYtMWgxdi0xaDF2LTFoMXYtMWgxVjloMVY4aDFWN2gxVjZoMVY1aDFWNGgtMVYzaC0xVjF6Ii8+PHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTTIwIDE1djdoLTF2MUgydi0xSDFWNWgxVjRoOXYzSDR2MTNoMTN2LTV6Ii8+PC9zdmc+);
    }
}

@font-face {
    font-family: "EB Garamond";
    src:
        url("../fonts/EBGaramond-Regular.woff2") format("woff2"),
        url("../fonts/EBGaramond-Regular.woff") format("woff");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

header {
    flex-shrink: 0;
    height: 3rem;
    a {
        text-decoration: none;
    }
}

#logo {
    display: flex;
    align-items: center;
    font-weight: bold;
    line-height: 1;
    p:nth-child(1) {
        font-size: 1.6rem;
        -webkit-text-stroke: 1px;
    }
    p:nth-child(2) {
        font-size: 0.7rem;
        text-align: right;
        -webkit-text-stroke: 0.2px;
    }
}

nav {
    display: flex;
    height: 100%;
    gap: 2rem;
    flex-direction: column;
    a {
        text-decoration: inherit;
    }
    div {
        border-top: 1px solid;
        font-size: 1.2rem;

        &[aria-current="page"],
        &:has(input:checked) label {
            font-weight: bold;
            -webkit-text-stroke: 0.8px;
        }
        &.push {
            margin-top: auto;
        }
        label {
            cursor: pointer;
        }
    }
    input[type="checkbox"] {
        display: none;
    }
}

#container {
    display: flex;
    gap: 1rem;
    flex-grow: 1;
    overflow: hidden;
}

main > section {
    > input[type="checkbox"] {
        display: none;
    }

    > label {
        font-size: 1.2rem;
        cursor: pointer;
    }

    > .accordeon {
        display: grid;
        grid-template-rows: 0fr;
        transition: grid-template-rows 0.3s;

        > div {
            overflow: hidden;

            > p,
            h3 {
                margin-top: 1rem;
            }
        }
    }

    &:has(input:checked) > .accordeon {
        grid-template-rows: 1fr;
    }
}

aside {
    width: 20rem;
    flex-shrink: 0;
}

section {
    border-top: 1px solid;
}

main {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

h3 {
    font-size: inherit;
    -webkit-text-stroke: 0.8px;
}

div.timeline {
    > span:nth-child(1) {
        display: inline-block;
        width: 5rem;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

div#messages {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    > div {
        border: 1px solid black;
        padding: 1rem;
        opacity: 1;
        animation: fadeOut 2s ease-in 5s;
        background-color: white;
        &.success {
            background-color: #bcd9a2;
        }
        &.error {
            background-color: #ffa6a6;
        }
    }
}

#map {
    height: 500px;
}

@media (max-width: 1199px) {
    body {
        height: auto;
        overflow: auto;
    }
    #container {
        flex-direction: column;
    }
    main {
        order: 1;
    }
    #right {
        max-width: 100%;
    }
}
