/* The Book · struttura del volume e impaginati di esempio (pagine in HTML/CSS che scalano con cqw) */

/* Testata */
.b-hero { background: var(--ivory); border-bottom: 1px solid var(--line); overflow: hidden; }
.b-hero__in { display: grid; grid-template-columns: 1fr; gap: 48px; align-items: center; padding-top: clamp(56px, 9vw, 120px); padding-bottom: clamp(64px, 9vw, 120px); }
@media (min-width: 900px) { .b-hero__in { grid-template-columns: 1.2fr .8fr; gap: 72px; } }
.b-hero .display { color: var(--navy); }
.b-hero__title { display: flex; flex-direction: column; gap: 8px; margin: 28px 0 0; }
.b-hero__title em { font-family: var(--brand); font-style: normal; font-size: 20px; color: var(--navy); }
.b-hero__book { width: min(64%, 360px); justify-self: center; padding-left: 3%; }
@media (max-width: 899px) { .b-hero__book { order: -1; width: min(52%, 250px); } }

/* Indice del volume */
.b-structure { align-items: start; }
.b-toc { border-top: 1px solid var(--navy); }
.b-toc li { display: grid; grid-template-columns: 48px 1fr; gap: 4px 16px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.b-toc__n { grid-row: span 2; font-family: var(--brand); font-size: 26px; line-height: 1.1; color: var(--brass); }
.b-toc__t { font-family: var(--brand); font-size: clamp(22px, 2.4vw, 28px); line-height: 1.15; color: var(--navy); }
.b-toc__d { font-family: var(--book); font-size: 16px; line-height: 1.6; color: var(--muted); }

/* Sezioni con impaginato */
.b-sample__grid { align-items: center; }
.b-sample .facts { margin-top: 32px; }
.b-sample .facts dd { font-size: 16px; }
.section--navy .facts dt { color: var(--brass-2); }
@media (min-width: 900px) { .b-sample__grid--rev > .b-mock-wrap { order: 0; } }
@media (max-width: 899px) { .b-mock-wrap { order: 2; } }

.b-mock-wrap { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.b-mock-wrap figcaption { font-size: 14px; color: var(--muted); text-align: center; }
.section--navy .b-mock-wrap figcaption { color: rgba(242, 237, 227, .66); }

/* La pagina del libro */
.b-sheet { container-type: inline-size; width: min(100%, 460px); }
.b-page {
  position: relative; width: 100%; aspect-ratio: 3 / 4;
  background: #fbf9f4; color: var(--ink); border-radius: 1px 3px 3px 1px;
  padding: 7cqw 7.5cqw 6cqw 8.5cqw; display: flex; flex-direction: column;
  box-shadow: 0 1px 1px rgba(0,0,0,.1), 0 24px 50px -22px rgba(6, 12, 22, .7);
}
.b-page::before { /* piega verso la rilegatura */
  content: ""; position: absolute; inset: 0 auto 0 0; width: 6%; pointer-events: none;
  background: linear-gradient(90deg, rgba(20, 23, 28, .1), transparent);
}
.section--ivory .b-page { box-shadow: 0 1px 1px rgba(0,0,0,.08), 0 24px 50px -24px rgba(20, 30, 45, .45); outline: 1px solid var(--line); }
.b-tag {
  position: absolute; top: 0; right: 6%; transform: translateY(-50%);
  font: 600 11px/1 var(--ui); letter-spacing: .18em; text-transform: uppercase;
  background: var(--brass); color: var(--navy); padding: 7px 10px; border-radius: 2px; white-space: nowrap;
}
.b-page__run { display: flex; justify-content: space-between; gap: 4cqw; font-family: var(--brand); font-size: 2.3cqw; letter-spacing: .24em; text-transform: uppercase; color: var(--brass); padding-bottom: 1.8cqw; border-bottom: 1px solid rgba(168, 135, 90, .55); margin-bottom: 4.5cqw; }

/* Segnaposto foto e logo: tratteggio sobrio */
.b-ph, .b-logo, .b-qr {
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(135deg, #e7e0d2 0 1px, #efe9dd 1px 7px);
  border: 1px solid #d6cdbb; color: #8a7f6c;
  font: 600 1.9cqw/1 var(--ui); letter-spacing: .16em; text-transform: uppercase;
}
.b-ph-grid { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 1.6cqw; height: 40cqw; }
.b-ph--main { grid-row: span 2; }
.b-page__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 4cqw; margin-top: 5cqw; padding-bottom: 2.6cqw; border-bottom: 1px solid var(--line); }
.b-page__name { font-family: var(--brand); font-size: 6.4cqw; line-height: 1.05; color: var(--navy); margin: 0; }
.b-page__place { font-family: var(--brand); font-size: 2.4cqw; letter-spacing: .22em; text-transform: uppercase; color: var(--brass); margin: 1.6cqw 0 0; }
.b-logo { width: 12cqw; height: 12cqw; border-radius: 50%; flex: none; font-size: 1.7cqw; }
.b-page__text { font-family: var(--book); font-size: 2.9cqw; line-height: 1.55; color: #333842; margin-top: 3.4cqw; columns: 2; column-gap: 4cqw; }
.b-page__text p { margin: 0 0 1.2em; break-inside: avoid; }
.b-page__foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 4cqw; padding-top: 2.6cqw; border-top: 1px solid var(--line); }
.b-page__contacts { display: flex; flex-direction: column; gap: .9cqw; font: 500 2.4cqw/1.3 var(--ui); color: var(--muted); }
.b-qr { width: 11cqw; height: 11cqw; flex: none; font-size: 1.8cqw; background: repeating-conic-gradient(#cfc5b2 0 25%, #efe9dd 0 50%) 0 0 / 2.2cqw 2.2cqw; color: var(--navy); }
.b-qr span { background: #fbf9f4; padding: .6cqw .8cqw; }
.b-page__folio { text-align: center; font-family: var(--brand); font-size: 2.4cqw; color: var(--brass); margin-top: 2.4cqw; }

/* Doppie pagine d'esempio */
.b-examples { border-block-start: 1px solid var(--line); }
.b-ex { display: grid; grid-template-columns: 1fr; gap: clamp(16px, 2.4vw, 28px); }
@media (min-width: 820px) { .b-ex { grid-template-columns: 1fr 1fr; } }
.b-ex__item { display: block; border-radius: 6px; overflow: hidden; background: var(--ivory); box-shadow: 0 18px 40px rgba(20, 23, 28, .14), 0 2px 6px rgba(20, 23, 28, .06);
  transition: transform .25s ease, box-shadow .25s ease; }
.b-ex__item:hover { transform: translateY(-3px); box-shadow: 0 24px 50px rgba(20, 23, 28, .18), 0 2px 6px rgba(20, 23, 28, .06); }
.b-ex__item img { display: block; inline-size: 100%; block-size: auto; aspect-ratio: 1600 / 1066; object-fit: cover; }
.b-ex__note { margin: clamp(18px, 2vw, 24px) 0 0; font-size: 14px; color: var(--muted); }
.b-ex__item { cursor: zoom-in; }
/* finestra delle pagine ingrandite */
.b-box { inline-size: 100vw; block-size: 100vh; max-inline-size: none; max-block-size: none; margin: 0; padding: 0; border: 0; background: rgba(14, 16, 20, .94); color: var(--ivory); }
.b-box::backdrop { background: rgba(14, 16, 20, .7); }
.b-box[open] { display: flex; align-items: center; justify-content: center; animation: b-box-in .22s ease; }
.b-box figure { margin: 0; padding: 72px 80px; box-sizing: border-box; inline-size: 100%; block-size: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.b-box img { display: block; max-inline-size: min(100%, 1600px); max-block-size: calc(100vh - 170px); inline-size: auto; block-size: auto; border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.b-box figcaption { margin-block-start: 14px; font: 500 13px/1.4 var(--ui); letter-spacing: .12em; color: rgba(242, 237, 227, .7); }
.b-box__btn { position: absolute; display: grid; place-items: center; inline-size: 48px; block-size: 48px; padding: 0; border-radius: 50%;
  border: 1px solid rgba(242, 237, 227, .3); background: rgba(14, 16, 20, .6); color: var(--ivory); font: 400 24px/1 var(--ui); cursor: pointer;
  transition: border-color .15s ease, background .15s ease; }
.b-box__btn:hover { border-color: var(--brass); background: rgba(14, 16, 20, .85); }
.b-box__btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.b-box__close { inset-block-start: 16px; inset-inline-end: 16px; font-size: 28px; }
.b-box__arrow { inset-block-start: 50%; transform: translateY(-50%); }
.b-box__arrow--prev { inset-inline-start: 16px; }
.b-box__arrow--next { inset-inline-end: 16px; }
[dir="rtl"] .b-box__arrow span { display: inline-block; transform: scaleX(-1); }
html.b-box-open { overflow: hidden; }
@keyframes b-box-in { from { opacity: 0; } }
@media (max-width: 639px) {
  .b-box figure { padding: 64px 12px 96px; }
  .b-box img { max-block-size: calc(100vh - 190px); }
  .b-box__arrow { inset-block-start: auto; inset-block-end: 22px; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .b-ex__item { transition: none; } .b-ex__item:hover { transform: none; } .b-box[open] { animation: none; } }
/* L'oggetto */
.b-object { display: grid; grid-template-columns: 1fr; gap: 56px; align-items: center; }
@media (min-width: 1024px) { .b-object { grid-template-columns: 1fr 1fr; gap: 80px; } }
.b-object .facts dd { font-size: 16px; }
.b-object__covers { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 2.4vw, 28px); align-items: end; max-width: 520px; width: 100%; justify-self: center; }
.b-object__cover:nth-child(2) { transform: translateY(-18px); }

/* Chiusura */
.b-close__in { display: flex; flex-direction: column; align-items: center; text-align: center; }
.b-close .rule-dia { width: 100%; max-width: 240px; }
.b-close__line { font-family: var(--brand); font-size: clamp(24px, 3.2vw, 36px); line-height: 1.35; margin: 32px 0 0; color: var(--ivory); }
.b-close .btn-row { justify-content: center; }
