/* ============================================================
   GRADE — projects.css
   Intercalaire orange. Fiches de totaux, une jauge épaisse avec
   le seuil de 80 % marqué (même logique que le repère 4.0 des
   matières), puis la liste des projets sur feuille.
   ============================================================ */

.proj-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:14px}
.stat{background:var(--glass-bg);border-radius:var(--r);padding:16px;display:flex;flex-direction:column}
.stat-val{font-family:var(--f-display);font-size:2.2rem;font-weight:700;letter-spacing:-.03em;line-height:1;margin-bottom:10px}
.stat-lbl{font-size:.85rem;font-weight:600;color:var(--tx)}

/* Jauge : le repère est au seuil de réussite (80 %) */
.prog-track{position:relative;background:var(--glass-bg);height:12px;border-radius:6px;margin-bottom:8px}
.prog-track::after{content:'';position:absolute;left:80%;top:-4px;width:2px;height:20px;background:var(--tx);border-radius:1px;transform:translateX(-1px)}
.prog-fill{height:100%;border-radius:6px;transition:width .4s,background .3s}
.pf-g{background:var(--green)}
.pf-o{background:var(--orange)}
.pf-r{background:var(--red)}
.prog-labels{display:flex;justify-content:space-between;font-size:.85rem;color:var(--tx);margin-bottom:14px;font-weight:500}
.proj-msg{font-size:.95rem;font-weight:600;padding:12px 16px;border-radius:var(--r);margin-bottom:14px;background:var(--glass-bg)}

.proj-list{display:flex;flex-direction:column;max-height:320px;overflow-y:auto;background:var(--glass-bg);border-radius:var(--r)}
.proj-item{display:flex;align-items:center;gap:10px;border-bottom:1px solid var(--glass-border);padding:12px 16px}
.proj-list .proj-item:last-child{border-bottom:none}
.proj-name{flex:1;font-weight:600;font-size:1rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.proj-periods{font-size:.88rem;color:var(--tx2);white-space:nowrap}

/* ── Barre d'objectif (note cible par semestre CG) ── */
.obj-bar-wrap{flex:1;min-width:60px;height:8px;background:var(--glass-bg);border-radius:4px;overflow:hidden}
.obj-bar-fill{height:100%;transition:width .5s ease;width:var(--w);border-radius:4px}
.bar-g{background:var(--green)}
.bar-o{background:var(--orange)}
.bar-r{background:var(--red)}

/* Statut projet : Échoué / En production / Réussi.
   Un curseur (.ps-ind) glisse sous l'option active ; --pos = index 0..2. */
.proj-status{--pos:0;position:relative;display:grid;grid-template-columns:repeat(3,1fr);gap:2px;flex-shrink:0;background:var(--sheet-2);border-radius:var(--r-btn);padding:3px}
.ps-ind{position:absolute;top:3px;bottom:3px;left:3px;width:calc((100% - 10px) / 3);border-radius:5px;background:var(--rbg);box-shadow:inset 0 0 0 1px var(--red);transform:translateX(calc(var(--pos) * (100% + 2px)));transition:transform .3s cubic-bezier(.4,0,.2,1),background-color .3s,box-shadow .3s}
.proj-status[data-st="orange"] .ps-ind{background:var(--obg);box-shadow:inset 0 0 0 1px var(--orange)}
.proj-status[data-st="green"] .ps-ind{background:var(--gbg);box-shadow:inset 0 0 0 1px var(--green)}
.ps-opt{position:relative;z-index:1;background:none;border:0;border-radius:5px;height:28px;padding:0 10px;font:inherit;font-size:.82rem;font-weight:600;color:var(--tx2);cursor:pointer;white-space:nowrap;transition:color .3s}
.ps-opt:hover{color:var(--tx)}
.proj-status[data-st="red"] .ps-opt.active{color:var(--red)}
.proj-status[data-st="orange"] .ps-opt.active{color:var(--orange)}
.proj-status[data-st="green"] .ps-opt.active{color:var(--green)}
.proj-prod-note{color:var(--orange)}
@media (max-width:600px){.proj-item{flex-wrap:wrap}.proj-status{order:5;width:100%}}
/* Exception voulue à la règle reduced-motion de tokens.css : le glissement est court. */
@media (prefers-reduced-motion:reduce){
  .ps-ind{transition:transform .3s cubic-bezier(.4,0,.2,1),background-color .3s,box-shadow .3s!important}
  .ps-opt{transition:color .3s!important}
}

/* Statut sous la jauge : posé sur une petite fiche blanche, pas directement sur
   l'intercalaire orange (vert/rouge sur orange = contraste insuffisant). */
.prog-labels .green,.prog-labels .red,.prog-labels .orange{background:var(--glass-bg);padding:2px 8px;border-radius:var(--rs);font-weight:600}
/* Clair : l'état actif est fortement teinté, on fonce le texte pour garder 4.5:1 */
html.light .proj-status[data-st="green"]  .ps-opt.active{color:color-mix(in srgb,var(--green) 78%,var(--tx))}
html.light .proj-status[data-st="orange"] .ps-opt.active{color:color-mix(in srgb,var(--orange) 78%,var(--tx))}
html.light .proj-status[data-st="red"]    .ps-opt.active{color:color-mix(in srgb,var(--red) 78%,var(--tx))}
