/* Librairie Upratic (/ebooks) : les ebooks posés de face sur une bibliothèque en bois.
   Les étagères sont formées par librairie.js (une planche par rangée, selon le nombre de colonnes --cols) ;
   sans script, les livres restent en grille. Textures : site/v2/ebook/librairie/ (dessinées par ebooks/librairie/bois.py). */
.lb-page { background: #f6f1e9; }
.lb-kick { margin: 0 0 10px; font: 800 .74rem/1.2 var(--head); letter-spacing: .16em; text-transform: uppercase; color: var(--orange); }

/* ---------- en-tête : le livre à la une ---------- */
.lb-hero { position: relative; isolation: isolate; overflow: hidden; padding: 150px 0 110px; color: #c9d4ea;
  background: radial-gradient(70% 80% at 82% 40%, rgba(255, 140, 50, .22), transparent 60%), radial-gradient(120% 90% at 20% 0%, #123b8f 0%, var(--navy-800) 45%, var(--navy-900) 100%); }
.lb-hero::after { content: ""; position: absolute; inset: auto 0 0; height: 90px; z-index: -1; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .25)); }
.lb-hero-in { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: center; }
.lb-hero h1 { font: 800 clamp(2.3rem, 4.6vw, 3.6rem)/1.06 var(--head); color: #fff; letter-spacing: -.02em; }
.lb-lead { margin: 22px 0 0; max-width: 560px; font-size: 1.08rem; line-height: 1.65; }
.lb-marks { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; }
.lb-marks li { padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06); font: 600 .85rem/1.2 var(--head); color: #dbe5f7; }
.lb-marks b { color: var(--orange); font-weight: 800; }
.lb-feat { position: relative; display: grid; grid-template-columns: 210px 1fr; gap: 34px; align-items: center; padding: 34px 34px 34px 38px; border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03)); border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .7); }
.lb-feat-book { position: relative; }
.lb-new { position: absolute; top: -16px; right: -18px; z-index: 5; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; transform: rotate(12deg);
  background: radial-gradient(circle at 35% 30%, #ff9a3c, var(--orange-600)); color: #fff; font: 800 .72rem/1 var(--head); letter-spacing: .04em; text-transform: uppercase; box-shadow: 0 10px 20px -8px rgba(0, 0, 0, .6); }
.lb-feat-k { margin: 0 0 6px; font: 800 .7rem/1.2 var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--orange); }
.lb-feat-txt h2 { font: 800 1.6rem/1.15 var(--head); color: #fff; }
.lb-feat-txt p { margin: 8px 0 0; color: #b9c6e0; }
.lb-feat-act { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ---------- un livre (couverture fidèle à celle de l'ebook) ---------- */
.lb-book { position: relative; display: block; width: 100%; max-width: 186px; aspect-ratio: 794 / 1123; perspective: 1100px; text-decoration: none; container-type: inline-size; }
.lb-big { max-width: 210px; }
.lb-3d { position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: 0 50%; transform: rotateY(14deg); transition: transform .55s cubic-bezier(.2, .7, .2, 1); }
.lb-big .lb-3d { transform: rotateY(22deg); }
.lb-cover { position: absolute; inset: 0; overflow: hidden; border-radius: 2px 5px 5px 2px; background: var(--navy-900); transform: translateZ(0);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 18px 24px -14px rgba(0, 0, 0, .7); }
.lb-cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .9; }
/* reliure (pli du dos) et reflet */
.lb-cover::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, .45) 0, rgba(255, 255, 255, .22) 2.5%, rgba(0, 0, 0, .18) 5%, transparent 9%),
              linear-gradient(118deg, rgba(255, 255, 255, .2) 0%, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, .07) 100%); }
.lb-logo { position: absolute; z-index: 2; left: 7%; top: 5%; display: flex; align-items: center; gap: 3.5cqw; padding: 2.8cqw 4.5cqw 2.8cqw 3.5cqw; border-radius: 3.5cqw; background: rgba(6, 26, 71, .82);
  font: 800 6.4cqw/1 var(--head); color: #fff; }
.lb-logo img { width: 10cqw; height: auto; }
.lb-band { position: absolute; z-index: 2; left: 0; right: 0; bottom: 15%; display: grid; gap: 2cqw; padding: 7cqw 7cqw 7cqw 8cqw; border-left: 2.6cqw solid var(--orange);
  background: linear-gradient(90deg, rgba(6, 26, 71, .95), rgba(6, 26, 71, .8)); }
.lb-coll { font: 800 4.4cqw/1.2 var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--orange); }
.lb-title { font: 800 9.4cqw/1.08 var(--head); color: #fff; }
.lb-sub { font: 600 5.2cqw/1.3 var(--head); color: #d6e0f3; }
/* épaisseur : la tranche des pages, vue quand le livre pivote */
.lb-pages { position: absolute; top: 1.2%; bottom: 1.2%; left: 100%; width: 7cqw; transform-origin: 0 50%; transform: rotateY(90deg);
  background: repeating-linear-gradient(90deg, #f6f1e4 0 1px, #ddd4c1 1px 2px), #efe8d8; box-shadow: inset 0 0 6px rgba(0, 0, 0, .25); }
/* ombre portée sur la planche */
.lb-book::after { content: ""; position: absolute; left: 4%; right: -8%; bottom: -5px; height: 12px; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent); filter: blur(2px); }
a.lb-book:hover .lb-3d, a.lb-book:focus-visible .lb-3d { transform: rotateY(-4deg) translateY(-10px) translateZ(30px); }
a.lb-book:focus-visible { outline: none; }
a.lb-book:focus-visible .lb-cover { box-shadow: 0 0 0 3px var(--orange), 0 18px 24px -14px rgba(0, 0, 0, .7); }
/* à paraître : couverture un peu éteinte, bandeau en coin */
.is-soon .lb-cover > img { filter: saturate(.55) brightness(.8); }
.is-soon .lb-band { background: linear-gradient(90deg, rgba(6, 26, 71, .9), rgba(6, 26, 71, .7)); border-left-color: #b98b46; }
.is-soon .lb-coll { color: #e7c17f; }
.lb-ribbon { position: absolute; z-index: 4; top: 7%; right: -5px; padding: 1.6cqw 4cqw 1.6cqw 5cqw; border-radius: 3px 0 0 3px;
  background: linear-gradient(180deg, #f2d49a, #c99a4e); color: #3a2508; font: 800 4.6cqw/1.2 var(--head); letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 4px 8px -3px rgba(0, 0, 0, .5); }
.lb-ribbon::after { content: ""; position: absolute; right: 0; bottom: -5px; border-left: 5px solid #7b5a26; border-bottom: 5px solid transparent; }

/* ---------- la bibliothèque ---------- */
.lb-room { position: relative; padding: 90px 0 70px; background: radial-gradient(90% 60% at 50% 0%, #fffaf2, #f1e8da 70%); }
.lb-wrap { width: min(1320px, 100% - 40px); }
.lb-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 32px; margin-bottom: 34px; }
.lb-head .lb-kick { color: var(--orange-600); }
.lb-head h2 { font: 800 clamp(1.7rem, 3vw, 2.4rem)/1.12 var(--head); color: var(--navy); }
.lb-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.lb-filters button { padding: 9px 15px; border-radius: 999px; border: 1.5px solid #d9cbb5; background: #fffdf9; color: #5a3b1c; font: 700 .84rem/1 var(--head); cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.lb-filters button:hover { border-color: #8a5a2b; }
.lb-filters button[aria-pressed="true"] { background: #5a3416; border-color: #5a3416; color: #fff3df; }

/* le meuble : corniche, montants, fond en lames, socle */
.lb-case { position: relative; padding: 0 26px; border-radius: 6px 6px 4px 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .1) 0, rgba(0, 0, 0, .15) 26px, transparent 26px, transparent calc(100% - 26px), rgba(255, 255, 255, .06) calc(100% - 26px), rgba(0, 0, 0, .35) 100%),
              url(/site/v2/ebook/librairie/planche-v1.webp) center / 1400px 100% #6d3f1e;
  box-shadow: 0 50px 70px -40px rgba(40, 20, 5, .75), 0 18px 30px -20px rgba(40, 20, 5, .5); }
.lb-crown { position: relative; height: 46px; margin: 0 -40px; border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, rgba(255, 240, 220, .28) 0, rgba(255, 240, 220, .05) 18%, rgba(0, 0, 0, .1) 60%, rgba(0, 0, 0, .45) 100%), url(/site/v2/ebook/librairie/planche-v1.webp) center / 1400px auto #6d3f1e;
  box-shadow: 0 10px 18px -8px rgba(0, 0, 0, .6); }
.lb-crown::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -8px; height: 8px; background: linear-gradient(180deg, #3b200d, #5a3416); border-radius: 0 0 3px 3px; }
.lb-base { height: 54px; margin: 0 -14px; border-radius: 0 0 6px 6px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .5) 0, rgba(0, 0, 0, .1) 14%, rgba(255, 240, 220, .12) 20%, rgba(0, 0, 0, .3) 100%), url(/site/v2/ebook/librairie/planche-v1.webp) center 30% / 1400px auto #5a3416; }
.lb-inner { position: relative; padding: 18px 0 0;
  background: linear-gradient(180deg, rgba(10, 4, 0, .55), rgba(10, 4, 0, .2) 30%, rgba(10, 4, 0, .35)), url(/site/v2/ebook/librairie/fond-v1.webp) center top / 520px auto #3a210f;
  box-shadow: inset 18px 0 24px -12px rgba(0, 0, 0, .75), inset -18px 0 24px -12px rgba(0, 0, 0, .75); }

/* les livres : grille sans script ; avec le script, une étagère par rangée */
.lb-books { --cols: 5; display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.lb-cell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; width: calc(100% / var(--cols)); padding: 0 14px; box-sizing: border-box; }
.lb-books:not(.is-shelved) .lb-cell { padding-bottom: 30px; }
.lb-books.is-shelved { display: block; }
.lb-shelf { position: relative; padding-top: 44px; }
/* bande de lumière chaude sous la planche du dessus */
.lb-shelf::before { content: ""; position: absolute; left: 4%; right: 4%; top: 0; height: 70%; pointer-events: none;
  background: radial-gradient(60% 100% at 50% 0%, rgba(255, 196, 120, .38), rgba(255, 170, 80, .08) 55%, transparent 75%); }
.lb-row { position: relative; z-index: 2; display: flex; justify-content: center; margin: 0; padding: 0; list-style: none; }
.lb-plank { position: absolute; left: -26px; right: -26px; bottom: 0; height: 46px; z-index: 1; }
.lb-plank::before { content: ""; position: absolute; left: 26px; right: 26px; top: 0; height: 15px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, .1) 45%, rgba(255, 235, 200, .18)), url(/site/v2/ebook/librairie/planche-v1.webp) center 20% / 1400px auto #7a4822; }
.lb-plank::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 31px;
  background: linear-gradient(180deg, rgba(255, 235, 200, .35) 0, rgba(255, 235, 200, .08) 12%, transparent 40%, rgba(0, 0, 0, .3) 100%), url(/site/v2/ebook/librairie/planche-v1.webp) center 60% / 1400px auto #7a4822;
  box-shadow: 0 14px 18px -10px rgba(0, 0, 0, .7); }
/* étiquette en laiton sur le chant de la planche, sous chaque livre */
.lb-tag { position: relative; z-index: 3; margin: 13px 0 5px; padding: 4px 11px; border-radius: 3px; white-space: nowrap; text-decoration: none;
  background: linear-gradient(180deg, #e5c788 0%, #c7a05a 55%, #a87f3b 100%); color: #3a2508; font: 800 .7rem/1.2 var(--head); letter-spacing: .03em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 2px 3px rgba(0, 0, 0, .45); }
.lb-tag::before, .lb-tag::after { content: ""; position: absolute; top: 50%; width: 3px; height: 3px; margin-top: -1.5px; border-radius: 50%; background: #6d4b1c; }
.lb-tag::before { left: 4px; } .lb-tag::after { right: 4px; }
.lb-tag.is-out { background: linear-gradient(180deg, #ffd3a8 0%, #ff8a2a 50%, var(--orange-600) 100%); color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.lb-tag:hover { filter: brightness(1.08); }
.lb-cell.is-hidden { display: none; }
.lb-note { margin: 22px 0 0; text-align: center; font-size: .9rem; color: #7a6248; }

/* ---------- comment ça marche ---------- */
.lb-how { padding: 20px 0 100px; background: #f1e8da; }
.lb-how-in { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.lb-how article { position: relative; padding: 28px 26px 26px; border-radius: 18px; background: #fffdf9; border: 1px solid #e6dac6; box-shadow: 0 20px 40px -30px rgba(60, 30, 5, .45); }
.lb-how-n { display: block; margin-bottom: 10px; font: 800 .8rem/1 var(--head); letter-spacing: .12em; color: var(--orange-ink); }
.lb-how h3 { font: 800 1.2rem/1.2 var(--head); color: var(--navy); }
.lb-how p { margin: 8px 0 0; color: #4c556a; font-size: .95rem; }

/* ---------- tailles d'écran : 5 livres par planche, puis 4, 3, 2 ---------- */
@media (max-width: 1180px) { .lb-books { --cols: 4; } .lb-hero-in { grid-template-columns: 1fr; gap: 44px; } .lb-feat { max-width: 640px; } }
@media (max-width: 820px) { .lb-books { --cols: 3; } .lb-how-in { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .lb-books { --cols: 2; }
  .lb-hero { padding: 120px 0 80px; }
  .lb-feat { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 30px 22px; }
  .lb-feat-book { width: 170px; }
  .lb-feat-act { justify-content: center; }
  .lb-case { padding: 0 14px; } .lb-crown { margin: 0 -18px; } .lb-base { margin: 0 -8px; }
  .lb-plank { left: -14px; right: -14px; } .lb-plank::before { left: 14px; right: 14px; }
  .lb-cell { padding: 0 9px; }
  .lb-tag { font-size: .64rem; padding: 4px 9px; }
  .lb-wrap { width: calc(100% - 24px); }
}
@media (prefers-reduced-motion: reduce) { .lb-3d { transition: none; } }
.lb-row.is-empty { min-height: 250px; }
@media (max-width: 560px) { .lb-row.is-empty { min-height: 210px; } }
