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

html,
body {
    margin: 0;
    width: 100%;
    background: rgb(0, 0, 0);
}

body {
    padding: 0 clamp(16px, 4vw, 50px);
}

/* Logo */
.figure {
    text-align: center;
    padding: clamp(32px, 5vw, 60px) 0 clamp(16px, 2.5vw, 30px);
}

.figure img {
    width: min(400px, 80%);
    height: auto;
}

@media (max-width: 600px) {
    .figure img {
        width: 60%;
    }
}

/* Roue de chargement */
.loader {
    width: 56px;
    height: 56px;
    margin: 40px auto;
    border: 5px solid rgba(180, 214, 224, 0.2);
    border-top-color: #1effff;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .loader {
        animation-duration: 3s;
    }
}

#title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 8vw, 120px);
    line-height: 1.1;
    color: rgb(180, 214, 224);
    margin: 20px 0;
    overflow-wrap: break-word;
}

/* Description + image du jour */
.description {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 40px;
}

#descriptif {
    font-family: 'Space Grotesk', sans-serif;
    flex: 1 1 700px;
    max-width: 700px;
    margin: 0;
    font-size: clamp(1rem, 1.8vw, 20px);
    text-align: left;
    line-height: 1.8;
    color: rgb(180, 214, 224);
}

#descriptif p {
    font-size: inherit;
    text-align: inherit;
    margin: 0 0 1.2em;
    text-wrap: pretty;
    hyphens: auto;
}

.description .popup-link {
    flex: 1 1 0;
    min-width: 0;
}

#image-space {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

#date {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.5rem, 7vw, 100px);
    text-align: right;
    color: rgb(180, 214, 224);
    margin: 20px 0;
}

.pastille {
    font-size: 15px;
    color: #7fffd4;
    font-family: 'Space Grotesk', sans-serif;
    text-align: center;
    border: 0,5px;
    background-color: rgb(27, 27, 26);;
    border-color: gray
}

/* Galerie des 4 derniers jours */
.gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 200px));
    justify-content: center;
    gap: clamp(16px, 5vw, 80px);
    margin: 30px 0 50px;
}

.gallery-item {
    margin: 0;
}

.gallery img {
    display: block;
    width: 100%;
    height: 200px;
    border-radius: 5px;
    object-fit: cover;
}

/* pas d'icône d'image cassée tant que l'API n'a pas répondu */
#image-space[src=""],
.gallery img[src=""] {
    display: none;
}

.gallery-item figcaption {
    font-family: 'Space Grotesk', sans-serif;
    color: rgb(180, 214, 224);
    text-align: center;
    margin-top: 10px;
}

.gallery-title {
    display: block;
    font-size: clamp(0.9rem, 1.4vw, 1.1rem);
    line-height: 1.3;
}

.gallery-date {
    display: block;
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 4px;
}

p {
    font-family: 'Space Grotesk', sans-serif;
    color: rgb(180, 214, 224);
    text-align: center;
    font-size: clamp(1.5rem, 5vw, 50px);
}

/* Tablette */
@media (max-width: 900px) {
    .description {
        flex-direction: column;
        align-items: center;
    }

    #descriptif {
        flex: none;
        max-width: 65ch;
        width: 100%;
    }

    .description .popup-link {
        width: 100%;
    }

    .gallery {
        grid-template-columns: repeat(2, minmax(0, 250px));
    }
}

/* Mobile */
@media (max-width: 600px) {
    #descriptif {
        line-height: 1.65;
    }

    #date {
        text-align: center;
    }

    .gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gallery img {
        height: 150px;
    }
}
