/* Album photo public (photos.php + album.php) : grille de cartes d'albums
   nommés (cover + nom), façon equipes.php (.team-card), puis grille de photos
   d'un album ouvert avec lightbox. Réutilise la palette et le motif "carte"
   déjà employés par equipes.css, pour rester visuellement cohérent avec le
   reste du site (module médias). */

.titre-photos {
    text-align: center;
    margin: 24px 0;
    font-family: 'Oswald', sans-serif; /* Titre de page condensé (charte graphique CCM) */
    font-weight: 800;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.album-empty {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 40px 0;
}

.album-back {
    text-align: center;
    margin: 0 0 24px;
}

.album-back a {
    color: #FE1C03;
    font-weight: 700;
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
}

.album-back a:hover {
    text-decoration: underline;
}

/* Grille de cartes d'albums (photos.php) : même recette visuelle que
   .team-card de equipes.css (coins arrondis, ombre, léger soulèvement +
   zoom de la cover au survol), pour une cohérence entre les deux pages. */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.album-card {
    display: block;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.album-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.album-card-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.album-card:hover .album-card-cover {
    transform: scale(1.1);
}

.album-card-body {
    padding: 20px;
    text-align: center;
    font-family: 'Roboto', sans-serif;
}

.album-card-body h3 {
    margin: 0 0 6px;
    font-family: 'Oswald', sans-serif;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.album-card-meta {
    margin: 0 0 4px;
    color: #CB1602;
    font-weight: 700;
    font-size: 0.85rem;
}

.album-card-count {
    margin: 0;
    color: #666;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .album-grid {
        grid-template-columns: 1fr;
    }
}

.album-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    padding: 14px;
}

/* Vignette photo : reprend le style "carte" de equipes.css (.team-card) --
   coins arrondis, ombre douce, léger soulèvement + zoom au survol -- pour une
   cohérence visuelle entre l'album et la page équipes (lot 4/4). */
.album-photo {
    margin: 0;
    position: relative;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.album-photo:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

/* Le déclencheur de la lightbox est un <button> (et non une div cliquable) :
   focusable au clavier et annoncé correctement par les lecteurs d'écran. */
.album-photo-open {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

.album-photo-open img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.album-photo:hover .album-photo-open img {
    transform: scale(1.08);
}

/* Bouton "Télécharger" sous forme de pastille sur la vignette (cf. section 1
   du prompt : bouton dispo sur la vignette ET dans la lightbox). Masqué par
   défaut sur les appareils à survol pour ne pas surcharger la grille, mais
   toujours visible au clavier (:focus-visible) et sur tactile (pas de hover). */
.album-photo-download {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.album-photo:hover .album-photo-download,
.album-photo-download:focus-visible {
    opacity: 1;
}

.album-photo-download:hover {
    background: #FE1C03;
}

@media (hover: none) {
    .album-photo-download {
        opacity: 1;
    }
}

@media (max-width: 600px) {
    .album-photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .album-photo-open img {
        height: 130px;
    }
}

/* ---------------------------------------------------------------------------
   Lightbox plein écran (assets/js/album_lightbox.js) : overlay sombre, photo
   centrée, navigation précédent/suivant, fermeture et téléchargement. Même
   esprit que la lightbox déjà utilisée par pef.php (#pef-lightbox), étendue
   ici avec la navigation clavier/flèches nécessaire à une galerie.
   --------------------------------------------------------------------------- */
.album-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
}

.album-lightbox.open {
    display: flex;
}

.album-lightbox-content {
    max-width: 92vw;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.album-lightbox-content img {
    max-width: 92vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.album-lightbox-caption {
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    text-align: center;
}

.album-lightbox-close,
.album-lightbox-prev,
.album-lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.album-lightbox-close:hover,
.album-lightbox-prev:hover,
.album-lightbox-next:hover {
    background: #FE1C03;
}

.album-lightbox-close {
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    font-size: 1.6rem;
    line-height: 1;
}

.album-lightbox-prev,
.album-lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
}

.album-lightbox-prev {
    left: 20px;
}

.album-lightbox-next {
    right: 20px;
}

.album-lightbox-download {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #FE1C03;
    color: #fff;
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 24px;
    font-weight: 700;
    font-family: 'Roboto', sans-serif;
    transition: background 0.2s ease;
}

.album-lightbox-download:hover {
    background: #CB1602;
}

.album-lightbox-counter {
    position: absolute;
    top: 24px;
    left: 24px;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Roboto', sans-serif;
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .album-lightbox-prev,
    .album-lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .album-lightbox-prev {
        left: 6px;
    }

    .album-lightbox-next {
        right: 6px;
    }

    .album-lightbox-close {
        top: 10px;
        right: 10px;
    }

    .album-lightbox-counter {
        top: 10px;
        left: 10px;
    }
}
