.public-page :focus-visible {
  outline: 3px solid #d4af37;
  outline-offset: 2px;
}

.public-page button:disabled,
.public-page [aria-disabled="true"] {
  cursor: default;
  opacity: 0.4;
}

.public-status {
  color: #5a6a6a;
  padding: 12px;
  text-align: center;
}

.public-status[data-state="error"] {
  color: #9b3131;
}

.public-retry {
  margin-left: 8px;
}

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

/* Only the editorial HTML policy emits this restricted video class. */
iframe.editorial-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 12px;
  margin: 20px 0;
}

/* Quill 2 uses flat ol markup for mixed lists and ql-indent-* for depth.
   Separate counters match its ordered-only increments without changing native
   ol/ul counters, start/value attributes or actual nested HTML lists. */
:is(.texte-original, .resume-content, .editorial-body, .reader-passage) {
  counter-reset: editorial-list-0 editorial-list-1 editorial-list-2 editorial-list-3 editorial-list-4 editorial-list-5 editorial-list-6 editorial-list-7 editorial-list-8;
}

:is(.texte-original, .resume-content, .editorial-body, .reader-passage) :is(p, h1, h2, h3, h4, h5, h6) {
  counter-set: editorial-list-0 editorial-list-1 editorial-list-2 editorial-list-3 editorial-list-4 editorial-list-5 editorial-list-6 editorial-list-7 editorial-list-8;
}

.public-page li[data-list] {
  --editorial-list-counter: editorial-list-0;
  --editorial-list-style: decimal;
  --editorial-list-depth: 0;
  --editorial-list-children: editorial-list-1 editorial-list-2 editorial-list-3 editorial-list-4 editorial-list-5 editorial-list-6 editorial-list-7 editorial-list-8;
  counter-set: var(--editorial-list-children);
  margin-inline-start: calc(var(--editorial-list-depth) * 3em);
}

.public-page li[data-list="ordered"] {
  counter-increment: var(--editorial-list-counter);
}

.public-page li[data-list="ordered"]::marker {
  content: counter(var(--editorial-list-counter), var(--editorial-list-style)) ". ";
}

.public-page li[data-list="bullet"] { list-style-type: disc; }
.public-page li[data-list="checked"]::marker { content: "☑ "; }
.public-page li[data-list="unchecked"]::marker { content: "☐ "; }

.public-page li[data-list].ql-indent-1 {
  --editorial-list-counter: editorial-list-1;
  --editorial-list-style: lower-alpha;
  --editorial-list-depth: 1;
  --editorial-list-children: editorial-list-2 editorial-list-3 editorial-list-4 editorial-list-5 editorial-list-6 editorial-list-7 editorial-list-8;
}

.public-page li[data-list].ql-indent-2 {
  --editorial-list-counter: editorial-list-2;
  --editorial-list-style: lower-roman;
  --editorial-list-depth: 2;
  --editorial-list-children: editorial-list-3 editorial-list-4 editorial-list-5 editorial-list-6 editorial-list-7 editorial-list-8;
}

.public-page li[data-list].ql-indent-3 {
  --editorial-list-counter: editorial-list-3;
  --editorial-list-style: decimal;
  --editorial-list-depth: 3;
  --editorial-list-children: editorial-list-4 editorial-list-5 editorial-list-6 editorial-list-7 editorial-list-8;
}

.public-page li[data-list].ql-indent-4 {
  --editorial-list-counter: editorial-list-4;
  --editorial-list-style: lower-alpha;
  --editorial-list-depth: 4;
  --editorial-list-children: editorial-list-5 editorial-list-6 editorial-list-7 editorial-list-8;
}

.public-page li[data-list].ql-indent-5 {
  --editorial-list-counter: editorial-list-5;
  --editorial-list-style: lower-roman;
  --editorial-list-depth: 5;
  --editorial-list-children: editorial-list-6 editorial-list-7 editorial-list-8;
}

.public-page li[data-list].ql-indent-6 {
  --editorial-list-counter: editorial-list-6;
  --editorial-list-style: decimal;
  --editorial-list-depth: 6;
  --editorial-list-children: editorial-list-7 editorial-list-8;
}

.public-page li[data-list].ql-indent-7 {
  --editorial-list-counter: editorial-list-7;
  --editorial-list-style: lower-alpha;
  --editorial-list-depth: 7;
  --editorial-list-children: editorial-list-8;
}

.public-page li[data-list].ql-indent-8 {
  --editorial-list-counter: editorial-list-8;
  --editorial-list-style: lower-roman;
  --editorial-list-depth: 8;
  --editorial-list-children: none;
}

/* Match Quill's fallback only where counter-set is unavailable: combining set
   and reset would create new counter scopes and break deeper-level restarts. */
@supports not (counter-set: none) {
  :is(.texte-original, .resume-content, .editorial-body, .reader-passage) :is(p, h1, h2, h3, h4, h5, h6) {
    counter-reset: editorial-list-0 editorial-list-1 editorial-list-2 editorial-list-3 editorial-list-4 editorial-list-5 editorial-list-6 editorial-list-7 editorial-list-8;
  }
  .public-page li[data-list] {
    counter-reset: var(--editorial-list-children);
  }
}
