/* Bladerfolder op de startpagina. Zonder script: pagina's naast elkaar om te schuiven (.fb-pages). Met script: .fb.is-ready. */
.fb-home { padding-top: 56px; scroll-margin-top: 72px; }
@media (min-width: 768px) { .fb-home { padding-top: 72px; } }
.fb-home-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; }
.fb-home-head h2 { margin-top: 16px; font-size: 1.75rem; font-weight: 700; line-height: 1.15; }
.fb-home-head p { margin-top: 12px; max-width: 42rem; font-size: 1.02rem; line-height: 1.6; color: var(--text-body); }
@media (min-width: 768px) { .fb-home-head h2 { font-size: 2.2rem; } }

.fb { scroll-margin-top: 80px; }
.fb [hidden] { display: none !important; }
.fb-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.fb-count { margin: 0; font-size: .9rem; font-weight: 600; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.fb-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; height: 44px; padding: 0 12px;
	border: 1px solid var(--surface-line); border-radius: var(--radius-pill); background: var(--surface);
	color: var(--text-strong); font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; text-decoration: none;
	transition: border-color .15s, opacity .15s;
}
.fb-btn:hover { border-color: var(--brand); }
.fb-btn:disabled { opacity: .35; cursor: default; border-color: var(--surface-line); }
.fb-btn-text { padding: 0 16px; }
.fb-hint { margin: 16px 0 0; text-align: center; font-size: .82rem; color: var(--text-muted); }

/* Zonder script: een rij pagina's om opzij te schuiven */
.fb-pages { list-style: none; margin: 0; padding: 0 0 12px; display: grid; grid-auto-flow: column; grid-auto-columns: min(78%, 320px); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; }
.fb-pages li { scroll-snap-align: start; }
.fb-pages img { display: block; width: 100%; height: auto; border: 1px solid var(--surface-line); }
.fb.is-ready .fb-pages { display: none; }

/* Boek */
.fb-stage { display: flex; justify-content: center; overflow-x: clip; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.fb-stage:focus:not(:focus-visible) { outline: none; }
.fb-stage:focus-visible { outline: 2px solid var(--brand); outline-offset: 6px; border-radius: 4px; }
.fb-book {
	--r: .7128; position: relative; width: min(100% - 136px, max(320px, calc((100svh - 260px) * 2 * var(--r)))); aspect-ratio: calc(2 * var(--r)) / 1;
	perspective: 2600px; transition: transform .6s cubic-bezier(.4, .1, .2, 1);
}
.fb-book.is-single { width: min(100%, calc((100svh - 200px) * var(--r))); aspect-ratio: var(--r) / 1; }
.fb-book.at-start { transform: translateX(-25%); }
.fb-book.at-end { transform: translateX(25%); }
.fb-slot, .fb-leaf { position: absolute; top: 0; height: 100%; width: 50%; }
.fb-slot-l { left: 0; }
.fb-slot-r { left: 50%; }
.fb-book.is-single .fb-slot, .fb-book.is-single .fb-leaf { width: 100%; left: 0; }
.fb-slot img, .fb-face img {
	display: block; width: 100%; height: 100%; object-fit: cover; background: #fff; cursor: zoom-in; -webkit-user-drag: none;
}
.fb-slot img { box-shadow: 0 1px 2px rgba(15, 23, 32, .08), 0 8px 24px rgba(15, 23, 32, .10); }
/* naad tussen twee pagina's */
.fb-slot-l::after, .fb-slot-r::after { content: ""; position: absolute; top: 0; bottom: 0; width: 18px; pointer-events: none; }
.fb-slot-l::after { right: 0; background: linear-gradient(to left, rgba(0, 0, 0, .10), transparent); }
.fb-slot-r::after { left: 0; background: linear-gradient(to right, rgba(0, 0, 0, .10), transparent); }
.fb-slot.is-empty::after, .fb-book.is-single .fb-slot::after { display: none; }

.fb-leaf { z-index: 3; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.4, .1, .2, 1); will-change: transform; }
.fb-leaf.from-r { left: 50%; transform-origin: left center; }
.fb-leaf.from-l { left: 0; transform-origin: right center; }
.fb-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.fb-face-back { transform: rotateY(180deg); }
.fb-face img { box-shadow: 0 6px 30px rgba(15, 23, 32, .18); }

/* Pijlen naast de pagina's */
.fb-side {
	position: absolute; top: 50%; z-index: 5; display: inline-flex; align-items: center; justify-content: center;
	width: 52px; height: 52px; margin-top: -26px; border: 1px solid var(--surface-line); border-radius: 50%;
	background: var(--surface); color: var(--text-strong); cursor: pointer;
	box-shadow: 0 4px 14px rgba(15, 23, 32, .12); transition: border-color .15s, opacity .2s, color .15s;
}
.fb-side:hover { border-color: var(--brand); color: var(--brand-ink); }
.fb-side:disabled { opacity: 0; pointer-events: none; }
.fb-side-prev { left: -68px; }
.fb-side-next { right: -68px; }
.fb-book.is-single .fb-side { width: 44px; height: 44px; margin-top: -22px; background: rgba(255, 255, 255, .92); }
.fb-book.is-single .fb-side-prev { left: 8px; }
.fb-book.is-single .fb-side-next { right: 8px; }

/* Telefoon: één pagina, schuiven */
.fb-book.is-single .fb-slot { transition: transform .35s ease, opacity .35s ease; }
.fb-book.is-single .fb-slot.slide-out-l { transform: translateX(-40px); opacity: 0; }
.fb-book.is-single .fb-slot.slide-out-r { transform: translateX(40px); opacity: 0; }

/* Miniaturen */
.fb-thumbs { list-style: none; margin: 22px 0 0; padding: 4px 2px 8px; display: flex; gap: 10px; overflow-x: auto; justify-content: safe center; }
.fb-thumbs button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 4px 2px; border: 2px solid transparent; border-radius: 8px; background: none; cursor: pointer; }
.fb-thumb-imgs { display: flex; gap: 2px; }
.fb-thumb-num { font-size: .75rem; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.fb-thumbs button[aria-current="true"] .fb-thumb-num { color: var(--brand-ink); }
.fb-thumbs button:hover { border-color: var(--surface-line); }
.fb-thumbs button[aria-current="true"] { border-color: var(--brand); }
.fb-thumbs img { display: block; width: 46px; height: auto; border: 1px solid var(--surface-line); }

/* Inzoomen */
.fb-zoom { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(15, 23, 32, .94); color: #fff; }
.fb-zoom::backdrop { background: rgba(15, 23, 32, .6); }
.fb-zoom-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: rgba(15, 23, 32, .9); }
.fb-zoom-bar p { margin: 0; font-size: .9rem; font-weight: 600; }
.fb-zoom-bar .fb-btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
.fb-zoom-bar .fb-btn:hover { border-color: #fff; }
.fb-zoom-bar .fb-btn:disabled { border-color: rgba(255, 255, 255, .15); }
.fb-zoom-scroll { height: calc(100dvh - 64px); overflow: auto; }
.fb-zoom-scroll img { display: block; width: min(100%, 1100px); height: auto; margin: 0 auto 24px; background: #fff; }
.fb-zoom-scroll.is-big img { width: 1800px; max-width: none; }

@media (max-width: 759px) { .fb-hint { display: none; } }
@media (prefers-reduced-motion: reduce) {
	.fb-book, .fb-leaf, .fb-book.is-single .fb-slot { transition: none; }
}
