/* Catalogue de styles. Chargé uniquement par styles.html.

   L'écrin reste dans la charte Webot : sable, encre, terracotta, Fraunces et
   Epilogue. Ce sont les démos qui explosent, pas la page qui les présente.
   Le contraste entre les deux fait partie de l'effet. */

/* ── Entête de page ───────────────────────────────────────────────────── */

.cat-intro { padding-block: calc(var(--nav-h) + clamp(3rem, 8vw, 6rem)) clamp(2rem, 4vw, 3rem); }
.cat-h {
  max-width: 20ch;
  margin: 0;
  font-family: var(--titre);
  font-size: var(--t-band);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.022em;
  font-variation-settings: "SOFT" 45, "WONK" 0;
  text-wrap: balance;
}
.cat-p {
  max-width: 56ch;
  margin: clamp(1.25rem, 2.5vw, 1.75rem) 0 0;
  color: var(--encre-72);
  font-size: var(--t-big);
  text-wrap: pretty;
}
.cat-avancement {
  max-width: 56ch;
  margin: 1rem 0 0;
  color: var(--encre-72);
  font-size: var(--t-small);
}

/* ── Filtres ──────────────────────────────────────────────────────────── */

.filtres {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: clamp(1.75rem, 3vw, 2.25rem);
  border-top: 1px solid var(--filet);
  display: grid;
  gap: 1rem;
}
.axe {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.axe-nom {
  flex: none;
  width: 7.5rem;
  padding: 0;
  color: var(--encre-72);
  font-size: var(--t-micro);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.filtre {
  padding: .5rem 1rem;
  border: 1px solid var(--bord);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-family: var(--texte);
  font-size: var(--t-small);
  font-weight: 500;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: background-color .35s var(--ease), border-color .35s var(--ease), color .35s var(--ease);
}
@media (hover: hover) { .filtre:hover { background: var(--encre-05); } }
/* Actif : encre sur sable. Le terracotta sur sable ne donne que 2,8:1,
   trop peu pour du texte de cette taille, il reste donc au contour. */
.filtre[aria-pressed="true"] {
  border-color: var(--terracotta);
  background: var(--encre);
  color: var(--sable);
}
.filtre:focus-visible { outline: 2px solid var(--encre); outline-offset: 3px; }

.barre-compte {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1rem;
  margin-top: 1.5rem;
}
.compte { margin: 0; color: var(--encre-72); font-size: var(--t-small); }
.remise {
  padding: 0;
  border: 0;
  background: none;
  color: var(--encre);
  font: inherit;
  font-size: var(--t-small);
  text-decoration: underline;
  text-underline-offset: .25em;
  cursor: pointer;
}
.remise[hidden] { display: none; }

/* ── Grille ───────────────────────────────────────────────────────────── */

.grille {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem) clamp(1.75rem, 3vw, 2.5rem);
  margin-top: clamp(2rem, 4vw, 3rem);
  list-style: none;
  padding: 0;
}
@media (min-width: 64rem) { .grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.fiche { min-width: 0; }
.fiche[hidden] { display: none; }

.apercu {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 12px;
  background: var(--sable-creux);
  box-shadow: var(--ombre);
  transition: box-shadow .5s var(--ease), transform .5s var(--ease);
}
.apercu img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.apercu:focus-visible { outline: 2px solid var(--encre); outline-offset: 4px; }

/* Au survol, l'aperçu descend lentement : on voit la page entière sans cliquer. */
@media (hover: hover) and (pointer: fine) {
  .apercu img { transition: object-position 5.5s linear; }
  .fiche:hover .apercu img, .fiche:focus-within .apercu img { object-position: center bottom; }
  .fiche:hover .apercu, .fiche:focus-within .apercu {
    transform: translateY(-5px);
    box-shadow: var(--ombre-haute);
  }
}
@media (prefers-reduced-motion: reduce) {
  .apercu img { transition: none; }
  .fiche:hover .apercu img, .fiche:focus-within .apercu img { object-position: center top; }
  .fiche:hover .apercu, .fiche:focus-within .apercu { transform: none; }
}

.fiche-corps { padding-top: 1.25rem; }
.fiche-tete { display: flex; align-items: baseline; gap: 1rem; }
.fiche-nom {
  margin: 0;
  font-family: var(--titre);
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.02em;
  font-variation-settings: "SOFT" 40;
}
.fiche-desc {
  max-width: 50ch;
  margin: .5rem 0 0;
  color: var(--encre-72);
  font-size: var(--t-small);
  text-wrap: pretty;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
  margin-top: 1rem;
}
.pastilles { display: flex; gap: .3rem; margin: 0; padding: 0; list-style: none; }
.pastilles li {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(51, 41, 31, .18);
}
.meta-polices, .meta-metiers {
  margin: 0;
  color: var(--encre-72);
  font-size: var(--t-micro);
}
.meta-metiers { flex-basis: 100%; }

.fiche-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.bouton-fiche, .lien-demo {
  padding: .6rem 1.15rem;
  border: 1px solid var(--bord);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-family: var(--texte);
  font-size: var(--t-small);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .35s var(--ease);
}
@media (hover: hover) { .bouton-fiche:hover, .lien-demo:hover { background: var(--encre-05); } }
.bouton-fiche:focus-visible, .lien-demo:focus-visible { outline: 2px solid var(--encre); outline-offset: 3px; }

/* Le détail reste dans le document : sans JavaScript, il s'affiche en clair
   sous la fiche au lieu de n'exister que dans le panneau. */
.js .fiche-detail { display: none; }
.fiche-detail { margin-top: 1.5rem; }

/* ── Panneau de détail ────────────────────────────────────────────────── */

.panneau {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: start center;
  overflow-y: auto;
  padding: clamp(1rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem) 4rem;
  background: color-mix(in srgb, var(--encre) 55%, transparent);
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s var(--ease), visibility 0s linear .4s;
}
.panneau.ouvert { opacity: 1; visibility: visible; transition-delay: 0s; }
@supports (backdrop-filter: blur(4px)) {
  .panneau { backdrop-filter: blur(6px); }
}
.panneau-boite {
  width: min(100%, 60rem);
  border-radius: 16px;
  background: var(--sable);
  box-shadow: var(--ombre-haute);
  transform: translateY(18px);
  transition: transform .45s var(--ease);
}
.panneau.ouvert .panneau-boite { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .panneau, .panneau-boite { transition: opacity .01s linear, visibility 0s; transform: none; }
}

.panneau-tete {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--filet);
  border-radius: 16px 16px 0 0;
  background: var(--sable);
}
.panneau-nom {
  margin: 0;
  font-family: var(--titre);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: -.02em;
}
.panneau-x {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--bord);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.panneau-x:focus-visible { outline: 2px solid var(--encre); outline-offset: 3px; }
.panneau-corps { padding: clamp(1.25rem, 3vw, 2rem); }

.detail-apercu {
  display: block;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--filet);
  margin-bottom: 1.75rem;
}
.detail-grille { display: grid; gap: clamp(1.5rem, 3vw, 2.25rem); }
@media (min-width: 46rem) { .detail-grille { grid-template-columns: 1.15fr .85fr; } }

.detail-bloc + .detail-bloc { margin-top: 1.75rem; }
.detail-t {
  margin: 0 0 .6rem;
  font-size: var(--t-micro);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--encre-72);
}
.detail-p { margin: 0; font-size: var(--t-small); text-wrap: pretty; }
.detail-liste { margin: 0; padding-left: 1.1rem; font-size: var(--t-small); }
.detail-liste li { margin-bottom: .3rem; }

.palette { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.copie {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  padding: .45rem .6rem;
  border: 1px solid var(--filet);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--t-small);
  text-align: left;
  cursor: pointer;
  transition: background-color .3s var(--ease);
}
@media (hover: hover) { .copie:hover { background: var(--encre-05); } }
.copie:focus-visible { outline: 2px solid var(--encre); outline-offset: 2px; }
.copie .echantillon {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 5px;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(51, 41, 31, .2);
}
.copie .hex {
  margin-left: auto;
  font-family: ui-monospace, Menlo, monospace;
  font-size: var(--t-micro);
  color: var(--encre-72);
  text-transform: uppercase;
}
.copie[data-copie="oui"] .hex::after { content: " copié"; color: var(--mousse); }

.specimen { border: 1px solid var(--filet); border-radius: 10px; padding: 1rem 1.1rem; }
.specimen + .specimen { margin-top: .6rem; }
.specimen-nom {
  margin: 0 0 .4rem;
  font-size: var(--t-micro);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--encre-72);
}
.specimen-exemple { margin: 0; line-height: 1.25; }

.panneau-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--filet);
}

/* ── Fin de page ──────────────────────────────────────────────────────── */

.cat-fin {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: clamp(3.5rem, 8vw, 6rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--filet);
}
.cat-fin-p {
  max-width: 30ch;
  margin: 0;
  font-family: var(--titre);
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.02em;
}

/* ── Révélation ───────────────────────────────────────────────────────── */

.js.reveal-on .fiche { opacity: 0; transform: translateY(16px); }
.js.reveal-on .fiche.vu {
  opacity: 1;
  transform: none;
  transition: opacity .75s var(--ease) var(--delai, 0ms), transform .75s var(--ease) var(--delai, 0ms);
}
/* Pendant un réagencement FLIP, aucune transition d'opacité ne doit interférer. */
.grille.bouge .fiche { transition: transform .45s var(--ease); }

/* Libellé réservé aux lecteurs d'écran. */
.vh {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}
