/* Menù sfogliabile */
.libro-pagina { max-width: 1400px; margin: 0 auto; padding: clamp(1.5rem, 3vw, 2.5rem) var(--pad) 2.5rem; display: grid; justify-items: center; gap: .6rem; }
.libro-pagina h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3.6rem); font-weight: 800; color: var(--rosso); letter-spacing: -.03em; text-align: center; }
.libro-istr { margin: 0 0 1rem; text-align: center; color: var(--inchiostro-2); max-width: 50ch; }
.libro-az { display: flex; align-items: center; gap: 1rem; margin-top: 1.2rem; }
.libro-az .btn { min-width: 3.4rem; }
.libro-az .btn:disabled { opacity: .35; pointer-events: none; }
.libro-n { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; min-width: 9ch; text-align: center; }
.libro-extra { font-size: .95rem; color: var(--inchiostro-2); text-align: center; }
.libro:focus-visible { outline: 3px solid var(--inchiostro); outline-offset: 8px; }

/* pagina */
.pg { --k: 1; container-type: inline-size; aspect-ratio: 1 / 1.414; background: var(--carta); color: var(--inchiostro); position: relative; overflow: hidden; display: flex; flex-direction: column; /* margini sulla larghezza della pagina (--pw), non dello schermo: i cqw qui varrebbero lo schermo */
  padding: calc(var(--pw, 100%) * .07) calc(var(--pw, 100%) * .075) calc(var(--pw, 100%) * .05); }
.pg::before { content: ""; position: absolute; inset: 2.6cqw; border: .35cqw solid rgb(27 21 18 / .5); pointer-events: none; }
.pg-corpo { flex: 1; }
.pg-cat { font-size: 7.2cqw; font-weight: 800; letter-spacing: -.02em; line-height: 1; margin: 3.4cqw 0 .6cqw; text-align: center; }
.pg-cat:first-child { margin-top: 0; }
.pg-cat small { font-size: .5em; font-weight: 600; color: var(--inchiostro-2); }
.pg-cat-tr { margin: 0; text-align: center; font-weight: 700; font-size: 3.4cqw; color: var(--inchiostro-2); }
.pg-olio { margin: .4cqw 0 0; text-align: center; font-size: 2.9cqw; font-style: italic; color: var(--inchiostro-2); }
.pg-righe { list-style: none; margin: 2.2cqw 0 0; padding: 0; border-top: .45cqw solid var(--inchiostro); }
.pg-righe li { display: flex; align-items: baseline; gap: 2cqw; padding: calc(1.25cqw * var(--k)) 0; border-bottom: .2cqw solid rgb(27 21 18 / .22); }
.pr-n { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pr-n b { font-family: var(--display); font-weight: 700; font-size: calc(4.8cqw * var(--k)); line-height: 1.15; overflow-wrap: anywhere; }
.pr-n i { font-style: normal; font-weight: 700; font-size: calc(3.7cqw * var(--k)); color: var(--inchiostro-2); }
.pr-n em { font-style: normal; font-size: calc(3.7cqw * var(--k)); color: var(--inchiostro-2); line-height: 1.25; }
.pr-p { font-family: var(--display); font-weight: 800; font-size: calc(4.8cqw * var(--k)); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pr-p.sala, .prezzo.sala { font-size: .78em; font-weight: 700; color: var(--inchiostro-2); }
.pg-piede-tr { margin: .6cqw 0 0; text-align: center; font-size: 2.7cqw; color: var(--inchiostro-2); }
.pg-piede { margin: 2cqw 0 0; text-align: center; font-size: 2.7cqw; letter-spacing: .14em; font-weight: 700; color: var(--inchiostro-2); }
.pg-copertina { padding: 0; background: #FBF7E6; }
.pg-copertina::before, .pg-foto::before { display: none; }
.pg-copertina img { width: 100%; height: 100%; object-fit: cover; }
.pg-foto { padding: 0; justify-content: flex-end; background: var(--rosso); }
.pg-foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pg-gruppo { position: relative; margin: 0; padding: 5cqw 7cqw 6cqw; background: var(--rosso); color: var(--carta); font-family: var(--display); font-weight: 800; font-size: 11cqw; line-height: .95; letter-spacing: -.03em; }
.pg-retro { background: var(--rosso); color: var(--carta); justify-content: center; align-items: center; text-align: center; gap: 2cqw; font-size: 3.6cqw; }
.pg-retro::before { border-color: rgb(255 255 255 / .6); }
.pg-retro img { width: 34cqw; height: auto; box-shadow: 0 0 0 .5cqw var(--carta); margin-bottom: 3cqw; }
.pg-retro p { margin: 0; }
.pg-tel { font-family: var(--display); font-weight: 800; font-size: 7cqw; }
.pg-note { font-size: 2.8cqw; color: #FFE3DF; max-width: 80%; margin-top: 4cqw !important; }
.pg-vuota { justify-content: center; align-items: center; background: var(--marmo); }
.pg-vuota img { width: 22cqw; opacity: .9; }

/* telefono: pagine in fila, si sfogliano col dito */
.libro { width: 100%; }
.libro.fila { --pw: min(88vw, calc((100svh - 13rem) / 1.414)); display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 1rem; padding: .3rem 0 1rem; scrollbar-width: none; }
.libro.fila::-webkit-scrollbar { display: none; }
.libro.fila .pg { flex: 0 0 var(--pw); scroll-snap-align: center; box-shadow: 0 16px 34px -20px rgb(27 21 18 / .6); }
.libro.fila .pg:first-child { margin-inline-start: calc((100% - var(--pw)) / 2); }
.libro.fila .pg:last-child { margin-inline-end: calc((100% - var(--pw)) / 2); }

/* PC: libro con pagine che girano */
.libro.libro3d { --pw: min(calc((100vw - 6rem) / 2), calc((100vh - 15rem) / 1.414), 560px); width: calc(var(--pw) * 2); height: calc(var(--pw) * 1.414); position: relative; perspective: 2600px; transition: transform .9s var(--ease); cursor: pointer; }
.libro.libro3d.chiuso { transform: translateX(-25%); }
.libro.libro3d.finito { transform: translateX(25%); }
.foglia { position: absolute; left: 50%; top: 0; width: 50%; height: 100%; transform-origin: left center; transform-style: preserve-3d; transition: transform .95s cubic-bezier(.45, .05, .25, 1); }
.foglia.girata { transform: rotateY(-180deg); }
.faccia { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: none; }
/* ombra solo sulle due pagine aperte: le ombre dei fogli impilati si sommavano */
.foglia.sopra .faccia { box-shadow: 0 20px 40px -22px rgb(27 21 18 / .7); }
.faccia .pg { width: 100%; height: 100%; aspect-ratio: auto; }
.faccia.retro { transform: rotateY(180deg); }
.faccia::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgb(0 0 0 / .14), transparent 8%); }
.faccia.retro::after { background: linear-gradient(270deg, rgb(0 0 0 / .14), transparent 8%); }
/* arabo, ebraico…: il libro si apre da destra */
[dir=rtl] .libro.libro3d.chiuso { transform: translateX(25%); }
[dir=rtl] .libro.libro3d.finito { transform: translateX(-25%); }
[dir=rtl] .foglia { left: 0; transform-origin: right center; }
[dir=rtl] .foglia.girata { transform: rotateY(180deg); }

@media print {
  .testa, .libro-az, .libro-extra, .libro-istr, .piede, .piede-admin, .libro-pagina h1 { display: none !important; }
  .libro, .libro.fila, .libro.libro3d { display: block !important; width: auto !important; height: auto !important; transform: none !important; }
  .libro { --pw: 190mm !important; }
  .libro .pg { width: 190mm !important; margin: 0 auto !important; break-after: page; box-shadow: none !important; }
}
