/* ==================================================
   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:#eef6fb;
  border:1px solid #dbeafe;
  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:#f8fafc;
  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, #edf6fc 0%, #f8fbfd 55%, #eefaf2 100%);
  box-shadow:var(--shadow-soft);
  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(11,59,32,.94) 0%, rgba(24,99,52,.92) 58%, rgba(47,142,77,.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(0,122,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:#f8fafc;
  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;
  box-shadow:var(--shadow-soft);
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  min-width:0;
  height:100%;
}

.public-card:hover{
  transform:translateY(-4px);
  box-shadow:0 18px 36px rgba(15,23,42,.08);
  border-color:var(--line-strong);
}

.public-card__media{
  aspect-ratio:16 / 10;
  background:#e5e7eb;
  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, #ecfdf5 0%, #f8fafc 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;
  box-shadow:var(--shadow-soft);
}

.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;
  box-shadow:var(--shadow-soft);
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.stat-card:hover{
  transform:translateY(-2px);
  box-shadow:0 16px 30px rgba(15,23,42,.06);
  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;
  box-shadow:var(--shadow-soft);
  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);
  box-shadow:0 16px 30px rgba(15,23,42,.06);
  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:#f8fafc;
  box-shadow:inset 0 0 0 1px rgba(15,23,42,.05);
  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:#f8fafc;
  color:#475569;
  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:#eef6fb;
  color:var(--accent-2);
  border:1px solid #dbeafe;
}

.badge--soft{
  background:#f8fafc;
  color:#475569;
  border-color:#e5e7eb;
}

.badge--success{
  background:#eef8ee;
  color:#166534;
  border-color:#d9f0dd;
}

.badge--warning{
  background:#fff7ed;
  color:#b45309;
  border-color:#fed7aa;
}

.badge--danger{
  background:#fff1f2;
  color:#be123c;
  border-color:#fecdd3;
}

/* ----------------------------------------------
   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;
  }
}