/*
* =====================================
* * GLOBALS *
* =====================================
*/

:root {
    /* colors */
    --white: #FAFAFA;
    --grey: #444;
    --green: #a99f4f;
    --orange: #d08c47;
    --marron: #B15636;

    /* fonts */
    --mainMargin: 6vw;
    --pageSize: 40vw;
    --pageHeight: 80vh;
    --fontSize: 1em;

    --baskerville: 'Libre Baskerville', serif;
}

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

html,
body {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
html {
    height: 100%;
}

body {
    background: url('/ressources/img/header.jpeg') no-repeat 50% 0 fixed;
    background-size: 1577px 782px;
    font-family: var(--baskerville);
    color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 var(--mainMargin);
}

main {
    width: 100%;
}


a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease-in-out, background-color .3s ease-in-out;
}

ul, ol {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

button {
    outline: 0;
    border: 0;
}

button:hover {
    cursor: pointer;
}

p {
    font-size: var(--fontSize);
    color: var(--grey);
}


/*
* =====================================
* * TITLES *
* =====================================
*/

:root {
    --h1Size: 2em;
    --h2Size: 2em;
    --pSize: 1em;
}

h1, h2 {
    display: block;
    padding: 0;
    margin: 0;
    letter-spacing: 0.02em;
    font-weight: 100;
}

h1 {
    font-size: calc(var(--h1Size) + 1vw);
    font-weight: 300;
}

h2 {
    font-size: calc(var(--h2Size) + 1vw);
}

/*
* =====================================
* * BLOCKS & RWD *
* =====================================
*/

.container, .container-content {
    display: flex;
    justify-content: center;
    width: auto;
    height: auto;
    flex-wrap: nowrap;
    align-items: center;
    margin: 0 var(--mainMargin);
    padding: 1vw 0;
}

.container-content {
    padding: 0 6vw 0 0;
    margin: 3.8vw;
}

.block15, .block25, .block30,
.block33, .block40, .block50, .block70,
.block60, .block75, .block100 {
    position: relative;
    padding: 0 1vw;
    margin: 1vw 0;
    align-items: center;
}

.container-content > .block50, .container-content > .block100 {
    padding: 0 1vw;
    margin: 0;
}

.block15 {
    width: 15%;
}

.block25 {
    width: 25%;
}

.block30 {
    width: 30%;
}

.block33 {
    width: 33%;
}

.block40 {
    width: 40%;
}

.block50 {
    width: 50%;
}

.block60 {
    width: 60%;
}

.block70 {
    width: 70%;
}

.block75 {
    width: 75%;
}

.block100 {
    width: 100%;
}

/*
* =====================================
* * PICTURES PARAMETERS *
* =====================================
*/

.photo {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/*
* =====================================
* * NAV *
* =====================================
*/

header .logo {
    text-align: center;

}
header .logo a {
    display: block;
    margin: 0 0 7vh 0;
    padding-top: 10vh;
}
header .logo a img {
    width: clamp(200px, 40vw, 500px);
    height: auto;
}

/*
* =====================================
* * SPECIFICS *
* =====================================
*/

.book {
    transition: opacity 0.4s 0.2s;
    transform-style: preserve-3d;
}
.page {
    width: 30vw;
    height: 44vw;
    float: left;
    margin-bottom: 0.5em;
    background: left top no-repeat var(--white);
    background-size: cover;
}
.page:nth-child(even) {
    clear: both;
}
.page:nth-child(odd){
    background-position: right top;
}
.book {
    perspective: 250vw;
    height: 100%;
}
.book .pages {
    width: calc(var(--pageSize) * 2);
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    border-radius: 4px;
    transition: margin-left 1s ease-in-out;
}
.book .page {
    float: none;
    clear: none;
    margin: 0;
    position: absolute;
    height: 100%;
    width: 50%;
    top: 0;
    transform-origin: 0 0;
    transition: transform 1.4s;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
}
.book .page:nth-child(odd) {
    pointer-events: all;
    transform: rotateY(0deg);
    right: 0;
    border-radius: 0 4px 4px 0;
}
.book .page:nth-child(odd):hover {
    transform: rotateY(-15deg);
}
.book .page:nth-child(odd):before {
    background: rgba(0, 0, 0, 0);
}
.book .page:nth-child(even) {
    pointer-events: none;
    transform: rotateY(180deg);
    transform-origin: 100% 0;
    left: 0;
    border-radius: 4px 0 0 4px;
    border-color: black;
}
.book .page.grabbing {
    transition: none;
}
.book .page.flipped:nth-child(odd) {
    pointer-events: none;
    transform: rotateY(-180deg);
}
.book .page.flipped:nth-child(even) {
    pointer-events: all;
    transform: rotateY(0deg);
}
.book .page.flipped:nth-child(even):hover {
    transform: rotateY(15deg);
}
.book .page.flipped:nth-child(even):before {
    background: rgba(0, 0, 0, 0);
}
.book .page img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    aspect-ratio: 1.414 / 2;
    max-width: 1414px;
    max-height: 2000px;
}
.book .page:nth-child(even) img {
    object-position: right;
}
.book .page:nth-child(odd) img {
    object-position: left;
}

/*
-----------------------------
===== ENDGAME COMPONENT =====
-----------------------------
   UNCOMMENT IN HOME.HTML
*/

section#endgame {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

section#endgame .container .block50 {
    text-align: center;
    background: var(--orange) url("/ressources/img/filigranne-gris.png") no-repeat;
    background-size: cover;
    background-blend-mode: multiply;
    padding: 3vw;
}

/* ===== GAME COMPONENTS ===== */

#text {
    margin-bottom: 5rem;
}

#text h1 {
    font-weight: bold;
    text-transform: uppercase;
    color: var(--orange);
    font-family: "Open Sans", sans-serif;
    font-size: calc(var(--fontSize) + .5vw);
    text-align: center;
}

#text .container .block100 > p {
    font-size: calc(var(--fontSize) + .25vw);
    text-align: center;
}

#desktop-book {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80vh;
    min-height: 500px;
}

#loader {
    display: block;
    position: absolute;
    z-index: 100;
    background-color: white;
    width: 100%;
    height: 120%;
    text-align: center;
    padding-top: 15rem;
}

#loader img {
    position: absolute;
    width: 3rem;
    top: 50%;
    transform: translateY(-50%);
}

.select-choice {
    display: flex;
    justify-content: center;
    align-items: stretch;
    flex-flow: column nowrap;
    position: absolute;
    right: 30%;
    top: 50%;
    max-width: 46%;
    max-height: 95%;
    padding: 0 2em;
    transform: translate(50%,-50%);
    background: var(--marron);
    background-size: cover;
    background-blend-mode: multiply;
    aspect-ratio: 1.3 / 2;
}

.select-choice h2 {
    font-size: calc(var(--fontSize) + .4em);
    color: var(--white);
    text-transform: uppercase;
    text-align: center;
}

.select-choice p {
    color: var(--white);
    letter-spacing: .05em;
    text-align: center;
    text-transform: uppercase;
    font-size: calc(var(--fontSize) + -.1em);
}

.select-choice button {
    margin: 8px 12px;
    padding: 8px 12px;
    font-family: var(--baskerville);
    transition: background-color .3s ease-in-out, border .3s ease-in-out, color .3s ease-in-out;
    border-radius: 4px;
}

.select-choice button:hover {
    color: var(--white);
    background-color: #000;
}

.select-choice button:hover {

}

/*
* =====================================
* * MODAL
* =====================================
*/

section.modal {
    position: fixed;
    display: none;
    align-items: center;
    justify-content: center;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, .4);
    z-index: 20;
}

@keyframes modalAnimation {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

section.modal .container {
    position: relative;
    width: 98%;
    max-width: 45rem;
    border-radius: 5px;
    padding: 6vw 4vw;
    background: var(--marron);
    border: 2px solid white;
}

section.modal h3 {
    text-align: center;
}

section.modal .block100 form {
    display: flex;
    flex-flow: column wrap;
}

section.modal .block100 input,
section.modal .block100 select {
    width: 100%;
    padding: 12px;
    margin: 4px 0;
}

section.modal label[for="rgpd"] {
    font-size: .8em;
}

section.modal label[for="rgpd"] a {
    text-decoration: underline;
}

section.modal input#rgpd {
    width: auto !important;
}

section.modal .block100 button {
    padding: 12px;
    margin: 12px 0;
    text-transform: uppercase;
    border-radius: 4px;
    transition: background-color .3s ease-in-out, color .3s ease-in-out;
}

section.modal .block100 button:hover {
    background-color: #000;
    color: var(--white);
}

section.modal .container .close-btn {
    position: absolute;
    top: 0;
    right: 0;
    margin: 1em;
    padding: 5px 8px;
    border: 1px solid var(--white);
    border-radius: 4px;
    background-color: transparent;
    color: var(--white);
    text-transform: uppercase;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    transition: background-color .3s ease-in-out, border .3s ease-in-out;
    z-index: 20;
    cursor: pointer;
}

section.modal .container .close-btn:hover {
    border: 1px solid #000;
    background-color: #000;
}

.message-fin-concours {
    width: 100%;
    text-align: center;
}

.message-fin-concours img {
    width: 30vw;
}

@media (max-width: 960px) {

    #text {
        margin-bottom: inherit;
    }

    .select-choice {
        right: 25%;
        max-height: 65%;
        padding: 0 1em;
        aspect-ratio: 1.4 / 2;
    }

    .select-choice button {
        padding: 5px;
        margin: 5px;
    }

    .modal .container{
        padding: 10vw 2vw;
    }
    .modal .close-btn {
        margin: .5em;
    }

    .message-fin-concours img {
        width: 50vw;
    }
}

@media (max-width: 760px) {
    .book {
        transform: translate(calc(var(--pageSize) * -1));
    }

    .book .pages {
        width: calc(var(--pageSize) * 4);
    }

    .select-choice {
        right: 25%;
        max-height: 65%;
        padding: 0 1em;
    }

    .select-choice button {
        margin: 7px;
        padding: 7px;
    }

    .message-fin-concours img {
        width: 80vw;
    }
}

/*
* =====================================
* * MEDIAS QUERIES *
* =====================================
*/

@media (min-width: 1480px) {

}

@media (min-width: 961px) {


}

@media (max-width: 960px) {
    .container, .container-content {
        flex-flow: row wrap;
    }

    .container-content {
        margin: 0 var(--mainMargin);
        padding: 0 2vw;
    }

    .block25 {
        width: 45%;
    }

    .block30 {
        width: 50%;
    }

    .block40 {
        width: 100%;
    }

    .block50 {
        width: 100%;
    }

    .block60 {
        width: 100%;
    }

    .block75 {
        width: 100%;
    }

    .select-choice h2 {
        font-size: var(--fontSize);
    }

    .select-choice p {
        font-size: calc(var(--fontSize) + -.3em);
    }

    .select-choice button {
        font-size: .8em;
    }
}

@media (max-width: 642px) {
    h1, h2 {
        padding: 1.5vw 0 1vw 0;
    }

    .container-fluid {
        flex-flow: column wrap;
    }

    .container-content {
        margin: 0 var(--mainMargin);
        padding: 0;
    }

    .block15 {
        width: 100%;
    }

    .block25 {
        width: 100%;
    }

    .block33 {
        width: 100%;
    }

    .block40 {
        width: 100%;
    }

    .block60 {
        width: 100%;
    }

    .block70 {
        width: 100%;
    }
}

@media (max-width: 400px) {
    .select-choice {
        max-height:75%;
    }
}

/*
* =====================================
* * FOOTER *
* =====================================
*/

footer .container:first-child .block100 {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 40px;
}
footer .container:first-child .block100 a:nth-child(1),
footer .container:first-child .block100 a:nth-child(3) {
    width: 18px;
    height: 18px;
    margin: 34px;
}
footer .container:first-child .block100 a:nth-child(2) {
    padding: 0px 40px;
}
footer .container:first-child .block100 a:nth-child(2) img {
    width: 100px;
    height: auto;
}
footer .container:nth-child(2) .block100 {
    margin-bottom: 0;
    padding-bottom: 0;
}
footer .container:nth-child(2) ol {
    display: flex;
    justify-content: center;
}
footer .container:nth-child(2) ol li {
    display: inline-block;
    color: var(--grey);
    padding: 3px 10px;
}
footer .container:nth-child(2) ol li a {
    font-size: .82em;
}
footer .container:last-child {
    padding-top: 0;
}
footer .container:last-child p {
    margin: 0;
    font-size: .8em;
    color: #000;
    opacity: .3;
    text-align: center;
}
@media (max-width: 760px) {
    footer .container:nth-child(2) .block100 ol {
        flex-flow: column wrap;
        align-items: center;
        padding: 12px;
    }
    footer .container:nth-child(2) .block100 ol li {
        padding: 12px 0;
    }
}



