/* The case: cloth spines on wooden shelves, the lamp over them and the opened book. Shared by the front page, the shelves and the register. */
.case { --wood: #2B2118; --wood-lit: #4A3826; --back: #090B0E; --foil: #CDAA5C; --lx: 24%; --ly: 8%; --lr: 46rem; --dark: .5; position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: .5rem solid var(--wood); border-bottom-width: .8rem; background: var(--back); box-shadow: inset 0 0 0 1px var(--wood-lit); }
.case::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle var(--lr) at var(--lx) var(--ly), rgba(6, 7, 9, 0), rgba(6, 7, 9, var(--dark)) 100%); }
.bay { position: relative; min-width: 0; padding: var(--s3) var(--s3) 0; border-right: .4rem solid var(--wood); border-bottom: .55rem solid var(--wood); box-shadow: inset 0 -1px 0 var(--wood-lit), inset 0 1.6rem 1.6rem -1rem rgba(0, 0, 0, .7); }
.bay:nth-child(3n) { border-right: 0; }
.bay:nth-last-child(-n+3) { border-bottom: 0; }
.bay-plate { display: flex; align-items: baseline; gap: var(--s3); margin: 0 0 var(--s2); font: 400 .9375rem/1.2 var(--f-display); letter-spacing: .06em; text-transform: uppercase; }
.bay-plate a { text-decoration: none; display: inline-flex; align-items: center; min-height: 2rem; }
.bay-plate a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .3em; }
.bay-n { font-size: .6875rem; color: var(--ink-dim); letter-spacing: .04em; }
.bay-row { display: flex; align-items: flex-end; gap: 1px; height: 11.5rem; }
.bay-row > li { flex: 0 1 auto; min-width: 0; height: 100%; display: flex; align-items: flex-end; }
.spine { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between; width: var(--w); height: var(--h); padding: .9rem 0 .35rem; overflow: hidden; text-decoration: none; color: var(--foil); background-color: var(--cloth); background-image: linear-gradient(90deg, rgba(0, 0, 0, .42), rgba(255, 255, 255, .09) 28%, rgba(0, 0, 0, 0) 62%, rgba(0, 0, 0, .46)); border-radius: 2px 2px 0 0; box-shadow: 0 -1px 0 rgba(255, 255, 255, .12); }
.spine::before { content: ""; position: absolute; left: 0; right: 0; top: .32rem; height: .28rem; border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; opacity: .75; }
.band-1::before { top: .45rem; height: 0; border-bottom: 0; }
.band-2::before { top: .25rem; height: .5rem; }
.spine-name { flex: 1 1 auto; min-height: 0; writing-mode: vertical-rl; font: 400 .625rem/1 var(--f-display); letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; overflow: hidden; }
.spine-mark { flex: none; width: min-content; margin-top: .3rem; font: 500 .5rem/1.25 var(--f-mono); letter-spacing: .02em; text-align: center; opacity: .85; }
.wide-0 { --w: 1.05rem; } .wide-1 { --w: 1.3rem; } .wide-2 { --w: 1.6rem; } .wide-3 { --w: 1.95rem; } .wide-4 { --w: 2.4rem; }
.wide-0 .spine-name { font-size: .5625rem; }
.wide-3 .spine-name, .wide-4 .spine-name { font-size: .6875rem; }
.tall-0 { --h: 76%; } .tall-1 { --h: 81%; } .tall-2 { --h: 86%; } .tall-3 { --h: 91%; } .tall-4 { --h: 95%; } .tall-5 { --h: 100%; }
.spine.cloth-ochre { color: #1A1408; } .spine.cloth-bone { color: #2A2114; }
.spine-edition { --cloth: #14181D; color: #E3A23A; box-shadow: inset 0 0 0 1px #E3A23A; }
.spine:hover, .spine:focus-visible { transform: translateY(-.7rem); filter: brightness(1.25); z-index: 1; }
.spine:focus-visible { outline-offset: 1px; }
.bay-note { flex: 1 1 auto !important; align-items: center !important; padding-left: var(--s4); font: 400 .75rem/1.5 var(--f-mono); color: var(--ink-dim); }
[data-power="off"] .case { --lr: 15rem; --dark: .93; }
.openbook { width: min(46rem, calc(100vw - 2rem)); padding: 0; border: .45rem solid #59422F; border-radius: 3px; background: #EDE6D6; color: #14181D; box-shadow: 0 2rem 5rem rgba(0, 0, 0, .7); }
.openbook[open] { display: grid; grid-template-columns: 1fr 1fr; }
.openbook::backdrop { background: rgba(4, 5, 6, .82); }
.ob-leaf { padding: var(--s6) var(--s5) var(--s5); min-height: 21rem; display: flex; flex-direction: column; }
.ob-left { background: linear-gradient(90deg, rgba(0, 0, 0, 0) 82%, rgba(0, 0, 0, .14)); border-right: 1px solid rgba(0, 0, 0, .25); }
.ob-right { background: linear-gradient(270deg, rgba(0, 0, 0, 0) 82%, rgba(0, 0, 0, .1)); }
.ob-mark { font-size: .75rem; letter-spacing: .08em; color: #4A4F52; }
.openbook h2 { margin: auto 0 var(--s3); padding: 0; border: 0; font: 400 clamp(1.4rem, 1rem + 1.6vw, 2rem)/1.12 var(--f-display); text-wrap: balance; }
.ob-publisher { margin-bottom: auto; font-size: .9375rem; color: #4A4F52; }
.ob-facts div { padding: var(--s3) 0; border-bottom: 1px solid rgba(0, 0, 0, .22); }
.ob-facts dt { font: 500 .6875rem/1.4 var(--f-mono); letter-spacing: .07em; text-transform: uppercase; color: #4A4F52; }
.ob-facts dd { font-size: .9375rem; }
.ob-links { margin-top: var(--s4); display: grid; gap: var(--s1); }
.ob-links a { display: inline-block; padding: .45rem 0; text-decoration-color: rgba(0, 0, 0, .45); overflow-wrap: anywhere; }
.ob-close { margin-top: auto; padding-top: var(--s5); }
.openbook .rule-button { color: #14181D; border-color: #14181D; }
.openbook .rule-button:hover { background: #14181D; color: #EDE6D6; }
.openbook :focus-visible { outline-color: #8F540A; }
.case .bay + .bay { margin-top: 0; }

/* One shelf alone, on a section page: a single long bay with larger spines. */
.case-one { grid-template-columns: minmax(0, 1fr); margin: var(--s5) 0 var(--s6); --lr: 38rem; }
.case-one .bay { border: 0; padding: var(--s4) var(--s4) 0; }
.case-one .bay-row { height: 15rem; gap: 2px; }
.case-one .spine { width: calc(var(--w) * 1.7); padding-top: 1.1rem; }
.case-one .spine-name, .case-one .wide-0 .spine-name, .case-one .wide-3 .spine-name, .case-one .wide-4 .spine-name { font-size: .8125rem; }
.case-one .spine-mark { font-size: .625rem; }
.t-shelf .case { margin: var(--s5) 0 var(--s6); }
@media (max-width: 62rem) {
  .case { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bay:nth-child(3n) { border-right: .4rem solid var(--wood); }
  .bay:nth-child(2n) { border-right: 0; }
  .bay:nth-last-child(-n+3) { border-bottom: .55rem solid var(--wood); }
  .bay:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 40rem) {
  .case { grid-template-columns: 1fr; border-width: .35rem; }
  .bay, .bay:nth-child(2n), .bay:nth-child(3n) { border-right: 0; }
  .bay:nth-last-child(-n+2) { border-bottom: .55rem solid var(--wood); }
  .bay:last-child { border-bottom: 0; }
  .bay-row { height: 9.5rem; }
  .openbook[open] { grid-template-columns: 1fr; }
  .ob-leaf { min-height: 0; }
  .ob-left { border-right: 0; border-bottom: 1px solid rgba(0, 0, 0, .25); background: none; }
  .openbook h2 { margin-top: var(--s4); }
}
@media (prefers-reduced-motion: no-preference) {
  .spine { transition: transform .16s ease-out, filter .16s linear; }
  .case::after { transition: background .5s linear; }
}
@media print { .case::after, .openbook { display: none !important; } .case { border: 0; background: none; display: block; } .bay { border: 0; box-shadow: none; padding: 0 0 8pt; } .bay-row { display: block; height: auto; } .bay-row > li { display: block; height: auto; } .spine { display: block; width: auto; height: auto; background: none; color: #000; padding: 0; } .spine::before { display: none; } .spine-name { writing-mode: horizontal-tb; font-size: 9pt; text-transform: none; white-space: normal; } .spine-mark { display: inline; width: auto; } }
@media (max-width: 40rem) {
  .case-one .bay { padding: var(--s3) var(--s2) 0; }
  .case-one .bay-row { height: 12.5rem; }
  .case-one .spine { width: calc(var(--w) * 1.3); }
  .case-one .spine-name, .case-one .wide-0 .spine-name, .case-one .wide-3 .spine-name, .case-one .wide-4 .spine-name { font-size: .6875rem; }
}
/* On a phone a full shelf wraps onto further boards, so each spine stays wide enough to press. */
@media (max-width: 40rem) {
  .bay-row { --bh: 9.5rem; flex-wrap: wrap; height: auto; row-gap: .55rem; padding-bottom: 0; background: repeating-linear-gradient(to bottom, transparent 0, transparent var(--bh), var(--wood) var(--bh), var(--wood) calc(var(--bh) + .55rem)); }
  .bay-row > li { flex: 0 0 auto; height: var(--bh); }
  .spine { width: calc(var(--w) * 1.4); }
  .case-one .bay-row { --bh: 12.5rem; height: auto; }
  .case-one .spine { width: calc(var(--w) * 1.5); }
}
@media print { .bay-row { background: none; } }
