/* =========================================================
   Speisekarte Flipbook — Frontend Styles
   ========================================================= */

:root {
    --sfb-gold:      #c8902a;
    --sfb-gold-lt:   #e8b84b;
    --sfb-dark:      #1c1a17;
    --sfb-dark2:     #2c2825;
    --sfb-parchment: #f5f0e8;
    --sfb-shadow-lg: 0 20px 60px rgba(0,0,0,.35);
    --sfb-shadow-md: 0 8px 24px rgba(0,0,0,.2);
    --sfb-radius:    4px;
}

.sfb-empty { color: #888; font-style: italic; }

/* ---- Wrapper ---- */
.sfb-wrapper {
    font-family: 'Georgia', 'Times New Roman', serif;
    margin: 0 auto;
    padding: 0;
}

/* ---- Flipbook container ---- */
.sfb-flipbook {
    background: var(--sfb-dark);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--sfb-shadow-lg);
    user-select: none;
}

/* ---- Viewer ---- */
.sfb-viewer {
    position: relative;
    background: #111;
    overflow: hidden;
}

/* Spread (two-page) */
.sfb-spread {
    display: flex;
    align-items: stretch;
    min-height: 400px;
}

/* Each page half */
.sfb-page-left,
.sfb-page-right {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--sfb-parchment);
    transition: opacity .08s ease;
}
.sfb-page-left  { border-right: 1px solid rgba(0,0,0,.18); }

/* Inner — holds image + page number */
.sfb-page-inner {
    width: 100%; height: 100%;
    position: relative;
    display: flex; align-items: center; justify-content: center;
}
.sfb-page-inner img {
    display: block;
    width: 100%; height: 100%;
    object-fit: contain;
    max-height: 78vh;
}

/* Spine shadow overlay */
.sfb-spread::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    left: 50%; transform: translateX(-50%);
    width: 24px;
    background: linear-gradient(to right,
        rgba(0,0,0,.22) 0%,
        rgba(0,0,0,.06) 40%,
        rgba(0,0,0,.06) 60%,
        rgba(0,0,0,.22) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* Page number badges */
.sfb-page-num {
    position: absolute;
    bottom: 10px;
    font-size: 11px;
    color: #aaa;
    letter-spacing: .08em;
    font-family: 'Georgia', serif;
    pointer-events: none;
    z-index: 2;
}
.sfb-page-left  .sfb-page-num { left: 14px; }
.sfb-page-right .sfb-page-num { right: 14px; }

/* ---- Flip animation ---- */
@keyframes sfb-flip-page {
    0%   { opacity: 1; transform: scaleX(1); }
    40%  { opacity: .55; transform: scaleX(.94); }
    100% { opacity: 1; transform: scaleX(1); }
}
.sfb-page-left.sfb-anim-next,
.sfb-page-right.sfb-anim-next,
.sfb-page-left.sfb-anim-prev,
.sfb-page-right.sfb-anim-prev { animation: sfb-flip-page .32s ease; }

/* ---- Navigation Buttons (big arrows) ---- */
.sfb-btn {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    z-index: 10;
    background: rgba(20,18,14,.72);
    border: 1px solid rgba(200,144,42,.35);
    border-radius: 50%;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,.8);
    backdrop-filter: blur(4px);
    transition: background .18s, border-color .18s, opacity .18s, transform .18s;
    opacity: .55;
}
.sfb-btn svg { width: 20px; height: 20px; }
.sfb-btn:hover {
    background: var(--sfb-gold);
    border-color: var(--sfb-gold);
    color: #fff;
    opacity: 1;
    transform: translateY(-50%) scale(1.08);
}
.sfb-btn:disabled { opacity: .15; pointer-events: none; }
.sfb-btn-prev { left: 10px; }
.sfb-btn-next { right: 10px; }

/* ---- Controls Bar ---- */
.sfb-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--sfb-dark2);
    border-top: 1px solid rgba(200,144,42,.2);
    padding: 8px 16px;
}
.sfb-ctrl {
    background: none;
    border: 1px solid rgba(200,144,42,.25);
    border-radius: 4px;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.65);
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.sfb-ctrl svg { width: 16px; height: 16px; }
.sfb-ctrl:hover {
    background: var(--sfb-gold);
    border-color: var(--sfb-gold);
    color: #fff;
}
.sfb-ctrl:disabled { opacity: .25; pointer-events: none; }
.sfb-page-indicator {
    font-size: 13px;
    color: rgba(255,255,255,.7);
    letter-spacing: .04em;
    min-width: 64px;
    text-align: center;
    font-family: 'Georgia', serif;
}

/* ---- Thumbnail Strip ---- */
.sfb-thumbs {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    background: var(--sfb-dark);
    border-top: 1px solid rgba(200,144,42,.15);
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(200,144,42,.4) transparent;
}
.sfb-thumbs::-webkit-scrollbar { height: 4px; }
.sfb-thumbs::-webkit-scrollbar-thumb { background: rgba(200,144,42,.4); border-radius: 2px; }

.sfb-thumb {
    flex-shrink: 0;
    width: 60px;
    background: none;
    border: 2px solid transparent;
    border-radius: 4px;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    opacity: .55;
    transition: opacity .18s, border-color .18s, transform .18s;
    position: relative;
}
.sfb-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
}
.sfb-thumb span {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,.55);
    color: rgba(255,255,255,.8);
    font-size: 9px;
    text-align: center;
    padding: 2px 0;
    letter-spacing: .05em;
}
.sfb-thumb:hover,
.sfb-thumb.sfb-active {
    opacity: 1;
    border-color: var(--sfb-gold);
    transform: translateY(-2px);
}

/* ---- Fullscreen ---- */
.sfb-flipbook.sfb-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    background: #0d0c0a;
}
.sfb-flipbook.sfb-fullscreen .sfb-viewer {
    flex: 1;
    min-height: 0;
}
.sfb-flipbook.sfb-fullscreen .sfb-page-inner img {
    max-height: 100%;
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
    /* Single-page layout */
    .sfb-spread::after { display: none; }
    .sfb-page-left { border-right: none; }

    /* Viewer takes full width, reasonable height */
    .sfb-viewer { min-height: 0; }
    .sfb-page-inner img {
        max-height: 65vh;
        width: 100%;
        object-fit: contain;
    }

    /* Bigger tap targets for arrows */
    .sfb-btn { width: 40px; height: 40px; opacity: .8; }
    .sfb-btn svg { width: 18px; height: 18px; }

    /* Controls bar: wrap if needed */
    .sfb-controls { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
    .sfb-page-indicator { font-size: 14px; min-width: 56px; }

    /* Smaller thumbnails */
    .sfb-thumb { width: 48px; }

    /* Hide fullscreen button on mobile (not useful) */
    .sfb-ctrl-fs { display: none; }
}
