/* css/album.css - Styles exclusifs à l'Album Souvenirs */

/* ==========================================================================
   1. CONTENEUR GLOBAL ET INTRO
   ========================================================================== */
.album-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
    
    /* Grille flexible pour aligner les dossiers côte à côte */
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.album-intro {
    width: 100%; /* Prend toute la largeur au-dessus des dossiers */
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid #e2e8f0;
    margin-bottom: 10px;
}

.album-intro h1 {
    color: #1a365d;
    font-size: 26px;
    margin: 0 0 10px 0;
    border-bottom: 3px solid #d69e2e;
    padding-bottom: 6px;
    display: inline-block;
}

.album-intro p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #4a5568;
}

/* ==========================================================================
   2. ACCORDÉONS DES DOSSIERS (EN GRILLE HORIZONTALE)
   ========================================================================== */
/* Chaque bloc de dossier devient une carte compacte */
.album-categorie-bloc {
    width: calc(33.333% - 14px); /* 3 dossiers par ligne par défaut */
    min-width: 280px; /* Évite qu'ils ne se déforment */
    display: flex;
    flex-direction: column;
}

/* Si un dossier est ouvert, il prend toute la largeur de la ligne */
.album-categorie-bloc.ouvert {
    width: 100%;
}

/* Le bouton du dossier lui-même */
.album-categorie-titre {
    color: #1a365d;
    font-size: 15px;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #cbd5e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: bold;
    transition: all 0.2s ease;
    user-select: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.album-categorie-titre:hover {
    background: #f8fafc;
    border-color: #3182ce;
    transform: translateY(-2px);
}

/* Ajustement cosmétique quand le dossier est ouvert */
.album-categorie-bloc.ouvert .album-categorie-titre {
    border-radius: 8px 8px 0 0;
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: none;
}

.album-toggle-icone::after {
    content: '▶';
    font-size: 11px;
    color: #718096;
    transition: transform 0.2s ease;
    display: inline-block;
}

.album-categorie-bloc.ouvert .album-toggle-icone::after {
    transform: rotate(90deg);
}

/* ==========================================================================
   3. LA GRILLE ET LES MINIATURES DE PHOTOS
   ========================================================================== */
.album-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 0 0 8px 8px;
    border: 1px solid #e2e8f0;
    border-top: none;
}

.album-categorie-bloc.ouvert .album-grid {
    display: grid;
}

.album-item {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.album-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.06);
}

.album-wrapper-img {
    width: 100%;
    height: 130px;
    overflow: hidden;
    background: #edf2f7;
}

.album-wrapper-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.album-item:hover .album-wrapper-img img {
    transform: scale(1.04);
}

.album-legende {
    padding: 8px 10px;
    font-size: 12px;
    color: #4a5568;
    font-weight: 500;
    border-top: 1px solid #f7fafc;
    background: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   4. VISIONNEUSE HAUT DE GAMME (LIGHTBOX)
   ========================================================================== */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 15, 30, 0.95);
    flex-direction: column;
}

.lightbox-top-bar {
    width: 100%;
    height: 60px;
    background: rgba(20, 26, 40, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    box-sizing: border-box;
    color: white;
    user-select: none;
}

.lightbox-titre-fichier {
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
    max-width: 30%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lightbox-nav-centre {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lightbox-compteur {
    font-size: 13px;
    color: #a0aec0;
    min-width: 65px;
    text-align: center;
}

.lightbox-actions-droite {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lightbox-ctrl-btn {
    background: rgba(255, 255, 255, 0.06);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.lightbox-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.lightbox-ctrl-btn.btn-close {
    background: #e53e3e;
    border-color: #e53e3e;
    font-size: 18px;
    padding: 4px 12px;
}

.lightbox-ctrl-btn.btn-close:hover {
    background: #c53030;
    border-color: #c53030;
}

.lightbox-zone-image {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.lightbox-zone-image img {
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.6);
}

/* ==========================================================================
   5. RESPONSIVE DESIGN (TABLETTES ET MOBILES)
   ========================================================================== */
@media (max-width: 900px) {
    .album-categorie-bloc { 
        width: calc(50% - 10px); 
    }
}

@media (max-width: 600px) {
    .album-categorie-bloc { 
        width: 100%; 
    }
    .lightbox-top-bar { 
        padding: 0 10px; 
        height: 50px; 
    }
    .lightbox-titre-fichier { 
        display: none; 
    }
    .lightbox-ctrl-btn { 
        padding: 5px 8px; 
        font-size: 12px; 
    }
    .lightbox-ctrl-btn.btn-close { 
        font-size: 15px; 
        padding: 3px 8px; 
    }
}