/* =========================
   BASE
========================= */

body {
    margin: 0;
    font-family: Georgia, serif;
    color: #eee;
    text-align: center;
    min-height: 100vh;
    position: relative;
    background: #0c1022; /* couleur de secours */
    overflow-x: hidden;
}

/* Image floutee en arriere-plan */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url("images/fond.jpg") center center / cover no-repeat;
    filter: blur(5px);
    transform: scale(1.1);
    z-index: -2;
}

/* Voile sombre */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 35, 0.55);
    z-index: -1;
}


/* =========================
   HEADER
========================= */

header {
    padding: 40px 20px;
}

h1 {
    margin: 0;
    font-weight: normal;
    letter-spacing: 2px;
}


/* =========================
   GALERIE
========================= */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    padding: 20px;
}

.item {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
}

.item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.4s ease;
}

.item:hover img {
    transform: scale(1.05);
}

/* Effet vitre legere */
.item img {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(3px);
    border: 1px solid rgba(255,255,255,0.08);
}


/* =========================
   CAPTION
========================= */

.caption {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: #fff;
    font-size: 16px;
    letter-spacing: 1px;
    text-align: left;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.item:hover .caption {
    opacity: 1;
}


/* =========================
   LIGHTBOX
========================= */

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}
.lightbox-img {
    transition: transform 0.3s ease;
}
.lightbox-img:hover {
    transform: scale(1.05);
}
.close {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    z-index: 1002;
    transition: transform 0.3s ease;
}
.close:hover {
    transform: rotate(90deg);
}
.filters {
    margin: 20px 0;
}

.filters button {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.15);
    padding: 8px 18px;
    margin: 0 5px;
    cursor: pointer;
    border-radius: 4px;
    transition: 0.3s;
}

.filters button:hover {
    background: rgba(255,255,255,0.2);
}

.filters button.active {
    background: rgba(255,255,255,0.3);
}
/* =========================
   CARTES (ratio libre)
========================= */

.item.carte img {
    height: auto;
    max-height: 500px;
    object-fit: contain;
}
/* Style specifique pour les fiches */
.item.fiche-article {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.item.fiche-article:hover {
    transform: translateY(-5px);
}

.item.fiche-article img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.fiche-contenu {
    padding: 20px;
}

.fiche-titre {
    font-size: 1.4rem;
    margin: 0 0 10px 0;
    color: #333;
    font-weight: bold;
}

.fiche-chapitre {
    display: inline-block;
    background: #e67e22;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.fiche-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.fiche-lire-suite {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s ease;
}

.fiche-lire-suite:hover {
    background: #2980b9;
}

/* =========================
   CONTROLES AUDIO - VERSION ULTRA COMPACTE
========================= */

.audio-controls {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 12px;
    border-radius: 20px;
    display: none;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 1001;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    max-width: 90%;
    width: auto;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.lightbox .audio-controls {
    display: flex;
}

/* Bouton Écouter/Pause */
.audio-btn {
    background: #6c63ff;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: Georgia, serif;
    flex-shrink: 0;
}

.audio-btn:hover {
    background: #5a52d5;
    transform: scale(1.05);
}

.audio-btn:active {
    transform: scale(0.95);
}

.audio-btn.playing {
    background: #ff6b6b;
}

.audio-btn.playing:hover {
    background: #e55a5a;
}

/* Icônes */
.play-icon, .pause-icon {
    font-size: 11px;
}

/* Barre de progression */
.audio-progress {
    display: flex;
    align-items: center;
    gap: 5px;
    color: white;
    font-size: 10px;
    flex: 0 1 auto;
    min-width: 60px;
    max-width: 150px;
}

#audio-timeline {
    width: 60px;
    height: 3px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    flex: 1;
    min-width: 30px;
    max-width: 100px;
}

#audio-timeline::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6c63ff;
    cursor: pointer;
}

#audio-timeline::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6c63ff;
    cursor: pointer;
    border: none;
}

#current-time, #total-time {
    min-width: 20px;
    font-family: 'Courier New', monospace;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
}

/* Animation du bouton play */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.audio-btn.playing {
    animation: pulse 2s ease-in-out infinite;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {
    .audio-controls {
        bottom: 12px;
        padding: 5px 10px;
        gap: 5px;
        border-radius: 16px;
        max-width: 92%;
    }
    
    .audio-btn {
        padding: 3px 10px;
        font-size: 11px;
    }
    
    .audio-progress {
        min-width: 40px;
        max-width: 100px;
        gap: 3px;
    }
    
    #audio-timeline {
        width: 40px;
        min-width: 20px;
        max-width: 60px;
    }
    
    #current-time, #total-time {
        font-size: 8px;
        min-width: 15px;
    }
}

@media (max-width: 480px) {
    .audio-controls {
        bottom: 10px;
        padding: 4px 8px;
        gap: 4px;
        border-radius: 14px;
        max-width: 95%;
    }
    
    .audio-btn {
        padding: 2px 8px;
        font-size: 10px;
        border-radius: 12px;
    }
    
    .play-icon, .pause-icon {
        font-size: 9px;
    }
    
    .audio-progress {
        min-width: 30px;
        max-width: 70px;
        gap: 2px;
    }
    
    #audio-timeline {
        width: 25px;
        min-width: 15px;
        max-width: 40px;
    }
    
    #current-time, #total-time {
        font-size: 7px;
        min-width: 12px;
    }
}