/* =========================================================
   Rapport de force — feuille de style commune
   Vanilla CSS, mobile-first, zéro JavaScript
   ========================================================= */


:root {
  /* palette bi-chrome : jasmine #ffe787 + dark amethyst #301a4b */
  --paper:        #ffe787;  /* jasmine — fond principal */
  --paper-2:      #f5da6a;  /* jasmine sombre — panneaux (formulaire) */
  --paper-card:   #fffef7;  /* carte quasi-blanche */
  --ink:          #301a4b;  /* dark amethyst — texte, contours, ombres */
  --ink-soft:     #4c3a66;
  --ink-faint:    #6f6385;
  --accent:       #301a4b;  /* dark amethyst — aplats d'action */
  --accent-deep:  #1e0f30;  /* amethyst profond — survols */
  --badge:        #301a4b;  /* dark amethyst — badges (texte jasmine) */
  --line:         rgba(48, 26, 75, 0.18);
  --line-strong:  rgba(48, 26, 75, 0.36);

  --shadow:       0 1px 2px rgba(48,26,75,.06), 0 8px 24px rgba(48,26,75,.07);
  --shadow-lift:  0 2px 6px rgba(48,26,75,.10), 0 18px 40px rgba(48,26,75,.14);

  --maxw:         1180px;
  --read:         64ch;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.18rem);
  line-height: 1.62;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* fine trame de fond pour donner une matière "papier" */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 500px at 88% -8%, rgba(48,26,75,.06), transparent 60%),
    radial-gradient(700px 600px at -5% 110%, rgba(48,26,75,.04), transparent 60%);
}

a { color: var(--ink); }

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

/* visibilité clavier homogène */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 3px;
}

/* lien d'évitement (accessibilité clavier) */
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.5rem 0.9rem;
  border-radius: 0 0 8px 8px;
  transition: top .18s ease;
}
.skip-link:focus { top: 0; }

/* ---------------------------------------------------------
   Barre de navigation fixe
   --------------------------------------------------------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(255, 231, 135, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.08rem;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
}
.brand .dot {
  width: 0.6rem; height: 0.6rem;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  transform: translateY(-1px);
}

.nav-links {
  display: flex;
  gap: clamp(0.6rem, 2vw, 1.6rem);
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: 0.96rem;
}
.nav-links a {
  position: relative;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 0.35rem 0.15rem;
  transition: color .18s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---------------------------------------------------------
   Conteneurs généraux
   --------------------------------------------------------- */
.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

main { padding-top: 4.6rem; }

.kicker {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: var(--ink);
  margin: 0 0 0.9rem;
}

h1 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 0.98;
  font-size: clamp(2.5rem, 1.6rem + 5.2vw, 5rem);
  margin: 0;
  color: var(--ink);
  max-width: 16ch;
}

h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.06;
  font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2.1rem);
  margin: 0 0 0.6rem;
}

footer.site {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  margin-top: 5rem;
  padding: 2.2rem 0 3rem;
  color: var(--ink-faint);
  font-size: 0.92rem;
}
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; justify-content: space-between; }
footer.site a { color: var(--ink-soft); }

/* =========================================================
   PAGE MANIFESTE
   ========================================================= */
.hero {
  padding-block: clamp(2.4rem, 4vw, 4.6rem) 1.6rem;
}
.hero .rule {
  width: 84px; height: 6px;
  background: var(--accent);
  margin: 1.5rem 0 0;
  border-radius: 3px;
}

.manifeste {
  max-width: var(--read);
  padding-bottom: 1rem;
}
.manifeste p { margin: 0 0 1.4rem; font-size: clamp(1.1rem, 1rem + 0.5vw, 1.28rem); line-height: 1.7; }

.lead {
  font-size: clamp(1.45rem, 1.2rem + 1.1vw, 1.9rem);
  line-height: 1.42;
  color: var(--ink);
}
.lead strong { font-weight: 600; }

.accent-text { color: var(--accent-deep); font-weight: 600; }

.section-mark {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: clamp(1.3rem, 1.05rem + 1vw, 1.7rem);
  letter-spacing: -0.02em;
  margin: 2.6rem 0 0.7rem;
  color: var(--ink);
}

.pullbox {
  border-left: 4px solid var(--accent);
  padding: 0.2rem 0 0.2rem 1.3rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--ink-soft);
}

.closing {
  margin-top: 2.6rem;
  padding: 1.6rem 1.6rem 1.7rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 10px;
}
.closing p { margin: 0 0 0.8rem; }
.closing p:last-child { margin-bottom: 0; }
.closing .big {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.closing strong { color: #fff; }

/* =========================================================
   PAGE FINANCER — filtres + grille
   ========================================================= */
.page-head { padding-block: clamp(2rem, 3.5vw, 3.4rem) 0.6rem; }
.page-head .rule { width: 84px; height: 6px; background: var(--accent); border-radius: 3px; margin: 1.1rem 0 0; }
.page-head .sub {
  max-width: var(--read);
  color: var(--ink-soft);
  margin: 1.3rem 0 0;
}

/* h1 bilingue : MOT-CLÉ (caps) + sous-titre — sur toutes les pages */
.page-head h1,
.hero h1 {
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.h1-top {
  display: block;
  font-size: clamp(2.8rem, 1.2rem + 9vw, 9rem);
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 0.92;
}
/* ratio ≈ 0.53 : compense les 19 chars lowercase vs 8 chars caps */
.h1-sub {
  display: block;
  font-size: clamp(1.5rem, 0.64rem + 4.77vw, 4.77rem);
  letter-spacing: -0.02em;
  line-height: 1;
  font-weight: 700;
}

/* le bloc qui porte le hack : radios -> .filtres -> .grille (frères) */
.filtrage { padding: 1.8rem 0 0; }

.filtres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.8rem;
}
.filtres label {
  cursor: pointer;
  user-select: none;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.filtres label:hover { border-color: var(--ink); color: var(--ink); }

/* séparateur de ligne dans les filtres */
.filtres-sep {
  flex-basis: 100%;
  height: 1px;
  background: var(--line-strong);
  margin: 0.2rem 0;
}

/* label "Réduction d'impôt" : contour pointillé pour le distinguer visuellement */
.label-defiscal {
  border-style: dashed !important;
}

/* état actif du bouton de filtre */
#f-tous:checked      ~ .filtres label[for="f-tous"],
#f-media:checked     ~ .filtres label[for="f-media"],
#f-culture:checked   ~ .filtres label[for="f-culture"],
#f-community:checked ~ .filtres label[for="f-community"],
#f-formation:checked ~ .filtres label[for="f-formation"],
#f-syndicat:checked  ~ .filtres label[for="f-syndicat"],
#f-parti:checked     ~ .filtres label[for="f-parti"],
#f-createurs:checked ~ .filtres label[for="f-createurs"],
#f-defiscal:checked  ~ .filtres label[for="f-defiscal"] {
  background: var(--ink);
  border-color: var(--ink);
  border-style: solid;
  color: var(--paper-card);
}

/* encart défiscalisation : caché par défaut, révélé quand filtre actif */
.encart-defiscal {
  display: none;
  margin-bottom: 1.8rem;
  padding: 1rem 1.3rem;
  border: 1.5px dashed var(--ink);
  border-radius: 10px;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-soft);
  background: var(--paper-card);
}
.encart-defiscal p { margin: 0; }
#f-defiscal:checked ~ .encart-defiscal { display: block; }

/* grille responsive : 1 / 2 / 3 colonnes */
.grille {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.4rem 1.6rem;
}
@media (min-width: 620px) { .grille { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grille { grid-template-columns: repeat(3, 1fr); } }

/* filtrage : on masque les cartes hors catégorie */
#f-media:checked     ~ .grille .card:not([data-type="media"]),
#f-culture:checked   ~ .grille .card:not([data-type="culture"]),
#f-community:checked ~ .grille .card:not([data-type="community"]),
#f-formation:checked ~ .grille .card:not([data-type="formation"]),
#f-syndicat:checked  ~ .grille .card:not([data-type="syndicat"]),
#f-parti:checked     ~ .grille .card:not([data-type="parti"]),
#f-createurs:checked ~ .grille .card:not([data-type="createurs"]),
#f-defiscal:checked  ~ .grille .card:not([data-defisc]) {
  display: none;
}

/* message "aucun projet" visible quand la catégorie est vide (ex. syndicat) */
.empty {
  display: none;
  grid-column: 1 / -1;
  padding: 1.4rem 0;
  color: var(--ink-faint);
  font-style: italic;
}
#f-syndicat:checked  ~ .grille .empty-syndicat  { display: block; }
#f-parti:checked     ~ .grille .empty-parti     { display: block; }
#f-createurs:checked ~ .grille .empty-createurs { display: block; }

/* =========================================================
   Carte projet — style "sticker" : onglet-logo en débord,
   contour encre + ombre portée dure décalée, pied à séparateur.
   ========================================================= */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-top: 1.7rem;            /* place pour l'onglet-logo qui déborde */
  background: var(--paper-card);
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  padding: 2.5rem 1.45rem 1.4rem;
  box-shadow: 5px 6px 0 0 var(--ink);
  transition: transform .16s ease, box-shadow .16s ease;
}
.card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 10px 0 0 var(--ink);
}

/* onglet-logo : carré arrondi en débord sur le coin supérieur gauche */
.logo-tab {
  position: absolute;
  top: -1.7rem;
  left: 1.1rem;
  z-index: 2;
  width: 80px;
  height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  background: var(--paper-card);
  border: 1.5px solid var(--ink);
  border-radius: 15px;
  box-shadow: 4px 5px 0 0 var(--ink);
}
.logo-tab img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  object-fit: contain;
}

/* repli quand aucun logo n'est disponible : monogramme améthyste / menthe */
.logo-fallback {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--paper-card);
  background: var(--ink);
}

/* badge catégorie : pastille cherry blossom, couleur unique pour tous les types */
.card .badge {
  align-self: flex-end;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--paper-card);
  background: var(--badge);
  padding: 0.24rem 0.7rem;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  margin-bottom: 0.9rem;
}

.card h3 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 1.32rem;
  margin: 0 0 0.5rem;
  color: var(--ink);
}
.card p {
  margin: 0 0 1.3rem;
  font-size: 0.99rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* pied de carte : séparateur + bouton Soutenir à icône circulaire */
.card-foot {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1.5px solid var(--line);
  display: flex;
  align-items: center;
}
.soutenir {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--paper-card);
  background: var(--accent);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.42rem 1rem 0.42rem 0.45rem;
  box-shadow: 2px 3px 0 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background .16s ease;
}
.soutenir:hover {
  background: var(--accent-deep);
  transform: translate(-1px, -1px);
  box-shadow: 3px 4px 0 0 var(--ink);
}
.soutenir:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 0 var(--ink);
}
.soutenir .ico {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-card);
  color: var(--ink);
  border-radius: 50%;
}
.soutenir .ico svg { width: 14px; height: 14px; display: block; }

/* ---------------------------------------------------------
   Proposer un projet — formulaire natif
   --------------------------------------------------------- */
.proposer {
  margin-top: 3.4rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(1.6rem, 3vw, 2.4rem);
}
.proposer h2 { margin-bottom: 0.4rem; }
.proposer .intro { color: var(--ink-soft); margin: 0 0 1.4rem; max-width: 52ch; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  max-width: 640px;
}
@media (min-width: 620px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .full { grid-column: 1 / -1; }
}

.proposer input,
.proposer select,
.proposer textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper-card);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
}
.proposer textarea { resize: vertical; }
.proposer input:focus,
.proposer select:focus,
.proposer textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.proposer button {
  justify-self: start;
  cursor: pointer;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--paper);
  background: var(--accent);
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  padding: 0.75rem 1.4rem;
  transition: background .16s ease, transform .12s ease;
}
.proposer button:hover { background: var(--accent-deep); }
.proposer button:active { transform: translateY(1px); }
.proposer .note {
  margin: 0.9rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

/* =========================================================
   PAGE ORGANISER — placeholder
   ========================================================= */
.placeholder {
  max-width: var(--read);
  padding: 1.4rem 0 1rem;
}
.placeholder .tag {
  display: inline-block;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  margin-bottom: 1.4rem;
}
.placeholder p { margin: 0 0 1.2rem; color: var(--ink-soft); }
.placeholder a { font-weight: 500; }

/* =========================================================
   Apparition au chargement (sobre, CSS pur)
   ========================================================= */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(14px); animation: rise .6s cubic-bezier(.2,.7,.2,1) forwards; }
  .reveal.d1 { animation-delay: .05s; }
  .reveal.d2 { animation-delay: .14s; }
  .reveal.d3 { animation-delay: .24s; }
  .reveal.d4 { animation-delay: .34s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}

