/* Tempus Belli Blocks : styles du bloc Bibliothèque (chargé uniquement quand le bloc est présent). Dépend de style.css. */
/* ===== Bibliothèque : couvertures de livres (1.8.0) ===== */
.tbb-bk { --_cols: var(--bk-cols, 4); --_gap: var(--bk-gap, 24px); box-sizing: border-box; width: 100%; max-width: var(--bk-mw, none); margin-inline: auto; background: var(--bk-bg, transparent); padding: 4px; }
.tbb-bk--empty { padding: 28px; text-align: center; border: 2px dashed rgba(127, 127, 127, .4); border-radius: 12px; color: var(--tbb-muted, #5b6270); }
.tbb-bk__list { list-style: none !important; margin: 0 !important; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(max(var(--bk-min, 120px), calc((100% - (var(--_cols) - 1) * var(--_gap)) / var(--_cols))), 1fr)); gap: calc(var(--_gap) * 1.2) var(--_gap); }
.tbb-bk__li { margin: 0 !important; padding: 0 !important; min-width: 0; list-style: none !important; }
.tbb-bk__li::marker { content: none; }
.tbb .tbb-bk__item { display: flex; flex-direction: column; gap: 10px; height: 100%; color: inherit !important; text-decoration: none !important; border: 0; box-shadow: none; position: relative; -webkit-tap-highlight-color: transparent; }
.tbb-bk__cover { position: relative; display: block; width: 100%; aspect-ratio: 2 / 3; border-radius: 2px var(--bk-r, 4px) var(--bk-r, 4px) 2px; overflow: hidden; background: var(--bk-cover, #2b2f3a); transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s ease; transform-origin: 50% 100%; }
.tbb-bk--r-34 .tbb-bk__cover { aspect-ratio: 3 / 4; }
.tbb-bk--r-11 .tbb-bk__cover { aspect-ratio: 1 / 1; }
.tbb-bk--r-auto .tbb-bk__cover { aspect-ratio: auto; }
.tbb-bk--shadow .tbb-bk__cover { box-shadow: 0 16px 22px -12px rgba(8, 10, 16, .55), 0 2px 5px rgba(8, 10, 16, .25); }
.tbb .tbb-bk__img { display: block; width: 100%; height: 100%; margin: 0; object-fit: cover; border-radius: 0; filter: var(--tbb-img-filter, none); transition: transform .6s ease, filter .35s ease; }
.tbb-bk--r-auto .tbb-bk__img { height: auto; }
.tbb-bk__item:hover .tbb-bk__img { filter: var(--tbb-img-filter-h, var(--tbb-img-filter, none)); }
.tbb-bk--spine .tbb-bk__cover::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(0, 0, 0, .34) 0, rgba(255, 255, 255, .22) 2.2%, rgba(0, 0, 0, .14) 4.2%, rgba(0, 0, 0, 0) 9%), linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(0, 0, 0, 0) 30%); }
/* Couverture générée quand il n'y a pas d'image */
.tbb-bk__fb { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; padding: 12% 14% 12% 18%; text-align: center; color: #fff; }
.tbb-bk__fb b { font-size: clamp(.85rem, 1.6vw, 1.15rem); line-height: 1.2; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.tbb-bk__fb i { font-size: .72rem; font-style: normal; opacity: .8; letter-spacing: .1em; text-transform: uppercase; }
.tbb-bk__fb--0 { background: linear-gradient(160deg, #7a1f1f, #2c0d0d); }
.tbb-bk__fb--1 { background: linear-gradient(160deg, #1f3a5f, #0d1a2e); }
.tbb-bk__fb--2 { background: linear-gradient(160deg, #3d4a2c, #151b0e); }
.tbb-bk__fb--3 { background: linear-gradient(160deg, #5a4630, #231a10); }
.tbb-bk__fb--4 { background: linear-gradient(160deg, #3a3a3a, #101010); }
.tbb-bk__fb--5 { background: linear-gradient(160deg, #5d2f59, #1e0e1c); }
.tbb-bk__badge { position: absolute; top: 8px; right: 8px; z-index: 2; padding: .2em .55em; border-radius: 4px; font-size: .68rem; font-weight: 800; letter-spacing: .08em; line-height: 1.3; background: var(--bk-badge-bg, var(--tbb-accent, #c4161c)); color: var(--bk-badge-c, #fff); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
/* Légendes */
.tbb-bk__cap { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tbb-bk--a-center .tbb-bk__cap { text-align: center; }
.tbb-bk--a-left .tbb-bk__cap { text-align: left; }
.tbb .tbb-bk__cap strong, .tbb .tbb-bk__over strong { font-size: .95rem; line-height: 1.25; font-weight: 700; color: var(--bk-title-c, var(--tbb-ink, #16181d)) !important; overflow-wrap: anywhere; }
.tbb .tbb-bk__cap em, .tbb .tbb-bk__over em { font-size: .8rem; font-style: normal; color: var(--bk-meta-c, var(--tbb-muted, #5b6270)) !important; }
.tbb-bk__over { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; display: flex; flex-direction: column; gap: 2px; padding: 34px 12px 12px 16px; background: linear-gradient(0deg, rgba(8, 10, 16, .92), rgba(8, 10, 16, 0)); opacity: 0; transform: translateY(8px); transition: opacity .3s ease, transform .3s ease; }
.tbb .tbb-bk__over strong, .tbb .tbb-bk__over em { color: #fff !important; }
.tbb-bk__item:hover .tbb-bk__over, .tbb-bk__item:focus-visible .tbb-bk__over { opacity: 1; transform: none; }
@media (hover: none) { .tbb-bk__over { opacity: 1; transform: none; } }
.tbb-bk__item:focus-visible { outline: 3px solid var(--tbb-accent, #c4161c); outline-offset: 4px; border-radius: 4px; }
/* Survols */
.tbb-bk--h-lift .tbb-bk__item:hover .tbb-bk__cover { transform: translateY(-10px); box-shadow: 0 26px 30px -14px rgba(8, 10, 16, .6), 0 3px 8px rgba(8, 10, 16, .25); }
.tbb-bk--h-zoom .tbb-bk__item:hover .tbb-bk__img { transform: scale(1.08); }
.tbb-bk--h-tilt .tbb-bk__li { perspective: 900px; }
.tbb-bk--h-tilt .tbb-bk__cover { transform-origin: 0 50%; }
.tbb-bk--h-tilt .tbb-bk__item:hover .tbb-bk__cover { transform: rotateY(-22deg) translateX(4px); box-shadow: 14px 16px 26px -10px rgba(8, 10, 16, .6); }
/* Étagère */
.tbb-bk__plank { display: none; }
.tbb-bk--shelf .tbb-bk__list { row-gap: calc(var(--_gap) * .9); }
.tbb-bk--shelf .tbb-bk__item { gap: 0; }
.tbb-bk--shelf .tbb-bk__cover { margin-bottom: 0; }
.tbb-bk--shelf .tbb-bk__plank { display: block; height: 18px; margin: 0 calc(var(--_gap) / -2) 10px; border-radius: 2px; background: linear-gradient(180deg, var(--bk-shelf, #7a5230) 0, var(--bk-shelf, #7a5230) 55%, rgba(0, 0, 0, .35) 100%); box-shadow: 0 10px 14px -8px rgba(0, 0, 0, .45); position: relative; }
.tbb-bk--shelf .tbb-bk__plank::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: rgba(255, 255, 255, .22); border-radius: 2px 2px 0 0; }
.tbb-bk--shelf .tbb-bk__cover { box-shadow: 0 0 0 rgba(0, 0, 0, 0); }
.tbb-bk--shelf.tbb-bk--shadow .tbb-bk__cover { box-shadow: 8px 0 14px -8px rgba(8, 10, 16, .45); }
/* Mosaïque : la première couverture est mise en avant */
.tbb-bk--mosaic .tbb-bk__list { grid-auto-flow: dense; }
.tbb-bk--mosaic .tbb-bk__li--first { grid-column: span 2; grid-row: span 2; }
.tbb-bk--mosaic .tbb-bk__li--first .tbb-bk__cover { aspect-ratio: auto; flex: 1 1 auto; min-height: 0; }
.tbb-bk--mosaic .tbb-bk__li--first .tbb-bk__fb b { font-size: clamp(1.1rem, 2.6vw, 1.9rem); }
.tbb-bk--mosaic .tbb-bk__li--first .tbb-bk__cap strong { font-size: 1.1rem; }
/* Rail : une seule rangée qui défile au doigt */
.tbb-bk--rail .tbb-bk__list { display: flex; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; padding: 14px 4px 22px !important; scrollbar-width: thin; }
.tbb-bk--rail .tbb-bk__li { flex: 0 0 calc((100% - (var(--_cols) - 1) * var(--_gap)) / var(--_cols)); scroll-snap-align: start; }
/* Alignement des légendes */
.tbb-bk--a-center .tbb-bk__list { justify-items: stretch; }
@media (max-width: 640px) {
	.tbb-bk { --_gap: min(var(--bk-gap, 24px), 16px); }
	.tbb-bk--rail { --_cols: 2.4; }
	.tbb-bk--shelf .tbb-bk__plank { height: 10px; }
}
