
/* Stability defaults for biblio area */
.biblio {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}


.biblio .livre-infos-box {
    background: #f9f9f9;
    border-left: 4px solid #7c4dff;
    padding: 1rem 1.5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    font-family: system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    border-radius: 4px;

    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    align-items: start;
    gap: 1.5em;
}

.biblio .livre-infos-box p {
    margin: 0;
}

.biblio .livre-infos-box strong {
    color: #333;
    font-weight: 200;
}

.biblio .livre-infos-box a {
    display: inline-block;
    color: #7c4dff;
    text-decoration: none;
}
.biblio .livre-infos-box a.isbn {
    color: inherit;
}

.biblio .livre-infos-box a:hover {
    text-decoration: underline;
}

.biblio .book-single {
    padding: 1rem;
}

.biblio .book-header {
    text-align: center;
    margin-bottom: 2rem;
}

.biblio .book-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin-bottom: 2rem;
}

.biblio .book-summary .post-thumbnail-left {
    flex: 0 0 auto;
    width: 300px;
}
.biblio .book-summary .post-title-right {
    flex: 1;
}

.biblio .editor-excerpt {
    flex: 1 1 0;
}
.biblio .committee-section {
}

.biblio .committee-review {
    font-style: italic;
    margin: 0;
    line-height: 1.6;
    border-left: 4px solid #ccc;
    padding-left: 2rem;
    margin: 2rem 0;
}

/* Hide committee section when there is no content */
.biblio .committee-section:has(blockquote:empty) {
    display: none !important;
}

.biblio .book-info {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #fafafa;
    border: 1px solid #e0e0e0;
}

.biblio .book-comments {
    margin-top: 3rem;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .biblio .book-summary {
        flex-direction: column;
        align-items: center;
    }

    .biblio .post-thumbnail-left {
        width: 100%;
        text-align: center;
    }

    .biblio .post-thumbnail-left img {
        max-width: 100%;
        height: auto;
    }
}

.mediatheque-terms,
.biblio .book-terms {
    display: flex;
    gap: 1rem;
}

.mediatheque-terms .wp-block-post-terms,
.biblio .book-terms .wp-block-post-terms {
    font-size: var(--wp--preset--font-size--medium);
}
.biblio .book-terms a,
.biblio .book-terms [rel="tag"],
.mediatheque-terms a,
.mediatheque-terms [rel="tag"] {
    border-radius: 20px;
    border-color: var(--wp--preset--color--accent-6);
    border-width: 0.8px;
    border-style: solid;
    font-weight: 400;
    line-height: 2.8;
    padding-top: 5px;
    padding-right: 10px;
    padding-bottom: 5px;
    padding-left: 10px;
    text-decoration: none;
    white-space: nowrap;
}
.biblio .book-terms .etiquette a,
.biblio .book-terms .etiquette [rel="tag"] {
    background: var(--wp--preset--gradient--cool-to-warm-spectrum);
    color: rgba(255,255,255, .7)
}



@keyframes pulse-heart {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.15); }
    100% { transform: translateX(-50%) scale(1); }
}
.biblio .book .badge-coup-de-coeur {
    animation: pulse-heart 3.6s ease-in-out infinite;
    position: absolute;
    bottom: -.25rem;
    left: 50%;
    transform: translateX(-50%);
    background: #e91e63; /* rose vif */
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.5rem;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 0;
}


.biblio .bibliographie-filtres {
    padding: 1em 2em;
    background-color: #f9f9f9;
    border-bottom: 1px solid #ccc;
    margin-bottom: 0;
}

.biblio .bibliographie-filtres form {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    align-items: center;
    justify-content: center;
}

.biblio .bibliographie-filtres select {
    padding: 0.5em 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    font-size: 1rem;
    min-width: 180px;
}

.biblio .bibliographie-filtres input[type="search"] {
    padding: 0.5em 0.75em;
    border: 1px solid #ccc;
    border-radius: 999px;
    background: #fff;
    font-size: 1rem;
    min-width: 260px;
}

.biblio .bibliographie-filtres button[type="submit"] {
    background-color: #0073aa;
    color: #fff;
    padding: 0.6em 1.2em;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.biblio .bibliographie-filtres button[type="submit"]:hover {
    background-color: #005d8f;
}

.biblio .bibliographie-filtres .reset-filters {
    color: #666;
    text-decoration: underline;
    font-size: 0.9rem;
    white-space: nowrap;
}

.biblio .bibliographie-filtres .add-book {
    background: var(--wp--preset--color--accent-6, #7c4dff);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-weight: 700;
    text-decoration: none;
    margin-left: 0.75rem;
}
.biblio .bibliographie-filtres .add-book:hover { filter: brightness(0.95); }

/* Book nav styles */
.mediatheque-nav-bottom,
.biblio .book-nav, .biblio .book-nav-bottom {
    gap: .75rem;
}
.biblio .book-nav a,
.biblio .book-nav-bottom a,
.mediatheque-nav a,
.mediatheque-nav-bottom a {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid #ddd;
    background: #fff;
}
.biblio .book-nav .back-to-archive, .mediatheque-nav-bottom .back-to-archive { border-color: #ccc; }
.biblio .book-nav-bottom .wp-block-post-navigation-link a,
.biblio .book-nav-bottom a.wp-block-post-navigation-link__anchor,
.mediatheque-nav-bottom .wp-block-post-navigation-link a,
.mediatheque-nav-bottom a.wp-block-post-navigation-link__anchor {
    background: var(--wp--preset--color--accent-6, #7c4dff);
    color: darkturquoise;
    border-color: transparent;
}
.mediatheque-nav-bottom .btn-prev a:before,
.biblio .book-nav-bottom .btn-prev a:before {
    content: '←';
}
.mediatheque-nav-bottom .btn-next a:after,
.biblio .book-nav-bottom .btn-next a:after {
    content: '→';
}
.biblio .book-archive-group {
    padding-top: 80px;
    text-align: center;
}
.biblio .book-archive-group h2{
    border-top: 5px solid;
    padding-top: 2rem;
    display: inline-block;
}
/* Base */
.biblio .book-archive-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    font-family: Georgia, serif;
    background: #FDE3A7;
    font-size: calc(var(--wp--preset--font-size--small) / 1.5);
    margin-top: 0;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.biblio .book {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    min-height: 300px;
    box-sizing: border-box;

    transform-style: preserve-3d;
    transition: transform 1s ease;
}
.biblio .book.open {
    transform: rotateY(0deg) scale(1.05);
    z-index: 10;
}
/* Typography */
.biblio .avis {
    font-family: 'Indie Flower', cursive !important;
    max-width: 90%;
    margin: 0 auto;
    max-height: 90%;
    overflow: auto;
}
.biblio .resume {
    overflow: auto;
}
.biblio .titre,
.biblio .auteur {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    width: 100%;
    text-align: center;
}
.biblio .edit-link {
    margin-left:auto; display:flex; align-items:center; gap:0.5em; justify-content: end;
}
.biblio .titre a {
    color: inherit;
    text-decoration: none;
}
.biblio .titre {
    font-size: 1.5em;
    line-height: 1.25;
    text-transform: capitalize;
    font-variant: small-caps slashed-zero;
    font-weight: 500;
}
.biblio .auteur {
    margin-top: 0.25em;
    font-size: 0.75em;
    line-height: 1.375;
}
.biblio .lien {
    text-decoration: none;
    display: block;
    text-align: center;
    margin-top: 0.5em;
    position: absolute;
    border: 0;
    font-size: 8px;
    bottom: 0;
    transition: transform 1s ease;
    transition-delay: .5s;
    background: white;
    right: 5px;
    transform: translate3d(-10px, -28px, 0px) rotate(-19deg);
    padding: 50px 10px 5px;
    z-index:-20;
    box-shadow: 0 0 10px rgba(0,0,0,.2);
    border-radius: 4px;
    font-family: 'Indie Flower', cursive !important;

}
.card.cover-open .lien {
    transform: translate3d(-10px, 22px, 0) rotate(-3deg);
}
.biblio .lien:hover { color: #f9975d; }
.biblio .resume { max-width: 90%; margin: 0 auto; font-size: .75em; }
.biblio .resume > p + p { margin-top: 1.5em; }
.biblio .text-right { text-align: right; }
.biblio .card .avis { line-height: 1.42; transform: rotate(-2deg); padding-left: 12px; margin: 6px 0; }

/* Card container */
.biblio .card {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: 66%;
    max-height: 66%;
    margin: 0 auto;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transform: translate(-50%,-50%) perspective(2000px);
    transition: transform 1s ease, box-shadow .7s ease;
    will-change: transform, box-shadow;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: inset 300px 0 50px rgba(0,0,0,.5), 20px 0 60px rgba(0,0,0,.5);
}
.biblio .card.cover-open {
    transform: translate3d(-50%,-50%, 40px) perspective(2000px) rotate(-2deg) scale(2);
    box-shadow: inset 20px 0 50px rgba(0,0,0,.5), 0 10px 100px rgba(0,0,0,.5);
}
.biblio .card.page1-open { transform: translate3d(-50%, -50%, 40px) perspective(2000px) rotate(-1deg) scale(2); }
.biblio .card:before {
    content:'';
    position: absolute;
    top: -5px;
    left: 0;
    width: 100%;
    height: 5px;
    background: #BAC1BA;
    transform-origin: bottom;
    transform: skewX(-45deg);
}
.biblio .card:after {
    content: '';
    position: absolute;
    top: 0;
    right: -5px;
    width: 5px;
    height: 100%;
    background: #92A29C;
    transform-origin: left;
    transform: skewY(-45deg);
}

/* Cover */
.biblio .card .cover {
    width: 100%;
    height: 100%;
    position: relative;
    transform-origin: left;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    transition: transform .7s ease, box-shadow .5s ease, margin .7s ease;
    will-change: transform, box-shadow;
    transform: translateZ(0);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.biblio .card .bark {
    position: absolute;
    background: #e0e1dc;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity .6s ease, box-shadow .6s ease;
}

/* Pages */
.biblio .page { background: #e0e1dc; transform-origin: left; }
.biblio .card .page1,
.biblio .card .page2 {
    position: absolute;
    top: 0;
    left: 0;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    z-index: -1;
    margin-top: 0;
    transition: transform .35s ease, background .35s ease, box-shadow .7s ease;
    will-change: transform, box-shadow;
}
.biblio .card .page2 { z-index: -2; background: #fff }
.biblio .card.cover-open .page1,
.biblio .card.page1-open .page2 { box-shadow: inset 20px 0 50px rgba(0,0,0,.5), 0 10px 100px rgba(0,0,0,.5); }
.biblio .card.cover-open .cover,
.biblio .card.page1-open .page1 { transform: rotateY(-105deg); padding: 0; opacity: .95; }
.biblio .card.cover-open .page1 { z-index: 1; }
.biblio .card.cover-open .cover .bark,
.biblio .card.page1-open .page1 .bark { opacity: .8; transition: .6s; box-shadow: 300px 200px 100px rgba(0,0,0,.4) inset; }
.biblio .card.page1-open .page1 .bark { opacity: 1; z-index: 1; }
.biblio .card.has-page1.page1-open .cover { margin-top: -5px; margin-right: -5px; }
.biblio .card.page1-open .cover .bark { box-shadow: 0 0 10px rgba(0,0,0,.4) inset; }

/* Content */
.biblio .content {
    padding: 10px 14px 14px;
    max-height: 100%;
    box-sizing: border-box;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    justify-content: space-evenly;
    align-items: stretch;
    flex-direction: column;
    height: 100%;
}

.biblio .resume {
    overflow: auto;

    display: flex;
    justify-content: space-evenly;
    align-items: stretch;
    flex-direction: column;
    min-height: 100%;
}
.biblio .resume::after {
    content: "";
}
.biblio .book-cover-foreground {
    height: 100%;
    width: 100%;
    object-fit: contain;
    object-position: center;
    position: absolute;
    z-index: 2;
    inset: 0;
    transition: transform 0s;
    transition-delay: .25s;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
}

/* .biblio .cover-open .book-cover-foreground { transform: scaleX(-1); } */

/* Effects */
.biblio .card:not(.cover-open):hover .cover {
    transform: perspective(2000px) rotateY(-30deg);
    transform-style: preserve-3d;
    box-shadow:
            inset 4px 1px 3px #ffffff60,
            inset 0 -1px 2px #00000080,
            10px 0 10px -5px #00000030;
}
.biblio .effect {
    width: 20px;
    height: 100%;
    margin-left: 10px;
    border-left: 2px solid #00000010;
    background-image: linear-gradient(90deg, rgba(255,255,255,.2) 0%, rgba(255,255,255,0) 100%);
    transition: width .5s ease;
    z-index: 2;
    position:absolute;
    left:0;
    top:0;
    pointer-events: none;
}
.biblio .card:not(.cover-open):hover .effect { width: 40px; }
.biblio .light {
    width: 90%;
    height: 100%;
    position: absolute;
    border-radius: 3px;
    background-image: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.2) 100%);
    top: 0;
    right: 0;
    opacity: .1;
    transition: opacity .5s ease, width .5s ease;
    z-index: 3;
    pointer-events: none;
}
.biblio .card:not(.cover-open):hover .light { opacity: 1; width: 70%; }

/* Focus visibility for keyboard users */
.biblio .card:focus,
.biblio .card:focus-visible { outline: none; }
.biblio a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}



.biblio .bookmark {
    position: absolute;
    top: 0;
    right: 20px;
    height: 3em;
    width: 2.5em;
    text-align: center;
    background-color: red;
    background-image:
            linear-gradient(
                    hsla(0, 0%, 100%, 0),
                    hsla(0, 0%, 100%, 0.5) 5px,
                    hsla(0, 0%, 100%, 0) 25px);
    -webkit-filter: drop-shadow(0 2px 6px hsla(0, 0%, 0%, 0.75));
    box-sizing: border-box;
    padding-top: 1em;
    color: white;
    font-size: 1.5em;
    text-shadow: 0 -1px 0 hsla(0, 0%, 0%, 0.5);
    z-index: 20;
}
.biblio .bookmark svg {
    width: 1.5em;
    height: 1.5em;
}
.biblio .bookmark:before,
.biblio .bookmark:after{
    content: '';
    display: block;
    position: absolute;
}
.biblio .bookmark:before {
    bottom: -50%;
    height: 100%;
    width: 100%;
    background-image:
            linear-gradient(
                    -45deg,
                    transparent 50%,
                    red 50%),
            linear-gradient(
                    45deg,
                    transparent 50%,
                    red 50%);
    z-index: -1;
}
.biblio .bookmark:after {
    height: 136.5%;
    width: 88%;
    left: 6%;
    top: 0;
    border-style: dashed;
    border-color: yellow;
    border-width: 0 1px;
    pointer-events: none;
}


/* Reduced motion to prevent flashing/flicker for sensitive users */
@media (prefers-reduced-motion: reduce) {
    .biblio * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}


.biblio .card .page1 {
    background: #e0e1dc; /* Fallback */
    background: linear-gradient(-30deg, transparent 1.5em, #e0e1dc 0);
}

.biblio .card .page1::before {
    content: '';
    position: absolute;
    bottom: 0; right: 0;
    width: 1.73em; height: 3em;
    background: linear-gradient(to right bottom, transparent 50%, rgba(0,0,0,.2) 0, rgba(0,0,0,.4)) 100% 0 no-repeat;
    transform: translateX(-1.3em) translateY(-2.73em) rotate(210deg);
    transform-origin: bottom right;
    border-bottom-right-radius: .5em;
    box-shadow: .3em .3em .4em -.1em rgba(0,0,0,.15);
}
