/* ==========================================================================
   Contenu des fiches (pages/…/*.html chargées dans le lecteur)
   ========================================================================== */

.content { font-size: 1.02rem; }

/* Documents : rangée défilante, quelle que soit leur quantité */
.docs { margin: 0 -1.5rem 1.75rem; }
.docs-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 1.5rem .6rem;
  font-size: 1rem;
}
.docs-count { font-size: .85rem; font-weight: 500; color: var(--text-muted); }
.docs-nav { display: none; margin-left: auto; gap: .25rem; }
.docs-nav .icon-btn { width: 2rem; height: 2rem; border: 1px solid var(--line); border-radius: 50%; }
.docs-nav .flip { transform: scaleX(-1); }
@media (hover: hover) and (pointer: fine) { .docs-nav { display: inline-flex; } }
.doc-list {
  display: flex;
  gap: .6rem;
  padding: 0 1.5rem .35rem;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 1.5rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.doc-list li { flex: none; scroll-snap-align: start; }
.doc {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .55rem;
  width: 9.5rem;
  height: 100%;
  min-height: 6.25rem;
  padding: .75rem .8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-deep);
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
  font-size: .88rem;
  font-weight: 500;
}
.doc:hover { border-color: var(--c, var(--accent)); }
.doc-name {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.doc-type {
  flex: none;
  padding: .2rem .4rem;
  border-radius: var(--radius-s);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font: 700 .7rem/1 var(--font-body);
  letter-spacing: .03em;
}
.doc[href$=".ppt"] .doc-type,
.doc[href$=".pptx"] .doc-type { background: color-mix(in srgb, var(--wait) 16%, transparent); color: var(--wait); }

/* Un seul document : carte pleine largeur, inutile de faire défiler */
.docs.single .doc { flex-direction: row; align-items: center; width: auto; min-height: 0; }
.docs.single .doc-list li { flex: 1; }

@media (max-width: 640px) {
  .docs { margin-inline: -1rem; }
  .docs-title { margin-inline: 1rem; }
  .doc-list { padding-inline: 1rem; scroll-padding-inline: 1rem; }
}

.page-note { margin-top: 1rem; color: var(--text-muted); max-width: 60ch; }

/* Intertitres */
.topic {
  margin: 2.25rem 0 .25rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--line-strong);
  font-size: 1.15rem;
  font-weight: 700;
}
.entries > .topic:first-child, .filter-empty + .topic { margin-top: 0; }
.topic-icon { display: none; }

/* Fiches */
.entry {
  border-bottom: 1px solid var(--line);
}
.entry > summary,
.entry-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .15rem .75rem;
  padding: .8rem 2.25rem .8rem 0;
  list-style: none;
}
.entry > summary { cursor: pointer; }
.entry > summary::-webkit-details-marker { display: none; }
.entry > summary::after {
  content: "";
  position: absolute;
  right: .5rem;
  top: 1.15rem;
  width: .55rem; height: .55rem;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform .15s;
}
.entry[open] > summary::after { transform: rotate(-135deg); top: 1.35rem; }
.entry > summary:hover .entry-term { color: var(--accent); }

.entry-term {
  font-weight: 600;
  line-height: 1.35;
}
.entry-def { color: var(--text-muted); }

/* Priorités : marque dans la marge gauche */
.entry[data-priority] { padding-left: .9rem; margin-left: -.9rem; border-left: 3px solid transparent; }
.entry[data-priority="essentiel"] { border-left-color: var(--accent); }
.entry[data-priority="important"] { border-left-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.entry[data-priority="essentiel"] .entry-term::after {
  content: "Essentiel";
  margin-left: .6rem;
  padding: .15rem .45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font: 600 .72rem/1 var(--font-body);
  vertical-align: .15em;
}

.entry-body {
  max-width: 68ch;
  padding: 0 0 1.1rem;
  color: var(--text);
}
.entry-body > * + * { margin-top: .6rem; }
.entry-body ul, .entry-body ol { padding-left: 1.3rem; }
.entry-body li + li { margin-top: .25rem; }
.entry-body strong { font-weight: 700; }
.entry-body img {
  display: block;
  max-width: min(100%, 22rem);
  margin: 1rem 0;
  border-radius: var(--radius);
  background: #fff;
}
.entry-body table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.entry-body th, .entry-body td { padding: .4rem .6rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }

.entry.flash { animation: flash 2.4s var(--ease); }
@keyframes flash {
  0%, 60% { background: color-mix(in srgb, var(--accent) 22%, transparent); }
  100% { background: transparent; }
}

.filter-empty { padding: 1rem 0; color: var(--text-muted); }

/* Ancienne mise en forme éventuellement restée dans une page */
.content .italic { font-style: italic; }

.entry-body .important { color: var(--accent); font-weight: 700; }

/* Document en cours de téléchargement (contenu protégé) */
.doc { position: relative; overflow: hidden; }
.doc.is-loading { cursor: progress; border-color: var(--accent); }
.doc.is-loading::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  width: var(--progress, 0%);
  background: var(--accent);
  transition: width .2s;
}
.entry-body img.is-missing { min-height: 2rem; background: var(--surface-2); }

/* Silhouette animée pendant le chargement d'une fiche */
.skeleton { display: grid; gap: .9rem; padding-block: .5rem; }
.sk {
  display: block;
  border-radius: 8px;
  background: linear-gradient(100deg, var(--surface-2) 30%, color-mix(in srgb, var(--surface-2) 55%, var(--line-strong)) 50%, var(--surface-2) 70%);
  background-size: 300% 100%;
  animation: sk-shimmer 1.3s ease-in-out infinite;
}
.sk-docs { display: flex; gap: .6rem; overflow: hidden; }
.sk-doc { flex: none; width: 11rem; height: 3.4rem; border-radius: 12px; }
.sk-card { display: grid; gap: .55rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius, 14px); }
.sk-title { width: 38%; height: 1.2rem; }
.sk-line { height: .75rem; }
.sk-card:nth-child(3) .sk, .sk-card:nth-child(4) .sk { animation-delay: .12s; }
.sk-card:nth-child(5) .sk { animation-delay: .24s; }
@keyframes sk-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
