/* =========================================================================
   portfolio.css — la page commune du projet « Mon portfolio »
   -------------------------------------------------------------------------
   S'ajoute a ../../assets/portail.css (fond, typographie, halos, en-tete,
   bouton retour). Ne contient que ce qui est propre a cette page.

   COULEURS DE TEXTE : chaque couleur posee sur du texte a ete choisie pour
   tenir 4,5:1 dans les DEUX themes, sur les surfaces de cette page.
     theme sombre : les couleurs vives des logiciels passent sur #17131f
     theme clair  : on bascule sur des variantes sombres (#0B5FAA,
                    #A35500, #C2123F…) — les couleurs vives d'Adobe
                    tombent sous 3:1 sur du blanc.
   Les couleurs vives restent utilisees pour les FONDS et les BORDURES,
   jamais pour du texte courant en theme clair.

   Les surfaces sont OPAQUES (--surface), pas le --carte translucide du
   portail : un texte pose sur une couche translucide se mesure mal et
   varie avec les halos qui passent dessous.
   ========================================================================= */

:root {
  --ps: #31A8FF;   --ai: #FF9A00;   --id: #FF3366;
  --ps-t: #31A8FF; --ai-t: #FF9A00; --id-t: #FF3366;
  --af: #7E4DD2;   --af-t: #B79BF5;
  --surface: #17131f;
  --surface-2: #1f1a2b;
  --papier: #f7f5fb;
  --ok-t: #3ddc97;
  --warn-t: #ffc15e;
  --ko-t: #ff8a9c;
  --lien: #a78bfa;
  --a: #a78bfa;
}

@media (prefers-color-scheme: light) {
  :root {
    --ps-t: #0B5FAA; --ai-t: #A35500; --id-t: #C2123F; --af-t: #5B2DB3;
    --surface: #ffffff;
    --surface-2: #f3f0f9;
    --papier: #ffffff;
    --ok-t: #0B7A53;
    --warn-t: #8A5300;
    --ko-t: #B3203A;
    --lien: #6d28d9;
  }
  /* la pastille du portail prend --a comme couleur de texte : en clair,
     un violet vif tomberait a 2,7:1 sur le blanc */
  .pastille { color: #6d28d9; }
}

/* ------------------------------------------------------------ en-tete --- */

.titre-portfolio {
  background: linear-gradient(100deg, var(--ps) 0%, var(--id) 55%, var(--ai) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sommaire-page {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: -24px 0 48px;
}
.sommaire-page a {
  padding: 7px 14px;
  border: 1px solid var(--bord);
  border-radius: 999px;
  background: var(--surface);
  color: var(--texte);
  font-size: .84rem;
  text-decoration: none;
  transition: border-color .2s;
}
.sommaire-page a:hover { border-color: var(--a); }
.sommaire-page a:focus-visible { outline: 3px solid var(--a); outline-offset: 2px; }

/* ------------------------------------------------------------ sections --- */

.bloc {
  background: var(--surface);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  padding: clamp(22px, 4vw, 38px);
  margin-bottom: 28px;
  scroll-margin-top: 24px;
}
.bloc h2 {
  font-size: clamp(1.45rem, 3.2vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin-bottom: 6px;
}
.bloc .sous {
  color: var(--doux);
  margin-bottom: 24px;
  max-width: 70ch;
}
.bloc h3 {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 26px 0 10px;
}
.bloc p { margin-bottom: 12px; max-width: 78ch; }
.bloc ul, .bloc ol { margin: 0 0 14px 1.2em; max-width: 78ch; }
.bloc li { margin-bottom: 6px; }
.bloc a { color: var(--lien); }
.bloc code, .bloc kbd {
  font-family: "Cascadia Code", Consolas, "SF Mono", monospace;
  font-size: .88em;
  background: var(--surface-2);
  border: 1px solid var(--bord);
  border-radius: 6px;
  padding: 1px 6px;
}
.ui {
  font-weight: 600;
  white-space: nowrap;
}

.numero {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; margin-right: 10px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--bord);
  font-size: .9rem; font-weight: 800;
  vertical-align: 3px;
}

/* -------------------------------------------------- les trois logiciels --- */

.trio {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}
.logiciel {
  background: var(--surface-2);
  border: 1px solid var(--bord);
  border-top: 4px solid var(--c);
  border-radius: 16px;
  padding: 20px 20px 18px;
  display: flex; flex-direction: column;
}
.logiciel.ps { --c: var(--ps); --t: var(--ps-t); }
.logiciel.ai { --c: var(--ai); --t: var(--ai-t); }
.logiciel.id { --c: var(--id); --t: var(--id-t); }
.logiciel.af { --c: var(--af); --t: var(--af-t); }
.logiciel .nom {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.05rem; margin-bottom: 10px;
}
.badge-app {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px;
  background: #001e36; color: var(--ps);
  font-weight: 800; font-size: .95rem; letter-spacing: -.02em;
  border: 1.5px solid var(--ps);
}
.logiciel.ai .badge-app { background: #330000; color: var(--ai); border-color: var(--ai); }
.logiciel.id .badge-app { background: #49021f; color: var(--id); border-color: var(--id); }
.logiciel.af .badge-app { background: #1c0f33; color: #B79BF5; border-color: var(--af); }
.logiciel .seul { font-size: .92rem; margin-bottom: 12px; flex: 1; }
.logiciel .seul b { color: var(--t); }
.completer {
  font-size: .85rem;
  border-top: 1px dashed var(--bord);
  padding-top: 10px;
  color: var(--doux);
}
.completer b { color: var(--texte); }

/* --------------------------------------------------------- les encadres --- */

.regle {
  border-left: 4px solid var(--a);
  background: var(--surface-2);
  border-radius: 0 12px 12px 0;
  padding: 14px 18px;
  margin: 18px 0;
  max-width: 80ch;
}
.regle p:last-child { margin-bottom: 0; }
.regle.attention { border-left-color: var(--ai); }
.regle.cle { border-left-color: var(--ps); }

/* ------------------------------------------------------------ tableaux --- */

.tableau-defile { overflow-x: auto; margin: 14px 0 6px; }
table.specs {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  font-size: .92rem;
}
table.specs th, table.specs td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--bord);
  vertical-align: top;
}
table.specs th {
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--doux);
}
table.specs td:first-child { font-weight: 700; }
/* les valeurs se replient : en nowrap, « 3 mm de chaque cote → 216 × 303 mm »
   ecrasait la colonne « Pourquoi » jusqu a un mot par ligne */
table.specs .val {
  font-family: "Cascadia Code", Consolas, "SF Mono", monospace;
  font-weight: 700;
  min-width: 11ch;
}

/* ecran etroit : chaque ligne devient une fiche empilee, lisible sans
   defilement horizontal */
@media (max-width: 680px) {
  .tableau-defile { overflow-x: visible; }
  table.specs { min-width: 0; }
  table.specs tr:first-child { display: none; }
  table.specs tr {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--bord);
  }
  table.specs td {
    display: block;
    border: 0;
    padding: 2px 0;
  }
  table.specs td:first-child { font-size: 1rem; margin-bottom: 2px; }
  /* un chemin de menu insecable (« Affichage › Reperes › Nouvelle
     disposition de reperes ») debordait de 21 px sur un telephone */
  table.specs .ui { white-space: normal; }
  table.specs td { overflow-wrap: anywhere; }
}

/* -------------------------------------------------------------- schemas --- */

.schemas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  margin: 18px 0 10px;
}
.schema figure { margin: 0; }
.schema svg { width: 100%; max-width: 330px; height: auto; display: block; margin: 0 auto; }
.schema figcaption {
  text-align: center; font-weight: 700; margin-top: 10px;
}
.schema .fond-perdu  { fill: #ff3366; opacity: .22; }
.schema .page        { fill: var(--papier); stroke: var(--texte); stroke-width: .6; }
.schema .visuel      { fill: url(#degrade-visuel); }
.schema .coupe       { fill: none; stroke: var(--texte); stroke-width: .7; }
.schema .securite    { fill: none; stroke: #0B7A53; stroke-width: .9; stroke-dasharray: 3 2; }
.schema .reserve     { fill: #ffffff; opacity: .88; stroke: #C2123F; stroke-width: .9; stroke-dasharray: 4 2; }
.schema .qr          { fill: #16121f; }
.schema .ligne-txt   { fill: #16121f; opacity: .55; }
.schema .etiq        { font: 700 8.5px "Segoe UI", system-ui, sans-serif; fill: #16121f; }
.schema .etiq-clair  { font: 700 9px "Segoe UI", system-ui, sans-serif; fill: #ffffff; }
.schema .monogramme  { fill: none; stroke: #ffffff; stroke-width: 1.6; }

.legende {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  justify-content: center;
  font-size: .86rem; color: var(--doux);
  margin-top: 6px;
}
.legende span { display: inline-flex; align-items: center; gap: 8px; }
.legende i {
  display: inline-block; width: 22px; height: 12px; border-radius: 3px;
}
.legende .l-fp  { background: rgba(255, 51, 102, .35); }
.legende .l-cp  { border: 2px solid var(--texte); }
.legende .l-sec { border: 2px dashed #0B7A53; }
.legende .l-res { border: 2px dashed #C2123F; background: rgba(255,255,255,.7); }

/* ------------------------------------------------ fiche d'identite --- */

.fiche {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 28px;
  align-items: start;
}
@media (max-width: 860px) {
  .fiche { grid-template-columns: 1fr; }
}

.champs { display: grid; gap: 14px; }
.champ label, .champ .intitule {
  display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px;
}
.champ .aide-champ { font-weight: 400; color: var(--doux); font-size: .84rem; }
.champ input[type="text"], .champ select {
  width: 100%;
  font: inherit;
  color: var(--texte);
  background: var(--surface-2);
  border: 1px solid var(--doux); /* 27/09 : --bord ne donnait que 1,3:1, un champ doit se voir (3:1) */
  border-radius: 10px;
  padding: 10px 12px;
}
.champ input[type="text"]:focus-visible, .champ select:focus-visible {
  outline: 3px solid var(--a); outline-offset: 1px;
}
.deux-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .deux-col { grid-template-columns: 1fr; } }

.choix-type { display: flex; gap: 8px; flex-wrap: wrap; }
.choix-type label {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid var(--bord); border-radius: 999px;
  background: var(--surface-2); cursor: pointer; font-weight: 600; font-size: .9rem;
  margin: 0;
}
.choix-type input { accent-color: var(--lien); }

.palette { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 520px) { .palette { grid-template-columns: repeat(2, 1fr); } }
.couleur {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--bord);
  border-radius: 12px;
  padding: 10px;
}
.couleur span { font-size: .78rem; font-weight: 700; }
.couleur input[type="color"] {
  width: 100%; height: 44px; border: 0; padding: 0; background: none; cursor: pointer;
  border-radius: 8px;
}
.couleur code { text-align: center; font-size: .8rem; }

.boutons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.btn-p {
  font: inherit; font-weight: 700; font-size: .92rem;
  padding: 10px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--bord);
  background: var(--surface-2); color: var(--texte);
}
.btn-p.principal {
  background: linear-gradient(100deg, #0B5FAA, #6d28d9);
  color: #ffffff; border-color: transparent;
}
.btn-p:focus-visible { outline: 3px solid var(--a); outline-offset: 2px; }
.btn-p:hover { filter: brightness(1.08); }
.note-sauvegarde { font-size: .82rem; color: var(--doux); margin-top: 6px; }

/* l apercu : une mini couverture et une mini 4e de couverture A4 */
.apercu { position: sticky; top: 18px; }
.apercu-pages { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-page {
  aspect-ratio: 210 / 297;
  border-radius: 6px;
  box-shadow: 0 14px 40px -18px rgba(0, 0, 0, .55);
  overflow: hidden;
  position: relative;
  display: flex; flex-direction: column;
  padding: 9%;
  border: 1px solid var(--bord);
}
.mini-page .mp-mono {
  width: 34%; aspect-ratio: 1;
  border: 2px solid currentColor; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: clamp(.9rem, 2.4vw, 1.4rem); letter-spacing: .02em;
  margin-bottom: auto;
}
.mini-page .mp-nom { font-size: clamp(.8rem, 2vw, 1.15rem); font-weight: 800; line-height: 1.1; }
.mini-page .mp-metier { font-size: clamp(.55rem, 1.2vw, .72rem); opacity: .9; margin-top: 4px; }
.mini-page .mp-bande { height: 4px; width: 40%; margin-top: 10px; border-radius: 2px; }
.mini-page .mp-texte { font-size: clamp(.5rem, 1.1vw, .66rem); line-height: 1.35; opacity: .95; }
.mini-page .mp-zone {
  margin-top: auto;
  border-radius: 4px;
  padding: 8%;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 6%;
}
.mini-page .mp-qr {
  width: 22%; aspect-ratio: 1;
  /* un damier : evoque un QR code sans en etre un faux lisible */
  background: conic-gradient(#111 25%, #fff 0 50%, #111 0 75%, #fff 0) 0 0 / 34% 34%;
  outline: 3px solid #fff;
}
.apercu-legende { font-size: .8rem; color: var(--doux); margin-top: 8px; text-align: center; }

.contrastes { margin-top: 16px; display: grid; gap: 8px; }
.contraste {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--bord);
  border-radius: 10px; padding: 8px 12px; font-size: .86rem;
}
.contraste .pastilles { display: inline-flex; }
.contraste .pastilles i {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--surface-2);
  box-shadow: 0 0 0 1px var(--bord);
}
.contraste .pastilles i + i { margin-left: -6px; }
.contraste .ratio { margin-left: auto; font-weight: 800; white-space: nowrap; }
.contraste.ok .ratio   { color: var(--ok-t); }
.contraste.moyen .ratio{ color: var(--warn-t); }
.contraste.ko .ratio   { color: var(--ko-t); }

/* ------------------------------------------------------ arborescence --- */

.arbo {
  font-family: "Cascadia Code", Consolas, "SF Mono", monospace;
  font-size: .86rem;
  line-height: 1.7;
  background: var(--surface-2);
  border: 1px solid var(--bord);
  border-radius: 12px;
  padding: 16px 18px;
  overflow-x: auto;
  white-space: pre;
  margin: 12px 0;
}
.arbo .dossier { font-weight: 700; }
.arbo .com { color: var(--doux); }

/* ---------------------------------------------------- verificateur --- */

.depot {
  display: block;
  border: 2px dashed var(--bord);
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.depot:hover, .depot.survol { border-color: var(--lien); }
.depot:focus-within { outline: 3px solid var(--a); outline-offset: 3px; }
.depot input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.depot .gros { font-weight: 800; font-size: 1.05rem; display: block; margin-bottom: 4px; }
.depot .petit { color: var(--doux); font-size: .88rem; }

.resultats { display: grid; gap: 12px; margin-top: 18px; }
.resultat {
  background: var(--surface-2);
  border: 1px solid var(--bord);
  border-radius: 14px;
  padding: 14px 16px;
}
.resultat .fichier { font-weight: 800; margin-bottom: 8px; word-break: break-all; }
.resultat ul { list-style: none; margin: 0; }
.resultat li { padding: 3px 0 3px 26px; position: relative; font-size: .92rem; }
.resultat li::before { position: absolute; left: 0; top: 3px; font-weight: 800; }
.resultat li.ok::before   { content: "\2713"; color: var(--ok-t); }
.resultat li.warn::before { content: "!";      color: var(--warn-t); left: 6px; }
.resultat li.ko::before   { content: "\2717"; color: var(--ko-t); }
.resultat li.info::before { content: "i";      color: var(--doux); left: 7px; font-style: italic; }

/* --------------------------------------------------------- navigation --- */

.suite {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.suite a {
  display: block;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--bord);
  border-left: 4px solid var(--c);
  color: var(--texte);
  text-decoration: none;
  font-weight: 700;
}
.suite a small { display: block; font-weight: 400; color: var(--doux); margin-top: 2px; }
.suite a:hover { border-color: var(--c); }
.suite a:focus-visible { outline: 3px solid var(--c); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .btn-p, .depot, .sommaire-page a { transition: none; }
}

@media print {
  body::before, body::after, .sommaire-page, #verifier, .boutons { display: none; }
  .bloc { break-inside: avoid; border-color: #999; }
}
