

body {
    overflow: hidden;
    background-color: transparent;
}


body:has(.flipbook-viewport) {
    margin: 0;
    min-height: 100vh;
    overflow: hidden;
    background: var(--color-bg-charcoal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--body-padding);
    padding-top: var(--header-height);
    box-sizing: border-box;
}

.flipbook-viewport {
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.flipbook-viewport .container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flipbook-viewport .flipbook {
    position: relative;
}

.flipbook-viewport .page {
    width: 50vw;
    height: calc(100vh - 50px);
    max-height: calc(100vh - 50px);
    background-color: var(--color-bg);
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.flipbook .page {
    box-shadow: var(--shadow-page);
}

.flipbook-viewport .page img {
    -webkit-touch-callout: none;
    user-select: none;
    margin: 0;
}

.flipbook-viewport .shadow {
    transition: box-shadow 0.5s;
    box-shadow: var(--shadow-page-hover);
}


.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--color-loading);
    z-index: 100;
}

.error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--color-error);
    text-align: center;
}

.flipbook .page canvas {
    width: 100%;
    height: 100%;
    display: block;
}


.nav-arrows {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(36px, 8vw, 56px);
    height: clamp(36px, 8vw, 56px);
    min-width: 36px;
    min-height: 36px;
    background: var(--color-overlay);
    color: var(--color-text-inverse);
    border: 1px solid var(--color-border-charcoal-strong);
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.3s, opacity 0.3s, border-color 0.3s;
    opacity: 0.9;
}

.nav-arrows svg {
    display: block;
    width: clamp(18px, 4.5vw, 26px);
    height: clamp(18px, 4.5vw, 26px);
}

.nav-arrows path {
    stroke: currentColor;
    stroke-width: 1px;
    stroke-linecap: square;
    stroke-linejoin: miter;
    fill: none;
}

.nav-arrows:hover {
    background: var(--color-overlay-hover);
    border-color: rgba(255, 255, 255, 0.5);
    opacity: 1;
}

.nav-arrows:active {
    background: var(--color-overlay-active);
}

.nav-arrows:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.nav-arrows.prev {
    left: clamp(12px, 3vw, 24px);
}

.nav-arrows.next {
    right: clamp(12px, 3vw, 24px);
}
