/* Catalog reader (/catalog/).
   A dark, full-height reading room under the site header: slim tool bar on top, the book
   as large as the window allows, a page scrubber below. Everything else sits under the fold. */

.fb-page {
    --fb-bg: #0d1015;
    --fb-panel: #151a21;
    --fb-panel-2: #1c222b;
    --fb-line: rgba(255, 255, 255, 0.09);
    --fb-text: #e8ebef;
    --fb-muted: #929bab;
    --fb-accent: #dc2626;
    --fb-accent-hi: #ef4444;
    --fb-bar-h: 56px;
    --fb-foot-h: 48px;
    --fb-r: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.fb-page *, .fb-page *::before, .fb-page *::after { box-sizing: border-box; }
.fb-sr {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Reader shell ---------- */
.fb {
    position: relative;
    display: grid;
    grid-template-rows: var(--fb-bar-h) minmax(0, 1fr) var(--fb-foot-h);
    height: calc(100vh - var(--fb-nav-h, 80px));
    height: calc(100svh - var(--fb-nav-h, 80px));
    min-height: 320px;
    background: var(--fb-bg);
    color: var(--fb-text);
    overflow: hidden;
}
.fb:fullscreen { height: 100vh; height: 100dvh; min-height: 0; }
.fb:-webkit-full-screen { height: 100vh; min-height: 0; }

.fb svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Tool bar ---------- */
.fb-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    background: var(--fb-panel);
    border-bottom: 1px solid var(--fb-line);
    position: relative;
    z-index: 5;
}
.fb-bar__start, .fb-bar__end { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fb-bar__end { justify-content: flex-end; }
.fb-bar__mid { display: flex; align-items: center; gap: 4px; }

.fb-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; padding-left: 4px; }
.fb-title h1 {
    margin: 0; font-size: 13px; font-weight: 700; color: var(--fb-text); letter-spacing: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fb-title__section {
    font-size: 12px; color: var(--fb-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.fb-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 36px; min-width: 36px; padding: 0 8px;
    border: 0; border-radius: 8px; background: transparent; color: var(--fb-text);
    font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
    transition: background-color .15s, color .15s, opacity .15s;
}
.fb-btn:hover { background: var(--fb-panel-2); color: #fff; }
.fb-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.fb-btn--label { padding: 0 12px 0 10px; background: var(--fb-panel-2); }
.fb-btn--label:hover, .fb-btn--label[aria-expanded="true"] { background: #262e39; }
.fb-btn--accent { background: var(--fb-accent); color: #fff; padding: 0 12px 0 10px; }
.fb-btn--accent:hover { background: var(--fb-accent-hi); color: #fff; }
.fb-page :focus-visible { outline: 2px solid #f87171; outline-offset: 2px; }

.fb-counter {
    min-width: 108px; text-align: center; font-size: 13px; font-weight: 600;
    font-variant-numeric: tabular-nums; color: var(--fb-text);
}
.fb-counter b { color: #fff; font-weight: 800; }
.fb-counter span { color: var(--fb-muted); font-weight: 500; }

.fb-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--fb-bg); border: 1px solid var(--fb-line); border-radius: 9px; }
.fb-seg__btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 28px; border: 0; border-radius: 6px; background: transparent;
    color: var(--fb-muted); cursor: pointer; transition: background-color .15s, color .15s;
}
.fb-seg__btn svg { width: 18px; height: 18px; }
.fb-seg__btn:hover { color: #fff; }
.fb-seg__btn[aria-pressed="true"] { background: var(--fb-panel-2); color: #fff; }

.fb-zoom { display: inline-flex; align-items: center; }
.fb-zoom__value {
    min-width: 48px; height: 36px; border: 0; background: transparent; color: var(--fb-muted);
    font: inherit; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; border-radius: 8px;
}
.fb-zoom__value:hover { color: #fff; background: var(--fb-panel-2); }

.fb-ico-exit { display: none; }
.fb.is-fullscreen .fb-ico-enter { display: none; }
.fb.is-fullscreen .fb-ico-exit { display: block; }

/* ---------- Stage ---------- */
.fb-stage {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 70% 60% at 50% 45%, #1c2330 0%, rgba(13, 16, 21, 0) 70%),
        var(--fb-bg);
}
.fb-scroller {
    position: absolute; inset: 0;
    display: flex;
    overflow: hidden;
    padding: var(--fb-pad-y, 16px) var(--fb-pad-x, 72px);
    scrollbar-color: #3a4350 transparent;
}
.fb-slot { margin: auto; flex: none; position: relative; transition: transform .45s ease; }
.fb.is-alone-right:not(.is-zoomed) .fb-slot { transform: translateX(-25%); }
.fb.is-alone-left:not(.is-zoomed) .fb-slot { transform: translateX(25%); }
.fb.is-zoomed .fb-scroller { overflow: auto; cursor: grab; }
.fb.is-zoomed .fb-scroller.is-panning { cursor: grabbing; user-select: none; }

/* Pages */
.fb-p { background: #fff; overflow: hidden; }
.fb-p__inner { position: relative; width: 100%; height: 100%; }
.fb-p img {
    position: absolute; inset: 0; width: 100%; height: 100%; display: block;
    user-select: none; -webkit-user-drag: none; pointer-events: none;
}
.fb-p__ph {
    position: absolute; inset: 0; display: grid; place-items: center;
    background: linear-gradient(110deg, #f1f3f6 30%, #fafbfc 50%, #f1f3f6 70%) 0 0 / 300% 100%;
    color: #c4cad3; font-size: 15px; font-weight: 700; letter-spacing: .08em;
    animation: fb-shimmer 1.6s linear infinite;
}
.fb-p.is-ready .fb-p__ph { display: none; }
@keyframes fb-shimmer { to { background-position: -150% 0; } }

/* Spine shading in two-page view: inner edge of each page */
.fb-p__inner::after {
    content: ""; position: absolute; top: 0; bottom: 0; width: 7%; pointer-events: none;
}
.fb.is-spread .fb-p--left .fb-p__inner::after { right: 0; background: linear-gradient(to left, rgba(0,0,0,.16), rgba(0,0,0,0)); }
.fb.is-spread .fb-p--right .fb-p__inner::after { left: 0; background: linear-gradient(to right, rgba(0,0,0,.16), rgba(0,0,0,0)); }
.fb-slot .stf__item { box-shadow: 0 10px 34px rgba(0, 0, 0, .45); }

/* Edge arrows */
.fb-edge {
    position: absolute; top: 50%; z-index: 3;
    width: 48px; height: 96px; margin-top: -48px;
    display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 12px; background: rgba(255, 255, 255, .04); color: var(--fb-muted);
    cursor: pointer; transition: background-color .15s, color .15s, opacity .2s;
}
.fb-edge svg { width: 28px; height: 28px; }
.fb-edge:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.fb-edge--prev { left: 12px; }
.fb-edge--next { right: 12px; }
.fb-edge.is-hidden { opacity: 0; pointer-events: none; }

/* Progress line while the rest of the pages are prepared */
.fb-progress { position: absolute; top: 0; left: 0; right: 0; height: 2px; z-index: 4; transition: opacity .4s; }
.fb-progress span { display: block; height: 100%; width: 0; background: var(--fb-accent); transition: width .25s; }
.fb-progress.is-done { opacity: 0; }

/* Loading */
.fb-loading {
    position: absolute; inset: 0; z-index: 6;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
    background: var(--fb-bg); color: var(--fb-muted); font-size: 14px; text-align: center; padding: 24px;
    transition: opacity .35s;
}
.fb-loading.is-hidden { opacity: 0; pointer-events: none; }
.fb-loading p { margin: 0; }
.fb-loading a { color: #f87171; text-decoration: underline; }
.fb-loading__book { display: flex; gap: 4px; perspective: 400px; }
.fb-loading__book span { width: 34px; height: 46px; border-radius: 3px; background: #2a323d; transform-origin: left center; }
.fb-loading__book span:last-child { animation: fb-turn 1.1s ease-in-out infinite; background: #3a4452; }
@keyframes fb-turn { 0% { transform: rotateY(0); } 50%, 100% { transform: rotateY(-180deg); } }
.fb-loading.is-error .fb-loading__book { display: none; }

/* Contents drawer */
.fb-scrim { position: absolute; inset: 0; z-index: 7; background: rgba(0, 0, 0, .45); }
.fb-scrim[hidden] { display: none; }
.fb-drawer {
    position: absolute; top: 0; bottom: 0; left: 0; z-index: 8;
    width: min(380px, 90vw);
    display: flex; flex-direction: column;
    background: var(--fb-panel); border-right: 1px solid var(--fb-line);
    transform: translateX(-100%); transition: transform .25s ease, visibility 0s .25s; visibility: hidden;
}
.fb-drawer.is-open { transform: none; visibility: visible; transition: transform .25s ease; box-shadow: 18px 0 40px rgba(0,0,0,.35); }
.fb-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 20px; border-bottom: 1px solid var(--fb-line); }
.fb-drawer__title { font-size: 14px; font-weight: 700; }
.fb-drawer__body { overflow-y: auto; padding: 12px 12px 24px; scrollbar-color: #3a4350 transparent; }
.fb-drawer__label { margin: 20px 8px 10px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fb-muted); }

.fb-toc, .fb-toc ol { list-style: none; margin: 0; padding: 0; }
.fb-toc__group + .fb-toc__group { margin-top: 10px; }
.fb-toc__group-name { display: block; padding: 6px 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fb-muted); }
.fb-toc__link {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 8px 10px; border-radius: 8px; color: var(--fb-text); font-size: 14px; font-weight: 500;
    text-decoration: none; border-left: 2px solid transparent;
}
.fb-toc__link:hover { background: var(--fb-panel-2); color: #fff; }
.fb-toc__link.is-current { background: rgba(220, 38, 38, .12); border-left-color: var(--fb-accent); color: #fff; }
.fb-toc__page { color: var(--fb-muted); font-variant-numeric: tabular-nums; font-size: 13px; }

.fb-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 8px; padding: 0 4px; }
.fb-thumb {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 0; border: 0; background: none; color: var(--fb-muted); cursor: pointer;
    font: inherit; font-size: 11px; font-variant-numeric: tabular-nums;
}
.fb-thumb__img {
    width: 100%; aspect-ratio: var(--fb-ratio, 0.707); border-radius: 3px; background: #262d37 center / cover no-repeat;
    outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .15s;
}
.fb-thumb:hover .fb-thumb__img { outline-color: #4b5563; }
.fb-thumb.is-current { color: #fff; }
.fb-thumb.is-current .fb-thumb__img { outline-color: var(--fb-accent); }

/* ---------- Footer: page scrubber ---------- */
.fb-foot {
    display: flex; align-items: center; gap: 20px;
    padding: 0 20px;
    background: var(--fb-panel); border-top: 1px solid var(--fb-line);
    position: relative; z-index: 5;
}
.fb-scrub { position: relative; flex: 1; height: 100%; display: flex; align-items: center; }
.fb-scrub input[type="range"] {
    -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0;
    background: transparent; cursor: pointer; position: relative; z-index: 1;
    --fb-fill: 0%;
}
.fb-scrub input[type="range"]:disabled { cursor: default; opacity: .4; }
.fb-scrub input[type="range"]::-webkit-slider-runnable-track {
    height: 4px; border-radius: 2px;
    background: linear-gradient(to right, var(--fb-accent) var(--fb-fill), #2c3440 var(--fb-fill));
}
.fb-scrub input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: #2c3440; }
.fb-scrub input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--fb-accent); }
.fb-scrub input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%;
    background: #fff; border: 0; box-shadow: 0 0 0 4px rgba(220, 38, 38, .35);
}
.fb-scrub input[type="range"]::-moz-range-thumb {
    width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 4px rgba(220, 38, 38, .35);
}
.fb-scrub__ticks { position: absolute; left: 8px; right: 8px; top: 50%; height: 0; pointer-events: none; }
.fb-scrub__ticks i { position: absolute; top: 5px; width: 2px; height: 6px; margin-left: -1px; border-radius: 1px; background: #4a5462; }
.fb-scrub__tip {
    position: absolute; bottom: calc(100% + 2px); left: 0; transform: translateX(-50%);
    padding: 6px 10px; border-radius: 8px; background: #fff; color: #111827;
    font-size: 12px; font-weight: 700; white-space: nowrap; pointer-events: none;
    opacity: 0; transition: opacity .12s; box-shadow: 0 6px 20px rgba(0,0,0,.35); z-index: 9;
}
.fb-scrub__tip.is-visible { opacity: 1; }
.fb-scrub__tip small { display: block; font-weight: 500; color: #4b5563; }
.fb-foot__hint { flex: none; font-size: 12px; color: var(--fb-muted); white-space: nowrap; }
.fb-foot__hint kbd {
    display: inline-block; min-width: 20px; padding: 1px 5px; margin-right: 2px;
    border: 1px solid var(--fb-line); border-bottom-width: 2px; border-radius: 4px;
    font: inherit; font-size: 11px; color: var(--fb-text); text-align: center;
}

.fb-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--fb-muted); z-index: 7; background: var(--fb-bg); }

/* Floating call / WhatsApp buttons: tuck them into the scrubber row instead of over the pages */
@media (min-width: 769px) {
    body:has(#fb) .floating-contact { bottom: 6px; right: 12px; flex-direction: row; gap: 8px; }
    body:has(#fb) .float-btn { width: 36px; height: 36px; }
    body:has(#fb) .float-btn:hover { transform: none; }
    body:has(#fb) .float-btn svg { width: 18px; height: 18px; }
    .fb-foot { padding-right: 112px; }
}

/* ---------- Below the fold ---------- */
.fb-about { background: #f6f7f9; color: #374151; padding: 72px 24px 88px; }
.fb-about__inner { max-width: 1200px; margin: 0 auto; }
.fb-about__intro { max-width: 720px; margin-bottom: 36px; }
.fb-eyebrow { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fb-accent); }
.fb-about h2 { margin: 0 0 12px; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; color: #0f172a; line-height: 1.2; }
.fb-about__intro p { margin: 0; font-size: 16px; line-height: 1.65; color: #4b5563; }
.fb-about__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.fb-about__card { display: flex; flex-direction: column; background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 26px; }
.fb-about__num { font-size: 12px; font-weight: 800; color: var(--fb-accent); letter-spacing: .06em; }
.fb-about__card h3 { margin: 8px 0 14px; font-size: 18px; font-weight: 800; color: #0f172a; }
.fb-about__card ul { margin: 0 0 20px; padding: 0; list-style: none; flex: 1; }
.fb-about__card li { position: relative; padding-left: 16px; margin-bottom: 8px; font-size: 14px; line-height: 1.55; color: #4b5563; }
.fb-about__card li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: #d1d5db; }
.fb-about__card strong { color: #111827; }
.fb-about__jump {
    align-self: flex-start; padding: 0; border: 0; background: none; cursor: pointer;
    font: inherit; font-size: 14px; font-weight: 700; color: var(--fb-accent);
}
.fb-about__jump::after { content: " ↑"; }
.fb-about__jump:hover { text-decoration: underline; text-underline-offset: 3px; }
.fb-about__cta {
    display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
    margin-top: 28px; padding: 28px 32px; border-radius: 14px; background: #0f172a; color: #cbd5e1;
}
.fb-about__cta h3 { margin: 0 0 6px; font-size: 20px; font-weight: 800; color: #fff; }
.fb-about__cta p { margin: 0; font-size: 14px; }
.fb-about__cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.fb-cta { display: inline-flex; align-items: center; height: 44px; padding: 0 20px; border-radius: 10px; font-size: 14px; font-weight: 700; text-decoration: none; transition: background-color .15s, color .15s; }
.fb-cta--solid { background: var(--fb-accent); color: #fff; }
.fb-cta--solid:hover { background: var(--fb-accent-hi); color: #fff; }
.fb-cta--ghost { border: 1px solid rgba(255,255,255,.25); color: #fff; }
.fb-cta--ghost:hover { background: rgba(255,255,255,.08); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .fb-foot__hint { display: none; }
}
@media (max-width: 900px) {
    .fb-title h1 { display: none; }
    .fb-title__section { font-size: 13px; color: var(--fb-text); font-weight: 600; }
    .fb-btn__text { display: none; }
    .fb-about__grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .fb-page { --fb-bar-h: 52px; --fb-foot-h: 44px; }
    /* the site's call / WhatsApp bar takes the bottom 52px on phones */
    .fb { height: calc(100vh - var(--fb-nav-h, 80px) - 52px); height: calc(100svh - var(--fb-nav-h, 80px) - 52px); min-height: 380px; }
    .fb:fullscreen { height: 100vh; height: 100dvh; }
    .fb-bar { grid-template-columns: auto 1fr auto; gap: 6px; padding: 0 6px; }
    .fb-bar__start { gap: 4px; }
    .fb-title { display: none; }
    .fb-btn--label span { display: none; }
    .fb-btn--label { padding: 0 8px; }
    .fb-bar__mid { justify-content: center; }
    .fb-counter { min-width: 76px; font-size: 12px; }
    .fb-seg, .fb-zoom__value, #fb-fullscreen.is-unsupported { display: none; }
    .fb-bar__end { gap: 2px; }
    .fb-foot { padding: 0 14px; }
    .fb-about { padding: 48px 16px 64px; }
    .fb-about h2 { font-size: 24px; }
    .fb-about__cta { padding: 22px; }
}
@media (hover: none), (max-width: 768px) {
    .fb-edge { display: none; }
}
/* Phones held sideways: keep the bars thin so the page gets the height */
@media (max-height: 520px) {
    .fb-page { --fb-bar-h: 44px; --fb-foot-h: 36px; }
    .fb-title__section { display: none; }
}
#fb-fullscreen.is-unsupported { display: none; }

@media (prefers-reduced-motion: reduce) {
    .fb-p__ph, .fb-loading__book span:last-child { animation: none; }
    .fb-slot { transition: none; }
    .fb-drawer, .fb-drawer.is-open { transition: none; }
}
