/* ==========================================================================
   Cap Famille — psychoéducation enfance & famille
   Système de design (voir docs/03-branding.md)
   Palette : Épinette #175E54 · Terracotta #B34A2B · Lin #FAF6F1
             Sauge #E4EFEA · Encre #2E3A3F · Ambre #F2C879 · Nuit #0E3B34
   ========================================================================== */

:root {
  --epinette: #175E54;
  --epinette-nuit: #0E3B34;
  --terracotta: #B34A2B;
  --terracotta-fonce: #933C22;
  --lin: #FAF6F1;
  --sauge: #E4EFEA;
  --encre: #2E3A3F;
  --ambre: #F2C879;
  --blanc: #FFFFFF;

  --font-titres: "Fraunces", Georgia, "Times New Roman", serif;
  --font-texte: "Nunito Sans", "Segoe UI", Arial, sans-serif;

  --largeur-max: 1100px;
  --largeur-texte: 46rem;
  --rayon: 12px;
  --ombre: 0 2px 12px rgba(14, 59, 52, 0.08);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* Les ancres ne doivent pas atterrir sous l'entête collante */
[id] { scroll-margin-top: 5.5rem; }

body {
  margin: 0;
  font-family: var(--font-texte);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--encre);
  background: var(--lin);
}

/* --------------------------------------------------------------------------
   Typographie
   -------------------------------------------------------------------------- */

h1, h2, h3 {
  font-family: var(--font-titres);
  color: var(--epinette);
  line-height: 1.2;
  text-wrap: balance;
}

h1 { font-size: clamp(1.9rem, 4.5vw, 2.75rem); font-weight: 600; margin: 0 0 0.75rem; }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); font-weight: 600; margin: 2.5rem 0 0.75rem; }
h3 { font-size: clamp(1.15rem, 2.2vw, 1.3rem); font-weight: 500; margin: 1.75rem 0 0.5rem; }

p, li { max-width: var(--largeur-texte); }
p { margin: 0 0 1rem; }

.intro, .lead { font-size: 1.125rem; }

a { color: var(--epinette); text-underline-offset: 3px; }
a:hover { color: var(--epinette-nuit); }

main a:not(.btn) { color: var(--terracotta); }
main a:not(.btn):hover { color: var(--terracotta-fonce); }

strong { font-weight: 700; }

ul, ol { padding-left: 1.35rem; margin: 0 0 1rem; }
li { margin-bottom: 0.4rem; }

blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: var(--sauge);
  border-left: 4px solid var(--epinette);
  border-radius: 0 var(--rayon) var(--rayon) 0;
}
blockquote p:last-child { margin-bottom: 0; }

hr {
  border: none;
  border-top: 1px solid var(--sauge);
  margin: 2.5rem 0;
}

/* Tableaux (ex. comparaison psychologue / psychoéducatrice) */
.table-scroll { overflow-x: auto; margin: 1.5rem 0; }
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 480px;
  background: var(--blanc);
  border-radius: var(--rayon);
  overflow: hidden;
  box-shadow: var(--ombre);
}
th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--sauge);
  vertical-align: top;
}
th {
  background: var(--epinette);
  color: var(--blanc);
  font-family: var(--font-texte);
  font-weight: 600;
}
tr:last-child td { border-bottom: none; }

/* --------------------------------------------------------------------------
   Structure
   -------------------------------------------------------------------------- */

.conteneur {
  max-width: var(--largeur-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

main { display: block; }

.section { padding: 2.5rem 0; }
.section--sauge { background: var(--sauge); }

/* --------------------------------------------------------------------------
   Bandeau d'entête + navigation
   -------------------------------------------------------------------------- */

.entete {
  background: var(--lin);
  border-bottom: 1px solid var(--sauge);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.logo {
  font-family: var(--font-titres);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--epinette);
  text-decoration: none;
  line-height: 1.1;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.55rem;
  align-items: center;
}
.logo__symbole {
  grid-row: 1 / span 2;
  width: 2.3rem;
  height: 2.3rem;
}
.logo small {
  display: block;
  font-family: var(--font-texte);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--encre);
}

.nav { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }

.nav a {
  text-decoration: none;
  color: var(--encre);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
}
.nav a:hover, .nav a[aria-current="page"] { background: var(--sauge); color: var(--epinette-nuit); }

/* Sous-menu Services */
.nav__item { position: relative; }
.nav__item > button {
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--encre);
  background: none;
  border: none;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
}
.nav__item > button:hover { background: var(--sauge); }
.nav__item > button::after { content: " ▾"; font-size: 0.7em; }

.sous-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--blanc);
  border-radius: var(--rayon);
  box-shadow: 0 8px 24px rgba(14, 59, 52, 0.18);
  padding: 0.5rem;
  min-width: 270px;
  z-index: 60;
}
.nav__item.ouvert .sous-menu,
.nav__item:hover .sous-menu,
.nav__item:focus-within .sous-menu { display: block; }
.sous-menu a { display: block; padding: 0.5rem 0.75rem; font-weight: 400; }

/* Bouton hamburger mobile */
.nav-bascule {
  display: none;
  font: inherit;
  background: none;
  border: 2px solid var(--epinette);
  border-radius: 8px;
  color: var(--epinette);
  font-weight: 700;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

@media (max-width: 860px) {
  .nav-bascule { display: inline-block; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--lin);
    border-bottom: 1px solid var(--sauge);
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1.25rem 1rem;
    box-shadow: 0 12px 24px rgba(14, 59, 52, 0.12);
  }
  .nav.ouvert { display: flex; }
  .sous-menu {
    position: static;
    box-shadow: none;
    background: var(--sauge);
    min-width: 0;
  }
  /* .entete ajouté pour l'emporter sur .btn, déclaré plus bas */
  .entete .entete__cta { display: none; }
  .logo span { white-space: nowrap; }
  .logo__symbole { width: 2rem; height: 2rem; }
}

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: var(--font-texte);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  text-align: center;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn--principal {
  background: var(--terracotta);
  color: var(--blanc);
}
.btn--principal:hover { background: var(--terracotta-fonce); color: var(--blanc); }

.btn--secondaire {
  background: transparent;
  color: var(--epinette);
  border-color: var(--epinette);
}
.btn--secondaire:hover { background: var(--epinette); color: var(--blanc); }

.btn--inverse {
  background: var(--blanc);
  color: var(--epinette);
}
.btn--inverse:hover { background: var(--sauge); color: var(--epinette-nuit); }

.btn:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--epinette);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Héro (accueil)
   -------------------------------------------------------------------------- */

.hero {
  background: linear-gradient(180deg, var(--sauge) 0%, var(--lin) 100%);
  padding: 3.5rem 0 3rem;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--lin);
  border-radius: 100% 100% 0 0;
}
.hero .conteneur { position: relative; z-index: 1; }
.hero h1 { max-width: 42rem; }
.hero .sous-titre {
  font-size: 1.2rem;
  max-width: 38rem;
  margin-bottom: 1.5rem;
}

.hero__boutons, .cta__boutons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.25rem 0 0.75rem;
}

.reassurance {
  font-size: 0.9rem;
  color: var(--encre);
  margin-top: 0.5rem;
}

/* Bandeau de confiance sous le héro */
.confiance {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 1rem 0 0;
  font-size: 0.9rem;
  font-weight: 600;
}
.confiance span::before { content: "✓ "; color: var(--epinette); font-weight: 700; }

/* --------------------------------------------------------------------------
   Cartes (services, blogue)
   -------------------------------------------------------------------------- */

.cartes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}
.cartes li { margin: 0; max-width: none; }

.carte {
  display: block;
  height: 100%;
  background: var(--blanc);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--encre);
  border-top: 4px solid var(--epinette);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.carte:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(14, 59, 52, 0.15);
  color: var(--encre);
}
.carte h3, .carte strong.titre {
  display: block;
  font-family: var(--font-titres);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--epinette);
  margin: 0 0 0.4rem;
}
.carte p { margin: 0; font-size: 0.95rem; }
.carte .lien { display: inline-block; margin-top: 0.6rem; color: var(--terracotta); font-weight: 700; font-size: 0.9rem; }

/* --------------------------------------------------------------------------
   Encadrés
   -------------------------------------------------------------------------- */

.encadre {
  background: var(--sauge);
  border-radius: var(--rayon);
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.encadre h2:first-child, .encadre h3:first-child { margin-top: 0; }
/* Carte Google « au clic » (page Contact) */
.carte-lieu {
  background: var(--sauge);
  border-radius: var(--rayon);
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.carte-lieu__texte { margin: 0 0 0.5rem; }
.carte-lieu__note { margin: 0 0 1rem; font-size: 0.95rem; }
.carte-lieu__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 0;
}
.carte-lieu iframe {
  display: block;
  width: 100%;
  height: 360px;
  border: 0;
  border-radius: var(--rayon);
  margin: 0.5rem 0 1rem;
  background: var(--blanc);
}

.encadre--tarif {
  background: var(--blanc);
  border: 2px solid var(--epinette);
}
.encadre--tarif .prix {
  font-family: var(--font-titres);
  font-size: 2rem;
  font-weight: 600;
  color: var(--epinette);
  margin: 0;
}

/* Sources des articles de blogue : appels [1] et liste en bas */
sup.ref { font-size: 0.75em; line-height: 0; }
sup.ref a { text-decoration: none; padding: 0.25em 0.15em; }
.sources {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 2px solid var(--sauge);
}
.sources h2 { font-size: 1.25rem; }
.sources li { margin-bottom: 0.6rem; overflow-wrap: anywhere; }
.sources li:target { background: var(--sauge); border-radius: 4px; }

/* --------------------------------------------------------------------------
   Photo de Julie (à propos + section « Pourquoi me faire confiance »)
   -------------------------------------------------------------------------- */

.photo-julie {
  float: right;
  width: 300px;
  margin: 0.25rem 0 1.25rem 2rem;
}
.photo-julie img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
}
.photo-julie--petite { width: 220px; }
/* À propos : la photo flotte à côté de l'introduction ET du parcours (pas de grand vide). */
section:has(> .photo-julie) { display: flow-root; }

@media (max-width: 600px) {
  .photo-julie, .photo-julie--petite {
    float: none;
    width: min(100%, 260px);
    margin: 0.5rem auto 1.5rem;
  }
}

/* --------------------------------------------------------------------------
   Bloc de conversion (bas de chaque page)
   -------------------------------------------------------------------------- */

.cta {
  background: var(--epinette);
  color: var(--blanc);
  border-radius: var(--rayon);
  padding: 2rem 1.5rem;
  margin: 3rem 0 2rem;
  text-align: center;
}
.cta h2 {
  color: var(--blanc);
  margin-top: 0;
}
.cta p { margin-left: auto; margin-right: auto; }
.cta a:not(.btn) { color: var(--blanc); text-decoration: underline; }
.cta .cta__boutons { justify-content: center; }
.cta .reassurance { color: var(--blanc); opacity: 0.92; }

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */

.faq h3 {
  background: var(--blanc);
  border-radius: var(--rayon) var(--rayon) 0 0;
  padding: 0.9rem 1.15rem 0.4rem;
  margin-bottom: 0;
  box-shadow: var(--ombre);
}
.faq h3 + p, .faq h3 + p + p {
  background: var(--blanc);
  padding: 0 1.15rem 0.9rem;
  border-radius: 0 0 var(--rayon) var(--rayon);
  max-width: none;
}

/* --------------------------------------------------------------------------
   Fil d'Ariane
   -------------------------------------------------------------------------- */

.ariane {
  font-size: 0.85rem;
  padding: 1rem 0 0;
}
.ariane ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0;
  margin: 0;
}
.ariane li { margin: 0; }
.ariane li + li::before { content: "›"; margin-right: 0.35rem; color: var(--epinette); }
.ariane a { color: var(--encre); }

/* --------------------------------------------------------------------------
   Pied de page
   -------------------------------------------------------------------------- */

.pied {
  background: var(--epinette-nuit);
  color: var(--blanc);
  margin-top: 3rem;
  padding: 2.5rem 0 1.5rem;
  font-size: 0.95rem;
}
.pied a { color: var(--blanc); }
.pied a:hover { text-decoration-thickness: 2px; }
.pied h2 {
  font-size: 1rem;
  font-family: var(--font-texte);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blanc);
  margin: 0 0 0.75rem;
}
.pied__colonnes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}
.pied ul { list-style: none; padding: 0; margin: 0; }
.pied li { margin-bottom: 0.45rem; }
.pied__legal {
  border-top: 1px solid rgba(228, 239, 234, 0.25);
  margin-top: 2rem;
  padding-top: 1.25rem;
  font-size: 0.85rem;
}
.pied__legal p { max-width: none; }

/* --------------------------------------------------------------------------
   Barre CTA mobile collante
   -------------------------------------------------------------------------- */

.barre-mobile {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--blanc);
  box-shadow: 0 -4px 16px rgba(14, 59, 52, 0.18);
  padding: 0.6rem 0.75rem;
  gap: 0.5rem;
}
/* Même seuil que la disparition du CTA d'entête : aucune plage sans CTA visible */
@media (max-width: 860px) {
  .barre-mobile { display: flex; }
  .barre-mobile .btn { flex: 1; padding: 0.7rem 0.5rem; font-size: 0.92rem; }
  body { padding-bottom: 4.5rem; }
}

/* --------------------------------------------------------------------------
   Formulaire de contact
   -------------------------------------------------------------------------- */

.formulaire {
  background: var(--blanc);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 1.5rem;
  max-width: 34rem;
}
.formulaire label { font-weight: 600; }
.formulaire input,
.formulaire textarea {
  width: 100%;
  font: inherit;
  color: var(--encre);
  background: var(--lin);
  border: 1px solid var(--epinette);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  margin-top: 0.25rem;
}
.formulaire input:focus,
.formulaire textarea:focus {
  outline: 2px solid var(--epinette);
  outline-offset: 1px;
}

/* --------------------------------------------------------------------------
   Divers
   -------------------------------------------------------------------------- */

img { max-width: 100%; height: auto; border-radius: var(--rayon); }

.visuellement-cache {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .carte, .btn { transition: none; }
}

@media print {
  .entete, .pied, .barre-mobile, .cta { display: none; }
}
