/* Page d'accueil et annuaire des campagnes (jetons de couleur et composants dans styles.css). */
/* C'est le document qui défile, comme sur n'importe quelle page web. La hauteur fixe et
   l'overflow caché du <body> sont faits pour la carte, qui ne doit jamais défiler ; ailleurs ils
   transformaient <body> en boîte à défilement : la barre d'adresse ne se repliait plus sur
   téléphone, window.scrollTo ne faisait rien, et le défilement restait bloqué après la fermeture
   du clavier ou d'une fenêtre modale. */
body.home-page { height: auto; min-height: 100%; overflow: visible; }
.home-page .topbar { position: sticky; top: 0; grid-template-columns: auto 1fr auto; z-index: 1200; }
.home-main { max-width: 1040px; margin: 0 auto; padding: 0 20px 64px; }

/* --- bandeau d'ouverture : une phrase, deux actions, rien d'autre */
.hero { padding: 54px 0 40px; display: grid; gap: 18px; max-width: 720px; }
.hero h1 { font-family: var(--font-display); font-size: clamp(30px, 5vw, 46px); font-weight: 800; letter-spacing: -.02em; line-height: 1.08; text-wrap: balance; }
.hero p.lead { margin: 0; font-size: clamp(16px, 2.2vw, 19px); line-height: 1.5; color: var(--ink-2); max-width: 62ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.hero-note { margin: 0; font-size: 13.5px; color: var(--muted); }

/* --- trois étapes */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 8px 0 44px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.step b { font-family: var(--font-display); font-size: 17px; font-weight: 800; }
.step span { font-size: 14.5px; color: var(--ink-2); line-height: 1.45; }
/* En-tête d'une étape : le numéro dans sa pastille, et l'icône qui dit de quoi il s'agit.
   Le sélecteur est plus précis que « .step span » : sans cela, le chiffre héritait du gris du texte. */
.step-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.step .step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--step-color, var(--hot)); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 14px; flex: none; }
.step-ico { width: 26px; height: 26px; color: var(--step-color, var(--hot)); opacity: .45; flex: none; }
.steps .step:nth-child(2) { --step-color: var(--accent); }
.steps .step:nth-child(3) { --step-color: var(--depot); }

/* --- sections */
.home-section { margin: 0 0 40px; }
.home-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.home-section h2 { font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -.01em; }

/* --- cartes de campagne */
.camp-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.camp-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, box-shadow .15s; }
.camp-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
/* Le secteur passe devant le nom : dans un annuaire, « où » décide avant « quoi », et deux campagnes
   qui portent le même nom ne se distinguent que par là. La catégorie descend sous le titre, en étiquette. */
.camp-card .cc-where { display: flex; align-items: center; gap: 5px; margin: 0; font-size: 13.5px; font-weight: 700;
  color: var(--cat-strong, var(--accent-strong)); line-height: 1.3; overflow: visible; }
.camp-card .cc-pin { width: 15px; height: 15px; flex: none; }
.camp-card .cc-cat { align-self: flex-start; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }
.camp-card .cc-where + h3 { margin-top: -2px; }
.camp-card h3 { font-family: var(--font-display); font-size: 18px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.camp-card h3 a { color: inherit; text-decoration: none; }
.camp-card h3 a::after { content: ""; position: absolute; inset: 0; }
.camp-card p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.camp-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); margin-top: auto; padding-top: 4px; font-variant-numeric: tabular-nums; }
.camp-meta .is-over { color: var(--muted); }
.camp-card.a-election { --cat-strong: var(--hot-strong); }
.camp-card.a-mobilisation { --cat-strong: var(--accent-strong); }

/* --- annuaire : recherche et filtres */
.dir-tools { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.dir-search { position: relative; display: flex; align-items: center; max-width: 520px; }
.dir-search input { width: 100%; height: 44px; padding: 0 14px 0 40px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); outline: none; font-size: 15px; }
.dir-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dir-search svg { position: absolute; left: 13px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.dir-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.dir-sort { height: 38px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 0 10px; }
.dir-count { font-size: 13.5px; color: var(--muted); }
.dir-more { display: flex; justify-content: center; margin-top: 20px; }
.dir-empty { padding: 40px 20px; text-align: center; color: var(--ink-2); display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* --- pied de page */
.home-foot { border-top: 1px solid var(--line); padding: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 13.5px; color: var(--muted); }
.home-foot a { color: var(--ink-2); }

@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .hero { padding: 32px 0 26px; }
  .home-main { padding: 0 14px 48px; }
}

/* --- campagne suspendue : l'adresse reste en ligne, la page explique */
.susp-tag { margin: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--warn-ink); background: var(--warn-soft); padding: 5px 11px; border-radius: 999px; justify-self: start; }
.susp-note { border-left: 4px solid var(--hot); background: var(--surface); border-radius: var(--radius-sm); padding: 12px 16px; display: grid; gap: 4px; }
.susp-note b { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.susp-note p { margin: 0; font-size: 15px; line-height: 1.45; white-space: pre-wrap; }
.susp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 760px) { .susp-cols { grid-template-columns: 1fr; } }

/* Très petits écrans : le bandeau tient sans déborder (le sous-titre de marque passe à la trappe). */
@media (max-width: 420px) {
  .home-page .topbar { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .home-page .brand-sub { display: none; }
  .home-page .topbar-actions { gap: 5px; }
  .home-page .topbar-actions .btn { padding: 0 11px; }
}

/* --- actions du bandeau : le lien vers l'annuaire, le compte, et l'appel à l'action.
   Le libellé de l'appel à l'action raccourcit avant de déborder, et le compte tombe à l'icône
   seule sur les petits écrans — l'ordre, lui, ne change jamais : l'action principale reste à droite. */
/* Le bandeau est une grille : sans cela les actions se collent au début de leur colonne,
   c'est-à-dire juste après le logo. Elles doivent tenir le bord droit. */
.home-page .topbar-actions { gap: 8px; justify-content: flex-end; margin-left: auto; }
.tb-link { font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; padding: 6px 2px; white-space: nowrap; }
.tb-link:hover { color: var(--ink); }
.tb-link[aria-current="page"] { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 4px; }
.tb-btn { gap: 7px; }
.tb-btn svg { width: 17px; height: 17px; }
.tb-cta { height: 36px; padding: 0 14px; font-size: 13.5px; }
.tb-cta svg { width: 15px; height: 15px; }
.tb-short { display: none; }
@media (max-width: 1080px) { .tb-long { display: none; } .tb-short { display: inline; } }
.tb-login { color: var(--accent-strong); }
/* Les entrées qui dépendent de l'état du compte : rien ne s'affiche tant qu'on ne le connaît pas,
   plutôt que de montrer « Se connecter » à quelqu'un qui l'est déjà, le temps d'un aller-retour. */
/* Le burger du bandeau n'existe que sur mobile : au-delà, les entrées tiennent en clair.
   (La feuille principale l'affiche dès 1024 px pour la carte ; ici on décide nous-mêmes.) */
.home-page .burger-wrap { display: none; }
@media (max-width: 760px) {
  .home-page .burger-wrap { display: block; }
  /* Ne reste que « Créer ma campagne » : tout le reste passe dans le burger. */
  .home-page .tb-link, .home-page #tb-account { display: none; }
  .home-page .topbar-actions { gap: 6px; }
}

/* Les plus petits téléphones (320 à 375 px) : le bandeau tient en une ligne, sans rien perdre.
   Ces règles viennent après les .tb-* ci-dessus, sinon elles perdraient la cascade à spécificité égale. */
@media (max-width: 420px) {
  .tb-cta { padding: 0 10px; font-size: 12.5px; gap: 5px; }
  .tb-cta svg { width: 14px; height: 14px; }
  .tb-login { font-size: 13px; padding: 6px 0; }
}

/* --- « Comment ça marche » : une illustration, un titre, une phrase.
   Les dessins sont tracés dans la page et prennent les couleurs du thème : rien à charger,
   et ils suivent le mode sombre sans seconde version. */
.hiw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.hiw { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.hiw-art { width: 100%; height: auto; display: block; border-radius: var(--radius-sm); margin-bottom: 4px; }
.hiw b { font-family: var(--font-display); font-size: 17px; font-weight: 800; }
.hiw span { font-size: 14.5px; color: var(--ink-2); line-height: 1.45; }
@media (max-width: 760px) {
  .hiw-grid { grid-template-columns: 1fr; }
  .hiw-art { max-width: 340px; }
}

/* --- Fond animé de l'accroche (public/hero-anim.js). Sur grand écran il occupe la place libre à droite
   du texte ; sur téléphone il passe derrière, très pâle, pour ne jamais disputer la lisibilité. */
.hero { position: relative; }
.hero > *:not(.hero-bg) { position: relative; z-index: 1; }
.hero-bg { position: absolute; z-index: 0; pointer-events: none; transition: opacity .6s linear; }
.hero-bg canvas { display: block; }
@media (min-width: 900px) {
  .hero-bg { left: calc(100% + 16px); top: 50%; width: 340px; height: 320px; transform: translateY(-50%); opacity: .95; }
}
@media (max-width: 899px) {
  .hero-bg { inset: -8px -14px 10px; opacity: .16;
    -webkit-mask-image: linear-gradient(to bottom, #000 0 70%, transparent 97%);
    mask-image: linear-gradient(to bottom, #000 0 70%, transparent 97%); }
}
