/* reset */
* {
    scroll-snap-type: start;
    margin: 0;
    padding: 0;
    color: inherit;
    box-sizing: border-box;
    scroll-behavior: smooth;
}
*, ::after, ::before {
    box-sizing: border-box;
}
html {
    width: 100dvw;
    line-height: 1.15;
}
body {
    font-family: "Barlow Condensed", sans-serif;
    height: max-content;
    width: 100vw;
    overflow-x: hidden;
    position: relative;

    --sb-track-color: var(--color-light);
    --sb-thumb-color: var(--color-dark);
    --sb-size: 16px;    
}
body::-webkit-scrollbar {
    width: var(--sb-size);
}
body::-webkit-scrollbar-track {
    background: var(--sb-track-color);
    border-radius: 1px;
}
body::-webkit-scrollbar-thumb {
    background: var(--sb-thumb-color);
    border-radius: 1px;
}
li, a {
    list-style: none;
    text-decoration: none;
    font-family: var(--font-code);
}

/* RETOUR INDEX */
.back, .btn-fixed {
    width: max-content;
    height: max-content;    
    font-weight: bold;
    font-size: var(--size-code);
    text-transform: uppercase;
    background: var(--color-light);
    border: 3px solid #000;
    box-shadow: 8px 8px 0px #000;
}
.back {
    padding: 2vh 2vw;
    margin: 2vh 0 0 2vh;
}
/* RETOUR EN HAUT */
.btn-fixed {
    padding: 1vh 1vw;
    cursor: pointer;
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-fixed svg {
    width: 2vw;
    height: auto;
    fill: var(--color-dark);
}
.btn-fixed:focus {
    outline: 2px solid var(--color-dark);
    outline-offset: 4px;
}
/* TITRE ET DESCRIPTION */
h1 {
    width: 100%;
    font-family: var(--font-title);
    font-size: var(--size-title);
    font-weight: 700;
    text-transform: uppercase;
    transform: scaleY(1.4);
    color: var(--color-dark);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 4vw;
}
p {
    font-family: var(--font-text);
    font-size: var(--size-text);
    color: var(--color-dark);
    padding: 0 4vw;
}

/* CONTAINER */
.container-principal {
    background-image:
        linear-gradient(#000 2px, transparent 2px),
        linear-gradient(90deg, #000 2px, transparent 2px);
    background-size: 40px 40px;
    background-color: var(--color-light);
    height: 100vh;
    width: 100%;
    display: grid;
    grid-template-rows: 34% 60% 5%;
    grid-template-columns: 1fr;
}

/* HEADER */
header {
    display: grid;
    grid-template-rows: 80% 20%;
    grid-template-columns: 1fr;
}

/* SEARCH */
.search-container {
    z-index: 1;
    position: fixed;
    top: 2vw;
    right: 2vw;
    width: min(60vw, 30rem);
    min-height: max-content;
    transition: all 0.2s ease;
    transform: translate(1rem, 1rem) rotate(5deg) skew(2deg, 2deg);
}
.search-container:hover {
    transform: translate(0, 0) rotate(0deg) skew(0deg, 0deg);
}
.search-container input {
    color: var(--color-dark);
    background: var(--color-light);
    border: 3px solid #000;
    box-shadow: 8px 8px 0px #000;
    width: 100%;
    padding: 1vw;
}
#search-results::-webkit-scrollbar { width: 6px; }
#search-results::-webkit-scrollbar-thumb {  background: #000; }
#search-results::-webkit-scrollbar-track { background: #e5e5e5; }

#search-results {
    color: var(--color-dark);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 50vh;
    height: max-content;
    overflow-y: auto;
    background: var(--color-light);
    z-index: 999;
}
#search-results li {
    cursor: pointer;
    padding: 1vw;
}
#search-status {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* MAIN */
main {
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* NAV */
    nav {
        width: 90%;
        height: 90%;
    }
        ul {
            width: 100%;
            height: 100%;
            display: grid;
            grid-template-rows: repeat(3, auto);
            grid-template-columns: repeat(auto-fit, 25%);
        }
/* LIST NAVIGATION */
li {
    font-family: var(--font-text);
    display: flex;
    align-items: center;
    justify-content: center;
}
    li a {
        color: var(--color-dark);
        font-weight: bold;
        font-size: var(--size-code);
        text-transform: uppercase;
        background: var(--color-light);
        border: 3px solid #000;
        box-shadow: 8px 8px 0px #000;
        transform: rotate(0deg) translate(-4px,-4px);
        width: 60%;
        height: 40%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.1s cubic-bezier(.2,1.4,.4,1);
    }
    li a:hover {
        transform: rotate(-2deg);
        box-shadow: 4px 4px 0px #000;
    }
/* CONTAINER SOUS PAGES */
.container-second {
    position: relative;
    background-color: var(--color-light);
    min-height: 100vh;
    height: max-content;
    width: 100%;
    display: grid;
    grid-template-rows: 8vw auto;
    grid-template-columns: 1fr;
    padding: 2vh;
}
/* MAIN SOUS PAGES */
.main-second {
    padding: 0vh 4vw;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
    display: grid;
    grid:
        "h1-queries h1-queries" 10vw
        "p-queries p-queries" 5vw
        ". ." auto
        / 50% 50%;
    align-items: baseline;
}
.main-second:has(.details-section[open]) {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}

/* TITRE ET DESCRIPTION SOUS PAGES */
.h1-main { 
    height: 100%;
    width: 100%;
    grid-area: h1-queries;
    display: block;
}
.p-main { 
    white-space: nowrap;
    height: 100%;
    width: 100%;
    grid-area: p-queries;
    line-height: 2;
    padding: 0;
}

/* DETAILS */
.details-section[open] {
    min-width: 95vw;
}
.details-section-theme .section-main {
    display: grid;
    grid-template-columns: 38% 18% 1fr;
    justify-items: start;
}
.details-section-query .section-main {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    justify-items: start;
}
details:has(summary:focus-visible) {
    outline: 3px solid var(--color-dark);
}
details, summary {
    padding: 1vw;
}

/* SOMMAIRE */
summary {
    font-size: 2vw;    
    cursor: pointer;
}
summary::marker {
    color: var(--color-dark);
    font-size: 2vw;
}

/* SECTION */
.section-main {
    height: 100%;
    width: 100%;
    padding: 2vw;
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-items: start;
}
/* ARTICLE */
article {
    width: 100%;
}
    /* H2 */
    h2 {
        display: none;
    }    
    /* P */
    .section-main p {
        padding: 1vw 0 4vw 0;
        font-size: var(--size-code);
    }
    /* H3 */
    h3 {
        width: max-content;
        text-transform: uppercase;
        padding: 2vh;
    }
    h3::after {
        content: "";
        display: block;
        width: 100%;
        height: 3px;
        background: var(--color-warning);
        margin: 6px auto 0;
        border-radius: 2px;
    }
    /* PRE */
    pre {
        width: 100%;
        font-family: var(--font-code);
        margin: 1vw 0;
    }
    .pre::-webkit-scrollbar {
        width: var(--sb-size);
    }
    .pre::-webkit-scrollbar-track {
        background: var(--sb-track-color);
        border-radius: 0px;
    }
    .pre::-webkit-scrollbar-thumb {
        background: var(--sb-thumb-color);
        border-radius: 0px;
    }
    .details-section-theme pre, .details-section-query pre {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        height: 100%;
    }
    /* PRE CODE */
        .details-section-query code {
            min-height: 50%;
            text-wrap: auto;
        }
        code {
            display: block;
            padding: 1vw;
            min-width: 95%;
            max-width: 95%;
            min-height: 80%;
            font-weight: bold;
            font-size: var(--size-code);
            background-color: var(--color-dark);
            color: var(--color-warning);
        }
        pre code:focus {
            outline: 3px solid var(--color-dark);
        }
        pre code:focus:not(:focus-visible) {
            outline: none;
        }

/* THEME */
.btn-custom {
    position: absolute;
    top: 8vw;
    right: 5vw;
    font-weight: bold;
    font-size: var(--size-code);
    text-transform: uppercase;
    background: var(--color-light);
    border: 3px solid #000;
    box-shadow: 8px 8px 0px #000;
    padding: 2vh 2vw;
    margin: 2vh 0 0 2vh;
    width: max-content;
    height: max-content;
    cursor: pointer;
    z-index: 1;
}

/* SITE MAP */

/* CONTAINER MAP */
.container-map {
    background-color: var(--color-dark);
    color: var(--color-light);
    min-height: 100vh;
    width: 100%;
    height: max-content;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}
.container-map .back {
    color: var(--color-dark);
}
.header-map {
    display: flex;
    min-height: 30vh;
    justify-content: flex-start;
    align-items: center;
}
    .h1-map {
        color: var(--color-light);    
    }
.header-map, .main-map {
    width: 100%;
}
.nav-map {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 5vw;
}
    .h2-map {
        padding: 2vw 0;
        text-transform: uppercase;
        border-bottom: 2px solid var(--color-warning);
        display: block;
    }
.article-map {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    padding: 3vw;
}
.article-map-prop {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(25%, 1fr));
    align-items: flex-start;
    justify-content: space-between;
    padding: 3vw;
}
    .h3-map {
        text-transform: uppercase;
        font-style: italic;
        line-height: 0;
        width: max-content;
    }
    .h3-map::after {
        display: none;
    }
    .ul-map {
        width: 65%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: space-between;
        padding: 0 1vw;
    }
        .ul-map li {
            width: 30vw;
            padding: 1vh 2vh;
            color: var(--color-dark);
            font-weight: bold;
            font-size: var(--size-code);
            text-transform: uppercase;
            background: var(--color-light);
            border: 3px solid #000;
            transform: rotate(0deg) translate(-4px, -4px);
            display: flex;
            align-items: center;
            justify-content: flex-start;
            transition: all 0.1s cubic-bezier(.2, 1.4, .4, 1);
        }

footer {
    width: 95vw;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1vh 0;
}
.footer-col {
    height: 100%;
    width: 50%;
}
.footer-col:nth-of-type(1) {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}
.footer-col:nth-of-type(2) {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: var(--size-text);
}
    .footer-col p {
        padding: 0;
    }
    .footer-col:nth-of-type(1) p {
        font-size: var(--size-code);        
    }
/* MEDIA QUERIES POUR MOBILE */
@media (max-width: 480px) and (orientation: portrait) {
    :root {
        --size-title: clamp(6vw, 8vw, 9vw);
        --size-text: clamp(2.5vw, 3.5vw, 4vw);
        --size-code: clamp(1.8vw, 2.2vw, 2.8vw);
    }
    /* text-wrap */
    code, h1, h3 {
        text-wrap: wrap;
    }
    h1 {
        padding: 5vw;
        width: 90%;       
    }
    p {
        padding: 2vw 13vw;
    }
    ul {
        grid-template-columns: repeat(auto-fit, 50%);
    }
    /* page secondaire */
    .back {
        padding: 2vw 3vw;
        margin: 2vw 0 0 2vw;
    }

    .main-second {
        padding: 0vh 4vw;
        grid:
            "h1-queries h1-queries" 30vw
            "p-queries p-queries" 10vw
            ". ." auto / 50% 50%;
        margin-top: 4vw;
    }
    /* query */
    .main-query {
        grid: 
            "h1-queries h1-queries" auto
            "p-queries p-queries" 20vw
            ". ." 1fr / 50% 50%
    }
    .p-main {
        padding: 0 5vw;
        line-height: 1;
        white-space: normal;
    }

    summary {
        font-size: var(--size-text);
    }
    summary::marker {
        font-size: var(--size-text);
    }


    .details-section-query .section-main, .details-section-theme .section-main, .section-main {
        display: grid;
        grid-template-columns: 1fr;
        justify-items: start;
    }
    article {
        height: max-content;
    }

    h3, h4 {
        width: 93%;
    }
    pre {
        width: 93%;        
    }

    code {
        min-width: 92%;
    }

    .btn-fixed {
        bottom: 8vh;
        right: 13vw;
        padding: 2vw 3vw;
    }
    .btn-fixed svg {
        width: var(--size-text);
    }
}
@media (min-width: 481px) and (max-width: 767px) and (orientation: portrait) {
    :root {
        --size-title: clamp(8vw, 9vw, 10vw);
        --size-text: clamp(2.5vw, 3vw, 3.5vw);
        --size-code: clamp(1.5vw, 2.5vw, 3vw);
    }
    .container-principal {
        grid-template-rows: 25% 75%;
    }
        h1 {
            padding: 0 4vw;
        }
        p {
            padding: 5vw 5vw 0 5vw;
        }
    ul {
        grid-template-columns: repeat(auto-fit, 50%);
    }
        li a {
            width: 65%;
            text-align: center;
        }
}

/* PAYSAGE */
@media (max-width: 812px) and (orientation: landscape) {
    :root {
        --size-title: clamp(6vw, 8vw, 9vw);
        --size-text: clamp(2.5vw, 3.5vw, 4vw);
        --size-code: clamp(1.2vw, 1.7vw, 2.2vw);
    }
    .back, .btn-fixed {
        box-shadow: 5px 5px 0px #000;
    }
    .btn-fixed {
        bottom: 4vw;
        right: 5vw;
    }
    .main-second {
        padding: 0vh 3vw;
    }
    h3 {
        width: calc(100% - 4vw);
    }
    pre {
        width: 85%;
    }
}


/* MEDIA QUERIES POUR TABLETTE */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    :root {
        --size-title: clamp(5vw, 7vw, 8vw);
        --size-text: clamp(2.5vw, 3vw, 3.5vw);
        --size-code: clamp(1.5vw, 2.5vw, 3vw);
    }
    .container-principal {
        grid-template-rows: 25% 75%;
    }
    code, h1, h3 {
        text-wrap: wrap;
    }
        h1 {
            padding: 2vh 8vw 0 8vw;
        }
        p {
            padding: 5vw 5vw 0 8vw;
        }
    ul {
        grid-template-columns: repeat(auto-fit, 50%);
    }
        li a {
            width: 65%;
            text-align: center;
        }
}


/* PAYSAGE */
@media (min-width: 813px) and (max-width: 1280px) and (orientation: landscape) {
    .back, .btn-fixed {
        box-shadow: 5px 5px 0px #000;
    }
    .btn-fixed {
        bottom: 4vw;
        right: 5vw;
    }
    article {
        height: max-content;
    }

    h3, h4 {
        width: 93%;
    }
    code, h1, h3 {
        text-wrap: wrap;
    }
    .main-second {
        padding: 0vh 3vw;
    }
    .section-main p {
        padding: 1vw 2vw 4vw 0;
    }
    h3 {
        width: calc(100% - 4vw);
    }
    pre {
        width: 85%;
    }
}
