/* ============================================================
   Prest'EVENTS 85 — Viewer flipbook (chrome visiteur)
   DA "Édition claire" — identité logo : azur + jaune couronne,
   sur fond clair et aéré. Épuré, propre, moderne.
   ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
body {
  font-family: 'Outfit', system-ui, sans-serif;
  display: grid; grid-template-rows: auto 1fr auto; min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

/* ===== Thème clair (accordé au logo) ===== */
.theme-clair {
  --azur: #38A2F8;          /* bleu EXACT du logo */
  --azur-deep: #1E86E0;
  --azur-ink: #0F6CC0;
  --crown: #FBE34B;         /* jaune EXACT du logo */
  --crown-deep: #F2C800;
  --ink: #14283c;
  --ink-soft: #5b6f84;
  --paper: #ffffff;
  --bg: #eef4fb;
  --surface: #ffffff;
  --surface-2: #f6f9fd;
  --line: #e2eaf2;
  --line-strong: #d2deea;
  --serif: 'Archivo', sans-serif;
  --sans: 'Outfit', sans-serif;
  --script: 'Caveat', cursive;
  --shadow-sm: 0 1px 2px rgba(20,60,110,.06), 0 2px 8px rgba(20,60,110,.05);
  --shadow-md: 0 6px 24px rgba(20,60,110,.10);
  --book-shadow: 0 24px 60px rgba(15,55,105,.20), 0 6px 18px rgba(15,55,105,.12);
}

body {
  background:
    radial-gradient(1100px 620px at 50% -8%, #ffffff 0%, rgba(255,255,255,0) 60%),
    radial-gradient(900px 600px at 100% 110%, #e3eefb 0%, rgba(227,238,251,0) 55%),
    linear-gradient(180deg, #f3f8fd 0%, #e7f0f9 100%);
  color: var(--ink);
}

/* ===== TOPBAR ===== */
.topbar {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 16px;
  padding: 13px 26px;
  background: rgba(255,255,255,.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; justify-content: center; }
.brand img { width: 36px; height: 36px; object-fit: contain; }
.brand div { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--serif); font-weight: 800; font-size: 17px;
  color: var(--ink); letter-spacing: .01em; }
.brand-sub { font-family: var(--sans); font-size: 9px; font-weight: 600;
  letter-spacing: 0.34em; text-transform: uppercase; color: var(--azur); }

/* Bouton Sommaire (gauche) */
.topbtn {
  justify-self: start;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 9px 18px; cursor: pointer; transition: all .18s ease;
  box-shadow: var(--shadow-sm);
}
.topbtn .bars { color: var(--azur); font-size: 13px; transition: color .18s; }
.topbtn:hover { border-color: var(--azur); color: var(--azur-ink);
  box-shadow: 0 4px 16px rgba(46,155,238,.18); }

/* Groupe droite de la topbar */
.top-right { justify-self: end; display: flex; align-items: center; gap: 10px; }

/* Bouton PDF (droite) — CTA jaune couronne */
.pdf {
  font-family: var(--sans); font-size: 11px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  text-decoration: none; color: #3a2f00;
  background: var(--crown); border: 1px solid var(--crown-deep);
  border-radius: 999px; padding: 10px 20px;
  transition: all .18s ease; box-shadow: 0 4px 14px rgba(243,200,30,.28);
}
.pdf:hover { background: var(--crown-deep); transform: translateY(-1px);
  box-shadow: 0 7px 22px rgba(243,200,30,.42); }

/* ===== Sommaire — panneau clair ===== */
:root { --rail: 384px; }
.toc-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(18,40,60,.34); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .3s ease;
}
.toc-backdrop.show { opacity: 1; }
.toc-backdrop[hidden] { display: none; }

.toc-panel {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--rail); max-width: 88vw;
  background: var(--surface);
  border-right: 1px solid var(--line);
  z-index: 61; display: flex; flex-direction: column;
  box-shadow: 30px 0 70px rgba(15,55,105,.18);
  transform: translateX(-104%);
  transition: transform .42s cubic-bezier(.22,.61,.36,1);
}
.toc-panel.open { transform: translateX(0); }
.toc-panel[hidden] { display: none; }

/* ===== Desktop : sommaire docké, toujours ouvert ===== */
@media (min-width: 900px) {
  .topbar, .stage, .footbar { margin-left: var(--rail); }
  .toc-panel { transform: none; box-shadow: none; z-index: 9;
    background: var(--surface-2); }
  .toc-panel[hidden] { display: flex; }
  .toc-backdrop { display: none !important; }
  #toc-btn, #toc-fab, #toc-close { display: none; }
}

.toc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--line);
}
.toc-head .toc-title { display: flex; flex-direction: column; line-height: 1; }
.toc-head .toc-kicker { font-family: var(--script); font-size: 22px;
  color: var(--azur); font-weight: 700; }
.toc-head .toc-h { font-family: var(--serif); font-weight: 900; font-size: 23px;
  text-transform: uppercase; letter-spacing: .02em; color: var(--ink); margin-top: 2px; }
.toc-head button {
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--ink-soft); width: 34px; height: 34px; border-radius: 50%;
  font-size: 21px; cursor: pointer; line-height: 1; transition: all .15s;
  display: flex; align-items: center; justify-content: center;
}
.toc-head button:hover { color: var(--azur-ink); border-color: var(--azur); }

#toc-list { list-style: none; margin: 0; padding: 12px 14px 24px; overflow-y: auto; flex: 1;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
#toc-list::-webkit-scrollbar { width: 8px; }
#toc-list::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
#toc-list a {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; margin: 2px 0; border-radius: 12px;
  text-decoration: none; color: var(--ink);
  cursor: pointer; position: relative;
  transition: background .16s ease, transform .16s ease;
}
#toc-list a:hover { background: var(--surface-2); transform: translateX(2px); }
#toc-list a.active {
  background: rgba(46,155,238,.10);
  box-shadow: inset 3px 0 0 var(--crown-deep);
}
.toc-num { font-family: var(--serif); font-weight: 800; font-size: 14px;
  color: var(--azur); flex: none; width: 26px; font-variant-numeric: tabular-nums; }
#toc-list a.active .toc-num { color: var(--azur-ink); }
.toc-nm { flex: 1; font-family: var(--serif); font-weight: 600; font-size: 14.5px;
  text-transform: uppercase; letter-spacing: .01em; line-height: 1.15; color: var(--ink); }
.toc-meta { display: flex; flex-direction: column; align-items: flex-end; flex: none; gap: 2px; }
.toc-count { font-family: var(--sans); font-size: 8.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.toc-pg { font-family: var(--sans); font-size: 11px; font-weight: 600;
  color: var(--azur); letter-spacing: .04em; font-variant-numeric: tabular-nums; }

/* ===== FAB Sommaire flottant ===== */
.toc-fab {
  position: fixed; left: 22px; bottom: 86px; z-index: 40;
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-size: 11px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: #fff; background: var(--azur);
  border: 0; border-radius: 999px; padding: 13px 22px; cursor: pointer;
  box-shadow: 0 10px 26px rgba(46,155,238,.40);
  transition: transform .18s ease, box-shadow .18s ease, opacity .25s ease;
}
.toc-fab .bars { font-size: 14px; }
.toc-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(46,155,238,.52); }
.toc-fab.hidden-when-open { opacity: 0; pointer-events: none; transform: translateX(-20px); }

/* ===== Bloc-notes flottant & déplaçable ===== */
/* Bulle flottante (déclencheur des notes) — bas à droite, AU-DESSUS du pied de page */
.notes-fab {
  position: fixed; right: 24px; bottom: 70px; z-index: 75;
  display: flex; align-items: center; gap: 8px;
  background: var(--azur); color: #fff; border: 0; cursor: pointer;
  border-radius: 999px; padding: 13px 19px;
  font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 12px 30px rgba(15,55,105,.32); transition: transform .15s, background .15s;
}
.notes-fab:hover { background: var(--azur-deep); transform: translateY(-2px); }
.notes-fab .notes-fab-ico { font-size: 17px; line-height: 1; }
.notes-fab.is-open { transform: scale(.92); opacity: .7; }

/* Mini pop-up d'invitation, juste au-dessus de la bulle (flèche pointant vers elle) */
.notes-tip {
  position: fixed; right: 24px; bottom: 126px; z-index: 76;
  width: 256px; max-width: 78vw;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--azur); border-radius: 14px;
  padding: 12px 30px 12px 14px;
  box-shadow: 0 16px 40px rgba(15,55,105,.26);
  font-family: var(--sans); font-size: 12.5px; line-height: 1.5;
  animation: notesTipIn .25s ease;
}
.notes-tip[hidden] { display: none; }
.notes-tip p { margin: 0; }
.notes-tip::after {
  content: ""; position: absolute; right: 30px; bottom: -9px;
  border: 9px solid transparent; border-bottom: 0; border-top-color: var(--surface);
  filter: drop-shadow(0 1px 0 var(--azur));
}
.notes-tip-close {
  position: absolute; top: 6px; right: 8px; width: 22px; height: 22px;
  border: 0; background: transparent; color: var(--ink-soft); font-size: 18px;
  line-height: 1; cursor: pointer; border-radius: 50%;
}
.notes-tip-close:hover { color: var(--azur-ink); }
@keyframes notesTipIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.notes-win {
  position: fixed; right: 24px; bottom: 132px; z-index: 76;
  width: 340px; max-width: 92vw;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15,55,105,.28);
  display: flex; flex-direction: column; overflow: hidden;
}
.notes-win[hidden] { display: none; }
.notes-intro {
  margin: 0 0 10px; font-family: var(--sans); font-size: 12px; line-height: 1.5;
  color: var(--ink-soft); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
}
.notes-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 15px; cursor: move; user-select: none; touch-action: none;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.notes-title {
  font-family: var(--serif); font-weight: 800; font-size: 13px;
  letter-spacing: .03em; text-transform: uppercase; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.notes-title .dot { color: var(--crown-deep); }
.notes-head button {
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--ink-soft); width: 28px; height: 28px; border-radius: 50%;
  font-size: 17px; line-height: 1; cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center;
}
.notes-head button:hover { color: var(--azur-ink); border-color: var(--azur); }
.notes-body { padding: 12px 13px 4px; }
.notes-ta {
  width: 100%; height: 190px; min-height: 90px; resize: vertical;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 11px;
  font-family: var(--sans); font-size: 13px; line-height: 1.55; outline: none;
}
.notes-ta::placeholder { color: var(--ink-soft); }
.notes-ta:focus { border-color: var(--azur); }
.notes-foot { display: flex; align-items: center; gap: 8px; padding: 10px 13px 13px; flex-wrap: wrap; }
.notes-foot button {
  font-family: var(--sans); font-size: 10.5px; font-weight: 600;
  letter-spacing: .03em; color: #fff; background: var(--azur);
  border: 0; border-radius: 999px; padding: 7px 13px; cursor: pointer; transition: all .15s;
}
.notes-foot button:hover { background: var(--azur-deep); }
.notes-foot button.ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line-strong); }
.notes-foot button.ghost:hover { color: var(--azur-ink); border-color: var(--azur); }
.notes-foot .saved {
  margin-left: auto; font-family: var(--sans); font-size: 10px;
  letter-spacing: .06em; color: var(--azur-ink); min-height: 12px;
}

/* ===== STAGE ===== */
.stage {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 28px 76px; min-height: 0;
}
#book { max-width: 100%; max-height: 100%; filter: drop-shadow(var(--book-shadow)); }
.pf-page { background: var(--paper); overflow: hidden; }
.pf-page img { width: 100%; height: 100%; display: block; object-fit: fill; }

.nav-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--surface); color: var(--azur-ink);
  border: 1px solid var(--line-strong);
  font-size: 27px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .16s ease; z-index: 5; font-family: serif;
  box-shadow: var(--shadow-md);
}
.nav-arrow:hover { background: var(--azur); color: #fff; border-color: var(--azur);
  box-shadow: 0 8px 22px rgba(46,155,238,.42); }
.nav-prev { left: 16px; }
.nav-next { right: 16px; }

/* ===== FOOTBAR ===== */
.footbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 28px;
  background: rgba(255,255,255,.82); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.page-indicator {
  font-family: var(--serif); font-weight: 700; font-size: 16px; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.page-indicator em { color: var(--azur); font-style: normal; margin: 0 7px; }
.hint {
  font-family: var(--sans); font-size: 10px; font-weight: 500;
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-soft);
}

/* ===== LOADER ===== */
.loader {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(900px 600px at 50% 4%, #ffffff 0%, rgba(255,255,255,0) 60%),
    linear-gradient(180deg, #f3f8fd 0%, #e7f0f9 100%);
  transition: opacity .35s;
}
.loader-inner { text-align: center; }
.loader-crown {
  width: 76px; height: auto; display: block; margin: 0 auto 22px;
  transform-origin: center bottom;
  animation: crown-rise 1.8s ease-in-out infinite;
  filter: drop-shadow(0 8px 16px rgba(243,200,30,.35));
}
.loader-crown .crown-fill { fill: var(--crown); }
.loader-crown .crown-shine { fill: #fff; opacity: .35;
  animation: crown-shine 1.8s ease-in-out infinite; }
@keyframes crown-rise {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-7px) scale(1.04); }
}
@keyframes crown-shine {
  0%, 100% { opacity: .15; }
  50% { opacity: .5; }
}
.loader-text { font-family: var(--script); font-size: 30px; color: var(--ink); margin: 0; }
.loader-progress {
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--azur); margin: 14px 0 0; font-variant-numeric: tabular-nums;
}

/* ===== MOBILE ===== */
@media (max-width: 720px) {
  .topbar { grid-template-columns: auto 1fr; padding: 11px 14px; gap: 8px; }
  .topbar .brand { display: none; }
  .pdf { font-size: 9.5px; letter-spacing: 0.1em; padding: 9px 14px; }
  .topbtn { font-size: 9.5px; letter-spacing: 0.12em; padding: 9px 13px; }
  .toc-panel { width: 100%; max-width: 100%; }
  .toc-fab { left: 14px; bottom: 74px; font-size: 9.5px; padding: 11px 17px; }
  .toc-head .toc-h { font-size: 20px; }
  .stage { padding: 12px 50px; }
  .nav-arrow { width: 42px; height: 42px; font-size: 23px; }
  .nav-prev { left: 6px; }
  .nav-next { right: 6px; }
  .footbar { padding: 10px 14px; }
  .hint { display: none; }
  .top-right { gap: 7px; }
  .notes-fab { right: 14px; bottom: 62px; padding: 11px 15px; font-size: 11px; }
  .notes-fab .notes-fab-lbl { display: none; }
  .notes-fab .notes-fab-ico { font-size: 18px; }
  .notes-tip { right: 14px; bottom: 116px; width: 230px; }
  .notes-win { right: 8px; left: 8px; width: auto; bottom: 120px; }
  .notes-ta { height: 150px; }
}


/* ===================== Recherche plein texte ===================== */
.search-wrap { position: relative; justify-self: end; display: flex; align-items: center; }
.search-ico {
  position: absolute; left: 12px; font-size: 12px; opacity: .55; pointer-events: none;
}
.search-input {
  font-family: var(--sans); font-size: 13px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 9px 32px 9px 32px; width: 210px;
  transition: all .18s ease; box-shadow: var(--shadow-sm);
}
.search-input::placeholder { color: #9aa7b1; }
.search-input:focus {
  outline: none; border-color: var(--azur); width: 260px;
  box-shadow: 0 0 0 3px rgba(56,162,248,.16);
}
.search-clear {
  position: absolute; right: 10px; border: 0; background: none; cursor: pointer;
  font-size: 18px; line-height: 1; color: #9aa7b1; padding: 0 2px;
}
.search-clear:hover { color: var(--azur-ink); }
.search-results {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  width: min(420px, 92vw); max-height: min(460px, 62vh); overflow-y: auto;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 14px;
  box-shadow: 0 18px 44px rgba(15,40,70,.18); padding: 6px;
}
.search-info { padding: 12px 14px; font-family: var(--sans); font-size: 12.5px; color: #6b7a86; }
.search-hit {
  display: flex; gap: 10px; align-items: flex-start; width: 100%;
  padding: 9px 11px; border: 0; border-radius: 10px; background: none;
  text-align: left; cursor: pointer; font-family: var(--sans);
}
.search-hit:hover, .search-hit:focus-visible { background: #f2f8ff; outline: none; }
.search-hit .pg {
  flex: 0 0 auto; font-size: 11px; font-weight: 800; letter-spacing: .06em;
  color: #fff; background: var(--azur); border-radius: 999px; padding: 3px 9px; margin-top: 1px;
}
.search-hit .sn { font-size: 12.5px; line-height: 1.45; color: var(--ink); }
.search-hit .sn mark { background: var(--crown, #FBE34B); color: inherit; padding: 0 2px; border-radius: 3px; }
@media (max-width: 860px) {
  .search-input { width: 150px; }
  .search-input:focus { width: 190px; }
}


/* --- resultats enrichis (produit) --- */
.search-hit { align-items: center; }
.sr-th {
  flex: 0 0 auto; width: 42px; height: 42px; object-fit: contain;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 2px;
}
.sr-noimg { display: inline-block; background: #f3f6f9; }
.sr-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.sr-nm { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.sr-cat { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #8b98a4; }
.sr-price { font-size: 11.5px; font-weight: 700; color: var(--azur-ink); }
.sr-price i { font-style: normal; font-weight: 500; color: #8b98a4; }
.sr-sep { color: #c8d2da; }
.sr-devis { font-style: italic; color: #8b98a4; font-weight: 600; }
