/* Scaffale libri ALC — dal blocco originale «Agitazioni Letterarie — Bookshelf block».
   Misure e colori arrivano dallo scaffale come variabili CSS (stile in linea) e dal JavaScript. */
.alc-sc { overflow: hidden; width: 100%; max-width: 100%; display: block; position: relative; }
.alc-sc-wrap, .alc-sc-wrap *, .alc-sc-wrap *::before, .alc-sc-wrap *::after { box-sizing: border-box; }
.alc-sc-wrap {
  width: 100%; max-width: 100%; position: relative; overflow: hidden;
  height: var(--alc-sc-h, 120px);
  background: linear-gradient(168deg, #c8d8e8 0%, #d4e4c4 38%, #ede4c4 68%, #f5edd4 100%);
}
.alc-sc-font-fell { font-family: "IM Fell English", Georgia, serif; }
.alc-sc-font-georgia { font-family: Georgia, serif; }
.alc-sc-font-tema { font-family: inherit; }

/* grana */
.alc-sc-grana::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
  opacity: var(--alc-sc-grain, 0.5);
}

@keyframes alc-sc-sway {
  0%, 100% { transform: rotate(calc(-1deg * var(--bsa, 4))); }
  50% { transform: rotate(calc(1deg * var(--bsa, 4))); }
}

.alc-sc-shelf {
  position: absolute; bottom: 0; left: 0; right: 0; height: var(--alc-sc-h, 120px);
  pointer-events: none; display: flex; align-items: flex-end; z-index: 5;
}
.alc-sc-plank {
  position: absolute; bottom: 0; left: 0; right: 0; height: var(--alc-sc-plank, 18px);
  background: linear-gradient(to bottom, var(--alc-sc-plank-a, #b07840), var(--alc-sc-plank-b, #7a4f2a));
  border-radius: 3px 3px 0 0; box-shadow: 0 -3px 10px rgba(28, 20, 8, 0.2); z-index: 1;
}
.alc-sc-book {
  position: absolute; bottom: var(--alc-sc-plank, 18px);
  border-radius: 2px 3px 3px 2px;
  box-shadow: 2px 0 4px rgba(28, 20, 8, 0.25), inset 1px 0 2px rgba(255, 255, 255, 0.1);
  display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
  transform-origin: bottom center; text-decoration: none;
}
.alc-sc-mosso .alc-sc-book { animation: alc-sc-sway var(--bsp) ease-in-out var(--bsd) infinite; }
.alc-sc-attivo .alc-sc-book { pointer-events: auto; }
a.alc-sc-book { cursor: pointer; }
a.alc-sc-book:hover, a.alc-sc-book:focus-visible { filter: brightness(1.18); }
a.alc-sc-book:focus-visible { outline: 2px solid #1c1408; outline-offset: 1px; }
.alc-sc-spine {
  writing-mode: vertical-rl; text-orientation: mixed; transform: rotate(180deg);
  font-family: inherit; font-size: 8px; color: rgba(248, 240, 215, 0.78);
  text-align: center; padding: 5px 2px; letter-spacing: 0.04em;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.alc-sc-ribbon { position: absolute; top: 0; right: 4px; width: 5px; border-radius: 0 0 50% 50%; }

/* chi preferisce meno movimento: libri fermi, con la loro inclinazione */
@media (prefers-reduced-motion: reduce) {
  .alc-sc-mosso .alc-sc-book { animation: none; }
}

/* elenco dei titoli per i lettori di schermo */
.alc-sc-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.alc-sc-avviso { padding: 12px 16px; border: 1px dashed #b07840; background: #f5edd4; color: #1c1408; font-size: 14px; }
/* chi naviga con la tastiera vede l'elenco quando ci entra */
.alc-sc-sr:focus-within {
  position: static !important; width: auto; height: auto; margin: 8px 0 0; padding: 8px 16px 8px 32px;
  overflow: visible; clip: auto; white-space: normal; background: #f5edd4; color: #1c1408;
}
