/*
 * Global section "Prospectus" (17 Oct 2026) — front/global-sections/ProspectusSection/style_{1,2}.
 * Style 1: page-flip book (StPageFlip) on a cream band · style 2: pages one under another in a scrolling panel.
 * Pages are drawn by pdf.js into <canvas> elements (prospectus.js).
 */

.pbook-head { text-align: center; margin-inline: auto; max-width: 46rem; }
.pbook-head .eyebrow { justify-content: center; }

.pbook { --pb-ratio: 0.7071; margin-top: 2rem; }

/* toolbar: page count + arrows left, buttons right */
.pbook__toolbar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem;
    max-width: 68rem; margin: 0 auto 1.25rem;
}
.pbook__nav { display: inline-flex; align-items: center; gap: 0.5rem; }
.pbook__actions { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; }
.pbook__actions .btn .icon { margin-right: 0.45em; }
.pbook__count { min-width: 6.5rem; text-align: center; font-weight: 600; color: var(--green-700); font-variant-numeric: tabular-nums; }
.pbook__btn {
    display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem;
    border: 1px solid var(--cream-300); border-radius: var(--radius-full); background: #fff; color: var(--green-600);
    box-shadow: var(--shadow-sm); cursor: pointer; transition: background-color .2s, color .2s, border-color .2s;
}
.pbook__btn:hover:not([disabled]) { background: var(--green-500); border-color: var(--green-500); color: #fff; }
.pbook__btn:focus-visible { outline: 3px solid var(--gold-300); outline-offset: 2px; }
.pbook__btn[disabled] { opacity: .4; cursor: default; }
.pbook__btn .icon { width: 1.15rem; height: 1.15rem; }

/* stage */
.pbook__stage { position: relative; max-width: 68rem; margin-inline: auto; }
.pbook__status {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem;
    min-height: 18rem; color: var(--green-700); text-align: center;
}
.pbook__status a { color: var(--green-600); font-weight: 600; text-decoration: underline; }
.pbook.is-ready .pbook__status { display: none; }
.pbook__spinner {
    width: 2.5rem; height: 2.5rem; border-radius: 50%;
    border: 3px solid var(--cream-300); border-top-color: var(--green-500); animation: pbook-spin .9s linear infinite;
}
.pbook.is-error .pbook__spinner { display: none; }
@keyframes pbook-spin { to { transform: rotate(360deg); } }

.pbook__page { background: #fff; overflow: hidden; }
.pbook__page canvas { display: block; width: 100%; height: 100%; }
.pbook__page:not(.is-drawn) { background: #fff linear-gradient(110deg, #fff 30%, var(--cream-100) 50%, #fff 70%) 0 0 / 200% 100%; animation: pbook-shimmer 1.4s linear infinite; }
@keyframes pbook-shimmer { to { background-position: -200% 0; } }

/* style 1 — flip book */
.pbook { --pb-maxh: 82vh; }
.pbook[data-mode="flip"] .pbook__book {
    margin-inline: auto; filter: drop-shadow(0 18px 30px rgba(4, 31, 21, .18));
    /* a two-page spread never taller than the screen (StPageFlip sizes the book from its width) */
    max-width: min(100%, calc(var(--pb-maxh) * 2 * var(--pb-ratio))) !important;
}
.pbook:fullscreen { --pb-maxh: calc(100vh - 8rem); }
.pbook__hint { margin: 1rem 0 0; text-align: center; font-size: var(--text-sm, .875rem); color: var(--gold-600); }
.pbook:not(.is-ready) .pbook__hint { visibility: hidden; }

/* style 2 — pages one under another */
.pbook[data-mode="scroll"] .pbook__book {
    display: none; max-height: min(80vh, 60rem); overflow-y: auto; padding: 1rem; border-radius: var(--radius-lg);
    background: var(--cream-100); border: 1px solid var(--cream-300);
}
.pbook[data-mode="scroll"].is-ready .pbook__book { display: grid; gap: 1rem; justify-items: center; }
.pbook[data-mode="scroll"] .pbook__page { width: min(100%, 46rem); aspect-ratio: var(--pb-ratio); box-shadow: var(--shadow-md); border-radius: var(--radius-sm); }

.pbook__fallback { text-align: center; }

/* full screen (the whole .pbook element) */
.pbook:fullscreen { display: flex; flex-direction: column; justify-content: center; margin: 0; padding: 1rem 1.5rem; background: var(--green-900); overflow: auto; }
.pbook:fullscreen .pbook__count { color: #fff; }
.pbook:fullscreen .pbook__hint { color: var(--gold-300); }
.pbook:fullscreen .pbook__toolbar { width: 100%; max-width: none; }
.pbook:fullscreen .pbook__stage { width: 100%; max-width: none; }
.pbook:fullscreen .btn--outline { color: #fff; border-color: rgba(255, 255, 255, .7); }
.pbook:fullscreen[data-mode="scroll"] .pbook__book { max-height: calc(100vh - 6rem); }

@media (max-width: 575.98px) {
    .pbook__toolbar { justify-content: center; }
    .pbook__actions { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .pbook__spinner, .pbook__page:not(.is-drawn) { animation: none; }
}
