/* ==========================================================
   B612 — VITRINE DE L'ACCUEIL (10 nov. 2026)
   1. Animations : cartes « affiche » (image pleine, texte sur dégradé,
      pastille de date en bas à gauche), arrondies partout.
   2. Nouveautés : livres posés sur une « tablette » (planche en CSS),
      titre et auteur toujours visibles.
   3. Coups de cœur : « coup de cœur du jour » mis en avant + carrousel.
   Chargée en DERNIER sur l'accueil (functions.php) : l'emporte sur
   b612-events.css et b612-home-recommendations.css / carousel.*.css.
   Gabarits : pmb-connector/templates/carousel-plank.php, shelf-book.php,
   book-feature.php ; b612-events/shortcode-b612-events.php.
   Accessibilité : contrastes ≥ 4,5:1, focus visible, survol réservé
   aux souris, « réduire les animations » respecté.
========================================================== */

.b612-events-home,
.b612-news,
.b612-recommendations--feature {
    --b612-ease-out: cubic-bezier(.23, 1, .32, 1);
    --b612-vitrine-ink: #25283a;
    --b612-vitrine-muted: #5f5a57;
}


/* ==========================================================
   1. ANIMATIONS — CARTES « AFFICHE »
========================================================== */

.b612-events-home .b612-event-card {
    --b612-event-radius: 18px;

    position: relative;
    flex: 0 0 260px;
    width: 260px;
    aspect-ratio: 3 / 4;

    border: 0;
    border-radius: var(--b612-event-radius);
    background: #2c2e52;

    /* Coins toujours arrondis, même pendant le zoom de l'image */
    clip-path: inset(0 round var(--b612-event-radius));
    overflow: hidden;

    transition: transform 220ms var(--b612-ease-out);
}

.b612-events-home .b612-event-card:hover {
    transform: none;
}

.b612-events-home .b612-event-card__link {
    position: relative;
    display: block;
    height: 100%;
    color: #fff;
    text-decoration: none;
}

/* Les cartes commencent APRÈS les bandes sombres (58px) qui protègent les
   flèches : avant, la 1re carte passait dessous (bord gauche et coins cachés). */
.b612-events-home .b612-events__viewport {
    padding-inline: 58px;
    scroll-padding-inline: 58px;
}

/* Image pleine + dégradé sombre en bas (lisibilité du texte blanc) */
.b612-events-home .b612-event-card__media {
    position: absolute;
    inset: 0;
    aspect-ratio: auto;
    background: #2c2e52;
}

.b612-events-home .b612-event-card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(10, 11, 30, 0) 30%,
        rgba(10, 11, 30, .6) 55%,
        rgba(10, 11, 30, .95) 85%
    );
}

.b612-events-home .b612-event-card__image {
    transition: transform 400ms var(--b612-ease-out);
}

/* Texte posé en bas de l'affiche */
.b612-events-home .b612-event-card__body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 18px 18px 20px;
}

/* Pastille de date, en bas à gauche, au-dessus du titre */
.b612-events-home .b612-event-card__date {
    position: static;
    display: inline-block;
    min-width: 0;
    min-height: 0;
    margin: 0 0 10px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #ffd500;
    color: #17182d;
    font-family: var(--b612-next-font-body, "Filson Pro", sans-serif);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.b612-events-home .b612-event-card__title {
    margin: 0;
    font-size: 21px;
    line-height: 1.1;

    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.b612-events-home .b612-event-card__meta {
    display: block;
    margin-top: 6px;
    font-family: var(--b612-next-font-body, "Filson Pro", sans-serif);
    font-size: 13.5px;
    line-height: 1.35;
    color: rgba(255, 255, 255, .9);
    opacity: 1;
}

.b612-events-home .b612-event-card__meta > span + span::before {
    content: " · ";
}

/* Focus clavier : contour jaune DANS la carte (le découpage arrondi masquerait un contour extérieur) */
.b612-events-home .b612-event-card__link:focus-visible {
    outline: none !important;
}

.b612-events-home .b612-event-card__link:focus-visible::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: var(--b612-event-radius);
    box-shadow: inset 0 0 0 3px #ffd500;
}

@media (hover: hover) and (pointer: fine) {
    .b612-events-home .b612-event-card:hover {
        transform: translateY(-4px);
    }

    .b612-events-home .b612-event-card:hover .b612-event-card__image {
        transform: scale(1.04);
    }
}

@media (max-width: 1200px) {
    .b612-events-home .b612-event-card {
        flex-basis: 240px;
        width: 240px;
    }
}

/* Mobile : pas de bandes sous les flèches (trop de place perdue) ; les
   flèches flottent sur les images ; deux cartes entières. */
@media (max-width: 760px) {
    .b612-events-home .b612-events__slider::before,
    .b612-events-home .b612-events__slider::after {
        display: none;
    }

    .b612-events-home .b612-events__slider {
        position: relative;
        display: block;
    }

    .b612-events-home .b612-events__prev,
    .b612-events-home .b612-events__next {
        position: absolute;
        z-index: 5;
        top: 38%;
        margin: 0;
    }

    .b612-events-home .b612-events__prev {
        left: -6px;
    }

    .b612-events-home .b612-events__next {
        right: -6px;
    }

    .b612-events-home .b612-events__viewport {
        padding-inline: 0;
        scroll-padding-inline: 0;
    }

    /* Deux vignettes entières côte à côte (retouche du 10 nov., variante 2A) */
    .b612-events-home .b612-events__cards {
        gap: 12px;
    }

    .b612-events-home .b612-event-card {
        flex: 0 0 calc((100% - 12px) / 2);
        width: calc((100% - 12px) / 2);
        aspect-ratio: 3 / 4.3;
        --b612-event-radius: 14px;
    }

    .b612-events-home .b612-event-card__body {
        padding: 10px 10px 12px;
    }

    .b612-events-home .b612-event-card__date {
        margin-bottom: 6px;
        padding: 3px 8px;
        font-size: 11px;
    }

    .b612-events-home .b612-event-card__title {
        font-size: 15px;
        line-height: 1.12;
    }

    .b612-events-home .b612-event-card__meta {
        font-size: 11px;
        line-height: 1.35;
    }

    .b612-events-home .b612-events__prev,
    .b612-events-home .b612-events__next {
        top: 34%;
        transform: scale(.85);
    }
}

/* Très petits écrans (≤ 400px) : vignettes plus hautes, titre plus petit
   avec césure, flèches remontées sur l'image (ne cachent plus la date) */
@media (max-width: 400px) {
    .b612-events-home .b612-event-card {
        aspect-ratio: 3 / 4.9;
    }

    .b612-events-home .b612-event-card__title {
        font-size: 13.5px;
        overflow-wrap: anywhere;
        hyphens: auto;
    }

    .b612-events-home .b612-event-card__meta {
        font-size: 10.5px;
    }

    .b612-events-home .b612-events__prev,
    .b612-events-home .b612-events__next {
        top: 20%;
    }
}


/* ==========================================================
   2 et 3. LIVRES — CARTE COMMUNE (.b612-shelfbook)
========================================================== */

.b612-carousel--books {
    --b612-cover-w: 128px;
    --b612-cover-h: 192px;
    --b612-lift-room: 12px;

    height: auto;
    padding: 0;
}

.b612-carousel--books .b612-carousel-right {
    height: auto;
    /* Flèches centrées sur les couvertures, pas sur le texte */
    align-items: start;
}

.b612-carousel--books .b612-carousel-prev,
.b612-carousel--books .b612-carousel-next {
    margin-top: calc(var(--b612-lift-room) + var(--b612-cover-h) / 2 - 24px);
}

.b612-carousel--books .b612-swiper {
    position: relative;
    /* Place pour le livre qui se soulève au survol et pour son ombre */
    padding: var(--b612-lift-room) 6px 6px;
}

.b612-carousel--books .swiper-wrapper {
    align-items: flex-start;
}

.b612-shelfbook {
    display: flex;
    flex-direction: column;
    width: var(--b612-cover-w);
    color: var(--b612-vitrine-ink);
    text-decoration: none;
}

/* Couverture : format uniforme 2:3, tranche éclairée, ombre douce */
.b612-shelfbook__cover {
    position: relative;
    display: block;
    width: var(--b612-cover-w);
    height: var(--b612-cover-h);
    border-radius: 3px 7px 7px 3px;
    overflow: hidden;
    background: #ddd5c4;
    box-shadow:
        0 1px 1px rgba(0, 0, 0, .08),
        0 6px 14px -4px rgba(37, 40, 58, .28),
        0 18px 30px -18px rgba(37, 40, 58, .45);
    transition:
        transform 220ms var(--b612-ease-out),
        box-shadow 220ms var(--b612-ease-out);
}

.b612-shelfbook__cover img {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #ddd5c4;
}

/* Reflet de tranche à gauche */
.b612-shelfbook__cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, .18) 0,
        rgba(255, 255, 255, .18) 3px,
        rgba(0, 0, 0, 0) 9px
    );
    pointer-events: none;
}

/* Couverture absente : couverture typographique (classe posée par carousel.js) */
.b612-shelfbook__fallback {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px 12px;
    background: linear-gradient(160deg, #28367f, #17182d);
    color: #fff;
}

.b612-shelfbook__fallback-title {
    font-family: var(--b612-next-font-heading, "Formiga", serif);
    font-weight: 900;
    font-size: 16px;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.b612-shelfbook__fallback-author {
    font-size: 11px;
    opacity: .9;
}

.b612-shelfbook__cover.is-missing img {
    display: none;
}

/* Titre et auteur, toujours visibles */
.b612-shelfbook__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 12px;
    font-family: var(--b612-next-font-body, "Filson Pro", sans-serif);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
}

.b612-shelfbook__author {
    display: block;
    margin-top: 3px;
    font-family: var(--b612-next-font-body, "Filson Pro", sans-serif);
    font-size: 13.5px;
    line-height: 1.3;
    color: var(--b612-vitrine-muted);
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Focus clavier : contour autour de la couverture */
.b612-shelfbook:focus-visible {
    outline: none !important;
}

.b612-shelfbook:focus-visible .b612-shelfbook__cover {
    outline: 3px solid #28367f;
    outline-offset: 4px;
}

.b612-shelfbook:focus-visible .b612-shelfbook__title {
    text-decoration: underline;
}

@media (hover: hover) and (pointer: fine) {
    .b612-shelfbook:hover .b612-shelfbook__cover {
        transform: translateY(-6px) rotate(-.6deg);
        box-shadow:
            0 1px 1px rgba(0, 0, 0, .08),
            0 14px 26px -8px rgba(37, 40, 58, .35),
            0 30px 40px -24px rgba(37, 40, 58, .5);
    }

    .b612-shelfbook:hover .b612-shelfbook__title {
        text-decoration: underline;
        text-underline-offset: 3px;
    }
}

.b612-shelfbook:active .b612-shelfbook__cover {
    transform: scale(.98);
}


/* ==========================================================
   2. NOUVEAUTÉS — LA « TABLETTE »
========================================================== */

/* Planche en bois clair sous les couvertures (aucune image à charger) */
.b612-carousel--plank .b612-swiper::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    /* Décollée de 8px sous les livres (retouche du 10 nov., variante 1B) */
    top: calc(var(--b612-lift-room) + var(--b612-cover-h) + 8px);
    height: 16px;
    border-radius: 3px;
    background: linear-gradient(180deg, #ece1cb 0%, #dccbab 55%, #cdb994 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .6) inset,
        0 10px 16px -10px rgba(60, 40, 10, .45);
    z-index: 0;
}

.b612-carousel--plank .swiper-wrapper {
    position: relative;
    z-index: 1;
}

/* Le texte passe sous la planche, avec de l'air (44px : retouche du 10 nov.,
   puis variante 1B : planche décollée de 8px sous les livres) */
.b612-carousel--plank .b612-shelfbook__title {
    margin-top: 52px;
}

.b612-news .b612-news__carousel {
    margin-top: 30px;
}


/* ==========================================================
   3. COUPS DE CŒUR — LIVRE MIS EN AVANT + CARROUSEL
========================================================== */

.b612-recommendations--feature .b612-recommendations__inner {
    grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
    gap: 48px;
}

.b612-recommendations--feature .b612-recommendations__title {
    margin-bottom: 28px;
}

.b612-recommendations--feature .b612-carousel-button {
    margin-top: 26px;
    align-self: flex-start;
}

.b612-feature {
    position: relative;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    padding: 22px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 10px 30px -18px rgba(37, 40, 58, .35);
    transition: transform 220ms var(--b612-ease-out), box-shadow 220ms var(--b612-ease-out);
}

.b612-feature__cover {
    width: 150px;
    height: 225px;
    box-shadow:
        0 1px 1px rgba(0, 0, 0, .08),
        0 16px 30px -12px rgba(37, 40, 58, .5);
}

.b612-feature__tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fde7ea;
    color: #9b1c33;
    font-family: var(--b612-next-font-body, "Filson Pro", sans-serif);
    font-size: 12px;
    font-weight: 700;
}

.b612-feature__title {
    margin: 10px 0 2px;
    font-family: var(--b612-next-font-heading, "Formiga", serif);
    font-size: 26px;
    font-weight: 900;
    line-height: 1.05;
}

.b612-feature__title a {
    color: var(--b612-vitrine-ink);
    text-decoration: none;
}

/* Toute la carte est cliquable (un seul lien, celui du titre) */
.b612-feature__title a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 20px;
}

.b612-feature__title a:focus-visible {
    outline: none !important;
}

.b612-feature:has(.b612-feature__title a:focus-visible) {
    outline: 3px solid #28367f;
    outline-offset: 4px;
}

.b612-feature__by {
    margin: 0 0 10px;
    font-family: var(--b612-next-font-body, "Filson Pro", sans-serif);
    font-size: 15px;
    color: var(--b612-vitrine-muted);
}

.b612-feature__text {
    margin: 0;
    padding-left: 14px;
    /* Filet en « points japonais » (charte : 1,6 pt) à la place du trait plein :
       points ronds dessinés par un dégradé répété (plus régulier que dotted) */
    background-image: radial-gradient(circle, #f0c400 1.15px, transparent 1.55px);
    background-size: 3px 5.5px;
    background-repeat: repeat-y;
    background-position: 0 3px;
    font-family: var(--b612-next-font-body, "Filson Pro", sans-serif);
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--b612-vitrine-ink);

    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (hover: hover) and (pointer: fine) {
    .b612-feature:hover {
        transform: translateY(-3px);
        box-shadow: 0 16px 36px -18px rgba(37, 40, 58, .45);
    }

    .b612-feature:hover .b612-feature__title a {
        text-decoration: underline;
        text-underline-offset: 4px;
    }
}


/* ==========================================================
   TABLETTE (768 – 1199 px)
========================================================== */

@media (max-width: 1199px) {
    .b612-recommendations--feature .b612-recommendations__inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 36px;
    }

    .b612-feature {
        max-width: 620px;
    }
}


/* ==========================================================
   MOBILE (≤ 768 px)
========================================================== */

@media (max-width: 768px) {
    .b612-carousel--books {
        --b612-cover-w: 96px;
        --b612-cover-h: 144px;

        padding: 0;
        margin: 0;
    }

    /* Flèches posées sur les couvertures : toute la largeur pour les livres */
    .b612-carousel--books .b612-carousel-right {
        position: relative;
        display: block;
    }

    .b612-carousel--books .b612-carousel-prev,
    .b612-carousel--books .b612-carousel-next {
        position: absolute;
        z-index: 3;
        top: calc(var(--b612-lift-room) + var(--b612-cover-h) / 2 - 20px);
        margin: 0;
    }

    .b612-carousel--books .b612-carousel-prev {
        left: -6px;
    }

    .b612-carousel--books .b612-carousel-next {
        right: -6px;
    }

    .b612-shelfbook__title {
        font-size: 14px;
    }

    .b612-shelfbook__author {
        font-size: 12.5px;
    }

    .b612-feature {
        grid-template-columns: 110px minmax(0, 1fr);
        gap: 16px;
        padding: 16px;
    }

    .b612-feature__cover {
        width: 110px;
        height: 165px;
    }

    .b612-feature__title {
        font-size: 22px;
    }

    .b612-feature__text {
        -webkit-line-clamp: 4;
    }
}

@media (max-width: 420px) {
    .b612-feature {
        grid-template-columns: minmax(0, 1fr);
    }

    .b612-feature__cover {
        width: 130px;
        height: 195px;
    }
}


/* ==========================================================
   « RÉDUIRE LES ANIMATIONS »
========================================================== */

@media (prefers-reduced-motion: reduce) {
    .b612-events-home .b612-event-card,
    .b612-events-home .b612-event-card__image,
    .b612-shelfbook__cover,
    .b612-feature {
        transition: none;
    }

    .b612-events-home .b612-event-card:hover,
    .b612-feature:hover {
        transform: none;
    }

    .b612-events-home .b612-event-card:hover .b612-event-card__image,
    .b612-shelfbook:hover .b612-shelfbook__cover {
        transform: none;
    }
}


/* ==========================================================
   COUPS DE CŒUR — SPHÈRE GRAINÉE SOUS LE CARROUSEL (10 nov. 2026)
   D'après la charte (« Formes rondes ») : sphère jaune #ffd618 qui se
   dissout en grain + orbite en pointillés. SVG intégré (aucune image à
   charger), décor pur (pseudo-élément : invisible aux lecteurs d'écran).
   Masque radial : le bord devient transparent vers le beige (pas de bord net) ;
   zone assez grande pour ne jamais rogner le dessin.
========================================================== */

.b612-recommendations--feature .b612-recommendations__carousel {
    position: relative;
    isolation: isolate;
}

/* La sphère déborde volontairement autour du carrousel : on la coupe au bord
   de la section pour ne jamais élargir la page (débord de 15 px vu le 10 nov.
   entre 320 et 1 200 px) */
.b612-recommendations--feature {
    overflow-x: clip;
}

.b612-recommendations--feature .b612-recommendations__carousel::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -30% -6%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 400'%3E%3Cdefs%3E%3CradialGradient id='d' cx='.75' cy='.22' r='.95'%3E%3Cstop offset='0' stop-opacity='1'/%3E%3Cstop offset='.5' stop-opacity='.7'/%3E%3Cstop offset='.95' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='e' cx='.5' cy='.5' r='.5'%3E%3Cstop offset='.7' stop-color='%23fff'/%3E%3Cstop offset='.88' stop-color='%23fff' stop-opacity='.5'/%3E%3Cstop offset='1' stop-color='%23fff' stop-opacity='0'/%3E%3C/radialGradient%3E%3Cmask id='em'%3E%3Ccircle cx='400' cy='200' r='168' fill='url%28%23e%29'/%3E%3C/mask%3E%3Cfilter id='s' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.6' numOctaves='1' seed='8' result='n'/%3E%3CfeColorMatrix in='n' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0' result='na'/%3E%3CfeComposite in='SourceAlpha' in2='na' operator='arithmetic' k2='1' k3='1' k4='-.98' result='m'/%3E%3CfeColorMatrix in='m' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 0' result='mm'/%3E%3CfeFlood flood-color='%23ffd618'/%3E%3CfeComposite in2='mm' operator='in'/%3E%3C/filter%3E%3ClinearGradient id='o' x1='1' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23fff'/%3E%3Cstop offset='.75' stop-color='%23fff' stop-opacity='.55'/%3E%3Cstop offset='1' stop-color='%23fff' stop-opacity='.15'/%3E%3C/linearGradient%3E%3Cmask id='om'%3E%3Crect width='640' height='400' fill='url%28%23o%29'/%3E%3C/mask%3E%3C/defs%3E%3Cg mask='url%28%23em%29'%3E%3Ccircle cx='400' cy='200' r='168' fill='url%28%23d%29' filter='url%28%23s%29'/%3E%3C/g%3E%3Cg mask='url%28%23om%29' opacity='.85'%3E%3Ccircle cx='400' cy='200' r='186' fill='none' stroke='%23e9bd00' stroke-width='2.2' stroke-dasharray='0 7' stroke-linecap='round'/%3E%3Ccircle cx='330.3' cy='27.5' r='4' fill='%23e9bd00'/%3E%3Ccircle cx='542.5' cy='80.4' r='4' fill='%23e9bd00'/%3E%3Ccircle cx='584.2' cy='174.1' r='4' fill='%23e9bd00'/%3E%3Ccircle cx='524.5' cy='338.2' r='4' fill='%23e9bd00'/%3E%3Ccircle cx='312.7' cy='364.2' r='4' fill='%23e9bd00'/%3E%3Ccircle cx='214.1' cy='206.5' r='4' fill='%23e9bd00'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
    pointer-events: none;
}

/* Noms d'auteurs un peu plus foncés : ≥ 4,5:1 même sur le jaune plein */
.b612-recommendations--feature .b612-recommendations__carousel .b612-shelfbook__author {
    color: #5a5a5a;
}
