/* ═══════════════════════════════════════════════
   Terres Communes — Site principal (vitrine)
   Palette : vert forêt, bleu nuit, terre cuite
   Tokens et styles de base repris de forum-terres-communes
═══════════════════════════════════════════════ */

:root {
  --vert:       #2d6a4f;
  --vert-clair: #52b788;
  --bleu:       #1d3557;
  --bleu-clair: #2e6185;  /* sombre → 6:1 sur blanc (WCAG AA) */
  --terre:      #e76f51;
  --sable:      #f4e9d8;
  --blanc:      #fafaf8;
  --gris:       #6b7280;
  --gris-clair: #e5e7eb;
  --texte:      #1a1a2e;
  --radius:     8px;
  --shadow:     0 2px 8px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.12);
  --card-bg:    white;
  --bg-sec:     #f8fafc;

  --serif: 'Georgia', 'Times New Roman', serif;
  --sans:  system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--serif);
  background: var(--blanc);
  color: var(--texte);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Typographie ── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p  { margin-bottom: .8rem; }
a  { color: var(--vert); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── En-tête ── */
.site-header {
  background: var(--bleu);
  color: white;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.site-header .logo {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
}
.site-header .logo:hover { text-decoration: none; opacity: .9; }

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-header nav a {
  color: rgba(255,255,255,.85);
  font-family: var(--sans);
  font-size: .9rem;
}
.site-header nav a:hover { color: white; text-decoration: none; }
.site-header nav a[aria-current="page"] {
  color: white;
  font-weight: 700;
  border-bottom: 2px solid var(--vert-clair);
}
.site-header nav a.connexion,
.site-header nav a.compte {
  padding: .4rem 1rem;
  border-radius: var(--radius);
  background: var(--vert);
  color: white;
}
.site-header nav a.connexion:hover,
.site-header nav a.compte:hover { opacity: .9; }

/* ── Contenu principal ── */
main {
  flex: 1;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}
main h1 { margin-bottom: 1rem; }
main h2 { margin: 1.75rem 0 .75rem; }

/* ── Pied de page ── */
.site-footer {
  background: var(--sable);
  color: var(--gris);
  font-family: var(--sans);
  font-size: .85rem;
  text-align: center;
  padding: 1.5rem;
}
.site-footer a { color: var(--bleu-clair); }

/* ── Page d'erreur ── */
.erreur {
  text-align: center;
  padding: 3rem 1rem;
}
.erreur h1 { margin-bottom: .75rem; }
.erreur p { color: var(--gris); }

/* ── Accueil : hero ── */
.hero {
  text-align: center;
  padding: 2rem 0 3rem;
}
.hero h1 { font-size: 2.6rem; margin-bottom: 1rem; }
.hero-sous-titre {
  font-size: 1.15rem;
  color: var(--gris);
  max-width: 42rem;
  margin: 0 auto 1.75rem;
}
.hero-actions {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Boutons ── */
.bouton {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: .95rem;
  padding: .7rem 1.5rem;
  border-radius: var(--radius);
  background: var(--vert);
  color: white;
}
.bouton:hover { background: var(--bleu); text-decoration: none; }
.bouton-secondaire {
  background: transparent;
  color: var(--vert);
  border: 2px solid var(--vert);
  padding: calc(.7rem - 2px) calc(1.5rem - 2px);
}
.bouton-secondaire:hover { background: var(--vert); color: white; }

/* ── Pages éditoriales ── */
.page-editoriale .chapo {
  font-size: 1.1rem;
  color: var(--gris);
}
.page-editoriale h2:first-of-type { margin-top: 1.25rem; }

/* ── Aperçu du forum (accueil) ── */
.apercu-forum {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gris-clair);
}
.apercu-forum ul { list-style: none; margin-bottom: 1.25rem; }
.apercu-forum li {
  padding: .6rem 0;
  border-bottom: 1px solid var(--gris-clair);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}
.apercu-forum li a { font-weight: 600; }
.apercu-forum .meta {
  font-family: var(--sans);
  font-size: .8rem;
  color: var(--gris);
  white-space: nowrap;
}
.apercu-forum .cta { font-weight: 600; }

/* ── Formulaire de contact ── */
.formulaire-contact { max-width: 32rem; margin-top: 1.5rem; }
.formulaire-contact label {
  display: block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: .3rem;
}
.formulaire-contact input[type="text"],
.formulaire-contact input[type="email"],
.formulaire-contact textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  padding: .6rem .75rem;
  border: 1px solid var(--gris-clair);
  border-radius: var(--radius);
  background: white;
  color: var(--texte);
}
.formulaire-contact input:focus,
.formulaire-contact textarea:focus {
  outline: 2px solid var(--vert-clair);
  outline-offset: 1px;
}
.formulaire-contact textarea { resize: vertical; min-height: 8rem; }
.formulaire-contact button {
  font-family: var(--sans);
  font-weight: 600;
  font-size: .95rem;
  padding: .7rem 1.75rem;
  border: none;
  border-radius: var(--radius);
  background: var(--vert);
  color: white;
  cursor: pointer;
}
.formulaire-contact button:hover { background: var(--bleu); }
.erreur-champ {
  display: block;
  font-family: var(--sans);
  font-size: .8rem;
  color: var(--terre);
  margin-top: .25rem;
}
.erreur-formulaire {
  font-family: var(--sans);
  background: #fdf1ee;
  border: 1px solid var(--terre);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  margin-bottom: 1.25rem;
}
