/* =========================================================================================================
   Suivi de chantier (inc/chantier.php)
   - .chx      : actualité de l'accueil, juste après le hero (mosaïque des photos réelles + texte sur fond clair)
   - .chx-sec  : section « Suivi du chantier » de la fiche (dernière étape, galerie, historique des étapes)
   - .chip--chantier : badge du haut de la fiche
   Bleu de marque pour le badge et les accents ; seule animation : un point qui pulse trois fois (aucune avec
   prefers-reduced-motion) et l'apparition du thème (data-reveal).
   ========================================================================================================= */

.chx-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.chx-dot::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: currentColor; opacity: 0.5; animation: lc-chx-pulse 1800ms ease-out 3; }
@keyframes lc-chx-pulse { from { transform: scale(1); opacity: 0.5; } to { transform: scale(2.8); opacity: 0; } }

/* ---------- Accueil ---------- */
.chx { padding-block: clamp(48px, 6vw, 96px) clamp(24px, 3vw, 40px); }
.chx__card {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); align-items: stretch;
  border-radius: var(--lc-radius); overflow: hidden; background: #fff;
  box-shadow: var(--lc-shadow-soft); border: 1px solid var(--lc-line);
}
.chx__media {
  display: grid; gap: 6px; padding: 6px; min-height: clamp(380px, 40vw, 560px); background: #fff; text-decoration: none;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); grid-template-rows: 1fr 1fr;
}
.chx__media--1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.chx__media--2 { grid-template-rows: 1fr; }
.chx__ph { position: relative; overflow: hidden; border-radius: calc(var(--lc-radius) - 8px); background: var(--lc-mist-2); }
.chx__media--3 .chx__ph:first-child { grid-row: 1 / span 2; }
.chx__ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1200ms var(--lc-ease); }
@media (hover: hover) and (pointer: fine) { .chx__media:hover .chx__ph img { transform: scale(1.035); } }

.chx__body { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 16px; padding: clamp(28px, 4vw, 60px); }
.chx__badge {
  display: inline-flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 16px 0 13px; border-radius: 999px;
  background: var(--lc-blue); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}
.chx__meta { display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 13.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--lc-ink-soft); }
.chx__meta span + span::before { content: '·'; margin: 0 10px; color: var(--lc-blue); }
.chx__title { font-family: var(--lc-font-display); font-weight: 400; font-size: clamp(2rem, 3.4vw, 3.2rem); line-height: 1.04; letter-spacing: -0.02em; color: var(--lc-ink); text-wrap: balance; }
.chx__title em { color: var(--lc-blue); }
.chx__text { max-width: 44ch; font-size: clamp(1.02rem, 1.25vw, 1.15rem); line-height: 1.6; color: var(--lc-ink-soft); }
.chx__text p + p { margin-top: 0.7em; }
.chx__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 8px; }
.chx__more { font-weight: 600; }

@media (max-width: 1000px) {
  .chx__card { grid-template-columns: 1fr; }
  .chx__media { min-height: 0; aspect-ratio: 16 / 11; }
}
@media (max-width: 560px) {
  .chx__media { aspect-ratio: auto; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
  .chx__media--3 .chx__ph:first-child { grid-row: auto; grid-column: 1 / -1; aspect-ratio: 4 / 3; }
  .chx__media--3 .chx__ph:not(:first-child), .chx__media--2 .chx__ph { aspect-ratio: 1 / 1; }
  .chx__media--1 .chx__ph { aspect-ratio: 4 / 3; grid-column: 1 / -1; }
  .chx__actions { width: 100%; }
  .chx__cta { width: 100%; }
}

/* ---------- Fiche du programme ---------- */
.chip--chantier { gap: 9px; background: var(--lc-blue); color: #fff; border-color: transparent; }

.chx-sec__text { max-width: 62ch; margin-bottom: 22px; }
.chx-gallery { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* .gallery.chx-gallery : plus spécifique que .gallery a / .gallery a:first-child (main.css), dont on garde la visionneuse */
.gallery.chx-gallery a, .gallery.chx-gallery a:first-child { grid-column: auto; grid-row: auto; position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--lc-radius-s, 14px); background: var(--lc-mist-2); }
.chx-gallery img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--lc-ease); }
@media (hover: hover) and (pointer: fine) { .chx-gallery a:hover img { transform: scale(1.04); } }
.chx-gallery--1 { grid-template-columns: minmax(0, 520px); }
.chx-gallery--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chx-gallery--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.chx-gallery--mini { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); margin-top: 12px; }

.chx-sec__past { margin: clamp(32px, 4vw, 48px) 0 14px; }
.chx-timeline { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 2px solid var(--lc-sky); display: grid; gap: 26px; }
.chx-timeline__item { position: relative; }
.chx-timeline__item::before { content: ''; position: absolute; left: -29px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--lc-blue); }
.chx-timeline__date { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lc-blue); }
.chx-timeline__t { margin-top: 4px; font-size: 1.15rem; font-weight: 700; }
.chx-timeline__txt { margin-top: 6px; color: var(--lc-ink-soft); }

@media (max-width: 700px) {
  .chx-gallery, .chx-gallery--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery.chx-gallery--3 a:first-child { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
  .chx-gallery--1 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .chx-dot::after { animation: none; }
  .chx__ph img, .chx-gallery img { transition: none; }
}
