/* ACTA Ingesta flipbook reader (/lecteur/numero-N): our own page-turning reader for the PDFs, served entirely
   from ingesta.net. Pages are the PDF rendered without its text + the text as SVG at the PDF's coordinates. */

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/poppins-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/poppins-latin-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/poppins-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "DM Serif Display";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/fonts/dm-serif-display-fr-40f3f9b3.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/fonts/playfair-display-wordmark-4df4c523.woff2") format("woff2");
  unicode-range: U+0000-00FF;
}
@font-face {
  font-family: "Play";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/fonts/play-number-770bf567.woff2") format("woff2");
  unicode-range: U+0000-00FF;
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/fonts/open-sans-digits-2c4bff1c.woff2") format("woff2");
  unicode-range: U+0030-0039;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #ececec;
  color: #1f2937;
  font-family: Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 400;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- stage ---------- */

.fb {
  --fb-ink: #1f2937;
  --fb-muted: #6b7280;
  --fb-panel: #fff;
  --fb-accent: #004e82;
  --fb-radius: 12px;
  height: 100%;
}

.fb-stage {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 62%),
    linear-gradient(118deg, transparent 54%, rgba(0, 78, 130, 0.025) 54%, rgba(0, 78, 130, 0.025) 76%, transparent 76%),
    linear-gradient(160deg, #f6f6f6 0%, #ececec 55%, #e3e3e3 100%);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.fb-stage.is-pseudo-fs {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.fb-viewport {
  position: absolute;
  inset: 24px 0 64px;
  overflow: hidden;
}

.fb-pan {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
}

.fb-book {
  width: 100%;
  height: 100%;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  transition: transform 0.55s cubic-bezier(0.4, 0.1, 0.2, 1);
}

.fb-book .stf__wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.fb-book .stf__block {
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.18));
}

.fb-page {
  position: relative;
  overflow: hidden;
  background: #f9f9f9;
}

.fb-bg,
.fb-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.fb-bg {
  object-fit: fill;
  -webkit-user-drag: none;
  user-select: none;
}

.fb-text {
  overflow: hidden;
}

.fb-text text {
  white-space: pre;
}

.fb-text a rect {
  fill: transparent;
  cursor: pointer;
}

/* depth: the paper darkens towards the spine of an open spread */
.fb-book .--left::after,
.fb-book .--right::after {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 9%;
  content: "";
  pointer-events: none;
}

.fb-book .--left::after {
  right: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.04) 35%, rgba(0, 0, 0, 0));
}

.fb-book .--right::after {
  left: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.035) 35%, rgba(0, 0, 0, 0));
}

.fb.is-portrait .fb-book .--left::after,
.fb.is-portrait .fb-book .--right::after,
.fb-book [data-density="hard"]::after {
  display: none;
}

/* edges: the stack of pages already read (left) and still to read (right) beside the open book */
.fb-edges {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  transition: transform 0.55s cubic-bezier(0.4, 0.1, 0.2, 1);
}

.fb-edge {
  position: absolute;
  top: 3px;
  bottom: 3px;
  width: 0;
  background: repeating-linear-gradient(90deg, #fbfbfb 0 1px, #d6d6d6 1px 2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
  transition: width 0.3s ease;
}

.fb-edge-l {
  right: 100%;
  border-radius: 2px 0 0 2px;
}

.fb-edge-r {
  left: 100%;
  border-radius: 0 2px 2px 0;
}

.fb.is-zoomed .fb-edges,
.fb.is-zoomed .fb-book {
  transition: none;
}

/* ---------- controls ---------- */

.fb-toolbar {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 20;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: var(--fb-panel);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 14px rgba(0, 0, 0, 0.08);
}

.fb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--fb-ink);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, opacity 0.2s ease;
}

.fb-btn:hover {
  background: #f1f3f5;
}

.fb-btn:focus-visible {
  outline: 2px solid var(--fb-accent);
  outline-offset: -2px;
}

.fb-btn svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fb-btn[aria-pressed="true"] {
  background: #e7f1f8;
  color: var(--fb-accent);
}

.fb-btn .i-alt {
  display: none;
}

.fb-btn.is-alt .i-main {
  display: none;
}

.fb-btn.is-alt .i-alt {
  display: block;
}

.fb-nav {
  position: absolute;
  top: 50%;
  z-index: 15;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.15s ease;
}

.fb-nav:hover {
  background: #fff;
}

.fb-prev {
  left: 14px;
}

.fb-next {
  right: 14px;
}

.fb-stage:hover .fb-nav,
.fb-stage:focus-within .fb-nav {
  opacity: 1;
}

.fb-nav[disabled] {
  opacity: 0 !important;
  pointer-events: none;
}

.fb-foot {
  position: absolute;
  right: 0;
  bottom: 16px;
  left: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 22px;
}

.fb-count {
  min-width: 5.5rem;
  color: var(--fb-muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.fb-slider {
  width: min(700px, 62%);
  height: 24px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.fb-slider:focus-visible {
  outline: 2px solid var(--fb-accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.fb-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
  background: #d3d4d7;
}

.fb-slider::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: #d3d4d7;
}

.fb-slider::-webkit-slider-thumb {
  width: 84px;
  height: 8px;
  border-radius: 4px;
  background: #6c6f75;
  -webkit-appearance: none;
  appearance: none;
}

.fb-slider::-moz-range-thumb {
  width: 84px;
  height: 8px;
  border: 0;
  border-radius: 4px;
  background: #6c6f75;
}

.fb-toc {
  position: absolute;
  top: 70px;
  right: 22px;
  bottom: 64px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  width: min(300px, calc(100% - 44px));
  border-radius: var(--fb-radius);
  background: var(--fb-panel);
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.16);
}

.fb-toc[hidden] {
  display: none;
}

.fb-toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px 6px 18px;
  color: var(--fb-muted);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.fb-toc-head .fb-btn {
  width: 34px;
  height: 34px;
}

.fb-toc-head .fb-btn svg {
  width: 20px;
  height: 20px;
}

.fb-toc-list {
  margin: 0;
  padding: 2px 8px 10px;
  overflow-y: auto;
  list-style: none;
}

.fb-toc-list button {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--fb-ink);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.fb-toc-list button:hover {
  background: #f1f3f5;
}

.fb-toc-list button.is-current {
  background: #e7f1f8;
  color: var(--fb-accent);
}

.fb-toc-list .pg {
  flex: none;
  color: var(--fb-muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

/* drag layer used while zoomed: owns the pointer so the page does not turn under the finger */
.fb-pan-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  cursor: grab;
  touch-action: none;
}

.fb.is-zoomed .fb-pan-layer {
  display: block;
}

.fb.is-dragging .fb-pan-layer {
  cursor: grabbing;
}

/* before the script runs (or without it): the pages simply stack and scroll */
.fb:not(.is-ready) .fb-toolbar,
.fb:not(.is-ready) .fb-foot,
.fb:not(.is-ready) .fb-nav,
.fb:not(.is-ready) .fb-toc,
.fb:not(.is-ready) .fb-edges {
  display: none;
}

.fb:not(.is-ready) .fb-stage {
  overflow-y: auto;
}

.fb:not(.is-ready) .fb-viewport,
.fb:not(.is-ready) .fb-pan {
  position: static;
}

.fb:not(.is-ready) .fb-book {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  height: auto;
  padding: 20px 12px;
}

.fb:not(.is-ready) .fb-page {
  width: min(100%, 720px);
  aspect-ratio: var(--fb-ratio, 0.7071);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  .fb-viewport {
    inset: 64px 0 54px;
  }

  .fb-toolbar {
    top: 10px;
    right: 10px;
  }

  .fb-btn {
    width: 38px;
    height: 38px;
  }

  .fb-nav {
    width: 38px;
    height: 38px;
    margin-top: -19px;
    opacity: 0.9;
  }

  .fb-prev {
    left: 6px;
  }

  .fb-next {
    right: 6px;
  }

  .fb-foot {
    bottom: 12px;
    gap: 10px;
    padding: 0 12px;
  }

  .fb-count {
    min-width: 4.4rem;
    font-size: 0.75rem;
  }

  .fb-slider {
    width: 58%;
  }

  .fb-slider::-webkit-slider-thumb {
    width: 56px;
  }

  .fb-slider::-moz-range-thumb {
    width: 56px;
  }

  .fb-toc {
    top: 56px;
    right: 10px;
    bottom: 54px;
    width: calc(100% - 20px);
  }
}

@media (hover: none) {
  .fb-nav {
    opacity: 0.9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fb-book,
  .fb-edges,
  .fb-edge,
  .fb-nav {
    transition: none;
  }
}
