body {
    font-family: 'Orbitron', sans-serif;
    margin: 20px;
    background-color: #f9f9f9;
    /* background: url("background.png") no-repeat center center fixed; */
    background: url("nebul_tarntule.jpg") no-repeat center center fixed;
    background-size: cover;
}

h1 {
    color: #333;
    text-align: center;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* ---- TABLE ---- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

th {
    background-color: #f4f4f4;
}

/* ---- BOUTONS ---- */
button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    margin-bottom: 20px;
    border-radius: 5px;
}

button:hover {
    background-color: #218838;
}

form {
    text-align: center;
}

/* ---- LIEN CLIQUABLE ---- */
.media-link {
    display: flex;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    text-decoration: none;
}


.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 colonnes */
    grid-auto-rows: 250px; /* Hauteur de base pour une ligne */
    gap: 20px;
    justify-content: center;
}

/* ---- MEDIA ITEM ---- */
.media-item {
    position: relative;
    border: 1px solid #ddd;
    background-color: #ddd;
    text-align: center;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Utilisation correcte de grid-row pour respecter les proportions dynamiques */
.media-item[data-grid] {
    grid-column: span var(--grid-col, 1);
    grid-row: span var(--grid-row, 1);
}

/* ---- IMAGE & VIDÉO ---- */
.media-item img, 
.media-item video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Ajuste sans déformation */
    border-radius: 10px;
}

.media-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    max-width: 1200px;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.media-container img, 
.media-container video {
    max-width: 100%;
    border-radius: 10px;
}
.media-description {
    margin-left: 20px;
    flex: 1;
    min-width: 300px;
}
.media-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    max-width: 1200px;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.back-btn {
    display: block;
    margin-top: 20px;
    padding: 10px 15px;
    background-color: #111;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    width: fit-content;
}
.back-btn:hover {
    background-color: #333;
}
.media-description {
    white-space: pre-wrap; /* Conserve les sauts de ligne et permet le retour automatique */
    word-wrap: break-word;  /* Coupe les mots trop longs pour éviter le débordement */
    overflow-wrap: break-word; /* Alternative pour assurer la coupure des mots */
    max-width: 100%;        /* Empêche le débordement horizontal */
    font-family: inherit;   /* Utilise la police du site */
    text-align: justify;
}

