/* ═══════════════════════════════════════════
 *  DeKijker Viewer v2.2 — Stylesheet
 *  Dark theme, PrimaPrint branding
 *  Full-bleed, spread-weergave, vh-begrenzing
 * ═══════════════════════════════════════════ */

/* ── Voorkom horizontale scroll door full-bleed viewer ── */
body.single-dekijker-editie {
    overflow-x: hidden;
}

/* ── Container — volle viewport breedte (full-bleed) ── */
.dkv-viewer {
    background: transparent;
    border-radius: 0;
    overflow: visible;
    width: 100vw !important;
    max-width: none !important;
    position: relative !important;
    left: 50% !important;
    margin-left: -50vw !important;
    outline: none;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    box-sizing: border-box;
}

.dkv-viewer:focus-visible {
    box-shadow: 0 0 0 2px #E8530E;
}


/* ── Laadscherm ── */
.dkv-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 4rem 1rem;
    color: #888;
    font-size: 0.95rem;
}

.dkv-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #333;
    border-top-color: #E8530E;
    border-radius: 50%;
    animation: dkv-spin 0.8s linear infinite;
}

@keyframes dkv-spin {
    to { transform: rotate(360deg); }
}


/* ── Foutmelding ── */
.dkv-error {
    text-align: center;
    padding: 3rem 1rem;
    color: #aaa;
}

.dkv-error p {
    margin: 0 0 1rem;
    font-size: 1rem;
}

.dkv-error__link {
    color: #E8530E;
    text-decoration: none;
    font-size: 0.9rem;
}

.dkv-error__link:hover {
    text-decoration: underline;
}


/* ── Geen PDF melding ── */
.dkv-no-pdf {
    text-align: center;
    padding: 2rem 1rem;
    color: #888;
    font-style: italic;
}


/* ── Canvas wrapper — spread layout ──
 *  Geen max-height: hoogte wordt in JS
 *  begrensd tussen MIN_VH en MAX_VH.
 * ──────────────────────────────────── */
.dkv-canvas-wrap {
    display: none;
    justify-content: center;
    align-items: flex-start;
    gap: 4px;
    padding: 0;
    background: transparent;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
}

/* Twee pagina's naast elkaar */
.dkv-canvas-wrap.dkv-spread-two {
    justify-content: center;
}

/* Enkele pagina gecentreerd */
.dkv-canvas-wrap.dkv-spread-one {
    justify-content: center;
}


/* ── Canvas ── */
.dkv-canvas {
    display: block;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
    height: auto;
    flex-shrink: 0;
}

.dkv-canvas[hidden] {
    display: none !important;
}


/* ── Controls balk ── */
.dkv-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    margin: 0.75rem auto 0;
    max-width: 500px;
    flex-wrap: wrap;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* Knop basis */
.dkv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1;
    -webkit-appearance: none;
    appearance: none;
}

.dkv-btn:hover:not(:disabled) {
    background: #E8530E;
    border-color: #E8530E;
    color: #fff;
}

.dkv-btn:active:not(:disabled) {
    background: #c94509;
    border-color: #c94509;
}

.dkv-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.dkv-btn--nav {
    padding: 6px 8px;
}

.dkv-btn--nav svg {
    display: block;
}

/* Separator */
.dkv-separator {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 4px;
}


/* ── Pagina-info ── */
.dkv-page-info {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #999;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.dkv-page-current {
    color: #eee;
    min-width: 2em;
    text-align: center;
}

.dkv-page-sep {
    color: #555;
}

.dkv-page-total {
    min-width: 1.5em;
}


/* ── Fullscreen modus ── */
.dkv-viewer:fullscreen,
.dkv-viewer:-webkit-full-screen {
    max-width: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    background: #0A0A0A;
    overflow: auto;
    /* Reset full-bleed in fullscreen */
    width: 100% !important;
    left: 0 !important;
    margin-left: 0 !important;
}

.dkv-viewer:fullscreen .dkv-canvas-wrap,
.dkv-viewer:-webkit-full-screen .dkv-canvas-wrap {
    flex: 1;
    overflow: auto;
}

.dkv-viewer:fullscreen .dkv-controls,
.dkv-viewer:-webkit-full-screen .dkv-controls {
    position: sticky;
    bottom: 0;
    max-width: none;
}


/* ── Responsive ── */
@media (max-width: 767px) {
    .dkv-canvas-wrap {
        gap: 0;
    }

    .dkv-controls {
        padding: 8px 10px;
        gap: 4px;
    }

    .dkv-btn {
        padding: 5px 7px;
    }

    .dkv-separator {
        margin: 0 2px;
    }
}

@media (max-width: 400px) {
    .dkv-controls {
        gap: 3px;
    }
}


/* ── Print: verberg viewer ── */
@media print {
    .dkv-viewer {
        display: none;
    }
}
