/* L'année de l'humanité (page-annee-de-l-humanite.php, assets/js/annee.js).
   Fond nuit (--hero-bg), une lueur terre de Sienne qui monte avec l'année
   (--an-p, de 0 à 1, posée par le JS). Sans JS : une simple liste. */

.esp-an {
  --an-p: 0;
  --an-top: var(--header-h);
  --an-txt: var(--hero-1);
  --an-mute: rgba(236, 232, 225, .62);
  --an-line: rgba(236, 232, 225, .16);
  --an-acc: color-mix(in srgb, var(--accent), #fff 28%);
  position: relative;
  /* Une lueur qui monte avec l'année. */
  background:
    radial-gradient(ellipse 90% 60% at 50% 110%, color-mix(in srgb, var(--accent) calc(8% + var(--an-p) * 34%), transparent), transparent 70%) fixed,
    var(--hero-bg);
  color: var(--an-txt);
}
/* ---------- Intro ---------- */
.esp-an__intro { padding: 96px 0 72px; text-align: center; }
.esp-an__intro .eyebrow { color: var(--hero-2); opacity: .8; }
.esp-an__h1 {
  font-family: var(--display); font-weight: 600; letter-spacing: 0;
  font-size: clamp(42px, 7vw, 96px); line-height: 1; margin: 18px 0 22px; color: var(--an-txt);
}
.esp-an__lead { font-size: clamp(17px, 1.8vw, 21px); line-height: 1.55; max-width: 44ch; margin: 0 auto; color: var(--hero-2); }
.esp-an__echelle {
  list-style: none; padding: 0; margin: 36px auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
}
.esp-an__echelle li {
  border: 1px solid var(--an-line); border-radius: 2px; padding: 10px 16px;
  font-size: 15px; color: var(--an-mute);
}
.esp-an__echelle strong { color: var(--an-txt); font-weight: 500; }
.esp-an__go { margin-top: 36px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ---------- Horloge-calendrier (collante) ---------- */
.esp-an__hud {
  position: sticky; top: var(--an-top); z-index: 5;
  background: rgba(20, 18, 16, .88);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--an-line); border-bottom: 1px solid var(--an-line);
}
.esp-an__hud-in {
  max-width: var(--maxw); margin: 0 auto; padding: 10px var(--gutter);
  display: flex; align-items: center; gap: 22px;
}
.esp-an__cal {
  flex: none; width: 62px; text-align: center; background: var(--hero-1); color: var(--ink);
  border-radius: 2px; overflow: hidden; box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .6);
}
.esp-an__cal-mois {
  display: block; background: var(--accent); color: #fff; font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; padding: 3px 0;
}
.esp-an__cal-jour { display: block; font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1.15; padding: 2px 0 4px; }
.esp-an__hud-txt { flex: none; min-width: 210px; display: flex; flex-direction: column; }
.esp-an__heure { font-family: var(--display); font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.1; }
.esp-an__ilya { font-size: 14px; color: var(--an-mute); }
.esp-an__barre {
  position: relative; flex: 1; height: 26px; display: grid; grid-template-columns: repeat(12, 1fr);
  border: 1px solid var(--an-line); border-radius: 2px; overflow: hidden;
}
.esp-an__barre i {
  position: relative; font-style: normal; font-size: 11px; color: var(--an-mute);
  display: flex; align-items: center; justify-content: center; border-left: 1px solid var(--an-line);
}
.esp-an__barre i:first-of-type { border-left: 0; }
.esp-an__barre-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(90deg, rgba(156, 91, 52, .35), var(--accent));
}
.esp-an__stop {
  flex: none; background: transparent; color: var(--an-txt); border: 1px solid var(--an-line);
  border-radius: 2px; padding: 7px 14px; font: inherit; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; cursor: pointer;
}
.esp-an__stop:hover { border-color: var(--hero-1); }

/* ---------- Les actes ---------- */
.esp-an__acte { padding: 120px 0 40px; }
.esp-an__acte-tete { text-align: center; max-width: 640px; margin: 0 auto 64px; padding: 0 var(--gutter); }
.esp-an__acte-num { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--an-acc); }
.esp-an__acte-titre { font-family: var(--display); font-weight: 600; font-size: clamp(34px, 5vw, 64px); line-height: 1.05; margin: 10px 0 14px; color: var(--an-txt); }
.esp-an__acte-sous { font-size: 18px; line-height: 1.55; color: var(--hero-2); margin: 0; }

.esp-an__piste {
  list-style: none; margin: 0 auto; padding: 0 var(--gutter); max-width: var(--maxw);
  display: flex; flex-direction: column; gap: 22px;
}
.esp-an__m { max-width: 560px; }

/* Mise en place par le JS : chaque moment à sa date, le long d'une ligne. */
.esp-an.is-js .esp-an__piste { position: relative; display: block; }
.esp-an.is-js .esp-an__piste::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px;
  background: linear-gradient(var(--an-line), var(--an-line)) no-repeat;
}
.esp-an.is-js .esp-an__m { position: absolute; top: 0; width: calc(50% - 48px - var(--gutter) / 2); max-width: 440px; }
.esp-an.is-js .esp-an__m.is-g { right: calc(50% + 34px); }
.esp-an.is-js .esp-an__m.is-d { left: calc(50% + 34px); }
.esp-an.is-js .esp-an__m::after {
  content: ""; position: absolute; top: 16px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--hero-bg); border: 2px solid var(--an-mute); transition: background .4s, border-color .4s, transform .4s;
}
.esp-an.is-js .esp-an__m.is-g::after { right: -41px; }
.esp-an.is-js .esp-an__m.is-d::after { left: -41px; }
.esp-an.is-js .esp-an__m.is-on::after { background: var(--accent); border-color: var(--accent); transform: scale(1.25); }
.esp-an.is-js .esp-an__m--redecouverte.is-on::after { background: var(--hero-1); border-color: var(--hero-1); }

/* Respirations : au milieu, sur la ligne. */
.esp-an.is-js .esp-an__m--calme { left: 50%; right: auto; width: min(440px, calc(100% - 2 * var(--gutter))); transform: translateX(-50%); }
.esp-an.is-js .esp-an__m--calme::after { display: none; }
.esp-an__m--calme p {
  margin: 0; padding: 18px 20px; text-align: center; background: var(--hero-bg);
  font-size: 16px; font-weight: 300; line-height: 1.55; color: var(--an-mute); font-style: italic;
}

/* Cartes */
.esp-an__carte {
  display: flex; flex-direction: column; overflow: hidden;
  background: rgba(236, 232, 225, .045); border: 1px solid var(--an-line); border-radius: 2px;
  transition: opacity .6s ease, transform .6s ease, border-color .6s;
}
.esp-an.is-js .esp-an__m:not(.is-on) .esp-an__carte { opacity: .28; transform: translateY(18px); }
.esp-an.is-js .esp-an__m:not(.is-on).esp-an__m--calme p { opacity: .35; }
.esp-an__m--calme p { transition: opacity .6s; }
.esp-an__m--individu .esp-an__carte { border-color: rgba(156, 91, 52, .55); }
.esp-an__m--redecouverte .esp-an__carte { border-color: rgba(236, 232, 225, .4); background: rgba(236, 232, 225, .08); }
.esp-an__fig { margin: 0; position: relative; aspect-ratio: 2 / 1; background: #1f1c19; }
.esp-an__fig img { width: 100%; height: 100%; object-fit: cover; display: block; }
.esp-an__fig figcaption {
  position: absolute; right: 0; bottom: 0; max-width: 100%; padding: 3px 7px; font-size: 10.5px;
  color: rgba(255, 255, 255, .78); background: rgba(0, 0, 0, .5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.esp-an__corps { padding: 16px 20px 18px; }
.esp-an__date { margin: 0 0 4px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--an-acc); }
.esp-an__titre { font-family: var(--display); font-weight: 500; font-size: 24px; line-height: 1.15; margin: 0 0 4px; color: var(--an-txt); }
.esp-an__meta { margin: 0 0 10px; font-size: 14px; color: var(--an-mute); }
.esp-an__texte { margin: 0; font-size: 16px; font-weight: 300; line-height: 1.55; color: var(--hero-2); }
.esp-an__lien { display: inline-block; margin-top: 12px; color: var(--an-acc); }
.esp-an__lien:hover { color: var(--hero-1); }

/* ---------- Minuit ---------- */
.esp-an__fin { padding: 140px 0 120px; text-align: center; }
.esp-an__minuit { font-family: var(--display); font-size: clamp(22px, 3vw, 30px); color: var(--an-acc); margin: 0 0 10px; letter-spacing: .04em; }
.esp-an__fin-titre { font-family: var(--display); font-weight: 600; font-size: clamp(32px, 4.6vw, 58px); line-height: 1.08; margin: 0 auto 30px; max-width: 18ch; color: var(--an-txt); }
.esp-an__naiss { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; }
.esp-an__naiss label { width: 100%; font-size: 15px; color: var(--an-mute); }
.esp-an__naiss input {
  width: 150px; padding: 13px 14px; font: inherit; font-size: 20px; text-align: center;
  background: transparent; color: var(--an-txt); border: 1px solid rgba(236, 232, 225, .4); border-radius: 2px;
}
.esp-an__naiss input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.esp-an__verdict { min-height: 1.5em; margin: 26px auto 0; max-width: 34ch; font-family: var(--display); font-size: clamp(22px, 2.6vw, 30px); line-height: 1.3; color: var(--an-txt); }
.esp-an__verdict strong { color: var(--an-acc); font-weight: 500; }
.esp-an__bilan {
  list-style: none; padding: 0; margin: 56px auto 0; max-width: 980px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; text-align: left;
}
.esp-an__bilan li { border-top: 2px solid var(--accent); padding: 14px 4px 0; font-size: 15px; font-weight: 300; line-height: 1.5; color: var(--hero-2); }
.esp-an__bilan strong { display: block; font-family: var(--display); font-size: 21px; font-weight: 500; color: var(--an-txt); margin-bottom: 6px; }
.esp-an__suite { margin-top: 56px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.esp-an__note { margin: 40px auto 0; max-width: 60ch; font-size: 13px; color: var(--an-mute); }

/* Le panneau newsletter fixe occupe la droite de l'écran dès 1024 px :
   la frise se décale à gauche pour qu'aucune carte ne passe dessous. */
@media (min-width: 1024px) {
  .esp-an.is-js .esp-an__piste {
    --an-pw: min(1040px, calc(100vw - 2 * var(--gutter) - 310px));
    width: var(--an-pw); max-width: none; box-sizing: border-box;
    margin-left: max(var(--gutter), calc((100vw - 310px - var(--an-pw)) / 2)); margin-right: 0;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .esp-an__bilan { grid-template-columns: repeat(2, 1fr); }
  .esp-an__hud-txt { min-width: 180px; }
}
@media (max-width: 860px) {
  .esp-an.is-js .esp-an__piste::before { left: calc(var(--gutter) + 6px); margin-left: 0; }
  .esp-an.is-js .esp-an__m,
  .esp-an.is-js .esp-an__m.is-g,
  .esp-an.is-js .esp-an__m.is-d { left: calc(var(--gutter) + 34px); right: auto; width: calc(100% - 2 * var(--gutter) - 34px); max-width: none; }
  .esp-an.is-js .esp-an__m.is-g::after,
  .esp-an.is-js .esp-an__m.is-d::after { left: -34px; right: auto; }
  .esp-an.is-js .esp-an__m--calme { left: calc(var(--gutter) + 34px); transform: none; width: calc(100% - 2 * var(--gutter) - 34px); }
  .esp-an__m--calme p { text-align: left; padding: 10px 0; }
}
@media (max-width: 620px) {
  .esp-an__intro { padding: 64px 0 52px; }
  .esp-an__hud-in { gap: 12px; padding: 8px 16px; flex-wrap: wrap; }
  .esp-an__cal { width: 58px; }
  .esp-an__cal-mois { font-size: 9px; letter-spacing: .04em; }
  .esp-an__cal-jour { font-size: 24px; }
  .esp-an__hud-txt { min-width: 0; flex: 1; }
  .esp-an__heure { font-size: 21px; }
  .esp-an__ilya { font-size: 13px; }
  .esp-an__barre { order: 3; flex: 1 0 100%; height: 18px; }
  .esp-an__barre i { font-size: 9.5px; }
  .esp-an__acte { padding-top: 88px; }
  .esp-an__acte-tete { margin-bottom: 44px; }
  .esp-an__acte-sous { font-size: 16px; }
  .esp-an__titre { font-size: 21px; }
  .esp-an__texte { font-size: 15px; }
  .esp-an__bilan { grid-template-columns: 1fr; }
  .esp-an__fin { padding: 100px 0 90px; }
}
@media (prefers-reduced-motion: reduce) {
  .esp-an__carte, .esp-an__m--calme p, .esp-an.is-js .esp-an__m::after { transition: none; }
  .esp-an.is-js .esp-an__m:not(.is-on) .esp-an__carte { transform: none; }
}
