/* Visionneuse : scène fixe, diapositive 1600×900 mise à l'échelle, barre haute, contrôles, sommaire. */
.viewer { position: fixed; inset: 0; overflow: hidden; background: #0b1224; }
.stage { position: fixed; inset: 0; z-index: 1; overflow: hidden; background: radial-gradient(circle at 50% 42%, rgba(176, 141, 74, 0.12), transparent 46%), #0b1224; }
.deck { position: absolute; top: 50%; left: 50%; width: 1600px; height: 900px; transform-origin: center center; box-shadow: 0 34px 120px rgba(0, 0, 0, 0.55); will-change: transform; }

.progress { position: fixed; z-index: 80; top: 0; left: 0; right: 0; height: 3px; background: rgba(246, 243, 236, 0.1); }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brass-soft), var(--brass)); transition: width 0.3s ease; }

.top { position: fixed; z-index: 70; top: 16px; left: 18px; right: 18px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; height: 54px; padding: 0 10px 0 12px; border: 1px solid rgba(246, 243, 236, 0.14); border-radius: 14px; background: rgba(11, 18, 36, 0.78); backdrop-filter: blur(16px); color: var(--paper); transition: opacity 0.25s ease, transform 0.25s ease; }
.brand { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--paper); cursor: pointer; font: inherit; min-height: 44px; }
.brand:hover, .brand:focus-visible { background: rgba(246, 243, 236, 0.08); outline: 0; }
.brand img { height: 22px; width: auto; }
.brand span { padding-left: 12px; border-left: 1px solid rgba(246, 243, 236, 0.22); font-size: 10px; font-weight: 700; letter-spacing: 0.16em; color: var(--brass-soft); }
.context { display: flex; min-width: 0; align-items: center; justify-content: center; gap: 12px; }
.context b { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass-soft); }
.context span { max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--paper-on-ink); }
.actions { display: flex; align-items: center; gap: 6px; }
.actions a, .actions button { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 12px; border: 1px solid rgba(246, 243, 236, 0.14); border-radius: 9px; background: rgba(246, 243, 236, 0.04); color: var(--paper); font: inherit; font-size: 12px; font-weight: 600; text-decoration: none; cursor: pointer; }
.actions a:hover, .actions button:hover, .actions a:focus-visible, .actions button:focus-visible { border-color: rgba(201, 168, 106, 0.6); background: rgba(176, 141, 74, 0.18); outline: 0; }
.actions .pdf { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.actions .pdf:hover { background: #fff; }

.controls { position: fixed; z-index: 72; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; height: 50px; padding: 5px 8px; border: 1px solid rgba(246, 243, 236, 0.15); border-radius: 999px; background: rgba(11, 18, 36, 0.82); backdrop-filter: blur(16px); color: var(--paper); transition: opacity 0.25s ease, transform 0.25s ease; }
.controls button { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(246, 243, 236, 0.08); color: var(--paper); font-size: 18px; cursor: pointer; }
.controls button:hover, .controls button:focus-visible { background: rgba(176, 141, 74, 0.45); outline: 0; }
.controls button:disabled { opacity: 0.3; cursor: default; }
.count { display: grid; grid-template-columns: 28px 44px 28px; align-items: center; text-align: center; }
.count b { font-size: 13px; }
.count span { font-size: 11px; color: rgba(246, 243, 236, 0.55); }
.count i { height: 2px; border-radius: 2px; background: var(--brass); }

.zone { position: fixed; z-index: 10; top: 80px; bottom: 80px; width: 18%; border: 0; background: transparent; opacity: 0; cursor: pointer; }
.zone-prev { left: 0; cursor: w-resize; }
.zone-next { right: 0; cursor: e-resize; }
.zone:disabled { cursor: default; }

/* Sommaire */
.menu { position: fixed; inset: 0; z-index: 90; display: none; }
.menu.open { display: block; }
.menu-backdrop { position: absolute; inset: 0; background: rgba(11, 18, 36, 0.7); border: 0; cursor: pointer; }
.menu-panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(440px, 100vw); background: var(--paper); color: var(--ink); padding: 26px 24px; overflow: auto; box-shadow: 30px 0 80px rgba(0, 0, 0, 0.4); }
.menu-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.menu-head .kicker { font-size: 12px; }
.menu-close { border: 1px solid var(--line); background: var(--paper-light); border-radius: 8px; min-height: 40px; padding: 8px 12px; font: inherit; font-weight: 600; cursor: pointer; }
.menu-chapter { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass-deep); margin: 18px 0 6px; }
.menu-list button { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: baseline; width: 100%; text-align: left; padding: 10px 8px; border: 0; border-bottom: 1px solid var(--line); background: transparent; font: inherit; font-size: 15px; cursor: pointer; min-height: 44px; color: var(--ink); }
.menu-list button:hover, .menu-list button:focus-visible { background: rgba(176, 141, 74, 0.1); outline: 0; }
.menu-list button.active { font-weight: 650; }
.menu-list button i { font-family: var(--serif); font-style: normal; color: var(--brass-deep); }
.menu-foot { margin-top: 22px; font-size: 12px; color: var(--muted); line-height: 1.5; }

.skip { position: absolute; left: 12px; top: -80px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

/* Plein écran : la chrome s'efface */
.viewer.fullscreen .deck { box-shadow: none; }
.viewer.idle .top, .viewer.idle .controls { opacity: 0; pointer-events: none; }
.viewer.idle .top { transform: translateY(-8px); }
.viewer.idle .controls { transform: translate(-50%, 8px); }

/* Petits écrans : portrait, la diapositive est réduite ; un rappel discret */
.rotate { position: fixed; z-index: 60; left: 50%; bottom: 84px; transform: translateX(-50%); display: none; font-size: 12px; color: var(--paper-on-ink); background: rgba(11, 18, 36, 0.8); border: 1px solid rgba(246, 243, 236, 0.14); border-radius: 999px; padding: 8px 14px; white-space: nowrap; }
@media (max-width: 720px) and (orientation: portrait) { .rotate { display: block; } }
@media (max-width: 1000px) { .context { display: none; } .brand span { display: none; } }
@media (max-height: 520px) { .top { top: 8px; left: 10px; right: 10px; height: 44px; } .controls { bottom: 8px; height: 42px; } .controls button { width: 34px; height: 34px; } .actions a, .actions button { min-height: 32px; padding: 6px 10px; } }

@media (prefers-reduced-motion: reduce) { .progress span, .top, .controls { transition: none; } }

/* Mode rendu (PDF / captures) : toutes les diapositives à la suite, sans chrome */
body.render .viewer { position: static; overflow: visible; background: #fff; }
body.render .progress, body.render .top, body.render .controls, body.render .zone, body.render .menu, body.render .rotate { display: none !important; }
body.render .stage { position: static; overflow: visible; background: #fff; }
body.render .deck { position: static; width: 1600px; height: auto; transform: none !important; box-shadow: none; }
body.render .slide { position: relative; display: block; break-after: page; page-break-after: always; }
body.render .slide:last-child { break-after: auto; page-break-after: auto; }
@page { size: 1600px 900px; margin: 0; }
