/* ==================================================
   PUBLIC PREMIUM
   Composants publics mutualisés
   Compatible avec le base.html.twig actuel
================================================== */

/* ----------------------------------------------
   Helpers généraux
---------------------------------------------- */

.page-shell{
  display:flex;
  flex-direction:column;
  gap:32px;
  margin:10px 0 28px;
}

.section-block{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}

.section-title{
  margin:0;
  font-size:34px;
  line-height:1.08;
  letter-spacing:-.02em;
  color:var(--ink);
  font-weight:950;
}

.section-desc{
  margin:8px 0 0;
  max-width:860px;
  color:var(--muted);
  line-height:1.75;
  font-size:15px;
}

.section-action{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:var(--accent-2);
  text-decoration:none;
  font-size:14px;
  font-weight:900;
  white-space:nowrap;
}

.section-action:hover{
  text-decoration:underline;
}

.page-kicker{
  display:inline-flex;
  align-items:center;
  gap:8px;
  width:max-content;
  padding:7px 12px;
  border-radius:999px;
  background:#ffffff;
  border:1px solid #e6ecf3;
  color:var(--accent-2);
  font-size:11px;
  font-weight:900;
  letter-spacing:.4px;
  text-transform:uppercase;
}

.empty-state{
  color:var(--muted);
  font-weight:700;
  padding:22px;
  border:1px dashed var(--line-strong);
  border-radius:16px;
  background:#ffffff;
  line-height:1.75;
}

/* ----------------------------------------------
   Hero générique
---------------------------------------------- */

.page-hero{
  position:relative;
  overflow:hidden;
  border-radius:24px;
  border:1px solid var(--line);
  background:linear-gradient(135deg, #ffffff 0%, #ffffff 55%, #ffffff 100%);
  padding:32px;
}

.page-hero > *{
  position:relative;
  z-index:1;
}

.page-hero--dark{
  color:#fff;
  border:1px solid rgba(255,255,255,.08);
  background:
    linear-gradient(135deg, rgba(28,42,34,.94) 0%, rgba(50,73,59,.92) 58%, rgba(80,109,89,.90) 100%);
}

.page-hero--dark::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    linear-gradient(90deg, rgba(206,17,38,.06) 0 33.333%, rgba(252,209,22,.04) 33.333% 66.666%, rgba(43,79,61,.08) 66.666% 100%);
  pointer-events:none;
}

.page-hero__title{
  margin:0 0 12px;
  font-size:clamp(32px, 4vw, 52px);
  line-height:1.05;
  letter-spacing:-.03em;
  font-weight:950;
}

.page-hero__intro{
  margin:0;
  max-width:920px;
  font-size:16px;
  line-height:1.85;
  color:var(--muted);
}

.page-hero--dark .page-hero__intro{
  color:rgba(255,255,255,.92);
}

/* ----------------------------------------------
   Boutons harmonisés
---------------------------------------------- */

.btn-secondary{
  background:#ffffff;
  color:var(--ink);
}

/* ----------------------------------------------
   Cards génériques publiques
---------------------------------------------- */

.cards-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:22px;
}

.public-card{
  display:flex;
  flex-direction:column;
  background:#fff;
  border:1px solid var(--line);
  border-radius:22px;
  overflow:hidden;
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  min-width:0;
  height:100%;
}

.public-card:hover{
  transform:translateY(-4px);
  border-color:var(--line-strong);
}

.public-card__media{
  aspect-ratio:16 / 10;
  background:#ffffff;
  overflow:hidden;
  border-bottom:1px solid var(--line-soft);
}

.public-card__media img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transition:transform .35s ease;
}

.public-card:hover .public-card__media img{
  transform:scale(1.04);
}

.public-card__fallback{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
  color:var(--brand-2);
  font-size:42px;
  font-weight:950;
}

.public-card__body{
  padding:20px;
  display:flex;
  flex-direction:column;
  gap:12px;
  flex:1;
  min-width:0;
}

.public-card__eyebrow{
  font-size:12px;
  font-weight:900;
  letter-spacing:.35px;
  text-transform:uppercase;
  color:var(--accent-2);
}

.public-card__title{
  margin:0;
  font-size:24px;
  line-height:1.15;
  letter-spacing:-.02em;
  font-weight:950;
  color:var(--ink);
  word-break:break-word;
}

.public-card__title a{
  color:inherit;
  text-decoration:none;
}

.public-card__title a:hover{
  color:var(--accent-2);
}

.public-card__text{
  margin:0;
  color:var(--muted-2);
  line-height:1.75;
  font-size:15px;
}

.public-card__meta{
  margin-top:auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  padding-top:8px;
  color:var(--muted);
  font-size:13px;
  font-weight:800;
}

.public-card__cta{
  color:var(--accent-2);
  font-weight:950;
  white-space:nowrap;
}

/* ----------------------------------------------
   Panels
---------------------------------------------- */

.content-panel,
.sidebar-panel{
  background:#fff;
  border:1px solid var(--line);
  border-radius:22px;
  padding:24px;
}

.content-panel h2,
.sidebar-panel h2,
.sidebar-panel h3{
  margin:0 0 14px;
  font-size:28px;
  line-height:1.15;
  letter-spacing:-.02em;
  font-weight:950;
  color:var(--ink);
}

/* ----------------------------------------------
   Stats / KPI
---------------------------------------------- */

.stats-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:18px;
}

.stat-card{
  border:1px solid var(--line);
  border-radius:20px;
  background:#fff;
  padding:22px;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.stat-card:hover{
  transform:translateY(-2px);
  border-color:var(--line-strong);
}

.stat-card__value{
  font-size:38px;
  font-weight:950;
  line-height:1;
  color:var(--ink);
  margin-bottom:10px;
}

.stat-card__label{
  margin-bottom:8px;
  font-size:13px;
  font-weight:900;
  letter-spacing:.35px;
  text-transform:uppercase;
  color:var(--accent-2);
}

.stat-card__text{
  color:var(--muted);
  font-size:14px;
  line-height:1.75;
}

.kpi-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:18px;
}

.kpi-card{
  position:relative;
  overflow:hidden;
  background:#fff;
  border:1px solid var(--line);
  border-radius:22px;
  padding:22px;
  display:flex;
  flex-direction:column;
  gap:10px;
  min-width:0;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.kpi-card:hover{
  transform:translateY(-2px);
  border-color:var(--line-strong);
}

.kpi-card::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:5px;
  background:#cbd5e1;
}

.kpi-card__top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.kpi-card__icon{
  width:52px;
  height:52px;
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:24px;
  background:#ffffff;
  flex:0 0 auto;
}

.kpi-card__category{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.3px;
  background:#ffffff;
  color:#3a3a3a;
  border:1px solid #e5e7eb;
}

.kpi-card__value{
  font-size:34px;
  line-height:1;
  font-weight:950;
  color:var(--ink);
  letter-spacing:-.02em;
  word-break:break-word;
}

.kpi-card__title{
  font-size:15px;
  color:#334155;
  font-weight:800;
  line-height:1.5;
}

.kpi-card__meta{
  color:var(--muted);
  font-size:13px;
  line-height:1.65;
  font-weight:700;
}

/* ----------------------------------------------
   Badges
---------------------------------------------- */

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:28px;
  padding:6px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:900;
  letter-spacing:.04em;
  text-transform:uppercase;
  background:#ffffff;
  color:var(--accent-2);
  border:1px solid #e6ecf3;
}

.badge--soft{
  background:#ffffff;
  color:#3a3a3a;
  border-color:#e5e7eb;
}

.badge--success{
  background:#ffffff;
  color:#39423f;
  border-color:#e1e8e2;
}

.badge--warning{
  background:#ffffff;
  color:#824f3b;
  border-color:#e6cdc2;
}

.badge--danger{
  background:#ffffff;
  color:#8c4944;
  border-color:#eededd;
}

/* ----------------------------------------------
   Responsive
---------------------------------------------- */

@media (max-width: 1200px){
  .cards-grid,
  .stats-grid,
  .kpi-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px){
  .section-title{
    font-size:28px;
  }

  .page-hero{
    padding:22px 18px;
  }

  .page-hero__title{
    font-size:32px;
  }

  .cards-grid,
  .stats-grid,
  .kpi-grid{
    grid-template-columns:1fr;
  }

  .content-panel,
  .sidebar-panel{
    padding:20px;
  }

  .public-card__title{
    font-size:22px;
  }

  .public-card__meta{
    flex-direction:column;
    align-items:flex-start;
  }
}

/* ══════════════════════════════════════════════════════
   PREMIUM UPGRADE v2 — VERT CLAIR PARTOUT
   Extensions et surcharges premium du composant library
══════════════════════════════════════════════════════ */

/* ── Public card : survol vert glow ── */
.public-card{
  transition:transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.public-card:hover{
  border-color:rgba(81,121,96,.30);
  transform:translateY(-5px);
}

/* ── Médias de card — zoom plus fluide ── */
.public-card:hover .public-card__media img{
  transform:scale(1.06);
}

/* ── Fallback media vert vif ── */
.public-card__fallback{
  background:linear-gradient(135deg,#ffffff 0%,#ffffff 100%);
  color:var(--brand-2);
}

/* ── Eyebrow pill ── */
.public-card__eyebrow{
  display:inline-flex;
  align-items:center;
  padding:3px 10px;
  border-radius:999px;
  background:linear-gradient(135deg,rgba(81,121,96,.10),rgba(126,170,142,.06));
  border:1px solid rgba(81,121,96,.18);
  font-size:11px;
  font-weight:900;
  letter-spacing:.4px;
  text-transform:uppercase;
  color:var(--brand-2);
  width:fit-content;
}

/* ── CTA card vert ── */
.public-card__cta{
  font-weight:900;
  color:var(--brand-2);
  display:inline-flex;
  align-items:center;
  gap:5px;
  transition:gap .15s ease, color .15s ease;
}
.public-card:hover .public-card__cta{
  gap:9px;
  color:var(--brand);
}

/* ── KPI cards — barre gauche colorée ── */
.kpi-card:nth-child(1)::before{ background:linear-gradient(to bottom,#5d6d66,#8b9d96); }
.kpi-card:nth-child(2)::before{ background:linear-gradient(to bottom,#4a698b,#8dabcd); }
.kpi-card:nth-child(3)::before{ background:linear-gradient(to bottom,#b16b4f,#c99580); }
.kpi-card:nth-child(4)::before{ background:linear-gradient(to bottom,#4a719a,#abc1da); }
.kpi-card:nth-child(5)::before{ background:linear-gradient(to bottom,#a85b56,#d39d99); }
.kpi-card:nth-child(6)::before{ background:linear-gradient(to bottom,#395b81,#5d86b3); }

/* ── KPI hover ── */
.kpi-card:hover{
  border-color:rgba(81,121,96,.22);
}

/* ── Stat cards premium ── */
.stat-card{
  background:linear-gradient(135deg,rgba(81,121,96,.07),rgba(126,170,142,.04));
  border-color:rgba(81,121,96,.22);
  border-radius:22px;
}
.stat-card:hover{
  border-color:rgba(81,121,96,.35);
}
.stat-card__value{
  background:linear-gradient(135deg,#36403c,#5d6d66);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
}
.stat-card__label{
  color:var(--brand-2);
}

/* ── Section title left border ── */
.section-title{
  padding-left:16px;
  border-left:4px solid;
  border-image:linear-gradient(to bottom,#5d6d66,#8b9d96) 1;
}

/* ── Page kicker pill ── */
.page-kicker{
  background:linear-gradient(135deg,rgba(81,121,96,.10),rgba(126,170,142,.06));
  border:1px solid rgba(81,121,96,.22);
  color:var(--brand-2);
}

/* ── Content panel fond vert très léger ── */
.content-panel{
  background:linear-gradient(145deg,#ffffff,#ffffff);
  border-color:rgba(81,121,96,.14);
}

/* ── Sidebar panel ── */
.sidebar-panel{
  background:linear-gradient(145deg,var(--green-50, #ffffff),#ffffff);
  border-color:rgba(81,121,96,.16);
}

/* ── Badges success vitaminés ── */
.badge--success{
  background:linear-gradient(135deg,#ffffff,#ffffff);
  color:#3a3a3a;
  border-color:rgba(81,121,96,.25);
}

/* ── Section hero --dark surcharge ── */
.page-hero--dark{
  background:linear-gradient(135deg,#0f1211 0%,#232927 58%,#36403c 100%);
  border-color:rgba(255,255,255,.06);
}

/* ── Wave separator utility ── */
.wave-top{
  display:block;
  width:100%;
  overflow:hidden;
  line-height:0;
  margin-bottom:-2px;
}
.wave-top svg{
  display:block;
  width:100%;
  height:56px;
}

/* ── Cards grid responsive mobile ── */
@media (max-width:640px){
  .cards-grid,
  .stats-grid,
  .kpi-grid{
    grid-template-columns:1fr;
  }
  .kpi-card{
    padding:18px 16px;
  }
}
/* Précomposer les éléments AOS pour éviter le layout thrashing */
/* will-change retiré : il s'appliquait à chaque élément animé au défilement, soit des dizaines de couches retenues en mémoire avant toute animation. */
[data-aos][data-aos][data-aos-duration="650"]{transition-duration:.65s;}
/* Réserver l'espace pour les images lazy avant chargement */
img[loading="lazy"]{content-visibility:auto;}