/* =========================================================
   PAGE GALERIES – RESPONSIVE STRICT
   AUCUN overflow horizontal – mobile first
========================================================= */


/* =========================================================
   1) CONTENEUR PAGE
========================================================= */

.page {
    max-width: 100%;
    overflow-x: hidden;
}


/* =========================================================
   2) FILTRES
========================================================= */

.filters-wrapper {
    margin: 1rem 0 2rem;
    max-width: 100%;
}

/* Bouton toggle */
.filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 14px;
    border: 1px solid rgba(0,0,0,.15);
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    color: #111827;
}

/* Panneau */
.filters-collapsible {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 12px;
    background: #fafafa;

    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Grille filtres desktop */
.filters-grid {
    display: flex;
    align-items: flex-end;
    gap: 12px;

    width: 100%;
    max-width: 100%;
}

/* Sécurité anti-débordement */
.filters-grid > * {
    min-width: 0;
    max-width: 100%;
}

/* Recherche */
.filters-grid .filter-search {
    flex: 1 1 0;
    min-width: 0;
}

/* Date */
.filters-grid .filter-date {
    display: flex;
    flex-direction: column;
    flex: 0 1 160px;
    min-width: 0;
}

/* Inputs */
.filters-collapsible input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;

    padding: 8px 10px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,.2);
}

.filters-collapsible label {
    color: #1f2937;
}

/* Boutons */
.filters-submit {
    display: flex;
    gap: 10px;
    white-space: nowrap;
}

/* Labels */
.filters-grid > label {
    display: flex;
    flex-direction: column;
    margin: 0;
    width: auto;
}


/* =========================================================
   3) GRILLE DES ALBUMS
========================================================= */

.albums-section {
    max-width: 100%;
    overflow-x: hidden;
}

/* Grille */
.albums-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;

    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Cartes */
.album-card {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Lien */
.album-card a {
    display: block;
    width: 100%;
    max-width: 100%;
}

/* Visuel */
.album-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: rgba(0,0,0,.05);
}

/* 🔴 CORRECTION CLÉ : images */
.album-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    box-sizing: border-box;
}

/* Fallback */
.no-thumb {
    font-size: 13px;
    color: #475569;
    opacity: 1;
}

/* Infos */
.album-meta {
    padding: 10px 12px 12px;
    display: grid;
    gap: 4px;
}

.album-meta strong {
    font-size: 16px;
    font-weight: 600;
}

.album-meta small {
    font-size: 13px;
    color: #475569;
    opacity: 1;
}

.album-card a:focus-visible {
    outline: 2px solid #0ea5b7;
    outline-offset: 2px;
    border-radius: 10px;
}


/* =========================================================
   4) RESPONSIVE BREAKPOINTS
========================================================= */

/* Tablette */
@media (max-width: 1100px) {
    .albums-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Tablet / mobile */
@media (max-width: 820px) {
    .albums-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile strict */
@media (max-width: 640px) {

    .filters-grid {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-grid label,
    .filters-grid input,
    .filters-submit {
        width: 100%;
        max-width: 100%;
    }

    .filters-submit .btn {
        flex: 1 1 0;
    }
}

/* Mobile étroit */
@media (max-width: 560px) {

    .albums-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 26px;
    }

    h2 {
        font-size: 20px;
    }
}


.album-cover img {
    width: 100%;
    height: auto;
    max-height: 95vh;
    object-fit: cover;
    border-radius: 12px;
}

.album-cover {
    position: relative;
}
