/* ============================================================
   BIBLIOTHÈQUE — le glossaire-outil, l'entrée par situation, les parcours (09/10/2026)
   Chargée par : /ressources/ (index), /ressources/glossaire/, les pages de rubrique.
   Même habillage que l'accueil : papier clair, filets fins, cartes arrondies, Newsreader + Instrument Sans.
   ============================================================ */

/* ------------------------------------------------------------
   1 · GLOSSAIRE — la barre d'outils
   ------------------------------------------------------------ */
.gl-page {
  max-width: none;
}

.gl-outil {
  display: grid;
  gap: 18px;
}

.gl-barre {
  position: sticky;
  top: 90px;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 12px 0;
  background: rgba(252, 250, 246, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.gl-recherche {
  flex: 1 1 360px;
  min-width: 0;
}

.gl-recherche input {
  width: 100%;
  min-height: 54px;
  padding: 0 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
}

.gl-recherche input:focus-visible {
  outline: 2px solid var(--bordeaux);
  outline-offset: 2px;
  border-color: var(--bordeaux);
}

.gl-modes {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.gl-modes button,
.gl-filtres button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 500 0.88rem/1 var(--sans);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.gl-modes button[aria-pressed="true"] {
  background: var(--plum);
  color: var(--paper);
}

.gl-filtres {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 2px 0 6px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.gl-filtres::-webkit-scrollbar {
  display: none;
}

.gl-filtres button {
  border: 1px solid var(--line);
  background: #fff;
  white-space: nowrap;
}

.gl-filtres button:hover {
  border-color: var(--bordeaux);
}

.gl-filtres button[aria-pressed="true"] {
  border-color: var(--plum);
  background: var(--plum);
  color: var(--paper);
}

.gl-compte {
  margin: 0;
  color: var(--ink-soft);
  font: 500 0.78rem/1 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------
   2 · GLOSSAIRE — les thèmes et les mots
   ------------------------------------------------------------ */
.gl-liste {
  display: grid;
  gap: clamp(34px, 5vw, 64px);
}

.gl-col.est-masquee {
  display: none;
}

.gl-col-tete {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  margin-bottom: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--plum);
}

.gl-col-tete h2,
.gl-lettre {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.6vw, 2.3rem);
  line-height: 1.1;
}

.gl-col-tete p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.96rem;
}

.gl-lettre {
  margin-top: 26px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--plum);
  color: var(--bordeaux);
}

.gl-termes {
  margin: 0;
  padding: 0;
  list-style: none;
}

.gl-item {
  border-bottom: 1px solid var(--line);
}

.gl-item[hidden],
.gl-col[hidden],
.gl-lettre[hidden] {
  display: none;
}

.gl-terme > summary {
  display: grid;
  grid-template-columns: 56px minmax(150px, 0.34fr) minmax(0, 1fr) 36px;
  align-items: baseline;
  gap: 4px 18px;
  padding: 20px 4px;
  list-style: none;
  cursor: pointer;
  transition: background 0.3s var(--ease);
}

.gl-terme > summary::-webkit-details-marker {
  display: none;
}

.gl-terme > summary:hover .gl-nom {
  color: var(--bordeaux);
}

.gl-terme > summary:focus-visible {
  outline: 2px solid var(--bordeaux);
  outline-offset: -2px;
  border-radius: 12px;
}

.gl-no {
  color: var(--or-ink, #7a6838);
  font: 600 0.72rem/1 var(--sans);
  letter-spacing: 0.18em;
}

.gl-nom {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: 440;
  letter-spacing: -0.02em;
  line-height: 1.12;
  transition: color 0.3s var(--ease);
}

.gl-courte {
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.5;
}

.gl-plus {
  position: relative;
  justify-self: end;
  align-self: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.gl-plus::before,
.gl-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 1.5px;
  margin: -0.75px 0 0 -5px;
  background: var(--ink);
  transition: transform 0.35s var(--ease);
}

.gl-plus::after {
  transform: rotate(90deg);
}

.gl-terme[open] .gl-plus {
  border-color: var(--bordeaux);
  background: var(--bordeaux);
}

.gl-terme[open] .gl-plus::before,
.gl-terme[open] .gl-plus::after {
  background: var(--paper);
}

.gl-terme[open] .gl-plus::after {
  transform: rotate(0deg);
}

.gl-corps {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 22px clamp(28px, 4vw, 64px);
  padding: 4px 4px 30px 74px;
}

.gl-dev p {
  margin: 0 0 12px;
  max-width: 62ch;
  color: var(--ink);
  line-height: 1.7;
}

.gl-cote {
  display: grid;
  gap: 12px;
  margin: 0;
  align-content: start;
}

.gl-cote div {
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.gl-cote dt {
  margin: 0 0 6px;
  color: var(--or-ink, #7a6838);
  font: 600 0.7rem/1.3 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.gl-cote dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.6;
}

.gl-label {
  grid-column: 1 / -1;
  margin: 6px 0 -10px;
  color: var(--ink-soft);
  font: 600 0.7rem/1 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.gl-liens,
.gl-articles {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gl-liens a,
.gl-articles a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: 500 0.9rem/1.2 var(--sans);
  text-decoration: none;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.gl-articles a {
  border-radius: 16px;
  padding: 10px 18px;
}

.gl-liens a:hover,
.gl-liens a:focus-visible,
.gl-articles a:hover,
.gl-articles a:focus-visible {
  border-color: var(--bordeaux);
  color: var(--bordeaux);
}

.gl-terme.est-cible {
  animation: gl-cible 2.2s var(--ease);
}

@keyframes gl-cible {
  0%,
  60% {
    box-shadow: inset 0 0 0 2px var(--gold);
    border-radius: 14px;
  }
  100% {
    box-shadow: inset 0 0 0 2px transparent;
  }
}

.gl-vide {
  margin: 0;
  padding: 30px 0;
  color: var(--ink-soft);
  text-align: center;
}

/* Sans JavaScript : tout est ouvert, lisible, sans outil. */
.gl-outil:not(.est-actif) .gl-barre,
.gl-outil:not(.est-actif) .gl-filtres,
.gl-outil:not(.est-actif) .gl-compte {
  display: none;
}

@media (max-width: 760px) {
  .gl-barre {
    top: 74px;
  }

  .gl-terme > summary {
    grid-template-columns: 38px minmax(0, 1fr) 32px;
    padding: 18px 2px;
  }

  .gl-nom {
    grid-column: 2;
  }

  .gl-plus {
    grid-column: 3;
    grid-row: 1;
  }

  .gl-courte {
    grid-column: 2 / -1;
  }

  .gl-corps {
    grid-template-columns: 1fr;
    padding: 0 2px 26px 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gl-terme.est-cible {
    animation: none;
    box-shadow: inset 0 0 0 2px var(--gold);
  }
}

/* ------------------------------------------------------------
   3 · INDEX — la recherche du hero, « qu'est-ce qui te bloque ? », les parcours
   ------------------------------------------------------------ */
.res-hero-search {
  max-width: 520px;
  margin-top: 26px;
}

.res-hero-search .search-input {
  width: 100%;
  min-height: 56px;
  padding: 0 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
}

.res-hero-search .search-input:focus-visible {
  outline: 2px solid var(--bordeaux);
  outline-offset: 2px;
}

.res-hero-search .search-results {
  margin-top: 8px;
}

.res-situations .section-heading,
.res-parcours-sec .section-heading {
  max-width: var(--wrap);
  margin-inline: auto;
}

.sit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: var(--wrap);
  margin: clamp(22px, 3vw, 36px) auto 0;
  padding: 0;
  list-style: none;
}

.sit {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 18px;
  min-height: 190px;
  padding: 24px 26px 22px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.4s var(--ease), transform 0.5s var(--ease), background 0.4s var(--ease);
}

.sit::before {
  content: "";
  position: absolute;
  left: 26px;
  top: 0;
  width: 34px;
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: var(--c, var(--gold));
}

.sit__k,
.parc__k {
  color: var(--ink-soft);
  font: 600 0.7rem/1.3 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sit__t {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.2vw, 1.9rem);
  font-weight: 440;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.sit__go {
  padding-right: 34px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.4;
}

.sit__fl {
  position: absolute;
  right: 22px;
  bottom: 20px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 0.5s var(--ease), background 0.4s var(--ease), color 0.4s var(--ease);
}

.sit:hover,
.sit:focus-visible,
.parc:hover,
.parc:focus-visible {
  border-color: var(--bordeaux);
  transform: translateY(-3px);
}

.sit:hover .sit__fl {
  background: var(--bordeaux);
  color: var(--paper);
  transform: translateX(3px);
}

.parc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: var(--wrap);
  margin: clamp(22px, 3vw, 36px) auto 0;
  padding: 0;
  list-style: none;
}

.parc {
  display: grid;
  align-content: start;
  gap: 12px;
  height: 100%;
  padding: 26px 28px 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.4s var(--ease), transform 0.5s var(--ease);
}

.parc--guide {
  border-color: var(--plum);
  background: var(--plum);
  color: var(--paper);
}

.parc--guide .parc__k,
.parc--guide .parc__p,
.parc--guide .parc__go {
  color: rgba(252, 250, 246, 0.82);
}

.parc__t {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.3vw, 2rem);
  font-weight: 440;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.parc__p {
  color: var(--ink-soft);
  font-size: 0.96rem;
  line-height: 1.55;
}

.parc__frise {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 6px 0 2px;
}

.parc__frise i {
  position: relative;
  flex: 1;
  height: 1px;
  background: var(--gold);
}

.parc__frise i::after {
  content: "";
  position: absolute;
  right: -4px;
  top: -3.5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--gold);
}

.parc__frise i:last-child::after {
  background: var(--gold);
}

.parc__trajet {
  display: grid;
  gap: 4px;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.4;
}

.parc__trajet span:first-child {
  color: var(--ink-soft);
}

.parc__go {
  margin-top: 6px;
  color: var(--bordeaux);
  font: 600 0.8rem/1.3 var(--sans);
  letter-spacing: 0.06em;
}

.parc--guide .parc__go {
  color: #ddb8c1;
}

@media (max-width: 980px) {
  .sit-grid,
  .parc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .sit-grid,
  .parc-grid {
    grid-template-columns: 1fr;
  }

  .sit {
    min-height: 0;
    gap: 14px;
  }
}

/* ------------------------------------------------------------
   4 · ARTICLES — la ligne de lecture, le sommaire, les mots du glossaire
   ------------------------------------------------------------ */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}

.article-meta span {
  color: var(--ink-soft);
  font: 500 0.8rem/1.3 var(--sans);
  letter-spacing: 0.04em;
}

.article-meta span + span::before,
.article-meta a + span::before {
  content: "·";
  margin-right: 14px;
  color: var(--gold);
}

.article-sommaire {
  max-width: var(--largeur-texte, 56ch);
  margin: 0 0 clamp(26px, 4vw, 40px);
  padding: 18px 22px 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
}

.article-sommaire__t {
  margin: 0 0 10px;
  color: var(--or-ink, #7a6838);
  font: 600 0.7rem/1 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.article-sommaire ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-sommaire a {
  display: flex;
  gap: 14px;
  align-items: baseline;
  min-height: 44px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.3;
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

.article-sommaire li:first-child a {
  border-top: 0;
}

.article-sommaire a span {
  flex: none;
  color: var(--or-ink, #7a6838);
  font: 600 0.7rem/1 var(--sans);
  letter-spacing: 0.14em;
}

.article-sommaire a:hover,
.article-sommaire a:focus-visible {
  color: var(--bordeaux);
}

.article-body h2[id] {
  scroll-margin-top: 110px;
}

a.glos {
  color: inherit;
  text-decoration: underline dotted var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  border-bottom: 0;
}

.article-body a.glos:not(.button) {
  color: inherit;
  font-weight: inherit;
  border-bottom: 0;
}

a.glos:hover,
a.glos:focus-visible {
  color: var(--bordeaux);
  text-decoration-style: solid;
}

.glos-pop {
  position: absolute;
  z-index: 120;
  display: grid;
  gap: 6px;
  width: min(320px, 86vw);
  padding: 16px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 24px 50px -30px rgba(56, 43, 63, 0.5);
}

.glos-pop[hidden] {
  display: none;
}

.glos-pop b {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 440;
  line-height: 1.2;
}

.glos-pop span {
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.5;
}

.glos-pop a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--bordeaux);
  font: 600 0.82rem/1.2 var(--sans);
  text-decoration: none;
}

.article-mots {
  max-width: var(--largeur-texte, 56ch);
  margin: clamp(28px, 4vw, 44px) 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.article-mots h2 {
  margin: 0 0 12px;
  color: var(--or-ink, #7a6838);
  font: 600 0.7rem/1 var(--sans) !important;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.article-mots ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-mots a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: 500 0.9rem/1.2 var(--sans);
  text-decoration: none;
}

.article-mots a:hover,
.article-mots a:focus-visible {
  border-color: var(--bordeaux);
  color: var(--bordeaux);
}

@media (max-width: 640px) {
  .article-meta {
    display: grid;
    gap: 6px;
  }

  .article-meta span + span::before,
  .article-meta a + span::before {
    display: none;
  }
}

/* 09/10 — Reprendre : les lectures « En cours » de la lectrice (rien d'affiché tant qu'elle n'en a pas) */
.res-reprise { max-width: var(--wrap, 1280px); margin: clamp(18px, 3vw, 34px) auto 0; padding: 18px clamp(18px, 3vw, 28px); display: grid; gap: 10px 24px; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; border: 1px solid var(--line); border-radius: 22px; background: #fff; }
.res-reprise[hidden] { display: none; }
.res-reprise__k { margin: 0; color: var(--bordeaux); font: 600 0.72rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; }
.res-reprise__liste { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.res-reprise__liste a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; color: var(--ink); text-decoration: none; }
.res-reprise__liste b { font: 440 1.15rem/1.25 var(--serif); }
.res-reprise__liste span { color: var(--ink-soft); font-size: 0.82rem; }
.res-reprise__liste a:hover b { color: var(--bordeaux); text-decoration: underline; text-underline-offset: 0.2em; }
.res-reprise__tous { color: var(--ink-soft); font-size: 0.88rem; text-decoration: underline; text-underline-offset: 0.22em; }
@media (max-width: 720px) { .res-reprise { grid-template-columns: 1fr; } }
