/* Site styling for the vendored PDF.js viewer (assets/vendor/pdfjs/web/viewer.html).
   Kept outside assets/vendor/ so the upstream files stay unmodified. Colours use
   the viewer's own tokens (light/dark aware) plus the site's primary blue. */

:root {
    --site-primary: #1E3A8A;
}

/* ---------- Back link inside the toolbar ---------- */

.siteBackLink {
    display: inline-flex;
    align-items: center;
    flex: none;
    gap: 6px;
    min-height: calc(var(--toolbar-height) - 6px);
    margin-inline-end: 4px;
    padding: 0 10px;
    border-radius: 4px;
    color: var(--main-color);
    font: message-box;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.siteBackLink:hover {
    background-color: var(--toolbar-icon-hover-bg-color, rgb(0 0 0 / 0.1));
}

.siteBackLink:focus-visible {
    outline: 2px solid var(--progressBar-color, #0a84ff);
    outline-offset: -2px;
}

.siteBackExtra {
    display: none;
}

@media (min-width: 760px) {
    .siteBackExtra {
        display: inline;
    }
}

/* ---------- Notice (for example an invalid page number) ---------- */

.siteReaderNotice {
    position: absolute;
    inset-block-start: var(--toolbar-height);
    inset-inline: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    background: light-dark(#fff8d6, #3b3412);
    color: var(--main-color);
    border-bottom: 1px solid light-dark(#d4af37, #8a6d0b);
    font: message-box;
}

.siteReaderNotice[hidden],
.siteReaderFallback[hidden] {
    display: none;
}

.siteReaderNotice button {
    flex: none;
    min-width: 32px;
    min-height: 32px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.siteReaderNotice button:hover {
    background: light-dark(rgb(0 0 0 / 0.08), rgb(255 255 255 / 0.12));
}

.siteReaderNotice button:focus-visible {
    outline: 2px solid var(--progressBar-color, #0a84ff);
}

/* ---------- Fallback shown when the reader cannot open the document ---------- */

.siteReaderFallback {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--body-bg-color);
    color: var(--main-color);
    font: message-box;
}

.siteReaderFallbackBox {
    width: 100%;
    max-width: 520px;
    padding: 24px;
    border-radius: 12px;
    background: light-dark(#fff, #1f1f23);
    box-shadow: 0 2px 12px rgb(0 0 0 / 0.2);
}

.siteReaderFallbackBox h1 {
    margin: 0 0 8px;
    font-size: 1.25rem;
    line-height: 1.3;
}

.siteReaderFallbackBox h1:focus {
    outline: none;
}

.siteReaderFallbackBox p {
    margin: 0 0 16px;
    font-size: 1rem;
    line-height: 1.5;
}

.siteReaderActions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.siteReaderButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border: 1.5px solid var(--site-primary);
    border-radius: 10px;
    background: transparent;
    color: light-dark(var(--site-primary), #bcd0ff);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}

.siteReaderButton:hover {
    background: light-dark(rgb(30 58 138 / 0.08), rgb(188 208 255 / 0.12));
}

.siteReaderButton:focus-visible {
    outline: 3px solid var(--progressBar-color, #0a84ff);
    outline-offset: 2px;
}

.siteReaderButton--primary {
    background: var(--site-primary);
    color: #fff;
}

.siteReaderButton--primary:hover {
    background: #1E40AF;
    border-color: #1E40AF;
}

/* Features that need blob: images or a file picker (blob: images are not
   allowed by the site's Content-Security-Policy) or that make no sense in a
   read-only reader: the page-thumbnail sidebar, and opening other files. */
#viewsManagerToggleButton,
#viewsManager,
#secondaryOpenFile,
#viewsManagerAddFileButton {
    display: none !important;
}
