/* Études sectorielles — Observatoire. Premium, lisible, mobile-first. */

.etude-page {
  --et-bg: #f6f7fb;
  --et-card: #ffffff;
  --et-ink: #0f172a;
  --et-muted: #64748b;
  --et-line: #e6eaf2;
  --et-brand: #6d28d9;
  --et-brand-2: #7c3aed;
  --et-soft: #faf5ff;
  --et-soft-line: #ede9fe;
  background: var(--et-bg);
  color: var(--et-ink);
  min-height: 60vh;
}

body.dark-mode .etude-page {
  --et-bg: #0a0a0f;
  --et-card: #15151f;
  --et-ink: #e5e7eb;
  --et-muted: #94a3b8;
  --et-line: #293449;
  --et-soft: rgba(109, 40, 217, 0.12);
  --et-soft-line: rgba(167, 139, 250, 0.22);
}

.etude-hero {
  background:
    radial-gradient(1200px 420px at 12% -10%, rgba(124, 58, 237, 0.35), transparent 55%),
    radial-gradient(900px 360px at 88% 0%, rgba(37, 99, 235, 0.22), transparent 50%),
    linear-gradient(145deg, #0f172a 0%, #1e1b4b 48%, #312e81 100%);
  color: #fff;
  padding: 2.4rem 1.25rem 2.6rem;
}

.etude-hero__inner {
  max-width: 1040px;
  margin: 0 auto;
}

.etude-hero__crumb {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  color: rgba(255, 255, 255, .72);
  text-decoration: none;
  margin-bottom: 1rem;
}
.etude-hero__crumb:hover { color: #fff; }

.etude-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: .9rem;
}

.etude-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: .32rem .7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .9);
}

.etude-badge--accent {
  background: rgba(167, 139, 250, .22);
  border-color: rgba(196, 181, 253, .35);
  color: #ddd6fe;
}

.etude-hero h1,
.etude-page .etude-hero h1 {
  font-size: clamp(1.55rem, 3.2vw, 2.25rem);
  line-height: 1.15;
  font-weight: 800;
  margin: 0 0 .75rem;
  max-width: 22ch;
  /* pages.css / base peintent les h1 en encre : sur hero sombre = invisible */
  color: #ffffff !important;
}

.etude-hero__lede {
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, .86);
  max-width: 62ch;
  margin: 0 0 1.25rem;
}

.etude-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1.1rem;
  font-size: .86rem;
  color: rgba(255, 255, 255, .68);
  margin-bottom: 1.35rem;
}
.etude-hero__meta strong { color: #fff; font-weight: 700; }

.etude-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.etude-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border-radius: 12px;
  padding: .85rem 1.3rem;
  font-weight: 800;
  font-size: .95rem;
  line-height: 1.25;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.etude-btn:hover { transform: translateY(-1px); }
.etude-btn:focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
}

/* RÈGLE CONTRASTE (retour Davy 2026-10-10) :
   fond sombre = texte blanc ; fond clair = texte encre.
   Jamais violet sur violet, jamais blanc sur blanc. */

/* Sur hero sombre : bouton blanc, texte violet profond (max contraste). */
.etude-btn--primary {
  background: #ffffff !important;
  color: #4c1d95 !important;
  border-color: #ffffff !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
}
.etude-btn--primary:hover {
  background: #f5f3ff !important;
  color: #3b0764 !important;
}

/* Sur hero sombre : bouton contour blanc, texte blanc. */
.etude-btn--ghost {
  background: rgba(15, 23, 42, .55) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, .85) !important;
}
.etude-btn--ghost:hover {
  background: rgba(15, 23, 42, .75) !important;
  color: #ffffff !important;
}

/* Sur card claire : bouton violet profond plein, texte blanc. */
.etude-btn--solid {
  background: #4c1d95 !important;
  color: #ffffff !important;
  border-color: #4c1d95 !important;
  box-shadow: 0 8px 20px rgba(76, 29, 149, .25);
}
.etude-btn--solid:hover {
  background: #3b0764 !important;
  color: #ffffff !important;
}

.etude-wrap {
  max-width: 1040px;
  margin: -1.6rem auto 2.5rem;
  padding: 0 1.15rem;
}

/* Bandeau chiffres d'accroche */
.etude-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .85rem;
  margin-bottom: 1.35rem;
}

.etude-kpi {
  background: var(--et-card);
  border: 1px solid var(--et-line);
  border-radius: 16px;
  padding: 1.05rem 1.1rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.etude-kpi--hot {
  background: var(--et-soft);
  border-color: var(--et-soft-line);
}

.etude-kpi__value {
  font-size: 1.85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--et-brand);
  line-height: 1.1;
}
.etude-kpi--hot .etude-kpi__value { color: var(--et-brand-2); }

.etude-kpi__label {
  margin-top: .35rem;
  font-size: .82rem;
  color: var(--et-muted);
  line-height: 1.35;
}

.etude-kpi__hint {
  margin-top: .25rem;
  font-size: .75rem;
  color: var(--et-muted);
  opacity: .85;
}

.etude-card {
  background: var(--et-card);
  border: 1px solid var(--et-line);
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, .05);
  overflow: hidden;
  margin-bottom: 1.15rem;
}

.etude-card__head {
  padding: 1.05rem 1.25rem;
  border-bottom: 1px solid var(--et-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.etude-card__head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}
.etude-card__body { padding: 1.15rem 1.25rem 1.3rem; }

.etude-card__body p { margin: 0 0 .75rem; line-height: 1.55; }
.etude-card__body p:last-child { margin-bottom: 0; }

.etude-top3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .75rem;
  margin-bottom: 1.15rem;
}

.etude-podium {
  border: 1px solid var(--et-line);
  border-radius: 16px;
  padding: 1rem 1.05rem;
  background: var(--et-card);
  position: relative;
}
.etude-podium--1 {
  background: linear-gradient(160deg, rgba(124, 58, 237, .1), transparent 55%), var(--et-card);
  border-color: var(--et-soft-line);
}

.etude-podium__rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: .85rem;
  background: var(--et-soft);
  color: var(--et-brand);
  border: 1px solid var(--et-soft-line);
  margin-bottom: .5rem;
}

.etude-podium__name {
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.25;
  margin-bottom: .35rem;
  overflow-wrap: anywhere;
}

.etude-podium__score {
  font-size: 1.55rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--et-brand-2);
}
.etude-podium__sub {
  font-size: .8rem;
  color: var(--et-muted);
}

.etude-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.etude-table {
  width: 100%;
  min-width: 640px;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
  font-size: .92rem;
}
.etude-table th {
  text-align: left;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--et-muted);
  padding: .75rem .9rem;
  border-bottom: 1px solid var(--et-line);
  background: var(--et-card);
  white-space: nowrap;
}
.etude-table td {
  padding: .8rem .9rem;
  border-bottom: 1px solid #f1f4f9;
  vertical-align: middle;
}
body.dark-mode .etude-table td { border-bottom-color: var(--et-line); }
.etude-table tbody tr:nth-child(even) { background: rgba(99, 102, 241, .03); }
.etude-table tbody tr:hover { background: rgba(99, 102, 241, .06); }

.etude-rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  min-height: 1.8rem;
  padding: .1rem .5rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: .8rem;
  background: var(--et-soft);
  color: var(--et-brand);
  border: 1px solid var(--et-soft-line);
}

.etude-bar {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 140px;
}
.etude-bar__track {
  flex: 1;
  height: 9px;
  border-radius: 99px;
  background: var(--et-line);
  overflow: hidden;
}
.etude-bar__fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #7c3aed, #6366f1);
}
.etude-bar__pct {
  font-weight: 800;
  min-width: 2.8rem;
  text-align: right;
}

.etude-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.etude-chip {
  display: inline-flex;
  padding: .25rem .65rem;
  border-radius: 8px;
  background: var(--et-soft);
  color: var(--et-brand);
  border: 1px solid var(--et-soft-line);
  font-size: .78rem;
  font-weight: 650;
}

.etude-cite {
  background: linear-gradient(140deg, rgba(124, 58, 237, .08), rgba(37, 99, 235, .06));
  border: 1px solid var(--et-soft-line);
}
.etude-cite__box {
  background: var(--et-card);
  border: 1px solid var(--et-line);
  border-radius: 12px;
  padding: .95rem 1rem;
  font-size: .93rem;
  line-height: 1.5;
}

.etude-soft-note {
  font-size: .85rem;
  color: var(--et-muted);
  font-style: italic;
}

@media (max-width: 640px) {
  .etude-hero { padding: 1.7rem 1rem 2rem; }
  .etude-hero h1 { max-width: none; }
  .etude-wrap { padding: 0 .75rem; }
  .etude-table { min-width: 560px; }
}
