/* Section 03 — Réalisations : huit cartes sombres (prototype index.html:14-23, 62-63, 88-91, 288-400) */

.cartes-sombres {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
  gap: 24px;
  margin-top: 40px;
}

/* Marges des paragraphes et listes à spécificité nulle : les classes ci-dessous les surchargent */
:where(.carte-sombre) :where(p, ul) {
  margin: 0;
}

:where(.carte-sombre) p {
  font-size: clamp(15px, 0.95vw, 18px);
  line-height: 1.6;
  color: var(--texte-corps-sombre);
}

:where(.carte-sombre) ul {
  padding-left: 20px;
  font-size: clamp(15px, 0.95vw, 18px);
  line-height: 1.7;
  color: var(--texte-corps-sombre);
}

/* Survol par la propriété translate : indépendante de transform, que .rv.in remet à none */
.carte-sombre {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px;
  border: 1px solid var(--bordure-carte-sombre);
  background: var(--fond-carte-sombre);
  transition:
    translate 0.4s cubic-bezier(0.2, 0.7, 0.2, 1),
    border-color 0.4s cubic-bezier(0.2, 0.7, 0.2, 1),
    background-color 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Liste complète : celle de .rv (motion.css) serait sinon écrasée. Spécificité 0,2,0 > .rv 0,1,0 */
.carte-sombre.in {
  transition:
    opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) var(--rd, 0s),
    transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) var(--rd, 0s),
    translate 0.4s cubic-bezier(0.2, 0.7, 0.2, 1),
    border-color 0.4s cubic-bezier(0.2, 0.7, 0.2, 1),
    background-color 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Aucune ombre : ADR 0002 ne l'admet que pour les cartes claires */
.carte-sombre:hover {
  translate: 0 -6px;
  border-color: var(--ambre);
  background-color: var(--fond-carte-sombre-survol);
}

.carte-sombre h3 {
  margin: 0;
  font-family: var(--police-titre);
  font-size: clamp(24px, 1.5vw, 30px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: #fff;
}

.carte-sombre strong {
  font-weight: 600;
  color: #fff;
}

/* Mise en évidence dans les listes de la grille (« 15 600 pixels ») */
.cartes-sombres li strong {
  color: var(--ambre);
}

/* Étiquettes : « LE BESOIN », « RÉSULTATS » (ambre) et surtitre « CAS 0N · SECTEUR » (gris) */
.etiquette {
  font-family: var(--police-mono);
  font-size: 12px;
  color: var(--ambre);
}

.etiquette-cas {
  letter-spacing: 0.1em;
  color: var(--texte-secondaire-sombre);
}

/* Cas vedette : deux colonnes qui passent l'une sous l'autre (flex-wrap) */
.carte-sombre--vedette {
  flex-flow: row wrap;
  gap: 0;
  padding: 0;
}

.vedette-gauche,
.vedette-droite {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(28px, 4vw, 48px);
}

.vedette-gauche {
  flex: 1 1 380px;
  gap: 20px;
  border-right: 1px solid var(--bordure-carte-sombre);
}

.vedette-droite {
  flex: 1 1 380px;
}

.carte-sombre--vedette h3 {
  font-size: clamp(26px, 2.8vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.bloc {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vedette-droite > .etiquette {
  margin-bottom: 12px;
}

.resultat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 0;
  border-bottom: 1px solid var(--bordure-carte-sombre);
}

.resultat p {
  line-height: 1.55;
}

.carte-sombre .resultat-valeur {
  font-family: var(--police-titre);
  font-size: clamp(40px, 2.6vw, 60px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
}

.vedette-droite > ul {
  margin-top: 20px;
}

/* Paragraphes de la colonne gauche : 16 px, sauf les étiquettes (12 px) */
.vedette-gauche .bloc p {
  font-size: 16px;
}

.vedette-gauche .bloc .etiquette {
  font-size: 12px;
}

/* Cartes statistiques : cellules séparées par un filet de 1 px */
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--bordure-carte-sombre);
  background: var(--bordure-carte-sombre);
  list-style: none;
}

.stat {
  padding: 16px;
  background: var(--encre);
}

.carte-sombre .stat-valeur {
  font-family: var(--police-titre);
  font-size: 25px;
  font-weight: 600;
  line-height: 1.05;
  white-space: nowrap;
  color: var(--ambre);
}

.carte-sombre .stat-libelle {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.45;
}

/* Replis natifs : fermés au chargement, sans script */
.repli {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--bordure-carte-sombre);
}

.vedette-gauche .repli {
  margin-top: 0;
  padding-top: 14px;
}

.repli summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  font-size: 14px;
  font-weight: 500;
  color: #e8e6e0;
  list-style: none;
  cursor: pointer;
}

.repli summary::-webkit-details-marker {
  display: none;
}

.repli summary:focus-visible {
  outline: 2px solid var(--ambre);
  outline-offset: 3px;
}

.plus {
  font-size: 22px;
  line-height: 1;
  color: var(--ambre);
  transition: transform 0.2s ease;
}

.repli[open] .plus {
  transform: rotate(45deg);
}

.repli ul {
  margin: 8px 0 12px;
}

.carte-sombre .repli-techno {
  margin-top: 8px;
  font-family: var(--police-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--texte-secondaire-sombre);
}

.repli ul + .repli-techno {
  margin-top: 0;
}

/* Bouton sortant : valeurs du prototype index.html:382, survol index.html:19,88 */
.btn-sortant,
.on-dark a.btn-sortant {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--bordure-sombre);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: #e8e6e0;
  transition:
    color 0.25s,
    border-color 0.25s,
    transform 0.25s;
}

.btn-sortant:hover,
.on-dark a.btn-sortant:hover {
  border-color: var(--ambre);
  color: #fff;
  transform: translateY(-2px);
}

.btn-sortant svg {
  flex: none;
}

@media (prefers-reduced-motion: reduce) {
  .carte-sombre,
  .carte-sombre.in,
  .plus,
  .btn-sortant,
  .on-dark a.btn-sortant {
    transition: none;
  }

  .carte-sombre:hover {
    translate: none;
  }

  .btn-sortant:hover,
  .on-dark a.btn-sortant:hover {
    transform: none;
  }
}
