* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    /* Match Siegmund style dark background */
    background-color: #1c1c1c;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

.catalog-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1400px; /* Constrain max width for desktop */
    height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    /* Add optional perspective if wanting 3D feel, though stPageFlip handles it */
}

/* Base styles for the pages */
.page {
    background-color: #fff;
    /* Provide a nice inline shadow effect to mimic paper depth */
    box-shadow: inset -1px 0 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.page-content {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.page-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    display: block;
}

/* Double-page spread split using absolute positioning */
.page-content img.spread-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    object-fit: fill;
}

.page-content img.spread-right {
    position: absolute;
    top: 0;
    right: 0;
    width: 200%;
    height: 100%;
    object-fit: fill;
}

/* Navigation buttons (Left / Right arrows) */
.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin: 0 40px;
    z-index: 10;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    border-color: #fff;
}

.nav-btn svg {
    width: 30px;
    height: 30px;
    fill: #fff;
}

/* Jump to page widget */
.jump-to-page {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    padding: 8px 10px;
    backdrop-filter: blur(8px);
    z-index: 100;
}

#jump-input {
    width: 72px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    padding: 5px 8px;
    outline: none;
    text-align: center;
    -moz-appearance: textfield;
}

#jump-input::-webkit-outer-spin-button,
#jump-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

#jump-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
}

#jump-input:focus {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.15);
}

#jump-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 14px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.5px;
}

#jump-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

#jump-btn:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    body {
        height: 100dvh;
        overflow: hidden;
    }

    .catalog-wrapper {
        padding: 0;
        width: 100vw;
        height: 100dvh;
    }

    .container {
        width: 100vw;
        height: 100dvh;
        max-width: 100vw;
        padding: 0;
    }

    /* Hide nav arrows — swipe to navigate on mobile */
    .nav-btn {
        display: none;
    }

    /* Keep each page showing its correct half of the spread image */
    .page-content img.spread-left {
        position: absolute;
        top: 0;
        left: 0;
        width: 200%;
        height: 100%;
        object-fit: fill;
    }

    .page-content img.spread-right {
        position: absolute;
        top: 0;
        right: 0;
        left: auto;
        width: 200%;
        height: 100%;
        object-fit: fill;
    }

    .jump-to-page {
        bottom: 16px;
        right: 50%;
        transform: translateX(50%);
        padding: 8px 14px;
    }

    #jump-input {
        width: 70px;
        font-size: 14px;
    }

    #jump-btn {
        font-size: 13px;
        padding: 5px 14px;
    }
}

/* ---- Mobile blue tap highlight fix ---- */
.flip-book,
.flip-book * ,
.page,
.page-content,
.page-content img {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* ---- Zoom button (in jump bar) ---- */
#zoom-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.1s;
}
#zoom-btn:hover { background: rgba(255, 255, 255, 0.3); }
#zoom-btn:active { transform: scale(0.95); }
#zoom-btn svg { width: 18px; height: 18px; fill: #fff; }

/* ---- Zoom overlay ---- */
#zoom-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    touch-action: none;
    overflow: hidden;
}
#zoom-overlay.open { display: block; }

#zoom-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#zoom-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
    transition: transform 0.05s linear;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    will-change: transform;
}
#zoom-img.grabbing { cursor: grabbing; transition: none; }

#zoom-close {
    position: fixed;
    top: 18px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    z-index: 1002;
}
#zoom-close:hover { background: rgba(255, 255, 255, 0.3); }

#zoom-hint {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 12px;
    border-radius: 8px;
    z-index: 1002;
    pointer-events: none;
}

@media (max-width: 768px) {
    #zoom-hint { font-size: 11px; }
}