/* Lecteur de BD (Cyberpunk RED) — styles communs à toutes les pages bd.html. */
:root { --bg:#0e0e0e; --surface:#131313; --line:rgba(225,29,72,0.28); --primary:#e11d48; --soft:#ffb3b6; --text:#e5e2e1; --muted:#a8a2a0; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: 'Space Grotesk', sans-serif;
  display: flex; flex-direction: column; overflow: hidden;
  background-image:
    linear-gradient(rgba(225,29,72,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(225,29,72,0.035) 1px, transparent 1px);
  background-size: 40px 40px;
}
/* Lignes CRT, derrière les planches */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.18) 0 1px, transparent 1px 3px);
}
header, .issues, main, footer { position: relative; z-index: 1; }
.material-symbols-outlined { font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; font-size: 22px; line-height: 1; }
.mono { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; }

/* Barre du haut */
header { flex: none; display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--primary); background: rgba(14,14,14,0.92); }
header nav { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); min-width: 0; }
header nav a { color: inherit; text-decoration: none; }
header nav a:hover { color: var(--soft); }
header nav .sep { color: rgba(225,29,72,0.6); }
header nav .here { color: var(--primary); }
header .title { font-weight: 700; letter-spacing: 0.12em; font-size: 15px; text-transform: uppercase; margin-left: auto; white-space: nowrap; }
header .title b { color: var(--primary); }
.tools { display: flex; gap: 6px; }
button { font: inherit; color: var(--soft); background: transparent; border: 1px solid var(--line); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 6px; border-radius: 0.25rem; }
button:hover:not(:disabled) { border-color: var(--primary); background: rgba(225,29,72,0.1); }
button:disabled { opacity: 0.3; cursor: default; }
button:focus-visible, .thumbs a:focus-visible, .issues a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
button[aria-pressed="true"] { background: rgba(225,29,72,0.18); border-color: var(--primary); }

/* Choix du numéro (masqué s'il n'y en a qu'un) */
.issues { flex: none; display: flex; gap: 6px; padding: 8px 16px; overflow-x: auto; border-bottom: 1px solid var(--line); background: rgba(14,14,14,0.85); scrollbar-width: thin; }
.issues[hidden] { display: none; }
.issues a { flex: none; display: flex; flex-direction: column; gap: 2px; padding: 6px 12px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; border-radius: 0.25rem; }
.issues a b { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.2em; color: var(--soft); }
.issues a span { font-size: 13px; font-weight: 500; white-space: nowrap; }
.issues a:hover { border-color: var(--primary); color: var(--text); }
.issues a[aria-current="true"] { border-color: var(--primary); background: rgba(225,29,72,0.15); color: var(--text); box-shadow: 3px 3px 0 0 rgba(225,29,72,0.55); }

/* Lecteur */
.stage { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; padding: 12px 64px; touch-action: pan-y pinch-zoom; }
.spread { height: 100%; width: 100%; min-width: 0; display: flex; justify-content: center; align-items: center; gap: 4px; }
.spread img { display: block; max-height: 100%; max-width: 100%; height: auto; width: auto; min-width: 0;
  border: 1px solid var(--line); background: #0a0a0a; box-shadow: 4px 4px 0 0 rgba(225,29,72,0.55); user-select: none; -webkit-user-drag: none; }
.spread.double img { max-width: calc(50% - 2px); }
.nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 88px; background: rgba(14,14,14,0.75); }
.nav-btn.prev { left: 10px; } .nav-btn.next { right: 10px; }
.nav-btn .material-symbols-outlined { font-size: 30px; }

/* Bas : compteur, séance, miniatures */
footer { flex: none; border-top: 1px solid var(--line); background: rgba(14,14,14,0.92); padding: 8px 16px; display: flex; align-items: center; gap: 16px; }
.counter { color: var(--soft); white-space: nowrap; min-width: 92px; }
.session { color: var(--primary); white-space: nowrap; min-width: 92px; }
.thumbs { display: flex; gap: 6px; overflow-x: auto; flex: 1; padding: 2px; scrollbar-width: thin; }
.thumbs a { flex: none; display: block; width: 40px; border: 1px solid var(--line); opacity: 0.45; transition: opacity .15s, border-color .15s; }
.thumbs a:hover { opacity: 0.85; }
.thumbs a[aria-current="true"] { opacity: 1; border-color: var(--primary); }
.thumbs a.cut { margin-left: 10px; position: relative; }
.thumbs a.cut::before { content: ""; position: absolute; left: -9px; top: 0; bottom: 0; width: 2px; background: var(--primary); }
.thumbs img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; }
.hint { color: rgba(168,162,160,0.6); white-space: nowrap; }

:fullscreen body, body:fullscreen { background: #000; }
@media (max-width: 767px) {
  header .title, .hint, .session, #btn-double { display: none; }
  header nav .sep:nth-of-type(-n+2), header nav a:nth-of-type(-n+2) { display: none; }
  .issues a span { display: none; }
  .stage { padding: 8px; }
  .nav-btn { display: none; }
}

/* Case par case : la case courante est cadrée, le reste de la planche est assombri */
.panel-frame { position: absolute; display: none; pointer-events: none; z-index: 2; box-shadow: 0 0 0 200vmax rgba(10,10,10,0.94); outline: 1px solid rgba(225,29,72,0.55); }
.bd-panels .panel-frame { display: block; }
.bd-panels .spread img { box-shadow: none; }
.bd-panels .nav-btn { z-index: 3; }
#spread.panel-anim { transition: transform .35s ease; }
.panel-frame.panel-anim { transition: left .35s ease, top .35s ease, width .35s ease, height .35s ease; }
.bd-panel-wait #spread, .bd-panel-wait .panel-frame { opacity: 0; }
.bd-panels #btn-zoom { display: none; }
@media (prefers-reduced-motion: reduce) { #spread.panel-anim, .panel-frame.panel-anim { transition: none; } }
