*,
*::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;
}

/* ---- */

li {
    list-style-type: "\2014   ";
}

a {
    color: inherit;

    &:not(:has(img))[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,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMSIgaGVpZ2h0PSIyMSIgdmlld0JveD0iMCAwIDIxIDIxIj48cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBkPSJNMTQuNSAxMy41di03aC03bTcgMGwtOCA4IiBzdHJva2Utd2lkdGg9IjEiLz48L3N2Zz4K);
    }
}

@font-face {
    font-family: "EB Garamond";
    src:
        url("../fonts/EBGaramond-Regular.b34d85c5c6a8.woff2") format("woff2"),
        url("../fonts/EBGaramond-Regular.235a287de910.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;
    }
    p:nth-child(2) {
        font-size: 0.7rem;
        text-align: right;
    }
}

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;
        }
        &.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;
}

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%;
    }
}

table {
    th {
        text-align: right;
        min-width: 130px;
        color: #999;
    }

    &.th-min-width-auto {
        th {
            min-width: auto;
        }
    }

    &.th-text-aligh-left {
        th {
            text-align: left;
        }
    }

    td {
        padding-left: 1rem;
    }
}

.leaflet-layer {
    filter: grayscale(1);
}
