/* ============================= */
/* SECTION BIBLIOTHÈQUE / ARTICLES */
/* ============================= */

#library-section {
    background: var(--trois);
    padding: 120px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ============================= */
/* GRILLE DES PUBLICATIONS */
/* ============================= */

.publication-grid {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    width: 90%;
}

/* ============================= */
/* CARTE ARTICLE / LIVRE */
/* ============================= */

.publication-card {
    background: var(--trois);
    border: 1px solid rgba(0, 0, 0, 0.08);
    width: 320px;
    height: 450px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

/* IMAGE — STRICTEMENT STATIQUE */
.publication-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: opacity 0.6s ease;
}

/* ============================= */
/* LANGUE */
/* ============================= */

.publication-lang {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--quatre);
    color: var(--trois);
    font-size: 0.65rem;
    letter-spacing: 2px;
    padding: 4px 12px;
    font-weight: 700;
    z-index: 10;
}

/* ============================= */
/* PROCHAINEMENT */
/* ============================= */

.publication-soon {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.358);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--un);
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 0.75rem;
    z-index: 15;
}

/* ============================= */
/* INTERACTION — SOBRE & ÉDITORIALE */
/* ============================= */

.publication-card:hover {
    transform: translateY(-10px);
    border-color: var(--quatre);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.publication-card:hover img {
    opacity: 1;
}

/* ==========================================================================
   RESPONSIVE MOBILE — explorations.css
   Ratio de la couverture : 320×450 ≈ 1:1.406 (portrait allongé)
   On conserve ce ratio sur tous les breakpoints.
   ========================================================================== */

@media (max-width: 1024px) {
    #library-section { padding: 80px 0; }
    .publication-grid { width: 92%; gap: 25px; }
    /* Ratio conservé : 280 × 394 ≈ 1:1.406 */
    .publication-card { width: 280px; height: 394px; }
}

@media (max-width: 768px) {
    #library-section { padding: 55px 0; }

    .publication-grid {
        width: 100%;
        padding: 0 5%;
        box-sizing: border-box;
        gap: 12px;
        justify-content: flex-start;
    }

    /* 2 cartes par ligne, même taille, ratio 1:1.406 conservé
       Calcul : largeur = (100% - 5%*2 - gap) / 2
       On pose width en %, height = width * 1.406 via padding-bottom trick  */
    .publication-card {
        width: calc(50% - 6px);
        flex: 0 0 calc(50% - 6px);
        /* Hauteur via aspect-ratio pour que les deux cartes soient identiques */
        height: auto;
        aspect-ratio: 320 / 450;
    }

    /* Pas de translateY sur mobile : overflow horizontal */
    .publication-card:hover {
        transform: none;
        border-color: var(--quatre);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    }
}

@media (max-width: 480px) {
    #library-section { padding: 42px 0; }

    .publication-grid {
        padding: 0 5%;
        gap: 10px;
        /* On centre l'unique carte */
        justify-content: center;
    }

    /* 1 carte par ligne, largeur maximale 280px centrée */
    .publication-card {
        width: 100%;
        max-width: 280px;
        flex: 0 0 100%;
        height: auto;
        aspect-ratio: 320 / 450;
    }
}