/* ── PDF Viewer — Front End ─────────────────────────────────────────────── */

.spdfv-wrapper {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    font-family: inherit;
    box-sizing: border-box;
}

/* Stacked pages container */
.spdfv-pages {
    display: flex;
    flex-direction: column;
    gap: 12px;         /* Space between pages */
    align-items: center;
    width: 100%;
}

/* Individual page wrapper — positions canvas + annotation layer */
.spdfv-page {
    position: relative;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    background: #fff;
    overflow: hidden;
    line-height: 0;    /* Eliminates phantom inline spacing under canvas */
}

/* Canvas fills the page div exactly */
.spdfv-page canvas {
    display: block;
    width: 100%;
    height: auto;
}

/* Annotation layer — PDF.js v4 sizes this via --scale-factor (set in JS).
   Do NOT set width/height or overflow:hidden here — let PDF.js own the sizing. */
.spdfv-page .annotationLayer {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    pointer-events: auto !important;
    overflow: visible !important; /* must NOT clip link hotspots */
}

.spdfv-page .annotationLayer .linkAnnotation {
    pointer-events: auto;
}

.spdfv-page .annotationLayer .linkAnnotation > a {
    cursor: pointer !important;
    pointer-events: auto !important;
}

.spdfv-page .annotationLayer .linkAnnotation > a:hover {
    background: rgba(255, 220, 0, 0.3) !important;
    border-radius: 2px;
    outline: 1px solid rgba(200, 160, 0, 0.5);
}

/* ── Loading indicator ──────────────────────────────────────────────────── */
.spdfv-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px;
    color: #555;
    font-size: 15px;
}

.spdfv-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #ddd;
    border-top-color: #555;
    border-radius: 50%;
    animation: spdfv-spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

/* ── SEO fallback link ───────────────────────────────────────────────────── */
.spdfv-seo-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    text-decoration: none;
    opacity: 0.6;
}

.spdfv-seo-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ── Admin notice (shown to admins when no PDF is set) ───────────────────── */
.spdfv-notice {
    background: #fff8e1;
    border-left: 4px solid #f5a623;
    padding: 10px 14px;
    font-size: 14px;
    max-width: 700px;
}

/* ── Responsive: narrow screens ─────────────────────────────────────────── */
@media (max-width: 640px) {
    .spdfv-pages {
        gap: 6px;
    }

    .spdfv-page {
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    }
}
