/* ===================== GALLERY CARDS ===================== */
/* Utilisé par : accueil (aperçu services & actualités) */

.container-galerie {
    width: 92%;
    margin: 0 auto;
    padding-bottom: 8px;
}

.flex {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* ---- Card ---- */
.bloc {
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.25s, transform 0.25s;
    position: relative;
}

.bloc::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #b34b32;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    z-index: 1;
}

.bloc:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    transform: translateY(-3px);
}

.bloc:hover::before {
    transform: scaleX(1);
}

/* ---- Image ---- */
.imageBackground {
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #d8e3e0;
    flex-shrink: 0;
}

.imageBackground img,
.imageBackground .image-actualites {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.bloc:hover .imageBackground img,
.bloc:hover .imageBackground .image-actualites {
    transform: scale(1.04);
}

.imageBackground iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ---- YouTube player ---- */
.youtube_player {
    width: 100%;
    height: 100%;
    min-height: 180px;
}

.youtube-facade {
    position: relative;
    cursor: pointer;
    display: block;
    width: 100%;
    height: 100%;
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.62);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 0.5em 1em;
    border-radius: 0.3em;
    pointer-events: none;
}

/* ---- Titre ---- */
.titreS {
    font-size: 1em;
    font-weight: 600;
    color: #2a3c42;
    margin: 16px 20px 8px;
    text-align: left;
    line-height: 1.4;
}

/* ---- Description ---- */
.bloc p,
.bloc .p {
    font-size: 0.88em;
    color: #666;
    line-height: 1.65;
    margin: 0 20px 14px;
    text-align: left;
    flex: 1;
}

/* ---- CTA ---- */
.enBas {
    margin-top: auto;
    padding: 0 20px 18px;
}

.enBas a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.86em;
    font-weight: 600;
    color: #b34b32;
    text-decoration: none;
    transition: color 0.2s, gap 0.2s;
}

.enBas a:hover {
    color: #8f3a25;
    gap: 10px;
    text-decoration: none;
}

/* ---- Lien "voir tous" hors card (sur fond #62757c) ---- */
.lien-galerie {
    display: block;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.92em;
    font-weight: 500;
    margin-top: 36px;
    padding: 11px 28px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 4px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    text-decoration: none;
    transition: background-color 0.25s, border-color 0.25s;
}

.lien-galerie:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff;
}

/* ---- Admin controls ---- */
.bloc .admin {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 5px;
    z-index: 10;
}

.bloc .admin a {
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    padding: 5px 9px;
    border-radius: 3px;
    font-size: 0.8em;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.bloc .admin a:hover {
    background: #b34b32;
}

.bloc .admin svg path {
    fill: #fff;
}

/* ---- Responsive ---- */
@media screen and (max-width: 900px) {
    .flex {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 540px) {
    .flex {
        grid-template-columns: 1fr;
    }

    .container-galerie {
        width: 100%;
        padding-left: 0;
        padding-right: 0;
    }
}
