/* MG Editorial Core – Flipbook-Viewer */
.mgec-fb { --mgec-fb-bg: #2b2d31; --mgec-fb-bar: rgba(20, 21, 24, .92); --mgec-fb-fg: #fff; position: relative; display: flex; flex-direction: column; width: 100%; background: var(--mgec-fb-bg); border-radius: 6px; overflow: hidden; outline: none; }
.mgec-fb:fullscreen { border-radius: 0; justify-content: center; }
.mgec-fb__stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 320px; padding: 24px 12px; }
.mgec-fb__book { margin: 0 auto; }
.mgec-fb__page { background: #fff; box-shadow: 0 0 1px rgba(0, 0, 0, .25); }
.mgec-fb__page canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity .25s; }
.mgec-fb__page.is-rendered canvas { opacity: 1; }
.mgec-fb__status { color: #d4d4d8; font: 14px/1.5 system-ui, sans-serif; text-align: center; }
.mgec-fb__status::before { content: ""; display: block; width: 28px; height: 28px; margin: 0 auto 10px; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; border-radius: 50%; animation: mgec-fb-spin .8s linear infinite; }
.mgec-fb__status.is-error::before { display: none; }
.mgec-fb__status a { color: #fff; text-decoration: underline; }
@keyframes mgec-fb-spin { to { transform: rotate(360deg); } }

.mgec-fb__bar { display: flex; align-items: center; gap: 4px; padding: 8px 10px; background: var(--mgec-fb-bar); color: var(--mgec-fb-fg); font: 600 13px/1 system-ui, sans-serif; }
.mgec-fb__count { min-width: 90px; text-align: center; font-variant-numeric: tabular-nums; }
.mgec-fb__spacer { flex: 1; }
.mgec-fb__btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--mgec-fb-fg); cursor: pointer; text-decoration: none; }
.mgec-fb__btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.mgec-fb__btn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.mgec-fb__btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Zoom */
.mgec-fb-zoom { position: absolute; inset: 0; z-index: 20; overflow: auto; background: rgba(15, 16, 18, .97); outline: none; }
.mgec-fb-zoom__pages { display: flex; justify-content: center; gap: 4px; padding: 56px 20px 20px; min-width: min-content; }
.mgec-fb-zoom__pages canvas { display: block; height: auto; background: #fff; }
.mgec-fb-zoom__close { position: sticky; top: 10px; left: calc(100% - 50px); z-index: 2; float: right; margin: 10px; background: rgba(0, 0, 0, .5); }

/* Lightbox */
.mgec-fb-locked, .mgec-fb-locked body { overflow: hidden; }
.mgec-fb-lightbox { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 2vh 2vw; background: rgba(10, 11, 13, .88); }
.mgec-fb-lightbox__inner { width: min(1400px, 100%); max-height: 100%; }
.mgec-fb-lightbox .mgec-fb { box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }

/* Vorschaubilder & Links */
.mgec-flipbook-thumb { display: inline-flex; flex-direction: column; align-items: center; gap: 10px; max-width: 100%; color: inherit; text-decoration: none; }
.mgec-flipbook-thumb img { display: block; max-width: 100%; height: auto; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); transition: transform .25s, box-shadow .25s; }
.mgec-flipbook-thumb:hover img, .mgec-flipbook-thumb:focus-visible img { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0, 0, 0, .25); }
.mgec-flipbook-thumb__placeholder { display: block; width: 180px; aspect-ratio: 210 / 297; background: #e5e5e5; }
.mgec-flipbook-thumb__title { font-weight: 600; text-align: center; }
.mgec-flipbook-button { display: inline-block; padding: 10px 18px; border-radius: 4px; background: #161719; color: #fff !important; font-weight: 600; text-decoration: none; }
.mgec-flipbooks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 24px; }

/* Eigenständige Seite /books/… */
body.mgec-flipbook-page { margin: 0; min-height: 100vh; background: #1f2023; color: #fff; }
.mgec-fb-page__bar { display: flex; align-items: center; gap: 20px; padding: 12px 20px; background: #141518; font: 14px/1.4 system-ui, sans-serif; }
.mgec-fb-page__site { color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; }
.mgec-fb-page__title { margin: 0; font-size: 15px; font-weight: 500; color: #d4d4d8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mgec-fb-page__main { padding: 16px; }
.mgec-flipbook--page.mgec-fb { border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
	.mgec-flipbook-thumb img, .mgec-fb__page canvas { transition: none; }
}
