/* Médiathèque des communes : galerie photos/vidéos, cartes vidéo, lecteur et fiche vidéo. */

/* Onglets Photos / Vidéos : laisse de la place à l'en-tête fixe quand un lien #videos les amène à l'écran. */
#mediaTab {
    scroll-margin-top: 90px;
}

.hover-up {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-up:hover {
    transform: translateY(-8px);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .1) !important;
}

.video-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.15);
    z-index: 1;
    transition: background 0.3s ease;
    pointer-events: none;
}
.video-container:hover::before {
    background: rgba(0, 0, 0, 0.3);
}

.commune-video-thumb {
    height: 220px;
    width: 100%;
    object-fit: cover;
}

/* Vidéo sans vignette : aperçu neutre plutôt qu'une image sans rapport avec la vidéo. */
.commune-video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    background: linear-gradient(135deg, #1f2d3d, #3a4f66);
    color: rgba(255, 255, 255, .8);
    font-size: .85rem;
}
.commune-video-placeholder i {
    font-size: 2.25rem;
    opacity: .6;
}

.play-button {
    position: relative;
    z-index: 2;
    width: 60px;
    height: 60px;
    font-size: 1.2rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}
.play-button:hover,
.play-button:focus-visible {
    transform: scale(1.15);
    background-color: var(--bs-primary) !important;
    color: #fff !important;
}
.play-button i {
    pointer-events: none;
}

.commune-video-title:hover,
.commune-video-title:focus-visible {
    color: var(--bs-primary) !important;
    text-decoration: underline !important;
}

.commune-video-modal .modal-content {
    background-color: #000;
}
.commune-video-modal .ratio video,
.commune-video-modal .ratio iframe {
    border: 0;
    outline: none;
    background: #000;
}

/* Fiche vidéo : lecteur YouTube chargé seulement au clic. */
.commune-video-facade {
    border: 0;
    padding: 0;
    width: 100%;
    cursor: pointer;
}
.commune-video-facade .commune-video-thumb {
    height: auto;
    aspect-ratio: 16 / 9;
}
