body {
    margin: 0;
    padding: 0;
    background: black;
    font-family: Arial, sans-serif;
    color: white;
}

/* HEADER */
#header {
    position: relative;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
}

.h-left {
    position: absolute;
    left: 10px;
    font-size: 18px;
    font-weight: 600;
    color: black;
}

.h-center {
    font-size: 18px;
    font-weight: 600;
    color: black;
}

.h-right img {
    position: absolute;
    right: 10px;
    width: 50px;
}

/* VIEWER : zone photo/vidéo */
#viewer {
    position: relative;
    height: calc(100vh - 300px); /* hauteur stable */
    overflow: hidden;
    background: black;
}

/* PHOTO / VIDEO */
.media {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    display: none; /* invisible par défaut */
}

/* Média actif (photo OU vidéo) */
#mainPhoto, #mainVideo {
    touch-action: none;       /* empêche zoom Android */
    -webkit-user-drag: none;  /* empêche drag */
}

/* BOUTONS */
#nav {
    display: flex;
    justify-content: space-between;
    padding: 10px;
}

.btn {
    width: 32%;
    background: rgba(255,0,0,0.85);
    padding: 15px;
    text-align: center;
    border-radius: 12px;
    font-size: 20px;
}

/* GALERIE EN BAS */
#gallery {
    height: 300px;        /* fixe, stable */
    overflow-y: scroll;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 10px;
    flex-shrink: 0;       /* empêche la galerie de pousser le viewer */
}

#gallery img {
    width: 100%;
    border-radius: 10px;
}

/* POPUP CARTE */
#mapPopup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
}

#mapClose {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 28px;
    color: white;
}

#map {
    width: 100%;
    height: 100%;
}
