/* =========================================================
 * app.css — Fondations, Variables & Structure
 * ========================================================= */

/* ---------- Reset / Base ---------- */
html {
  box-sizing: border-box;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height, 80px);
  overflow-x: hidden;
  width: 100%;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font: 16px/1.6 var(--font-sans, "Montserrat", sans-serif);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  width: 100%;
  max-width: 100%;
  position: relative;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------- Gestion de l'Espace (NOUVEAU) ---------- */
/* Espacement automatique entre les sections principales
section + section {
  margin-top: var(--section-spacing, 20px);
}*/

/* Si une section a la classe .section-padded, elle a aussi du padding interne */
.section-padded {
  padding-top: var(--section-spacing, 80px);
  padding-bottom: var(--section-spacing, 80px);
}

/* ---------- Liens ---------- */
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
a:hover:not(.btn):not(.link-reset):not(.link-plain) {
  color: var(--accent);
  text-decoration-color: var(--accent);
}
:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
  outline-offset: 2px;
}
/* Liens utilitaires sans style */
a.card, a.cp-card, .card a, .link-reset, .link-plain {
  text-decoration: none !important;
}

/* ---------- Containers & Utils ---------- */
.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
}

.hidden { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.hr {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 2rem 0; /* Un peu plus d'espace autour des HR */
}

/* ---------- Typographie ---------- */
.h1 { font-size: var(--h1); font-weight: 900; line-height: 1.1; margin: 0; }
.h2 { font-size: var(--h2); font-weight: 800; line-height: 1.15; margin: 0; }
.h3 { font-size: var(--h3); font-weight: 700; line-height: 1.2; margin: 0; }

/* =========================================================
 * Sémantique COMMUNE (Titres de sections)
 * ========================================================= */
.section-title {
  font-size: var(--h2);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: .01em;
  margin: 0;
  color: var(--text);
  text-transform: uppercase; /* Harmonisation globale */
}

.section-desc {
  --desc-color: var(--muted);
  --desc-pad: clamp(12px, 1.1vw, 16px);
  --desc-bar: 4px;

  position: relative;
  margin: clamp(12px, 1.4vw, 18px) 0 clamp(14px, 1.8vw, 22px);
  padding-left: var(--desc-pad);
  max-width: 65ch; /* Lecture optimale */
  color: var(--desc-color);
  line-height: 1.55;
}
.section-desc::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: var(--desc-bar);
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 55%, transparent),
                              color-mix(in srgb, var(--accent) 24%, transparent)
  );
}

.section-rules {
  display: flex; flex-direction: column; gap: .35rem; margin: 0 0 1.1rem;
}
.section-rules .rule {
  height: 4px; border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 85%, transparent);
}
.section-rules .rule.thin {
  height: 2px; opacity: .65;
  background: color-mix(in srgb, var(--accent) 50%, transparent);
}

/* =========================================================
 * BOUTONS GLOBAUX
 * ========================================================= */
.btn {
  --_bg: var(--surface);
  --_fg: var(--text);
  --_bd: var(--border);
  --_shadow: var(--shadow-1);

  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .65rem 1.05rem;
  border-radius: 999px; /* Pill par défaut pour l'harmonie */
  border: 1px solid var(--_bd);
  background: var(--_bg); color: var(--_fg);
  text-decoration: none; cursor: pointer;
  font-weight: 800; letter-spacing: .02em;
  box-shadow: var(--_shadow);
  text-transform: uppercase; font-size: 0.8rem;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.btn:active { transform: none; box-shadow: var(--shadow-1); }

/* Primaire */
.btn-primary {
  --_bg: var(--accent);
  --_fg: var(--accent-ink);
  --_bd: color-mix(in srgb, var(--accent) 22%, var(--border));
  --_shadow: 0 10px 24px color-mix(in srgb, var(--accent) 24%, transparent);

  background: var(--_bg); color: var(--_fg); border-color: var(--_bd);
  box-shadow: var(--_shadow);
}
.btn-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 28%, transparent);
}

/* Ghost */
.btn-ghost {
  --_bg: transparent;
  --_fg: var(--text);
  --_bd: var(--border);
  background: var(--_bg); color: var(--_fg); border-color: var(--_bd);
  box-shadow: none;
}
.btn-ghost:hover {
  border-color: var(--text);
  background: var(--surface);
}

.btn-sm { padding: .4rem .8rem; font-size: 0.7rem; }
.btn-lg { padding: .9rem 1.8rem; font-size: 0.9rem; }
.btn i, .btn svg { color: currentColor; }

/* =========================================================
 * COMPOSANTS COMMUNS
 * ========================================================= */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  position: relative;
  color: inherit;
}
.card:hover { box-shadow: var(--shadow-2); }

.card-media { position: relative; overflow: hidden; }
.card-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}

.ratio { position: relative; width: 100%; height: 0; }
.ratio.r1x1 { padding-top: 100%; }
.ratio.r4x3 { padding-top: 75%; }
.ratio.r16x9 { padding-top: 56.25%; }

.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .8rem; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: .75rem; text-transform: uppercase;
}

/* =========================================================
 * BANNIÈRE PARTICIPATIVE (Style Neutre)
 * ========================================================= */
.c-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent); /* Petite touche couleur */
  border-radius: 14px;
  margin: 0; /* Géré par le parent ou section spacing */
  overflow: hidden;
  box-shadow: var(--shadow-1);
}

.c-banner .pb-content {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 25px 30px;
}

.c-banner .pb-text { max-width: 700px; }

.c-banner .pb-eyebrow {
  display: block; font-size: 0.75rem; letter-spacing: 0.06em;
  text-transform: uppercase; font-weight: 800;
  margin-bottom: 6px;
  color: var(--accent);
}

.c-banner .pb-title {
  font-size: 1.3rem; font-weight: 800; line-height: 1.2;
  margin: 0 0 6px 0; color: var(--text);
}

.c-banner .pb-desc {
  margin: 0; line-height: 1.5; color: var(--muted); font-size: 0.95rem;
}

.c-banner .pb-cta { flex: 0 0 auto; }

/* Responsive Banner */
@media (max-width: 800px) {
  .c-banner .pb-content { flex-direction: column; align-items: flex-start; }
  .c-banner .pb-cta { width: 100%; margin-top: 10px; }
  .c-banner .pb-cta .btn { width: 100%; }
}
