/* Catalogue à feuilleter (/catalogue/) : page à part, comme un PDF ouvert dans un nouvel onglet. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.cat-viewer {
  --cv-bg: #1B1E24; --cv-bar: #111317; --cv-line: rgba(255, 255, 255, .12); --cv-text: #F2F4F7; --cv-muted: #A9B0BB;
  background: radial-gradient(ellipse at 50% 40%, #2B3039 0%, var(--cv-bg) 70%); color: var(--cv-text);
  font-family: var(--font-body, system-ui, sans-serif); display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; overflow: hidden;
}
.cv-top { position: relative; z-index: 3; display: flex; align-items: center; gap: 16px; padding: 10px 18px; background: var(--cv-bar); border-bottom: 1px solid var(--cv-line); flex: none; }
.cv-logo { display: flex; align-items: center; color: inherit; text-decoration: none; flex: none; }
.cv-logo img { height: 38px; width: auto; display: block; }
.cv-title { flex: 1; min-width: 0; margin: 0; font-family: var(--font-head, inherit); font-size: 1.05rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--cv-muted); }
.cv-actions { display: flex; gap: 8px; flex: none; }
.cv-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--accent, #E2231A); background: var(--accent, #E2231A); color: var(--on-accent, #fff); font: inherit; font-weight: 600; font-size: .9375rem; text-decoration: none; cursor: pointer; white-space: nowrap; transition: filter .12s, border-color .12s; }
.cv-btn:hover { filter: brightness(1.08); }
.cv-btn.ghost { background: transparent; border-color: var(--cv-line); color: var(--cv-text); }
.cv-btn.ghost:hover { border-color: var(--cv-text); filter: none; }
.cv-btn svg { flex: none; }
.cv-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cv-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 16px 12px; }
.cv-book-wrap { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: center; }
.cv-page { background: #fff; overflow: hidden; }
.cv-page img { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; pointer-events: none; background: #fff; }
.cv-nav { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--cv-line); background: rgba(255, 255, 255, .06); color: var(--cv-text); display: grid; place-items: center; cursor: pointer; transition: background .12s, border-color .12s; }
.cv-nav:hover { background: rgba(255, 255, 255, .14); border-color: var(--cv-text); }
.cv-bar { position: relative; z-index: 3; flex: none; display: flex; align-items: center; justify-content: center; gap: 10px 14px; flex-wrap: wrap; padding: 10px 16px 14px; }
.cv-count { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 160px; text-align: center; }
.cv-go { display: flex; align-items: center; gap: 6px; }
.cv-go label { font-size: .875rem; color: var(--cv-muted); }
.cv-go input { width: 66px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--cv-line); background: rgba(255, 255, 255, .06); color: var(--cv-text); font: inherit; }
.cv-go input:focus { outline: none; border-color: var(--cv-text); }
.cv-small { min-height: 38px; padding: 0 14px; font-size: .875rem; }
.cv-msg { margin: auto; text-align: center; color: var(--cv-muted); padding: 24px; }
.cv-msg a { color: var(--cv-text); }
.cv-tip { margin: 0; width: 100%; text-align: center; color: var(--cv-muted); font-size: .8125rem; }
.cv-zoom { position: fixed; inset: 0; z-index: 50; background: rgba(8, 9, 12, .95); display: flex; flex-direction: column; }
.cv-zoom[hidden] { display: none; }
.cv-zoom-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; font-weight: 600; }
/* Agrandissement : les deux pages entières, aussi grandes que l'écran le permet ; un clic zoome davantage. */
.cv-zoom-body { flex: 1; min-height: 0; overflow: auto; padding: 0 12px 12px; }
.cv-spread { display: flex; justify-content: center; align-items: center; height: 100%; gap: 0; }
.cv-spread img { display: block; height: 100%; width: auto; max-width: 100%; object-fit: contain; background: #fff; cursor: zoom-in; box-shadow: 0 8px 30px rgba(0, 0, 0, .45); }
.cv-zoom-body.two .cv-spread img { max-width: 50%; }
.cv-zoom-body.closer .cv-spread { height: auto; width: max-content; min-width: 100%; }
.cv-zoom-body.closer .cv-spread img { height: auto; width: 1500px; max-width: none; cursor: zoom-out; }
.cv-zoom-body.two.closer .cv-spread img { width: 1300px; max-width: none; }
.cv-zoom-hint { color: var(--cv-muted); font-weight: 400; font-size: .875rem; margin-left: auto; margin-right: 12px; }
:focus-visible { outline: 3px solid var(--accent, #E2231A); outline-offset: 2px; }
@media (max-width: 760px) {
  .cv-top { gap: 10px; padding: 8px 12px; }
  .cv-title { display: none; }
  .cv-logo img { height: 30px; }
  .cv-actions { margin-left: auto; }
  .cv-btn { padding: 0 12px; min-height: 38px; font-size: .875rem; }
  .cv-btn.ghost span { display: none; }
  .cv-stage { padding: 8px 4px; gap: 4px; }
  .cv-nav { width: 36px; height: 36px; }
  .cv-go label, .cv-tip, [data-cv-full], .cv-zoom-hint { display: none; }
}
@media (max-width: 480px) {
  .cv-logo { display: none; }
  .cv-actions { gap: 6px; margin-left: 0; width: 100%; }
  .cv-btn.ghost { padding: 0 11px; }
  .cv-actions .cv-btn:not(.ghost) { margin-left: auto; }
}

/* Volet de gauche : recherche et sommaire */
.cv-main { flex-direction: row; }
.cv-reader { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.cv-side { flex: none; width: 320px; min-height: 0; display: flex; flex-direction: column; background: rgba(12, 14, 18, .72); border-right: 1px solid var(--cv-line); transition: margin-left .25s ease; }
body.cv-side-closed .cv-side { margin-left: -320px; visibility: hidden; transition: margin-left .25s ease, visibility 0s .25s; }
.cv-side-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px; }
.cv-search { flex: 1; min-width: 0; }
.cv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cv-search-box { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--cv-line); background: rgba(255, 255, 255, .06); }
.cv-search-box:focus-within { border-color: var(--cv-text); }
.cv-search-box svg { flex: none; color: var(--cv-muted); }
.cv-search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--cv-text); font: inherit; padding: 11px 0; }
.cv-search-box input::placeholder { color: var(--cv-muted); }
.cv-side-close { display: none; flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--cv-line); background: transparent; color: var(--cv-text); cursor: pointer; place-items: center; }
.cv-results, .cv-toc { flex: 1; min-height: 0; overflow: auto; padding: 0 8px 16px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }
.cv-results[hidden], .cv-toc[hidden] { display: none; }
.cv-results-head { margin: 4px 8px 10px; font-size: .875rem; color: var(--cv-muted); }
.cv-results ul, .cv-toc ul { list-style: none; margin: 0; padding: 0; }
.cv-side button[data-cv-goto] { width: 100%; display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--cv-text); font: inherit; font-size: .9rem; line-height: 1.3; cursor: pointer; }
.cv-side button[data-cv-goto]:hover { background: rgba(255, 255, 255, .08); }
.cv-side button[data-cv-goto].on { background: rgba(255, 255, 255, .12); box-shadow: inset 3px 0 0 var(--accent, #E2231A); }
.cv-pn { flex: none; min-width: 40px; color: var(--cv-muted); font-variant-numeric: tabular-nums; font-size: .8125rem; padding-top: 1px; }
.cv-results b { display: block; font-weight: 600; }
.cv-results small { display: block; margin-top: 3px; color: var(--cv-muted); font-size: .8125rem; line-height: 1.4; overflow-wrap: anywhere; }
.cv-results mark { background: #FFD94A; color: #16181D; border-radius: 3px; padding: 0 2px; }
.cv-toc details { border-bottom: 1px solid var(--cv-line); }
.cv-toc summary { list-style: none; cursor: pointer; padding: 11px 10px; font-weight: 600; font-size: .9375rem; display: flex; justify-content: space-between; align-items: center; }
.cv-toc summary::-webkit-details-marker { display: none; }
.cv-toc summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--cv-muted); border-bottom: 2px solid var(--cv-muted); transform: rotate(45deg); transition: transform .2s; margin-right: 4px; }
.cv-toc details[open] summary::after { transform: rotate(-135deg); }
.cv-toc ul { padding-bottom: 8px; }
@media (max-width: 1000px) {
  .cv-side { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: min(88vw, 360px); background: #14171C; box-shadow: 0 0 40px rgba(0, 0, 0, .5); }
  body.cv-side-closed .cv-side { margin-left: calc(-1 * min(88vw, 360px)); }
  .cv-side-close { display: grid; }
}
@media (max-width: 480px) {
  [data-cv-side-toggle] span { display: none; }
}
/* Deux pages affichées (double page) : lignes surlignées séparées par un petit espace. */
.cv-results ul, .cv-toc ul { display: grid; gap: 3px; }
