@font-face {
    font-family: 'Source Sans 3';
    src: url(../assets/fonts/Source_Sans_3/SourceSans3-VariableFont_wght.ttf);
    font-style: normal;
}

@font-face {
    font-family: 'Source Sans 3';
    src: url(../assets/fonts/Source_Sans_3/SourceSans3-Italic-VariableFont_wght.ttf);
    font-style: italic;
}

@font-face {
    font-family: 'Source Code Pro';
    src: url(../assets/fonts/Source_Code_Pro/SourceCodePro-VariableFont_wght.ttf);
    font-style: normal;
}

@font-face {
    font-family: 'Source Code Pro';
    src: url(../assets/fonts/Source_Code_Pro/SourceCodePro-Italic-VariableFont_wght.ttf);
    font-style: italic;
}

:root {
    font-family: 'Source Sans 3', sans-serif;
    color: var(--color-default-text);

    h1,
    h2,
    h3,
    h4 {
        font-family: 'Source Sans 3', serif;
        text-shadow: var(--shadow-titles-and-nav);
    }
}

#main {
    display: grid;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    grid-template-columns: repeat(48, 1fr);
    grid-template-rows: repeat(24, 1fr);
    box-sizing: border-box;
    overflow: clip;
    container: main / size;
    --unit-vertical: calc(100vh/24);
    --unit-horizontal: calc(100vw/48);
}

#ecorpusContainerId {
    z-index: 0;
    display: block;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    position: absolute;
}


#sceneTitle {
    grid-column: 2/25;
    grid-row: 2/4;
    z-index: 5;

    h1 {
        margin-top: -8px;
    }

    .scene-subtitle {
        font-size: var(--font-size-1);
    }
}

#navBar {
    grid-column: 25/49;
    grid-row: 1/3;
    z-index: 5;
}

#stepNavigation {
    grid-column: 1/9;
    grid-row: 6/20;
    z-index: 5;
}

.secondary-control {
    grid-column: 10/36;
    grid-row: 22/24;
    z-index: 2;
}

#toursArticleContainerId {
    grid-column: 37/49;
    grid-row: 4/23;

}

#navBackground {
    grid-column: 1/49;
    grid-row: 1/25;
    z-index: 1;
    display: none;
}

#experiment {
    display: grid;
    grid-template-rows: subgrid;
    grid-template-columns: subgrid;
    grid-column: 1/49;
    grid-row: 1/25;
    z-index: 3;
    background-color: var(--color-article-background);
    background-image: url(../assets/img/grid-line-pattern-with-blue-texture-background2.jpg);
    background-size: cover;

    .secondary-control {
        flex-direction: row;
        align-items: center;
        justify-content: space-evenly;
        display: flex;
    }
}

#experimentRender {
    grid-column: 14/36;
    grid-row: 2/22;
    z-index: 2;
    position: relative;
    height: fit-content;
    margin: auto;
    max-height: 100%;

    img {
        inset: 0;
        margin: auto;
        max-height: calc(var(--unit-vertical) * 19 );
        max-width: calc(var(--unit-horizontal) * 25 );
        &:first-of-type {
            anchor-name: --background-socle;
        }

        &:last-of-type {
            position: absolute;
        }
    }

    canvas {
        width: 100%;
        height: 100%;
        position-anchor: --background-socle;
        aspect-ratio: 1;
        left: anchor(-29.8%);
        top: anchor(-12.8%);
        position: absolute;
        /* transform: scale(1.17) perspective(133em) rotateX(0deg) rotateY(32deg); */
        transform: perspective(19em) rotateX(-14deg) rotateY(29deg) scale(0.7);
    }
}

.simple-button {
    background-color: var(--color-button-background);
    border: none;
    color: var(--color-button-text);
    box-shadow: var(--shadow-default);
    border-radius: var(--button-corner-radius);
    text-align: center;
    min-height: var(--unit-vertical);
    pointer-events: all;
    font-family: "Source Code Pro", monospace;
    text-wrap: balance;
    text-wrap: pretty;

    &:has(>svg) {
        display: flex;
        align-items: center;
        justify-content: space-between;

        span {
            flex-grow: 1;
        }

        svg {
            min-width: calc(var(--unit-horizontal) * 1.4);
            width: calc(var(--unit-horizontal) * 1.4);
        }
    }

}

.active {
    background-color: var(--color-accent);
}




/* ------------ Tour article common ------------ */

.tours-article-container {
    background-color: var(--color-article-background);
    padding: calc(100vw/96);
    color: var(--color-default-text);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-accent) var(--color-article-background);
    z-index: 6;
    box-shadow: 2px 4px 6px #0000006d;
    font-size: var(--font-size);


    h2 {
        margin-top: 0;
        max-width: calc(100% - 100vw/96);
        font-weight: 600;
        font-family: "Source Code Pro";
    }

    p {
        margin-top: 0.5rem;

        strong {
            font-weight: 625;
            color: var(--color-accent-lighter);
        }
    }

    img {
        margin-top: 0.5rem;
        width: 100%;
        height: auto;
    }

    figcaption {
        font-size: var(--font-size-1b);
    }

    h1 {
        margin-top: 0;
        max-width: calc(100% - 100vw/96);
    }


    .close-article-button {
        position: fixed;
        top: calc(200vh / 12 + 0.2rem);
        left: auto;
        right: 0.2rem;
    }
}


/*----*/
#substepsNavigation {
    pointer-events: none;

    div {
        display: none;
        flex-direction: row;
        justify-content: center;
        gap: var(--unit-horizontal);
        grid-template-columns: repeat(var(--nb-substeps, 3), 1fr);
    }

    div:has(.active) {
        display: grid;
    }

    button {
        min-width: calc(5*var(--unit-horizontal));
    }

}

#stepNavigation {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: var(--unit-vertical);
    pointer-events: none;

    button {
        padding-left: calc(2 * var(--unit-horizontal));
        margin-left: calc(-1 * var(--unit-horizontal));
        font-weight: 540;
        text-align: left;
        position: relative;
        left: 0;
        transition: left 0.3s ease;

        &.active{
            left: var(--unit-horizontal);
        }
    }
}