/* ------------------------------------------------- */
/* Body centré avec Flexbox et background responsive */
/* ------------------------------------------------- */
body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    height: 100vh;
    margin: 0;
    font-family: Arial, sans-serif;
    color: white;
    text-align: center;

    background-color: #0a0a2a;
    background-size: cover;
    background-position: left top;
    background-repeat: no-repeat;

    /* Fallback portrait JPEG par défaut */
    background-image: url('images/portrait-720.jpg');

    /* Portrait WebP si supporté */
    background-image: url('images/portrait-720.webp'), url('images/portrait-720.jpg');
}

/* ------------------------- */
/* Header et logo responsive */
/* ------------------------- */
header {
    width: 100%;
    display: flex;
    justify-content: center; /* centre horizontalement */
    align-items: flex-start; /* place le logo en haut */
    position : sticky;

    background-color: rgba(255, 0, 0, 0.1);
}

/* ------ Logo responsive ------ */
.logo {
    width: clamp(100px, 20vw, 300px); /* min 60px, max 180px, idéal 12% largeur écran */
    height: auto;
    margin-top: clamp(10px, 2vw, 25px);
}

/* --------------- */
/* Main et contenu */
/* --------------- */
main {
    width: 100%;
    display: flex;
    justify-content: center; /* centre horizontalement */
    align-items: flex-start; /* place le logo en haut */
    position : sticky;

    background-color: rgba(0, 255, 0, 0.1);
}

/* ----------------- */
/* Footer et contenu */
/* ----------------- */
footer {
    width: 100%;
    display: flex;
    justify-content: center; /* centre horizontalement */
    align-items: flex-start; /* place le logo en haut */
    position : sticky;

    background-color: rgba(0, 0, 255, 0.1);
}

/* ------------------------------------------------------- */
/* Media querries => Responsive selon la taille de l'écran */
/* ------------------------------------------------------- */
/* ------ Portrait responsive selon largeur écran ------ */
@media (max-width: 480px) {
    body {
        background-image: url('images/portrait-480.webp'), url('images/portrait-480.jpg');
    }
}
@media (min-width: 481px) and (max-width: 720px) {
    body {
        background-image: url('images/portrait-720.webp'), url('images/portrait-720.jpg');
    }
}
@media (min-width: 721px) and (max-width: 1080px) {
    body {
        background-image: url('images/portrait-1080.webp'), url('images/portrait-1080.jpg');
    }
}
@media (min-width: 1081px) {
    body {
        background-image: url('images/portrait-1536.webp'), url('images/portrait-1536.jpg');
    }
}

/* ------ Landscape responsive via orientation ------ */
@media (orientation: landscape) {
    /* Fallback JPEG landscape */
    body {
        background-image: url('images/landscape-1280.jpg');
    }

    /* WebP landscape si supporté */
    body {
        background-image: url('images/landscape-1280.webp'), url('images/landscape-1280.jpg');
    }

    /* Landscape selon largeur écran */
    @media (max-width: 640px) {
        body {
            background-image: url('images/landscape-640.webp'), url('images/landscape-640.jpg');
        }
    }
    @media (min-width: 641px) and (max-width: 896px) {
        body {
            background-image: url('images/landscape-896.webp'), url('images/landscape-896.jpg');
        }
    }
    @media (min-width: 897px) and (max-width: 1280px) {
        body {
            background-image: url('images/landscape-1280.webp'), url('images/landscape-1280.jpg');
        }
    }
    @media (min-width: 1281px) and (max-width: 1440px) {
        body {
            background-image: url('images/landscape-1440.webp'), url('images/landscape-1440.jpg');
        }
    }
    @media (min-width: 1441px) and (max-width: 1920px) {
        body {
            background-image: url('images/landscape-1920.webp'), url('images/landscape-1920.jpg');
        }
    }
    @media (min-width: 1921px) and (max-width: 2560px) {
        body {
            background-image: url('images/landscape-2560.webp'), url('images/landscape-2560.jpg');
        }
    }
    @media (min-width: 2561px) {
        body {
            background-image: url('images/landscape-3840.webp'), url('images/landscape-3840.jpg');
        }
    }
}

/* ------ Logo responsive ------ */
@media (orientation: portrait) {
  .logo {
    width: clamp(180px, 25vw, 280px);
  }
}
@media (orientation: landscape) {
  .logo {
    width: clamp(160px, 20vw, 260px);
  }
}
