/* Additional book appearances. Original library remains in style.css. */
/* Horizontal books stacked directly ON the original .row/.plank shelf — no nested tiers. */
html[data-view="shelves"] .case{padding-top:24px}
html[data-view="shelves"] .case .row{
 height:auto;min-height:calc(228px * var(--u));
 padding:20px 16px 0;display:flex;flex-wrap:nowrap;align-items:flex-end;
 gap:12px;overflow:visible;
}
html[data-view="shelves"] .stack{
 flex:none;width:var(--stack-w);max-width:100%;display:flex;align-items:center;
 flex-direction:column;justify-content:flex-end;gap:3px;min-width:0;padding:0 0 3px;
 animation:pileIn .45s ease both;
}
html[data-view="shelves"] .stack .book{
 flex:none;width:var(--bw);max-width:100%;height:auto;min-height:var(--bh);
 display:flex;align-items:center;justify-content:center;padding:5px 19px 4px;
 text-align:center;border-radius:4px 6px 3px 3px;
 background:linear-gradient(180deg,rgba(255,255,255,.11),transparent 40%,rgba(0,0,0,.38)),var(--c);
 border-block:1px solid var(--brass);
 box-shadow:2px 2px 1px rgba(0,0,0,.4),inset 0 0 0 1px rgba(0,0,0,.24);
 transition:transform .22s,box-shadow .22s;
}
html[data-view="shelves"] .stack .book::before,
html[data-view="shelves"] .stack .book::after{
 top:0;bottom:0;right:auto;left:auto;height:auto;width:5px;
 border-block:0;border-inline:1px solid var(--brass);background:rgba(224,194,124,.18)
}
html[data-view="shelves"] .stack .book::before{right:8px}
html[data-view="shelves"] .stack .book::after{left:8px}
html[data-view="shelves"] .stack .book span{
 writing-mode:horizontal-tb;display:block;position:relative;z-index:1;
 width:100%;height:auto;max-height:none;max-width:100%;overflow:visible;
 white-space:normal;overflow-wrap:anywhere;word-break:normal;
 font-family:'Amiri',serif;font-size:.9rem;font-weight:700;line-height:1.55;text-align:center;
}
html[data-view="shelves"] .stack .book.t1::before{background:repeating-linear-gradient(0deg,transparent 0 3px,var(--brass) 3px 4px)}
html[data-view="shelves"] .stack .book.t2::before{background:var(--diamond) center/11px no-repeat;width:12px}
html[data-view="shelves"] .stack .book.t3::before{right:7px;width:5px;border:1px solid var(--brass)}
html[data-view="shelves"] .stack .book.t3::after{left:7px;width:5px;border:1px solid var(--brass)}
html[data-view="shelves"] .case .row>.deco{
 align-self:flex-end;flex:0 0 auto;margin-inline-start:auto;
 width:calc(56px * var(--u));height:calc(100px * var(--u));opacity:.92;
}
html[data-view="shelves"] .stack .book:active{transform:translateX(-6px)}
@media(hover:hover){html[data-view="shelves"] .stack .book:hover{transform:translateX(-7px);box-shadow:5px 6px 12px rgba(0,0,0,.36)}}
html[data-view="shelves"] .stack .book:focus-visible{transform:translateX(-7px)}
@keyframes pileIn{from{transform:translateY(12px);opacity:.5}to{transform:translateY(0);opacity:1}}

/* Simple upright covers based on the separately supplied index.html: no wooden bookcase, but framed shelves. */
html[data-view="simple"] .case{
  max-width:1200px;padding:0 20px;border:0;background:none;box-shadow:none;
}
html[data-view="simple"] .case::before{display:none}
html[data-view="simple"] .simple-panel {
  position:relative;margin-bottom:40px;padding:26px 26px 34px;
  background:linear-gradient(180deg,var(--wood-surface),var(--wood));
  border:1px solid var(--brass);border-radius:8px;
  box-shadow:0 12px 24px rgba(0,0,0,.13);
}
html[data-view="simple"] .simple-panel::before {
  content:'';position:absolute;top:0;left:10%;right:10%;height:2px;
  background:linear-gradient(90deg,transparent,var(--brass-light),transparent);
}
html[data-view="simple"] .simple-panel::after {
  content:'✦';position:absolute;bottom:4px;right:50%;transform:translateX(50%);
  color:var(--brass);font-size:14px;
}
html[data-view="simple"] .simple-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:18px;
}
html[data-view="simple"] .simple-book {
  --w:auto;--h:178px;width:100%;height:178px;min-width:0;padding:12px 9px;
  border-radius:4px 7px 7px 4px;border:1px solid rgba(255,255,255,.12);
  background:linear-gradient(160deg,rgba(255,255,255,.07),transparent 55%,rgba(0,0,0,.40)),var(--c);
  box-shadow:0 5px 10px rgba(0,0,0,.2);animation:coverIn .35s ease both;
  transition:transform .25s ease,box-shadow .25s ease;
}
html[data-view="simple"] .simple-book::before{
  content:'';position:absolute;top:0;bottom:0;right:0;left:auto;width:6px;height:auto;
  background:rgba(0,0,0,.36);border:0;
}
html[data-view="simple"] .simple-book::after{
  content:'';top:0;left:0;right:0;height:40%;background:linear-gradient(rgba(255,255,255,.08),transparent);border:0;
}
html[data-view="simple"] .simple-book span {
  writing-mode:horizontal-tb;display:block;line-height:1.5;text-align:center;
  overflow-wrap:anywhere;max-width:100%;max-height:100%;font-size:.90rem;
  text-shadow:0 1px 2px rgba(0,0,0,.15)
}
html[data-view="simple"] .simple-book.lt span{color:var(--book-title-dark);text-shadow:none}
html[data-view="simple"] .simple-panel .orn{margin-bottom:0}
html[data-view="simple"] .simple-panel .orn svg{width:14px;height:14px}
@keyframes coverIn{from{opacity:0;transform:translateY(9px)}to{opacity:1;transform:translateY(0)}}
html[data-view="simple"] .simple-book:active{transform:translateY(-5px)}
@media(hover:hover){html[data-view="simple"] .simple-book:hover{transform:translateY(-11px) rotate(-1deg);box-shadow:0 16px 22px rgba(0,0,0,.3)}}
html[data-view="simple"] .simple-book:focus-visible{transform:translateY(-10px)}

/* Lightweight mode: one flat grid, no bookcase, ornaments, shadows, gradients or animations. */
html[data-view="lite"] .case{
  max-width:1180px;padding:0 20px;border:0;box-shadow:none;background:transparent;
}
html[data-view="lite"] .case::before{display:none}
html[data-view="lite"] .lite-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:10px}
html[data-view="lite"] .lite-book{
  position:relative;display:flex;align-items:center;justify-content:center;min-width:0;min-height:74px;
  width:100%;height:auto;padding:12px;border:1px solid var(--brass);border-radius:5px;
  color:var(--parch);background:var(--lite-card);
  box-shadow:none;cursor:pointer;font:inherit;font-size:.95rem;line-height:1.5;
  text-align:center;animation:none;transition:none;
}
html[data-view="lite"] .lite-book:hover,html[data-view="lite"] .lite-book:active,html[data-view="lite"] .lite-book:focus-visible{transform:none;box-shadow:none}
html[data-view="lite"] .lite-book::before,html[data-view="lite"] .lite-book::after{display:none}
html[data-view="lite"] .lite-book span{writing-mode:horizontal-tb;max-height:none;overflow-wrap:anywhere;font-size:inherit;line-height:inherit}
html[data-view="lite"] .modal .slip,html[data-view="lite"] .btn,html[data-view="lite"] .book{animation:none!important;transition:none!important}

@media(max-width:600px){
 html[data-view="shelves"] .case .row{padding-inline:9px;gap:8px;min-height:calc(228px * var(--u))}
 html[data-view="shelves"] .stack{gap:2px}
 html[data-view="shelves"] .stack .book{padding:4px 13px 3px}
 html[data-view="shelves"] .stack .book span{font-size:.83rem;line-height:1.45}
 html[data-view="shelves"] .case .row>.deco{width:calc(56px * var(--u));height:calc(100px * var(--u))}
 html[data-view="simple"] .case{padding-inline:16px}
 html[data-view="simple"] .simple-panel{padding:20px 15px 28px;margin-bottom:24px}
 html[data-view="simple"] .simple-grid{grid-template-columns:repeat(auto-fill,minmax(100px,1fr));gap:14px}
 html[data-view="simple"] .simple-book{height:155px}
 html[data-view="lite"] .case{padding-inline:14px}
 html[data-view="lite"] .lite-grid{grid-template-columns:repeat(auto-fill,minmax(125px,1fr));gap:8px}
}
@media(prefers-reduced-motion:reduce){
 html[data-view="shelves"] .stack,html[data-view="simple"] .simple-book{animation:none}
 html[data-view="shelves"] .stack .book,html[data-view="simple"] .simple-book{transition:none}
}

/* Horizontal spine used for the first phase of the shelves opening animation. */
.fx .fx-flyer.book{
 position:fixed;z-index:2;display:flex;align-items:center;justify-content:center;
 min-height:0;padding:5px 19px 4px;border-block:1px solid var(--brass);border-radius:4px 6px 3px 3px;
 background:linear-gradient(180deg,rgba(255,255,255,.11),transparent 40%,rgba(0,0,0,.38)),var(--c);
 box-shadow:2px 2px 1px rgba(0,0,0,.4),inset 0 0 0 1px rgba(0,0,0,.24);
 pointer-events:none;transform-origin:center center;
}
.fx .fx-flyer.book::before,.fx .fx-flyer.book::after{
 top:0;bottom:0;right:auto;left:auto;width:5px;height:auto;border-block:0;
 border-inline:1px solid var(--brass);background:rgba(224,194,124,.18)
}
.fx .fx-flyer.book::before{right:8px}
.fx .fx-flyer.book::after{left:8px}
.fx .fx-flyer.book span{
 display:block;width:100%;height:auto;max-height:none;overflow:visible;
 writing-mode:horizontal-tb;white-space:normal;overflow-wrap:anywhere;
 font-family:'Amiri',serif;font-size:.9rem;line-height:1.45;text-align:center;
}
.fx .fx-flyer.book.t1::before{background:repeating-linear-gradient(0deg,transparent 0 3px,var(--brass) 3px 4px)}
.fx .fx-flyer.book.t2::before{background:var(--diamond) center/11px no-repeat;width:12px}
.fx .fx-flyer.book.t3::before,.fx .fx-flyer.book.t3::after{width:5px;border:1px solid var(--brass)}
.fx .tome{z-index:3}
.fx .fx-close{z-index:4}
@media(max-width:600px){.fx .fx-flyer.book{padding:4px 13px 3px}.fx .fx-flyer.book span{font-size:.83rem}}
