/* Charte reprise du logo : changer une couleur ici la change partout.
   Les couleurs vives du logo n'atteignent pas le contraste AA pour du texte : elles restent
   décoratives. Les textes et les boutons utilisent leurs versions foncées. */
:root {
  /* Couleurs du logo */
  --green: #7ED957;
  --orange: #FAAD26;
  --red: #FF5757;
  --gold: #F9DC66;
  --blue: #65C5F9;
  --pink: #FF88CC;
  --violet: #D68CE6;
  --cream: #FFFAE7;

  /* Versions foncées et claires, pour le texte et les fonds */
  --ink: #3A3838;
  --blue-dark: #0F4C75;
  --blue-darker: #0A3755;
  --red-dark: #C4302B;
  --red-darker: #9E2420;
  --green-tint: #EEF9E9;
  --gold-tint: #FFF1C2;
  --white: #FFFFFF;
  --error: #A32A12;
  --success: #1F6245;

  --radius: 12px;
  --font-body: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-title: var(--font-body);
}

/* Hébergée sur le site, pour n'envoyer aucune donnée de visiteur à un service tiers. */
@font-face {
  font-family: "Lexend";
  src: url("../fonts/lexend.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

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

html { scroll-behavior: smooth; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}

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

h1, h2, h3 {
  margin: 0 0 .6em;
  color: var(--blue-dark);
  font-family: var(--font-title);
  font-weight: 600;
  line-height: 1.25;
}
h1 { font-size: clamp(2rem, 5vw, 2.75rem); }
h2 { font-size: clamp(1.45rem, 3vw, 1.8rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

a { color: var(--blue-dark); text-underline-offset: .15em; }
a:hover { color: var(--blue-darker); text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--blue-dark);
  outline-offset: 2px;
  border-radius: 3px;
}
main { flex: 1; }
main:focus { outline: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 10;
  padding: .6rem 1rem;
  background: var(--blue-dark);
  color: var(--white);
  border-radius: 0 0 8px 8px;
}
.skip-link:focus { top: 0; color: var(--white); }

/* Texte provisoire, à remplacer avant la mise en ligne */
.todo {
  padding: .1em .35em;
  background: var(--gold-tint);
  border: 1px dashed var(--ink);
  border-radius: 4px;
  color: var(--ink);
  font-size: .95em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Mise en page */
.container { width: min(100% - 2rem, 1080px); margin-inline: auto; }
.container--narrow { max-width: 720px; }
.section { padding-block: clamp(2rem, 5vw, 3.5rem); }
.section--tinted { background: var(--green-tint); }
.section section { margin-top: 2.5rem; }
.section__more { margin: 1.5rem 0 0; }
.lead { font-size: 1.2rem; }

/* En-tête */
.site-header {
  background: var(--white);
  border-bottom: 4px solid;
  border-image: linear-gradient(90deg, var(--green), var(--orange), var(--red)) 1;
}
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.5rem;
  padding-block: .75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: var(--blue-dark);
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: block;
  padding: .5rem .75rem;
  border-bottom: 3px solid transparent;
  text-decoration: none;
}
.site-nav a:hover { border-bottom-color: var(--green); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--blue-dark); font-weight: 700; }

.brand { margin-right: auto; }

/* Lien vers la page Facile à lire, à part du menu pour rester visible sur mobile */
.falc-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .4rem 1rem;
  border: 2px solid var(--blue-dark);
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.falc-link:hover, .falc-link[aria-current="page"] { background: var(--blue-dark); color: var(--white); }

.nav-toggle {
  min-height: 44px;
  padding: .4rem 1rem;
  background: var(--white);
  border: 2px solid var(--blue-dark);
  border-radius: 8px;
  color: var(--blue-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.nav-toggle[hidden] { display: none; }

@media (max-width: 860px) {
  .brand { flex: 1 1 0; min-width: 0; font-size: 1.15rem; }
  .brand img { width: 64px; height: 64px; }
  /* Le lien Facile à lire passe sous le bouton Menu */
  .site-header__actions { display: flex; flex-direction: column; align-items: stretch; gap: .5rem; }
  .nav-toggle, .falc-link { justify-content: center; }
  .site-nav { flex-basis: 100%; }
  .site-nav.is-collapsed { display: none; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { min-height: 44px; }
}

/* Accueil */
.hero {
  --landscape-height: clamp(180px, 28.75vw, 460px);
  position: relative;
  /* Le texte s'arrête au-dessus de la prairie, pour laisser voir les personnages. */
  padding-block: clamp(1.5rem, 3vw, 2.5rem) calc(var(--landscape-height) * .33);
  background: var(--white); /* le haut du paysage est blanc : le ciel se prolonge sans raccord */
}
.hero__landscape {
  position: absolute;
  inset: auto 0 0;
  display: block;
  width: 100%;
  max-width: 1600px;
  height: var(--landscape-height);
  margin-inline: auto;
  object-fit: cover;
  object-position: center bottom;
}
/* Au-delà de sa largeur d'origine, l'image n'est plus agrandie : ses bords se fondent dans le fond. */
@media (min-width: 1601px) {
  .hero { background: linear-gradient(var(--white) calc(100% - 3rem), var(--cream)); }
  .hero__landscape { mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
}
.hero__inner { position: relative; }
/* Le fond presque opaque garantit le contraste du texte, quel que soit le dessin en dessous. */
.hero__text h1 { font-size: clamp(1.9rem, 3.4vw, 2.4rem); }
.hero__text {
  max-width: 36rem;
  padding: 1.5rem 1.75rem;
  background: rgba(255, 255, 255, .92);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(15, 76, 117, .14);
}
.hero__text > :last-child { margin-bottom: 0; }
.hero__subtitle { color: var(--blue-dark); font-size: 1.3rem; font-weight: 700; }
.hero__lead { font-size: 1.2rem; }

/* Sur téléphone, le texte couvrirait tout le dessin : il passe au-dessus, et le dessin
   est recadré pour garder le logo et les personnages. */
@media (max-width: 860px) {
  .hero { --landscape-height: 260px; padding-bottom: 0; }
  .hero__landscape { position: static; object-position: 72% bottom; }
  .hero__text { padding: 0; background: none; box-shadow: none; }
  .hero__inner { padding-bottom: 1rem; }
  .hero { display: flex; flex-direction: column-reverse; }
}

.notice {
  padding: 1.25rem 1.5rem;
  background: var(--white);
  border-left: 6px solid var(--red);
  border-radius: var(--radius);
}
.notice > :last-child { margin-bottom: 0; }

/* Accueil : ce que nous proposons ou non, côte à côte et au même niveau */
.panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 1.5rem;
}
.panel {
  padding: 1.5rem;
  background: var(--white);
  border-top: 6px solid;
  border-radius: var(--radius);
}
.panel--green { border-top-color: var(--green); }
.panel--red { border-top-color: var(--red); }
.panel > :last-child { margin-bottom: 0; }

/* Boutons */
.button {
  display: inline-block;
  min-height: 44px;
  padding: .6rem 1.4rem;
  background: var(--blue-dark);
  border: 2px solid var(--blue-dark);
  border-radius: 999px;
  color: var(--white);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--blue-darker); border-color: var(--blue-darker); color: var(--white); }
.button--accent { background: var(--red-dark); border-color: var(--red-dark); }
.button--accent:hover { background: var(--red-darker); border-color: var(--red-darker); }
.button--secondary { background: var(--white); color: var(--blue-dark); }
.button[hidden] { display: none; }
.button--danger { background: var(--error); border-color: var(--error); }
.button--danger:hover { background: #7E200E; border-color: #7E200E; }
.button-link {
  padding: 0;
  background: none;
  border: 0;
  color: var(--blue-dark);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Actualités */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
}
.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--green);
  border-radius: var(--radius);
}
.card__image { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card__body { padding: 1.25rem; }
.card__body > :last-child { margin-bottom: 0; }
.card__date { margin-bottom: .4rem; font-size: .95rem; }
.card__title { margin-bottom: .5rem; }

.pagination { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin-top: 2rem; }

/* Images d'une actu : 200 px de large au plus, un clic ouvre le fichier en 1600 px. */
.article-image, .carousel { display: block; max-width: 200px; margin-top: 1.5rem; }
.article-image img, .carousel img { display: block; width: 100%; border-radius: var(--radius); }
.carousel__track { display: flex; align-items: center; margin: 0; padding: 0; overflow-x: auto; scroll-snap-type: x mandatory; list-style: none; }
.carousel__slide { flex: 0 0 100%; scroll-snap-align: start; }
.carousel__slide a { display: block; }
.carousel__controls { display: flex; align-items: center; justify-content: space-between; margin-top: .5rem; }
.carousel__controls[hidden] { display: none; }
.carousel__button { width: 44px; height: 44px; padding: 0; background: var(--white); border: 2px solid var(--blue-dark); border-radius: 50%; color: var(--blue-dark); font: inherit; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.carousel__button:hover { background: var(--blue-dark); color: var(--white); }
.carousel__count { font-size: .95rem; }

/* Visionneuse des photos (public/js/site.js) : une fenêtre centrée, pas la page entière. */
.lightbox { position: relative; max-width: min(90vw, 900px); max-height: 90vh; padding: 1rem; overflow: visible; background: var(--white); border: 0; border-radius: var(--radius); }
.lightbox::backdrop { background: rgba(0, 0, 0, .75); }
.lightbox__image { display: block; max-width: 100%; max-height: calc(90vh - 6rem); margin: 0 auto; border-radius: var(--radius); }
.lightbox__close { position: absolute; top: -.9rem; right: -.9rem; width: 44px; height: 44px; padding: 0; background: var(--white); border: 2px solid var(--blue-dark); border-radius: 50%; color: var(--blue-dark); font: inherit; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.lightbox__close:hover { background: var(--blue-dark); color: var(--white); }
.lightbox__controls { display: flex; align-items: center; justify-content: center; gap: 1.5rem; margin-top: .75rem; }
.lightbox__count { font-size: .95rem; }

.emoji-palette { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: .4rem; }
.emoji-palette button { width: 2.25rem; height: 2.25rem; padding: 0; background: var(--white); border: 1px solid var(--blue-dark); border-radius: 6px; font-size: 1.15rem; line-height: 1; cursor: pointer; }
.emoji-palette button:hover { background: var(--gold); }
.text-toolbar { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: .4rem; }
.text-toolbar button, .text-toolbar select { min-width: 2.25rem; height: 2.25rem; padding: 0 .6rem; background: var(--white); border: 1px solid var(--blue-dark); border-radius: 6px; color: var(--ink); font: inherit; font-size: .95rem; cursor: pointer; }
.text-toolbar button:hover, .text-toolbar select:hover { background: var(--gold); }

/* Textes mis en forme depuis l'administration (src/format.php). */
.rich-text > :last-child { margin-bottom: 0; }
.rich-text .text-heading { margin-top: 1.5rem; font-size: 1.25rem; }
.text-bleu { color: var(--blue-dark); }
.text-rouge { color: var(--red-dark); }
.text-vert { color: var(--success); }
.text-orange { color: #A3540A; }
.text-violet { color: #7B3A8C; }
.article-body { overflow-wrap: anywhere; }

/* L'association */
.axes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
.axes li {
  padding: 1.25rem;
  background: var(--white);
  border-top: 5px solid var(--green);
  border-radius: var(--radius);
}
.axes li:nth-child(3n+2) { border-top-color: var(--orange); }
.axes li:nth-child(3n) { border-top-color: var(--red); }
.axes p { margin: 0; }

.values {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}
.values li {
  padding: .35rem 1rem;
  background: var(--white);
  border: 2px solid var(--green);
  border-radius: 999px;
  font-weight: 600;
}
.values li:nth-child(4n+2) { border-color: var(--orange); }
.values li:nth-child(4n+3) { border-color: var(--red); }
.values li:nth-child(4n) { border-color: var(--blue); }

.quote {
  margin: 1.25rem 0 0;
  padding: 1.25rem 1.5rem;
  background: var(--white);
  border-left: 6px solid var(--orange);
  border-radius: var(--radius);
}
.quote p { margin-bottom: .5rem; }
.quote footer { font-size: .95rem; }

.join {
  padding: 1.5rem;
  background: var(--white);
  border: 3px solid var(--red);
  border-radius: var(--radius);
  text-align: center;
}
.join > :last-child { margin-bottom: 0; }
.tagline { color: var(--red-dark); font-family: var(--font-title); font-size: 1.3rem; font-weight: 600; }

.prose h2 { margin-top: 2rem; }

/* Facile à lire : texte grand, une phrase par ligne, une image à gauche de chaque partie */
.falc { font-size: 1.25rem; line-height: 1.6; text-align: left; }
.falc p { margin: 0 0 .5em; }
.falc__partie {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: 1.5rem 2rem;
  align-items: start;
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 2px solid var(--green);
}
.falc__image img { display: block; border-radius: var(--radius); }
.falc__partie--logo { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); align-items: center; }
.falc__texte > :last-child { margin-bottom: 0; }
/* Espace entre deux groupes de phrases d'une même partie */
.falc__suite { margin-top: 1.25em; }
/* Encadré des mots difficiles : toujours le même, le mot en gras sur la 1re ligne */
.falc__mot {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  background: var(--gold-tint);
  border-left: 6px solid var(--orange);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.falc__mot > :last-child { margin-bottom: 0; }
.falc__numero { font-size: 2rem; font-weight: 700; line-height: 1.2; }
@media (max-width: 860px) {
  .falc__partie { grid-template-columns: 1fr; }
  .falc__image { max-width: 240px; }
  .falc__partie--logo { grid-template-columns: 1fr; }
  .falc__partie--logo .falc__image { max-width: 320px; }
}

/* Formulaires */
.form { margin-top: 1.5rem; }
.form__legend { font-weight: 700; }
.field { margin: 0 0 1.25rem; padding: 0; border: 0; }
.field label, .field legend { display: block; margin-bottom: .3rem; font-weight: 700; }
.field__hint { margin-bottom: .4rem; font-size: .95rem; }
.field__error { margin: .35rem 0 0; color: var(--error); font-weight: 700; }
.field--hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field .checkbox { display: flex; gap: .5rem; align-items: baseline; font-weight: 400; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"], textarea {
  width: 100%;
  min-height: 44px;
  padding: .55rem .7rem;
  background: var(--white);
  border: 2px solid #686666;
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
}
input[type="file"] { max-width: 100%; font: inherit; }
[aria-invalid="true"] { border-color: var(--error); }

.alert { margin-block: 1.5rem; padding: 1rem 1.25rem; background: var(--white); border-left: 6px solid; border-radius: var(--radius); }
.alert > :last-child { margin-bottom: 0; }
.alert--success { border-color: var(--success); }
.alert--error { border-color: var(--error); }

.contact-other ul { display: grid; gap: .6rem; padding: 0; list-style: none; }
.contact-other li { display: flex; align-items: center; gap: .6rem; }
.contact-icon { flex: none; width: 1.5rem; height: 1.5rem; }
.contact-icon--mail { color: var(--blue-dark); }
.contact-other .social-links { gap: 1.75rem; margin-top: .4rem; }
.social-links a { display: inline-flex; border-radius: .4rem; }
.social-icon { width: 4rem; height: 4rem; transition: transform .15s; }
.social-links a:hover .social-icon { transform: scale(1.08); }
.social-icon--linkedin { color: #0a66c2; }
.social-icon--instagram { color: #e1306c; }

/* Pied de page */
.site-footer { background: var(--blue-dark); color: var(--white); padding-block: 2.5rem 1.5rem; }
.site-footer a { color: var(--white); }
.site-footer a:hover { color: var(--gold); }
.site-footer :focus-visible { outline-color: var(--gold); }
.site-footer h2 { color: var(--white); font-size: 1.4rem; }

.help ul { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.help li { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; }
.help__number { font-size: 1.7rem; font-weight: 700; line-height: 1.2; }
/* Les logos des réseaux s'alignent sur la ligne du 3114, à droite du titre d'aide. */
.site-footer .container { display: grid; grid-template-columns: 1fr auto; column-gap: 2rem; }
.site-footer .help { grid-column: 1; grid-row: 1 / 3; display: grid; grid-template-rows: subgrid; }
.site-footer__social { grid-column: 2; grid-row: 2; align-self: start; display: flex; gap: 1.25rem; }
.site-footer__legal { grid-column: 1 / -1; }
@media (max-width: 860px) {
  .site-footer .container { grid-template-columns: 1fr; }
  .site-footer .help { grid-row: 2 / 4; }
  .site-footer__social { grid-column: 1; grid-row: 1; margin-bottom: 1.5rem; }
}
.site-footer__social .social-icon { width: 2.5rem; height: 2.5rem; color: var(--white); }
.site-footer__social a:hover .social-icon { color: var(--gold); }
.site-footer__legal { margin: 2rem 0 0; padding-top: 1rem; border-top: 1px solid var(--green); font-size: .95rem; }

/* Administration */
.admin-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; }
.admin-nav form { margin: 0; }
.admin-preview { display: block; max-width: 280px; margin-bottom: .5rem; border-radius: 8px; }
.admin-image { margin-bottom: 1.25rem; padding: 1rem; border: 1px solid var(--blue-dark); border-radius: 8px; }
.admin-image .field:last-child { margin-bottom: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.admin-section { margin-top: 2.5rem; }
.table-order { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin: 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--white); }
th, td { padding: .7rem .8rem; border-bottom: 1px solid var(--green); text-align: left; vertical-align: top; }
thead th { color: var(--blue-dark); }
tbody th { font-weight: 600; }
.table-actions { white-space: nowrap; }
.table-actions a + a { margin-left: .75rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
