/* Blätterkatalog – Viewer
   Alles lokal: keine externen Schriften, Skripte oder Dienste.
   Schrift: Roboto (SIL Open Font License 1.1), liegt als Datei im Ordner viewer/fonts. */

@font-face { font-family: "Roboto"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/roboto-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/roboto-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  --fb-ink: #1B2430;
  --fb-muted: #4A5667;
  --fb-line: #C5CEDA;
  --fb-line-soft: #D5DBE3;
  --fb-ctrl: #7A8698;
  --fb-blue: #1F5FAD;
  --fb-blue-dark: #164784;
  --fb-blue-soft: #E3EBF5;
  --fb-blue-tint: #EEF3FA;
  --fb-surface: #FFFFFF;
  --fb-stage: #DDE3EA;
  --fb-hint: #3B4757;
  --fb-skel: #E3E8EE;
  --fb-font: "Roboto", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html.fb-bg-white { --fb-stage: #FFFFFF; }
html.fb-bg-light2 { --fb-stage: #F3F5F8; }
html.fb-bg-dark { --fb-stage: #2E3A4A; --fb-hint: #E3E8EE; }
html.fb-bg-transparent { --fb-stage: transparent; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--fb-font); color: var(--fb-ink); background: var(--fb-stage); overflow: hidden; }
html.fb-bg-transparent body { background: transparent; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--fb-blue); outline-offset: 2px; }
button { font: inherit; color: inherit; }
button:disabled { opacity: .4; cursor: default; }

.fb-app { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0; }
.fb-noselect { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

.fb-skip { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--fb-surface); color: var(--fb-blue); border-radius: 8px; font-weight: 600; box-shadow: 0 2px 8px rgba(27,36,48,.25); }
.fb-skip:focus { top: 8px; }

/* ---------- Toolbar ---------- */
.fb-bar { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 12px; background: var(--fb-surface); border-bottom: 1px solid var(--fb-line); position: relative; z-index: 30; }
.fb-bar-l, .fb-bar-r { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; flex: 1 1 200px; }
.fb-bar-r { justify-content: flex-end; }
.fb-nav { display: flex; align-items: center; gap: 2px; }
.fb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--fb-ink); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.fb-btn:hover:not(:disabled) { background: #EEF1F5; }
.fb-btn[aria-expanded="true"], .fb-btn[aria-pressed="true"] { background: var(--fb-blue-soft); color: var(--fb-blue-dark); }
.fb-btn.fb-icon { padding: 0; }
.fb-btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.fb-btn-primary { background: var(--fb-blue); color: #fff; }
.fb-btn-primary:hover:not(:disabled) { background: var(--fb-blue-dark); }
.fb-btn-outline { border: 1px solid var(--fb-ctrl); background: var(--fb-surface); }
.fb-pageinfo { min-width: 150px; text-align: center; font-size: 15px; font-weight: 600; }

/* ---------- Main ---------- */
.fb-main { position: relative; display: flex; flex: 1 1 auto; min-height: 0; }
.fb-stage { position: relative; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px 72px 8px; overflow: hidden; }
.fb-bookwrap { position: relative; flex: 1 1 auto; width: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; }
.fb-book { position: relative; outline: none; }
.fb-book:focus-visible { outline: 3px solid var(--fb-blue); outline-offset: 6px; border-radius: 2px; }
.fb-book .stf__wrapper { width: 100%; height: 100%; }
.fb-hint { margin: 8px 0 0; min-height: 18px; font-size: 13px; color: var(--fb-hint); text-align: center; }

.fb-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 20; width: 52px; height: 52px; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--fb-ink); box-shadow: 0 1px 4px rgba(27,36,48,.25); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.fb-arrow svg { width: 24px; height: 24px; }
.fb-arrow:hover:not(:disabled) { background: #fff; }
.fb-arrow.fb-prev { left: 12px; }
.fb-arrow.fb-next { right: 12px; }

/* ---------- Pages ---------- */
.fb-pg { position: relative; width: 100%; height: 100%; background: #fff; overflow: hidden; }
.fb-soft .fb-pg { box-shadow: 0 4px 16px rgba(27,36,48,.22); }
.fb-book:not(.fb-soft) .fb-pg { box-shadow: inset 0 0 0 1px rgba(27,36,48,.08); }
.fb-pg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; opacity: 0; transition: opacity .25s ease; -webkit-user-drag: none; user-select: none; pointer-events: none; }
.fb-pg.is-loaded img { opacity: 1; }
.fb-pg.is-loaded .fb-skel { display: none; }
.fb-pg-l::after, .fb-pg-r::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.fb-pg-l::after { background: linear-gradient(to left, rgba(27,36,48,.14), rgba(27,36,48,0) 7%); }
.fb-pg-r::after { background: linear-gradient(to right, rgba(27,36,48,.14), rgba(27,36,48,0) 7%); }
.fb-book .fb-pg { cursor: grab; }
.fb-book:active .fb-pg { cursor: grabbing; }

.fb-skel { position: absolute; inset: 0; padding: 9% 9%; display: flex; flex-direction: column; gap: 3%; }
.fb-skel i { display: block; border-radius: 3px; }
.fb-skel i:nth-child(1) { height: 40%; }
.fb-skel i:nth-child(2) { height: 3%; width: 62%; }
.fb-skel i:nth-child(3), .fb-skel i:nth-child(4) { height: 1.6%; }
.fb-skel i:nth-child(5) { height: 1.6%; width: 80%; }
.shimmer { position: relative; overflow: hidden; background: var(--fb-skel); }
.shimmer::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.75) 50%, rgba(255,255,255,0) 100%); animation: fb-shimmer 1.4s ease-in-out infinite; }
@keyframes fb-shimmer { 100% { transform: translateX(100%); } }

.fb-hl { position: absolute; inset: 0; pointer-events: none; }
/* Fundstellen: blauer Rahmen mit hellem Saum, damit sie auf hellem wie auf dunklem Seitengrund auffallen */
.fb-hl b { position: absolute; background: rgba(86,150,230,.30); box-shadow: 0 0 0 2px var(--fb-blue), 0 0 0 4px rgba(255,255,255,.85); border-radius: 2px; }
.fb-hl b.is-cur { background: rgba(86,150,230,.45); box-shadow: 0 0 0 3px var(--fb-blue), 0 0 0 6px rgba(255,255,255,.95); }

/* Blattstärke: Schatten unter dem umschlagenden Blatt und Biegekante am Falz */
.fb-leafclip { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: hidden; pointer-events: none; display: none; }
.fb-leafshadow { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.fb-creasebox { position: absolute; overflow: hidden; pointer-events: none; display: none; }
.fb-crease { position: absolute; transform-origin: 0 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,.55) 38%, rgba(255,255,255,.95) 58%, rgba(11,20,32,.42) 64%, rgba(11,20,32,.12) 78%, rgba(11,20,32,0) 100%); }

/* Soft engine */
.fb-spread { display: flex; justify-content: center; align-items: center; }
.fb-slot { position: relative; }
.fb-spread.is-out { opacity: 0; transform: translateX(calc(var(--fb-dir, 1) * -28px)); transition: opacity .22s ease, transform .22s ease; }
.fb-spread.is-pre { opacity: 0; transform: translateX(calc(var(--fb-dir, 1) * 28px)); transition: none; }
.fb-spread.is-in { opacity: 1; transform: none; transition: opacity .26s ease, transform .26s cubic-bezier(.2,.8,.2,1); }

/* ---------- Side panel ---------- */
.fb-panel { flex: 0 0 320px; max-width: 100%; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; background: var(--fb-surface); border-right: 1px solid var(--fb-line); overflow-y: auto; z-index: 25; }
.fb-panel[hidden] { display: none; }
.fb-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fb-panel h2 { margin: 0; font-size: 17px; }
.fb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.fb-item { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; font-size: 15px; color: var(--fb-ink); text-decoration: none; }
.fb-item:hover { background: #EEF1F5; }
.fb-item small { font-size: 14px; color: var(--fb-muted); white-space: nowrap; }
.fb-item svg { width: 20px; height: 20px; flex: 0 0 auto; }
.fb-nodeco { text-decoration: none; }
.fb-link { display: inline; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; min-height: 24px; }
.fb-blocked { margin: auto; padding: 32px; max-width: 520px; text-align: center; font-size: 16px; line-height: 1.5; }
.fb-blocked a { color: var(--fb-blue); font-weight: 600; }
.fb-result { flex-direction: column; align-items: flex-start; border: 1px solid var(--fb-line-soft); }
.fb-result strong { font-size: 13px; color: var(--fb-blue-dark); }
.fb-result span { font-size: 14px; line-height: 1.4; }
.fb-result[aria-current] { border-color: var(--fb-blue); box-shadow: inset 3px 0 0 var(--fb-blue); }
.fb-result mark { background: #CFE0F5; color: var(--fb-ink); padding: 0 2px; border-radius: 2px; }
.fb-field { display: flex; flex-direction: column; gap: 6px; }
.fb-field label { font-size: 14px; font-weight: 600; }
.fb-input { min-height: 44px; padding: 0 12px; border: 1px solid var(--fb-ctrl); border-radius: 8px; color: var(--fb-ink); background: #fff; font: inherit; font-size: 15px; width: 100%; }
.fb-input[readonly] { background: #F7F9FB; font-size: 14px; }
.fb-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; }
.fb-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--fb-blue); }
.fb-status { margin: 0; min-height: 20px; font-size: 14px; color: var(--fb-muted); }
.fb-status.is-ok { color: var(--fb-blue-dark); font-weight: 600; }

/* ---------- Thumbnails ---------- */
.fb-thumbs { flex: 0 0 auto; background: var(--fb-surface); border-top: 1px solid var(--fb-line); padding: 8px 12px; overflow-x: auto; overflow-y: hidden; z-index: 10; cursor: grab; -webkit-user-select: none; user-select: none; scrollbar-width: thin; }
.fb-thumbs.is-drag { cursor: grabbing; }
.fb-thumbs.is-drag .fb-thumb { pointer-events: none; }
.fb-thumbs ul { list-style: none; margin: 0 auto; padding: 0; display: flex; gap: 8px; width: max-content; }
.fb-thumb { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px; border: 2px solid transparent; border-radius: 8px; background: transparent; cursor: pointer; }
.fb-thumb[aria-current="page"] { border-color: var(--fb-blue); background: var(--fb-blue-tint); }
.fb-thumb-imgs { display: flex; gap: 1px; height: 52px; }
.fb-thumb-imgs span { position: relative; display: block; height: 52px; background: var(--fb-skel); border: 1px solid #9AA6B6; overflow: hidden; }
.fb-thumb-imgs img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s; pointer-events: none; }
.fb-thumb-imgs span.is-loaded img { opacity: 1; }
.fb-thumb-imgs span.is-loaded::after { display: none; }
.fb-thumb small { font-size: 12px; color: var(--fb-hint); color: #3B4757; }
.fb-slider { display: none; }

/* ---------- Focus (Einzelansicht + Lupe) ---------- */
.fb-focus { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--fb-stage); }
html.fb-bg-transparent .fb-focus { background: #DDE3EA; }
.fb-focus[hidden] { display: none; }
.fb-focus-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 12px; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--fb-line); }
.fb-focus-bar .fb-spacer { flex: 1 1 auto; }
.fb-focus-box { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; cursor: zoom-in; }
.fb-focus.is-zoom .fb-focus-box { overflow: auto; cursor: zoom-out; }
.fb-focus-page { position: absolute; background: #fff; box-shadow: 0 10px 40px rgba(27,36,48,.3); }
.fb-focus.is-zoom .fb-focus-page { box-shadow: none; }
.fb-focus-page img { display: block; width: 100%; height: 100%; -webkit-user-drag: none; pointer-events: none; }
.fb-focus-page .fb-skel { z-index: 0; }
.fb-focus-page.is-loaded .fb-skel { display: none; }
.fb-focus-hint { margin: 0; padding: 6px 8px; text-align: center; font-size: 13px; color: var(--fb-hint); }

.fb-print { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .fb-btn .fb-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .fb-btn:not(.fb-keep) { padding: 0; }
  .fb-pageinfo { min-width: 110px; font-size: 14px; }
}
@media (max-width: 640px) {
  .fb-bar { padding: 4px 6px; gap: 2px; justify-content: space-between; }
  .fb-bar-l, .fb-bar-r { flex: 0 1 auto; }
  .fb-nav { order: -1; flex: 1 1 100%; justify-content: center; border-bottom: 1px solid #EEF1F5; }
  .fb-nav .fb-first, .fb-nav .fb-last { display: none; }
  .fb-stage { padding: 12px 12px 4px; }
  .fb-arrow { display: none; }
  .fb-thumbs ul { display: none; }
  .fb-slider { display: block; width: 100%; height: 32px; margin: 0; accent-color: var(--fb-blue); }
  .fb-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 80%; border-right: 0; border-top: 1px solid var(--fb-line); border-radius: 16px 16px 0 0; box-shadow: 0 -6px 24px rgba(27,36,48,.25); z-index: 45; }
}

/* Animationen aus: vom Besucher gewählt oder Systemeinstellung „Bewegung reduzieren“ */
html.fb-noanim .shimmer::after { animation: none; }
html.fb-noanim .fb-spread.is-out, html.fb-noanim .fb-spread.is-pre, html.fb-noanim .fb-spread.is-in { transform: none; }
html.fb-noanim .fb-pg img, html.fb-noanim .fb-thumb-imgs img { transition: none; }

/* ---------- Druckschutz ---------- */
@media print {
  html.fb-noprint .fb-app { display: none !important; }
  html.fb-noprint .fb-print { display: block; padding: 40px; font: 16px/1.5 var(--fb-font); color: #000; }
}

/* ---------- StPageFlip (MIT) ---------- */
.stf__parent {
  position: relative;
  display: block;
  box-sizing: border-box;
  transform: translateZ(0);

  -ms-touch-action: pan-y;
  touch-action: pan-y;
}

.sft__wrapper {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.stf__parent canvas {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
}

.stf__block {
  position: absolute;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  perspective: 2000px;
}

.stf__item {
  display: none;
  position: absolute;
  transform-style: preserve-3d;
}

.stf__outerShadow {
  position: absolute;
  left: 0;
  top: 0;
}

.stf__innerShadow {
  position: absolute;
  left: 0;
  top: 0;
}

.stf__hardShadow {
  position: absolute;
  left: 0;
  top: 0;
}

.stf__hardInnerShadow {
  position: absolute;
  left: 0;
  top: 0;
}