/***** Variables *****/
:root {
    /* Couleurs générales */
    --ghibli-noir: #181a17;
    --ghibli-marron: #2c1d17;
    --ghibli-creme: #f5f3e7;
    --ghibli-vert: #1ca943;
    --ghibli-bleu: #0097c4;

    /* Couleurs par film */
    --couleur-totoro: #0b2035;
    --couleur-lucioles: #69200f;
    --couleur-mononoke: #899eb3;
    --couleur-chihiro: #dd5f5f;

    /* Tailles */
    --affiche-largeur: 16rem;
}

/***** Polices *****/
@font-face { /* Police 'Ghibli" */
    font-family: "Ghibli";
    src: url("../ressources/polices/Ghibli.woff");
}

@font-face { /* Police 'Ghibli" en gras */
    font-family: "Ghibli Bold";
    src: url("../ressources/polices/Ghibli-Bold.woff");
}

/***** Style global *****/
* { /* Style appliqué sur tous les éléments de la page pour simplifier la mise en page */
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    
}

body {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    max-width: 100vw;
    line-height: 1.1em;
    letter-spacing: 0.05em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    font-family: 'Ghibli', Arial, sans-serif;
    color: var(--ghibli-creme);
}

/***** Navbar *****/
.navbar {
    position: absolute;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(2, auto);
    justify-content: space-between;
    width: 100%;
    padding: 3rem 4rem;
}

/***** Logo *****/
.navbar__logo-img {
    background-color: #7d8182;
    box-shadow: 0 0 10px #7d8182;
}

.navbar__logo-img, .navbar__logo-lien {
    display: block;
    width: 5rem;
    border-radius: 50%;
    transition: transform 0.3s;
}

.navbar__logo-img:hover {
    transform: scale(1.2);
}

/***** Menu *****/
.navbar__menu {
    display: grid;
    grid-template-columns: repeat(4, auto);
    justify-content: space-between;
    align-items: center;
    list-style: none;
}

.navbar__menu-lien {
    position: relative;
    display: grid;
    width: var(--affiche-largeur);
    line-height: 2rem;
    font-size: 1.1rem;
    text-align: center;
    text-decoration: none;
    font-family: 'Ghibli Bold', Arial, sans-serif;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
    color: var(--ghibli-creme);
}

.navbar__menu li { /* Permet de rendre l'élément <li> parent de l'élément dans la règle avec ::after */
    position: relative;
    padding-inline: 1rem;
}

.navbar__menu li:not(:last-child)::after { /* Ajoute une barre horizontale après chaque élément <li> du menu SAUF le dernier */
    content: "|";
    position: absolute;
    right: -.2rem;
    top: 50%;
    transform: translateY(-50%); /* Décale et centre l'élément en fonction de son parent */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

/***** Animation menu *****/
.navbar__menu-titre {
    transition: opacity 0.5s ease-out;
}

.navbar__menu-affiche { /* On positionne et stylise l'affiche puis on la cache pour l'afficher uniquement lors du survol */
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-20px); /* Décale et centre l'élément en fonction de son parent */
    width: var(--affiche-largeur);
    border-radius: 30px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out, visibility 0.5s;
}

.navbar__menu-lien:hover .navbar__menu-titre { /* On cache le texte lors du survol d'un lien */
    opacity: 0;
}

.navbar__menu-lien:hover .navbar__menu-affiche { /* On affiche l'image lors du survol d'un lien */
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/***** Pied de page *****/
footer {
    display: grid;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding-block: 3rem 2rem;
    background-color: var(--ghibli-noir);
    text-align: center;
    font-size: small;
}

.footer__menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    margin-top: 1rem;
    list-style: none;
}

.footer__menu a {
    line-height: 1.3rem;
    color: var(--ghibli-bleu);
}

.footer__menu a:hover {
    color: var(--ghibli-vert);
}

.footer__separateur {
    opacity: 0.3;
    width: 80%;
    height: 1px;
    margin: auto;
    border: none;
    background-color: var(--ghibli-creme);
}