/* Lecteur autonome : cette feuille ne s'applique jamais aux pages City Hall. */
:root { color-scheme: dark; }
* { box-sizing: border-box; }
html, body {
    margin: 0; min-height: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #062f27; color: #f7faf8;
}
body { min-height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }

/* En-tete : retour dans le meme onglet, PDF original dans un nouvel onglet. */
.wzpv-reader-header {
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    padding: 14px clamp(14px, 3vw, 36px); background: #03271f;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.wzpv-reader-brand { min-width: 0; }
.wzpv-reader-kicker {
    margin: 0 0 4px; color: #e8c77d; font-size: .7rem;
    font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.wzpv-reader-title {
    margin: 0; color: #fff; overflow-wrap: anywhere;
    font: 700 clamp(1rem, 2.2vw, 1.45rem)/1.25 Georgia, "Times New Roman", serif;
}
.wzpv-reader-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.wzpv-reader-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    min-height: 44px; padding: 9px 13px; border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 9px; background: rgba(255, 255, 255, .08); color: #fff;
    text-decoration: none; font-size: .85rem; font-weight: 700; cursor: pointer;
}
.wzpv-reader-btn:hover:not(:disabled), .wzpv-reader-btn:focus-visible {
    background: rgba(255, 255, 255, .16); color: #fff;
}
.wzpv-reader-btn:focus-visible { outline: 3px solid #e8c77d; outline-offset: 3px; }
.wzpv-reader-btn:disabled { cursor: default; opacity: .45; }

/* Les images sont rendues en PNG et ne sont jamais recadrees. */
.wzpv-reader-main {
    width: 100%; max-width: 1400px; margin: 0 auto;
    padding: 18px clamp(8px, 2vw, 28px) 24px; flex: 1; display: flex; flex-direction: column;
}
.wzpv-reader-toolbar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 0 auto 12px; }
.wzpv-reader-status { color: #d5e5dd; font-size: .85rem; min-width: 120px; text-align: center; }
.wzpv-reader-stage { width: 100%; flex: 1; min-height: 340px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#wzpv-book { width: 100%; max-width: 1120px; height: min(72vh, 780px); min-height: 360px; margin: 0 auto; }
.wzpv-book-page { position: relative; background: #fff; color: #222; overflow: hidden; }
.wzpv-book-image { display: none; width: 100%; height: 100%; object-fit: contain; background: #fff; user-select: none; pointer-events: none; }
.wzpv-book-page.is-rendered .wzpv-book-image { display: block; }
.wzpv-page-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; color: #52625b; font-size: .9rem; text-align: center; }
#wzpv-book.wzpv-single-page { width: 100%; max-width: 600px; height: auto; min-height: 0; }
.wzpv-single-page .wzpv-book-page { width: 100%; }
.wzpv-single-page .wzpv-book-image { position: absolute; inset: 0; }
.wzpv-reader-progress { max-width: 1120px; width: 100%; margin: 10px auto 0; min-height: 1.4em; text-align: center; color: #cfdfd7; font-size: .85rem; }
.wzpv-reader-fallback { max-width: 720px; margin: 28px auto; padding: 22px; background: #fffdf8; color: #173f35; border-radius: 12px; text-align: center; }
.wzpv-reader-fallback a { color: #075b49; font-weight: 700; }
.wzpv-reader-footer { padding: 0 16px 14px; color: #a9c3b8; text-align: center; font-size: .75rem; }
.wzpv-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 700px) {
    .wzpv-reader-header { align-items: flex-start; flex-direction: column; gap: 10px; }
    .wzpv-reader-header-actions { width: 100%; justify-content: flex-start; }
    .wzpv-reader-main { padding: 10px 4px 18px; }
    .wzpv-reader-toolbar { margin-bottom: 6px; gap: 7px; }
    .wzpv-reader-toolbar .wzpv-reader-btn { min-height: 44px; min-width: 44px; }
    .wzpv-reader-status { min-width: 85px; font-size: .78rem; }
    #wzpv-book { height: min(72dvh, 760px); min-height: 300px; }
    .wzpv-reader-stage { min-height: 0; }
    .wzpv-reader-progress { padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; }
}
