/* =====================================================================
   Lycées de Chauny : schéma des parcours (lyc-parcours)
   Reprend les variables de lyc-design (--lyc-nuit, --lyc-clair, --lyc-brique, --lyc-acier…),
   avec des valeurs de repli pour s'afficher aussi dans une page qui ne les charge pas.
   Couleurs de voie : texte blanc à 6,3:1 au moins, 5,6:1 sur le fond clair.
   ===================================================================== */

.lyc-parcours {
  --pc-nuit: var(--lyc-nuit, #0e2740);
  --pc-clair: var(--lyc-clair, #eef2f5);
  --pc-blanc: var(--lyc-blanc, #ffffff);
  --pc-note: var(--lyc-note, #43566a);
  --pc-brique: var(--lyc-brique, #9c3a25);
  --pc-acier: var(--lyc-acier, #1d5c85);
  --pc-gt: #4a3d8f;       /* violet, 8,9:1 sur blanc */
  --pc-pro: #1e6b47;      /* vert, 6,5:1 */
  --pc-cap: #8a5300;      /* ocre, 6,3:1 */
  --pc-postbac: #0e2740;  /* nuit, 15,2:1 */
  --pc-trait: #7a8a9a;    /* traits ordinaires, 3,5:1 sur le fond clair (élément graphique) */
  --pc-voie: var(--pc-nuit);
  box-sizing: border-box;
  max-width: var(--lyc-max, 75rem);
  margin-inline: auto;
  color: var(--pc-nuit);
  font-family: var(--lyc-texte, inherit);
  font-size: 1rem;
  line-height: 1.45;
}
.lyc-parcours *, .lyc-parcours *::before, .lyc-parcours *::after { box-sizing: border-box; }
.lyc-parcours > * + * { margin-block-start: 1.5rem; }
.lyc-parcours :is(h2, h3, h4) { font-family: var(--lyc-titre, inherit); color: inherit; letter-spacing: -0.01em; line-height: 1.15; }
.lyc-parcours p { max-width: 68ch; }
.lyc-parcours a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.lyc-parcours :is(a, button, summary):focus-visible { outline: 3px solid var(--pc-nuit); outline-offset: 2px; }
.lyc-parcours abbr[title] { text-decoration: underline dotted 1px; text-underline-offset: 0.15em; cursor: help; }

.lyc-pc-voie-gt { --pc-voie: var(--pc-gt); }
.lyc-pc-voie-pro { --pc-voie: var(--pc-pro); }
.lyc-pc-voie-cap { --pc-voie: var(--pc-cap); }
.lyc-pc-voie-postbac { --pc-voie: var(--pc-postbac); }

/* Pastilles de site et texte masqué : repris de lyc-design, au cas où il ne serait pas chargé. */
.lyc-parcours .lyc-site { display: inline-block; padding: 0.05rem 0.45rem; font-size: 0.8125rem; font-weight: 700; line-height: 1.5; white-space: nowrap; color: #fff; background: var(--pc-nuit); }
.lyc-parcours .lyc-site-gambetta { background: var(--pc-brique); }
.lyc-parcours .lyc-site-ternynck { background: var(--pc-acier); }
.lyc-parcours .lyc-masque { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Badges de statut : le libellé est toujours écrit ---------- */
.lyc-pc-badges { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; }
.lyc-pc-badge { position: relative; display: inline-block; padding: 0 0.4rem; border: 1.5px solid var(--pc-nuit); font-size: 0.75rem; font-weight: 700; line-height: 1.5; white-space: nowrap; background: var(--pc-blanc); color: var(--pc-nuit); }
.lyc-pc-badge-initial { border-color: var(--pc-note); color: var(--pc-note); font-weight: 400; }
.lyc-pc-badge-apprentissage { background: var(--pc-nuit); color: #fff; }
.lyc-pc-badge-initial-apprentissage { background: linear-gradient(90deg, var(--pc-blanc) 50%, var(--pc-clair) 50%); }
.lyc-pc-badge-mixite { border-style: dashed; cursor: help; }
/* Info-bulle « Mixité possible » : au survol du badge, et au focus de la carte. */
.lyc-pc-badge-mixite::after {
  content: attr(data-infobulle);
  position: absolute; z-index: 5; left: 50%; bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 0.3rem 0.55rem;
  background: var(--pc-nuit); color: #fff;
  font-size: 0.8125rem; font-weight: 700; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.15s ease;
}
.lyc-pc-badge-mixite:hover::after,
.lyc-pc-carte:focus-visible .lyc-pc-badge-mixite::after,
summary:focus-visible .lyc-pc-badge-mixite::after { opacity: 1; }
.lyc-pc-legende .lyc-pc-badge-mixite::after { display: none; }

/* ---------- Filtres ---------- */
.lyc-pc-filtres-boite > summary { cursor: pointer; display: flex; align-items: center; min-height: 44px; font-family: var(--lyc-titre, inherit); font-weight: 700; font-size: 1.125rem; }
.lyc-pc-filtres-boite[open] > summary { margin-block-end: 0.75rem; }
.lyc-pc-filtres { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-end; }
.lyc-pc-filtres fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.lyc-pc-filtres legend { padding: 0; margin-block-end: 0.4rem; font-weight: 700; font-size: 0.9375rem; }
.lyc-pc-boutons { display: flex; flex-wrap: wrap; gap: 4px; }
.lyc-pc-filtre, .lyc-pc-tout {
  min-height: 44px; padding: 0.55rem 0.9rem;
  border: 2px solid var(--pc-nuit); border-radius: 0;
  background: var(--pc-blanc); color: var(--pc-nuit);
  font: inherit; font-size: 0.9375rem; font-weight: 700; line-height: 1.2;
  cursor: pointer; transition: background-color 0.15s ease, color 0.15s ease;
}
.lyc-pc-filtre::before { content: ""; display: inline-block; width: 0.9em; }
.lyc-pc-filtre[aria-pressed="true"] { background: var(--pc-nuit); color: #fff; }
.lyc-pc-filtre[aria-pressed="true"]::before { content: "\2713"; }
.lyc-pc-filtre.lyc-pc-filtre-voie { border-color: var(--pc-voie); color: var(--pc-voie); }
.lyc-pc-filtre.lyc-pc-filtre-voie[aria-pressed="true"] { background: var(--pc-voie); color: #fff; }
.lyc-pc-filtre-gambetta[aria-pressed="true"] { background: var(--pc-brique); border-color: var(--pc-brique); }
.lyc-pc-filtre-ternynck[aria-pressed="true"] { background: var(--pc-acier); border-color: var(--pc-acier); }
.lyc-pc-filtre:hover, .lyc-pc-tout:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.lyc-pc-filtres-pied { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.lyc-pc-compte { margin: 0; color: var(--pc-note); font-size: 0.9375rem; }
.lyc-pc-tout { border-color: transparent; background: transparent; text-decoration: underline; }

/* ---------- Grille (grand écran, script actif) ---------- */
.lyc-pc-schema { display: none; position: relative; }
@media (min-width: 64rem) {
  .lyc-pc-js .lyc-pc-schema { display: block; }
  .lyc-pc-js .lyc-pc-liste { display: none; }
}
.lyc-pc-aide { margin: 0 0 1rem; color: var(--pc-note); font-size: 0.9375rem; }
.lyc-pc-colonnes, .lyc-pc-grille {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) repeat(3, minmax(0, 1fr)) minmax(0, 1.1fr);
  column-gap: 2.25rem;
}
.lyc-pc-colonnes { padding-inline: 1rem; margin-block-end: 0.5rem; }
.lyc-pc-colonnes span { font-family: var(--lyc-titre, inherit); font-weight: 700; font-size: 1.125rem; border-block-end: 2px solid var(--pc-nuit); padding-block-end: 0.25rem; }
.lyc-pc-bande { padding: 0.75rem 1rem 1rem; background: var(--pc-clair); border-block-start: 6px solid var(--pc-nuit); }
.lyc-pc-bande + .lyc-pc-bande, .lyc-pc-bande + svg + .lyc-pc-bande { margin-block-start: 1rem; }
.lyc-pc-bande-gambetta { border-color: var(--pc-brique); }
.lyc-pc-bande-ternynck { border-color: var(--pc-acier); }
.lyc-pc-bande[hidden] { display: none; }
.lyc-parcours .lyc-pc-bande-titre { margin: 0 0 0.75rem; font-size: 1.125rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; }
.lyc-pc-bande-titre .lyc-site { font-size: 1rem; padding: 0.15rem 0.6rem; }
.lyc-pc-bande-lycees { font-family: var(--lyc-texte, inherit); font-size: 0.9375rem; font-weight: 400; color: var(--pc-note); }
.lyc-pc-grille { list-style: none; margin: 0; padding: 0; row-gap: 0.5rem; }
.lyc-pc-case { margin: 0; display: flex; position: relative; z-index: 1; }
.lyc-pc-case.est-filtre { visibility: hidden; }

.lyc-pc-carte {
  display: flex; flex-direction: column; gap: 0.3rem; justify-content: center;
  width: 100%; min-height: 44px;
  padding: 0.5rem 0.65rem 0.55rem;
  background: var(--pc-blanc);
  border: 1px solid #c9d3dc; border-inline-start: 6px solid var(--pc-voie);
  color: var(--pc-nuit); text-decoration: none;
  transition: opacity 0.2s ease, box-shadow 0.15s ease;
}
.lyc-pc-carte .lyc-pc-nom { font-family: var(--lyc-titre, inherit); font-weight: 700; font-size: 1rem; line-height: 1.15; }
.lyc-pc-carte abbr[title] { text-decoration: none; cursor: inherit; }
.lyc-pc-carte .lyc-pc-sites { display: flex; gap: 0.25rem; }
.lyc-pc-carte .lyc-site { font-size: 0.75rem; padding: 0 0.4rem; }
.lyc-pc-carte:hover .lyc-pc-nom { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.15em; }
.lyc-pc-actif .lyc-pc-carte:not(.est-allume) { opacity: 0.35; }
.lyc-pc-carte.est-allume { box-shadow: 0 0 0 2px var(--pc-voie); }
.lyc-pc-carte.est-choisi { box-shadow: 0 0 0 4px var(--pc-voie); }

.lyc-pc-traits { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 0; }
.lyc-pc-trait { fill: none; stroke: var(--pc-trait); stroke-width: 1.5; transition: opacity 0.2s ease; }
.lyc-pc-trait.est-allume { stroke: var(--pc-nuit); stroke-width: 3; }
/* Poursuite après le bac, sur sélection Parcoursup : pointillés. */
.lyc-pc-trait-selection { stroke-dasharray: 6 5; }
.lyc-pc-trait-selection.est-allume { stroke-width: 2.5; }
.lyc-pc-colonne-note { display: block; font-family: var(--lyc-texte, inherit); font-size: 0.8125rem; font-weight: 400; color: var(--pc-note); }
.lyc-pc-colonnes span { align-self: end; }
/* Légende des traits. */
.lyc-pc-liens-legende { list-style: none; margin: 0 0 1rem; padding: 0 !important; display: grid; gap: 0.5rem; }
.lyc-pc-liens-legende li { margin: 0; display: flex; align-items: center; gap: 0.6rem; }
.lyc-pc-liens-legende svg { flex: none; }
.lyc-pc-actif .lyc-pc-trait:not(.est-allume) { opacity: 0.2; }
.lyc-pc-pointe { fill: var(--pc-trait); }
.lyc-pc-pointe.est-allume { fill: var(--pc-nuit); }

/* ---------- Panneau de détail ---------- */
.lyc-pc-panneau {
  position: fixed; inset: 0 0 0 auto;
  width: min(32rem, 100vw); height: 100%; max-width: 100vw; max-height: none;
  margin: 0; padding: 0;
  border: 0; border-inline-start: 8px solid var(--pc-voie);
  background: var(--pc-blanc); color: var(--pc-nuit);
  font-family: var(--lyc-texte, inherit); line-height: 1.5;
  overflow-y: auto;
}
.lyc-pc-panneau[open] { animation: lyc-pc-entree 0.25s ease both; }
.lyc-pc-panneau::backdrop { background: rgb(14 39 64 / 0.5); }
@keyframes lyc-pc-entree { from { transform: translateX(2rem); opacity: 0; } }
.lyc-pc-panneau-entete { position: sticky; top: 0; z-index: 1; display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; padding: 1.5rem 1.5rem 1rem; background: var(--pc-blanc); border-block-end: 1px solid #c9d3dc; }
.lyc-pc-panneau-sur { margin: 0 0 0.35rem; font-size: 0.875rem; font-weight: 700; color: var(--pc-voie); text-transform: uppercase; letter-spacing: 0.04em; }
.lyc-parcours .lyc-pc-panneau-titre { margin: 0; font-size: 1.5rem; line-height: 1.15; }
.lyc-pc-panneau-titre:focus { outline: none; }
.lyc-pc-fermer { flex: none; min-height: 44px; padding: 0.5rem 0.9rem; border: 2px solid var(--pc-nuit); border-radius: 0; background: var(--pc-blanc); color: var(--pc-nuit); font: inherit; font-weight: 700; cursor: pointer; }
.lyc-pc-fermer:hover { background: var(--pc-nuit); color: #fff; }
.lyc-pc-panneau-corps { padding: 1rem 1.5rem 2rem; }
.lyc-pc-panneau-corps h3 { margin: 1.5rem 0 0.4rem; font-size: 1.125rem; }
.lyc-pc-panneau-corps p { margin: 0 0 0.75rem; }
.lyc-pc-statut-texte { display: block; margin-block-start: 0.3rem; font-size: 0.9375rem; }

/* Faits : terme en gras, valeur à côté. */
.lyc-pc-faits { display: grid; gap: 0.5rem; margin: 0; }
.lyc-pc-faits > div { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 0.75rem; }
.lyc-pc-faits dt { font-weight: 700; }
.lyc-pc-faits dd { margin: 0; }
.lyc-pc-faits dd p { margin: 0; }
.lyc-pc-source { font-size: 0.9375rem; color: var(--pc-note); }
.lyc-pc-voir {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0.75rem 1.25rem;
  background: var(--pc-brique); color: #fff !important; border: 2px solid var(--pc-brique);
  font-weight: 700; text-decoration: none;
}
.lyc-pc-voir::after { content: "\2192"; margin-inline-start: 0.5rem; }
.lyc-pc-voir:hover { background: var(--pc-nuit); border-color: var(--pc-nuit); }

/* ---------- Vue en liste (mobile, ou sans script) ---------- */
.lyc-pc-liste { display: grid; gap: 4px; }
.lyc-pc-entree { background: var(--pc-clair); }
.lyc-pc-entree > summary { cursor: pointer; padding: 1rem 1.25rem; min-height: 44px; display: flex; flex-direction: column; gap: 0.15rem; }
.lyc-pc-entree > summary:hover { background: var(--pc-nuit); color: #fff; }
.lyc-pc-entree-titre { font-family: var(--lyc-titre, inherit); font-size: 1.375rem; font-weight: 700; line-height: 1.15; }
.lyc-pc-entree-chapo { font-size: 1rem; }
.lyc-pc-entree[open] > summary { border-block-end: 1px solid #c9d3dc; }
.lyc-pc-groupe { padding: 1rem 1.25rem 0.5rem; }
.lyc-pc-groupe[hidden] { display: none; }
.lyc-parcours .lyc-pc-groupe-titre { margin: 0 0 0.6rem; font-size: 1rem; }
.lyc-pc-items { list-style: none; margin: 0; padding: 0 !important; display: grid; gap: 4px; }
.lyc-pc-item { margin: 0; }
.lyc-pc-item[hidden] { display: none; }
.lyc-pc-vide { margin: 0 0 0.75rem; color: var(--pc-note); font-size: 0.9375rem; }
.lyc-pc-fiche { background: var(--pc-blanc); border-inline-start: 6px solid var(--pc-voie); }
.lyc-pc-fiche > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; padding: 0.7rem 0.9rem; min-height: 44px; }
.lyc-pc-fiche > summary .lyc-pc-nom { font-family: var(--lyc-titre, inherit); font-weight: 700; font-size: 1.0625rem; margin-inline-end: auto; }
.lyc-pc-fiche > summary:hover .lyc-pc-nom { text-decoration: underline; text-underline-offset: 0.15em; }
.lyc-pc-corps { padding: 0 0.9rem 1rem; }
.lyc-pc-corps h4 { margin: 1rem 0 0.25rem; font-size: 1rem; }
.lyc-pc-corps p { margin: 0 0 0.5rem; }
.lyc-pc-complet { font-weight: 700; }

/* ---------- Légende ---------- */
.lyc-pc-legende { padding: 1.25rem 1.5rem; border: 2px solid var(--pc-clair); }
.lyc-parcours .lyc-pc-legende-titre { margin: 0 0 0.75rem; font-size: 1.25rem; }
.lyc-pc-voies, .lyc-pc-statuts { list-style: none; margin: 0 0 1rem; padding: 0 !important; display: grid; gap: 0.5rem 1.5rem; }
.lyc-pc-voies { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.lyc-pc-voies li, .lyc-pc-statuts li { margin: 0; display: flex; align-items: baseline; gap: 0.5rem; }
.lyc-pc-statuts .lyc-pc-badge { flex: none; }
.lyc-pc-pastille { flex: none; display: inline-block; width: 1.25rem; height: 1rem; align-self: center; background: var(--pc-voie); }
.lyc-pc-note { color: var(--pc-note); font-size: 0.9375rem; }
.lyc-pc-lexique > summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.lyc-pc-lexique dl { margin: 0.5rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 0.35rem 1.5rem; }
.lyc-pc-lexique dl > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.5rem; font-size: 0.9375rem; }
.lyc-pc-lexique dt { font-weight: 700; }
.lyc-pc-lexique dd { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .lyc-parcours *, .lyc-parcours *::after, .lyc-pc-panneau { transition: none !important; animation: none !important; }
}
