@charset "UTF-8";
/* ==========================================================================
   Article « Poêle à bois : MaPrimeRénov' par geste, c'est fini.
   Quelles aides restent ? »
   Complète css/article-foyer-ouvert.css (composants communs .foyer-*) :
   scène d'ouverture, chiffres, graphique, comparatif avant / après
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Scène d'ouverture (cycle de 12 s)
      0-30 %   vieil appareil, fumée noire, forfait MaPrimeRénov' affiché
      18-46 %  calendrier 1er septembre, tampon « SUPPRIMÉ »
      40-58 %  trois autres aides tombent dans la tirelire
      53-75 %  ramonage (hérisson, repris de article-foyer-ouvert.css)
      76-100 % poêle performant, fumée claire, coche
   -------------------------------------------------------------------------- */
.ab-scene {
  background: linear-gradient(180deg, #D7E8F3 0%, #EEF5FA 62%, #F6F2EA 62%, #F6F2EA 100%);
}

.ab-ancien {
  animation: ab-ancien 12s ease-in-out infinite;
}

@keyframes ab-ancien {
  0%, 46%  { opacity: 1; transform: translateY(0); }
  50%, 97% { opacity: 0; transform: translateY(8px); }
  100%     { opacity: 1; transform: translateY(0); }
}

.ab-nouveau {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: ab-nouveau 12s cubic-bezier(0.2, 0.7, 0.2, 1) infinite;
}

@keyframes ab-nouveau {
  0%, 75%  { opacity: 0; transform: scale(0.6); }
  79%      { opacity: 1; transform: scale(1.06); }
  82%, 96% { opacity: 1; transform: scale(1); }
  99%, 100%{ opacity: 0; transform: scale(1); }
}

/* Forfait, tampon et calendrier */
.ab-forfait {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: ab-forfait 12s ease-in-out infinite;
}

@keyframes ab-forfait {
  0%       { opacity: 0; transform: translateY(-10px); }
  4%, 38%  { opacity: 1; transform: none; }
  46%, 100%{ opacity: 0; transform: translateY(30px) rotate(6deg); }
}

.ab-tampon {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: ab-tampon 12s ease-out infinite;
}

@keyframes ab-tampon {
  0%, 23%  { opacity: 0; transform: scale(1.8) rotate(-14deg); }
  26%      { opacity: 1; transform: scale(0.94) rotate(-8deg); }
  28%, 38% { opacity: 1; transform: scale(1) rotate(-8deg); }
  46%, 100%{ opacity: 0; transform: translateY(30px) scale(1) rotate(-2deg); }
}

.ab-calendrier {
  transform-box: fill-box;
  transform-origin: 50% 0;
  animation: ab-calendrier 12s ease-out infinite;
}

@keyframes ab-calendrier {
  0%, 17%  { opacity: 0; transform: rotateX(90deg); }
  21%      { opacity: 1; transform: rotateX(-12deg); }
  23%, 44% { opacity: 1; transform: none; }
  48%, 100%{ opacity: 0; transform: none; }
}

/* Les trois aides qui tombent dans la tirelire */
.ab-piece {
  opacity: 0;
  animation: ab-piece 12s cubic-bezier(0.5, 0, 0.75, 0) infinite;
}

.ab-piece--1 { --dx: 61px; }
.ab-piece--2 { --dx: -6px;  animation-delay: 0.35s; }
.ab-piece--3 { --dx: -82px; animation-delay: 0.7s; }

@keyframes ab-piece {
  0%, 37%  { opacity: 0; transform: translate(0, -14px); }
  41%, 46% { opacity: 1; transform: translate(0, 0); }
  52%      { opacity: 1; transform: translate(var(--dx), 56px) scale(0.7); }
  54%, 100%{ opacity: 0; transform: translate(var(--dx), 62px) scale(0.5); }
}

.ab-tirelire {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: ab-tirelire 12s ease-in-out infinite;
}

@keyframes ab-tirelire {
  0%, 51%, 62%, 100% { transform: scale(1, 1); }
  54%      { transform: scale(1.05, 0.94); }
  57%      { transform: scale(0.98, 1.03); }
}

/* --------------------------------------------------------------------------
   2. Les chiffres
   -------------------------------------------------------------------------- */
.ab-chiffre__valeur {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--encre);
  font-variant-numeric: tabular-nums;
}

.ab-chiffres .foyer-cle:nth-child(3) .ab-chiffre__valeur {
  color: var(--accent-fonce);
}

/* --------------------------------------------------------------------------
   3. Graphique : part des gestes financés (barres horizontales)
   -------------------------------------------------------------------------- */
.ab-graphique__intro {
  max-width: 720px;
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--texte);
}

.ab-legende {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  font-weight: 700;
  color: var(--encre);
  white-space: nowrap;
}

.ab-legende__pastille {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--accent);
}

.ab-graphique {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.ab-graphique tr {
  transition: background 0.2s ease;
}

.ab-graphique tr:hover {
  background: var(--pale);
}

.ab-graphique th {
  width: 220px;
  padding: 5px 12px 5px 0;
  font-weight: 600;
  color: var(--texte);
  text-align: left;
  white-space: nowrap;
}

.ab-graphique__bois th {
  font-weight: 800;
  color: var(--encre);
}

.ab-graphique td {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}

.ab-barre {
  display: block;
  flex: 0 0 auto;
  width: calc(var(--valeur) * 0.8);
  height: 16px;
  border-radius: 0 4px 4px 0;
  background: #C9CDD3;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  transition-delay: calc(var(--rang) * 0.1s + 0.2s);
}

.ab-graphique__bois .ab-barre {
  background: var(--accent);
}

.ab-barre__valeur {
  font-weight: 800;
  color: var(--encre);
  font-variant-numeric: tabular-nums;
  transition: opacity 0.4s ease;
  transition-delay: calc(var(--rang) * 0.1s + 1s);
}

.ab-graphique__note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--discret);
}

.foyer.anime-ok .ab-barre { width: 0; }
.foyer.anime-ok .ab-barre__valeur { opacity: 0; }
.foyer.anime-ok .ab-graphique.est-visible .ab-barre { width: calc(var(--valeur) * 0.8); }
.foyer.anime-ok .ab-graphique.est-visible .ab-barre__valeur { opacity: 1; }

/* --------------------------------------------------------------------------
   4. Comparatif : ce qui n'est plus financé (barré l'un après l'autre)
      et ce qui l'est encore
   -------------------------------------------------------------------------- */
.ab-comparatif {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ab-colonne {
  padding: 16px 18px;
  border: 1px solid var(--trait);
  border-top: 4px solid var(--foyer-rouge);
  border-radius: 16px;
  background: var(--blanc);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.ab-colonne--reste {
  border-top-color: var(--foyer-vert);
}

.ab-colonne__titre {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
  color: var(--encre);
}

.ab-colonne--retire .ab-colonne__titre svg { color: var(--foyer-rouge); }
.ab-colonne--reste .ab-colonne__titre svg { color: var(--foyer-vert); }

.ab-colonne ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  line-height: 1.45;
  color: var(--texte);
}

.ab-colonne li {
  position: relative;
  padding-left: 22px;
}

.ab-colonne li::before {
  content: "";
  position: absolute;
  top: 0.55em;
  left: 2px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--foyer-vert);
}

.ab-colonne--retire li::before {
  background: var(--foyer-rouge);
}

/* Le texte se barre : trait qui se dessine de gauche à droite */
.ab-colonne--retire li span {
  background: linear-gradient(var(--foyer-rouge), var(--foyer-rouge)) no-repeat 0 55% / 100% 2px;
  transition: background-size 0.5s ease, color 0.5s ease;
}

.ab-colonne--retire li span { color: var(--discret); }

.foyer.anime-ok .ab-colonne--retire li span {
  background-size: 0 2px;
  color: var(--texte);
}

.foyer.anime-ok .ab-comparatif.est-visible .ab-colonne--retire li span {
  background-size: 100% 2px;
  color: var(--discret);
}

.ab-comparatif.est-visible .ab-colonne--retire li:nth-child(1) span { transition-delay: 0.6s; }
.ab-comparatif.est-visible .ab-colonne--retire li:nth-child(2) span { transition-delay: 0.9s; }
.ab-comparatif.est-visible .ab-colonne--retire li:nth-child(3) span { transition-delay: 1.2s; }
.ab-comparatif.est-visible .ab-colonne--retire li:nth-child(4) span { transition-delay: 1.5s; }
.ab-comparatif.est-visible .ab-colonne--retire li:nth-child(5) span { transition-delay: 1.8s; }

/* La colonne « encore financé » arrive ensuite */
.foyer.anime-ok .ab-colonne--reste {
  opacity: 0;
  transform: translateX(24px);
}

.foyer.anime-ok .ab-comparatif.est-visible .ab-colonne--reste {
  opacity: 1;
  transform: none;
  transition-delay: 2.2s;
}

/* --------------------------------------------------------------------------
   Mobile et mouvement réduit
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .ab-comparatif {
    grid-template-columns: minmax(0, 1fr);
  }

  .ab-graphique th {
    width: 140px;
    font-size: 13px;
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ab-barre { width: calc(var(--valeur) * 0.8) !important; }
  .ab-barre__valeur { opacity: 1 !important; }
  .ab-colonne--reste { opacity: 1 !important; transform: none !important; }
  .ab-colonne--retire li span { background-size: 100% 2px !important; color: var(--discret) !important; }

  /* Image fixe : état final (poêle performant, fumée claire, aides dans la tirelire) */
  .ab-ancien, .ab-forfait, .ab-tampon, .ab-calendrier, .ab-piece {
    opacity: 0 !important;
  }

  .ab-nouveau { opacity: 1 !important; transform: none !important; }
}
