/* ==========================================================================
   ATODD — Association Tunisienne pour les Objectifs de Développement Durable
   Feuille de style du site (HTML/CSS statique, sans dépendance)
   ========================================================================== */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter-700.woff2") format("woff2"); }

:root {
  --bleu: #204592;          /* bleu du logo */
  --bleu-fonce: #162f68;
  --bleu-clair: #e6ebf7;
  --rouge: #e11f2a;         /* rouge du logo, accent discret */
  --sauge: #dbe4d8;         /* vert sauge des sections (identité d'origine, éclairci) */
  --sauge-fonce: #8fa98a;
  --ivoire: #f6f7f4;
  --blanc: #ffffff;
  --encre: #0f1b33;
  --texte: #3e4756;
  --texte-doux: #6b7280;
  --ligne: rgba(15, 27, 51, 0.12);

  --police: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --conteneur: 1200px;
  --gouttiere: 20px;
  --rayon: 16px;
  --rayon-petit: 8px;
  --header-h: 84px;
  --transition: 180ms ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body { margin: 0; font-family: var(--police); font-size: 1.0625rem; line-height: 1.6; color: var(--texte); background: var(--blanc); -webkit-font-smoothing: antialiased; }
img, svg, video, iframe { display: block; max-width: 100%; }
picture { display: contents; }
img { height: auto; }

h1, h2, h3, h4 { color: var(--encre); margin: 0 0 0.5em; line-height: 1.15; font-weight: 700; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 1.8vw, 1.4rem); letter-spacing: 0; }
h4 { font-size: 1.1rem; letter-spacing: 0; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: var(--bleu); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--encre); }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 3px; border-radius: 4px; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--encre); color: #fff; padding: 10px 16px; border-radius: 999px; z-index: 100; }
.skip-link:focus { top: 12px; }

.conteneur { width: min(100% - 2 * var(--gouttiere), var(--conteneur)); margin-inline: auto; }
.section { padding-block: clamp(56px, 8vw, 96px); }
.section--sauge { background: var(--sauge); }
.section--ivoire { background: var(--ivoire); }
.section--bleu-clair { background: var(--bleu-clair); }
.section__intro { max-width: 680px; margin-bottom: clamp(32px, 5vw, 56px); }
.section__intro p { font-size: 1.125rem; }
.titre-marque::after { content: ""; display: block; width: 48px; height: 4px; background: var(--rouge); border-radius: 2px; margin-top: 14px; }
.centre { text-align: center; }
.centre .titre-marque::after, .titre-marque--centre::after { margin-inline: auto; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 28px; border-radius: 999px; border: 1.5px solid transparent; font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background-color var(--transition), color var(--transition), border-color var(--transition); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--primaire { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.btn--primaire:hover { background: var(--bleu-fonce); border-color: var(--bleu-fonce); color: #fff; }
.btn--rouge { background: var(--rouge); color: #fff; border-color: var(--rouge); }
.btn--rouge:hover { background: #b8141d; border-color: #b8141d; color: #fff; }
.btn--contour { background: transparent; color: var(--bleu); border-color: var(--bleu); }
.btn--contour:hover { background: var(--bleu); color: #fff; }
.btn--blanc { background: #fff; color: var(--bleu); border-color: #fff; }
.btn--blanc:hover { background: var(--bleu-clair); border-color: var(--bleu-clair); color: var(--bleu-fonce); }
.btn--blanc-contour { background: transparent; color: #fff; border-color: rgba(255,255,255,0.7); }
.btn--blanc-contour:hover { background: #fff; color: var(--bleu); border-color: #fff; }

/* ---------- En-tête ---------- */
.header { position: sticky; top: 0; z-index: 50; background: var(--blanc); border-bottom: 1px solid var(--ligne); }
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: var(--header-h); }
.header__logo img { width: 150px; height: auto; }
.nav { display: flex; align-items: center; gap: clamp(16px, 2.5vw, 36px); }
.nav__liens { display: flex; gap: clamp(14px, 1.8vw, 26px); margin: 0; padding: 0; list-style: none; }
.nav__liens a { color: var(--bleu); text-decoration: none; font-weight: 600; font-size: 0.9875rem; padding: 6px 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav__liens a:hover, .nav__liens a[aria-current="page"] { border-bottom-color: var(--rouge); color: var(--encre); }
.header__actions { display: flex; align-items: center; gap: 12px; }
.nav .btn { display: none; }
.header .btn { padding: 10px 20px; font-size: 0.95rem; }
.nav-toggle { display: none; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--bleu); }
.nav-toggle svg { width: 28px; height: 28px; }
.nav-toggle .icone-fermer { display: none; }
.nav-toggle[aria-expanded="true"] .icone-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icone-fermer { display: block; }

/* ---------- Héros ---------- */
.hero { background: var(--bleu); color: #fff; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(900px 500px at 85% 20%, rgba(255,255,255,0.12), transparent 60%); pointer-events: none; }
.hero h1, .hero h2 { color: #fff; }
.hero p { color: rgba(255,255,255,0.9); }
.hero__contenu { position: relative; padding-block: clamp(48px, 7vw, 96px); }
.hero--accueil .hero__contenu { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero--accueil h1 { font-size: clamp(2.75rem, 6.5vw, 5rem); margin-bottom: 0.25em; }
.hero__sous-titre { font-size: clamp(1.2rem, 2vw, 1.5rem); max-width: 560px; margin-bottom: 1.6em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero__roue { justify-self: center; width: min(100%, 440px); filter: drop-shadow(0 20px 40px rgba(0,0,0,0.25)); }
.hero--page .hero__contenu { max-width: 820px; }
.hero--page p { font-size: 1.125rem; }
.hero--page .hero__contenu > :last-child { margin-bottom: 0; }

/* ---------- Accueil ---------- */
.slogan { text-align: center; padding-block: clamp(48px, 7vw, 80px); }
.slogan h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); color: var(--bleu); margin-bottom: 18px; }
.slogan picture { margin-inline: auto; }
.slogan img { width: min(100%, 420px); margin-inline: auto; }
.messages { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 2.5vw, 28px); margin-top: clamp(32px, 5vw, 48px); text-align: left; }
.messages li { list-style: none; background: var(--blanc); border-radius: var(--rayon); padding: 24px 24px 24px 28px; border-left: 6px solid var(--c, var(--bleu)); font-size: 1.05rem; color: var(--encre); font-weight: 600; line-height: 1.45; box-shadow: 0 1px 0 var(--ligne); }
.messages { padding: 0; }
.slogan .btn { margin-top: clamp(28px, 4vw, 40px); }

.diapo { position: relative; background: var(--encre); }
.diapo__piste { display: grid; }
.diapo__item { grid-area: 1 / 1; opacity: 0; transition: opacity 600ms ease; }
.diapo__item[aria-hidden="false"] { opacity: 1; position: relative; z-index: 1; }
.diapo__item img { width: 100%; height: clamp(260px, 42vw, 620px); object-fit: cover; }
.diapo__nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.85); color: var(--encre); cursor: pointer; display: grid; place-items: center; transition: background-color var(--transition); }
.diapo__nav:hover { background: #fff; }
.diapo__nav svg { width: 22px; height: 22px; }
.diapo__nav--prec { left: 16px; }
.diapo__nav--suiv { right: 16px; }
.diapo__points { position: absolute; bottom: 14px; left: 0; right: 0; z-index: 2; display: flex; justify-content: center; gap: 8px; }
.diapo__points button { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; background: transparent; padding: 0; cursor: pointer; }
.diapo__points button[aria-current="true"] { background: #fff; }

/* ---------- Mises en page ---------- */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.duo--inverse > :first-child { order: 2; }
.duo__texte p { font-size: 1.1rem; }
.duo__image img { width: 100%; border-radius: var(--rayon); }
.duo__image--contenir img { object-fit: contain; }
.liste-points { margin: 0 0 1em; padding-left: 1.3em; }
.liste-points li { margin-bottom: 6px; }

/* Réalisations : entrées alternées */
.realisation { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.realisation--inverse > :first-child { order: 2; }
.realisation__image { background: var(--blanc); border-radius: var(--rayon); padding: 18px; display: grid; place-items: center; min-height: 240px; }
.section--sauge .realisation__image { background: rgba(255,255,255,0.75); }
.realisation__image img { width: 100%; max-height: 360px; object-fit: contain; border-radius: var(--rayon-petit); }
.realisation__image--photo { padding: 0; }
.realisation__image--photo img { max-height: none; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--rayon); }
.realisation h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.realisation p { font-size: 1.1rem; }

/* Projets */
.projets-groupe h2 { margin-bottom: 0.3em; }
.projets { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(20px, 3vw, 32px); margin-top: clamp(24px, 3vw, 36px); }
.projet { background: var(--blanc); border-radius: var(--rayon); border: 1px solid var(--ligne); overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
.projet__image { background: #fff; padding: 20px; display: grid; place-items: center; height: 230px; border-bottom: 1px solid var(--ligne); }
.projet__image img { max-height: 190px; width: auto; max-width: 100%; object-fit: contain; }
.projet__image--photo { padding: 0; }
.projet__image--photo img { width: 100%; height: 100%; max-height: none; object-fit: cover; }
.projet__corps { padding: 22px 24px 26px; }
.projet h3 { margin-bottom: 8px; }
.projet p { margin: 0; }

/* Les ODD */
.odd-grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 2.5vw, 28px); }
.odd { display: grid; grid-template-columns: 112px 1fr; gap: 18px; align-items: start; background: var(--blanc); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 18px; }
.odd img { width: 112px; height: 112px; border-radius: 10px; }
.odd h3 { font-size: 1.05rem; margin: 2px 0 6px; }
.odd p { font-size: 0.95rem; margin: 0; color: var(--texte); }
.infographies { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 48px); align-items: start; }
.infographies figure { margin: 0; background: var(--blanc); border-radius: var(--rayon); padding: 20px; border: 1px solid var(--ligne); }
.infographies img { width: 100%; }
.infographies figcaption { margin-top: 12px; font-size: 0.95rem; color: var(--texte-doux); }
.frise { margin: 0; }
.frise img { width: 100%; border-radius: var(--rayon); }
.frise figcaption { margin-top: 12px; color: var(--texte-doux); font-size: 0.95rem; }

/* À propos */
.fondateurs { columns: 3; column-gap: 32px; margin: 0; padding-left: 1.2em; }
.fondateurs li { break-inside: avoid; margin-bottom: 6px; }
.bureau { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(18px, 2.5vw, 28px); }
.membre { text-align: center; }
.membre img { width: min(100%, 180px); aspect-ratio: 1; object-fit: cover; border-radius: 50%; margin: 0 auto 14px; border: 4px solid var(--blanc); box-shadow: 0 6px 20px rgba(15,27,51,0.12); }
.membre h3 { font-size: 1.05rem; margin-bottom: 2px; }
.membre p { margin: 0; color: var(--texte-doux); font-size: 0.95rem; }
.partenaires { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(14px, 2vw, 24px); }
.partenaire { background: var(--blanc); border-radius: var(--rayon); border: 1px solid var(--ligne); padding: 20px; display: grid; place-items: center; aspect-ratio: 4 / 3; text-decoration: none; }
.partenaire img { max-height: 110px; width: auto; max-width: 100%; object-fit: contain; }
.partenaire span { display: block; margin-top: 10px; font-size: 0.85rem; color: var(--texte-doux); text-align: center; }

/* Photos */
.galerie { columns: 3; column-gap: 16px; }
.galerie a { display: block; margin-bottom: 16px; break-inside: avoid; border-radius: 12px; overflow: hidden; background: var(--ivoire); }
.galerie img { width: 100%; transition: transform 400ms ease; }
.galerie a:hover img { transform: scale(1.03); }
.visionneuse { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1200px); max-height: 96vh; }
.visionneuse::backdrop { background: rgba(10, 16, 30, 0.92); }
.visionneuse img { max-width: min(96vw, 1200px); max-height: 88vh; width: auto; height: auto; border-radius: 10px; margin: 0 auto; }
.visionneuse__barre { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.visionneuse__barre button { background: rgba(255,255,255,0.14); color: #fff; border: 1px solid rgba(255,255,255,0.4); border-radius: 999px; padding: 8px 16px; font: inherit; cursor: pointer; }
.visionneuse__barre button:hover { background: rgba(255,255,255,0.28); }
.reseaux-cta { text-align: center; }
.reseaux-cta .social { justify-content: center; margin-top: 18px; }

/* ---------- Formulaires ---------- */
.formulaire { display: grid; gap: 14px; }
.formulaire label { display: block; font-weight: 600; color: var(--encre); margin-bottom: 6px; font-size: 0.95rem; }
.formulaire input, .formulaire textarea { width: 100%; font: inherit; color: var(--encre); padding: 13px 16px; border: 1px solid rgba(15,27,51,0.22); border-radius: var(--rayon-petit); background: #fff; }
.formulaire input:focus, .formulaire textarea:focus { outline: 2px solid var(--bleu); outline-offset: 1px; border-color: var(--bleu); }
.formulaire textarea { min-height: 150px; resize: vertical; }
.formulaire .btn { justify-self: start; margin-top: 4px; }
.formulaire__statut { margin: 0; font-weight: 600; min-height: 1.5em; }
.formulaire__statut[data-etat="ok"] { color: #1f6b3a; }
.formulaire__statut[data-etat="erreur"] { color: #b3261e; }
.champ-pot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.formulaire--ligne { gap: 10px; }
.formulaire--ligne .btn { margin: 0; }

.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.contact__coordonnees { display: grid; gap: 18px; margin-top: 26px; }
.contact__coordonnees h3 { margin-bottom: 2px; font-size: 1rem; }
.contact__coordonnees a { color: var(--encre); font-size: 1.125rem; }
.carte-formulaire { background: var(--blanc); border-radius: var(--rayon); padding: clamp(22px, 3vw, 32px); border: 1px solid var(--ligne); }

.hero--contact { background: var(--bleu-fonce); }
.hero--contact .hero__fond { position: absolute; inset: 0; }
.hero--contact .hero__fond img { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
.hero--contact::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(22,47,104,0.9) 0%, rgba(22,47,104,0.6) 55%, rgba(22,47,104,0.35) 100%); }
.hero--contact .hero__contenu { z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero--contact .carte-formulaire { color: var(--texte); }

.social { display: flex; gap: 8px; }
.social a { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--bleu); border: 1px solid var(--ligne); transition: background-color var(--transition), color var(--transition); }
.social a:hover { background: var(--bleu); color: #fff; }
.social svg { width: 20px; height: 20px; }

/* ---------- Pied de page ---------- */
.footer { background: var(--bleu); color: #fff; padding-block: clamp(56px, 7vw, 80px) 28px; }
.footer a { color: #fff; }
.footer a:hover { color: #ffd9db; }
.footer__grille { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.2fr; gap: clamp(28px, 4vw, 56px); }
.footer__logo { background: #fff; border-radius: 12px; padding: 10px 14px; width: fit-content; margin-bottom: 16px; }
.footer__logo img { width: 150px; }
.footer p { color: rgba(255,255,255,0.88); }
.footer h3 { color: #fff; font-size: 1rem; font-weight: 700; margin: 0 0 12px; }
.footer__liens { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer__liens a { text-decoration: none; }
.footer__liens a:hover { text-decoration: underline; }
.footer__coord { display: grid; gap: 10px; }
.footer__coord a { text-decoration: none; }
.footer .social { margin-top: 16px; }
.footer .social a { color: #fff; border-color: rgba(255,255,255,0.45); }
.footer .social a:hover { background: #fff; color: var(--bleu); }
.footer .formulaire label { color: #fff; }
.footer .formulaire input { border-color: transparent; }
.footer .formulaire__statut[data-etat="ok"] { color: #dff5e3; }
.footer .formulaire__statut[data-etat="erreur"] { color: #ffd9d2; }
.footer__bas { margin-top: clamp(40px, 6vw, 56px); padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.25); font-size: 0.9rem; color: rgba(255,255,255,0.85); display: grid; gap: 6px; }
.footer__bas p { margin: 0; }

/* ---------- Réactivité ---------- */
@media (max-width: 1100px) {
  .odd-grille { grid-template-columns: repeat(2, 1fr); }
  .bureau { grid-template-columns: repeat(3, 1fr); }
  .partenaires { grid-template-columns: repeat(3, 1fr); }
  .footer__grille { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 960px) {
  :root { --header-h: 72px; }
  .header__logo img { width: 128px; }
  .nav-toggle { display: inline-grid; place-items: center; }
  .header__actions .btn { display: none; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0; background: var(--blanc); border-bottom: 1px solid var(--ligne); padding: 8px var(--gouttiere) 20px; box-shadow: 0 18px 30px -20px rgba(15,27,51,0.35); }
  .nav[hidden] { display: none; }
  .nav__liens { flex-direction: column; gap: 0; }
  .nav__liens a { display: block; padding: 13px 0; border-bottom: 1px solid var(--ligne); font-size: 1.05rem; white-space: normal; }
  .nav__liens a[aria-current="page"] { border-bottom-color: var(--ligne); color: var(--rouge); }
  .nav .btn { display: inline-flex; margin-top: 16px; justify-content: center; }
  .hero--accueil .hero__contenu { grid-template-columns: 1fr; text-align: center; }
  .hero--accueil .hero__sous-titre { margin-inline: auto; }
  .hero__actions { justify-content: center; }
  .hero__roue { width: min(70%, 360px); }
  .messages { grid-template-columns: 1fr; }
  .duo, .duo--inverse, .realisation, .realisation--inverse, .contact, .infographies, .hero--contact .hero__contenu { grid-template-columns: 1fr; }
  .duo--inverse > :first-child, .realisation--inverse > :first-child { order: 0; }
  .projets { grid-template-columns: 1fr; }
  .fondateurs { columns: 2; }
  .galerie { columns: 2; }
}

@media (max-width: 600px) {
  body { font-size: 1rem; }
  .odd-grille { grid-template-columns: 1fr; }
  .odd { grid-template-columns: 88px 1fr; }
  .odd img { width: 88px; height: 88px; }
  .bureau { grid-template-columns: repeat(2, 1fr); }
  .partenaires { grid-template-columns: repeat(2, 1fr); }
  .fondateurs { columns: 1; }
  .footer__grille { grid-template-columns: 1fr; }
  .hero__actions .btn { width: 100%; justify-content: center; }
  .diapo__nav { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .galerie a:hover img { transform: none; }
}

@media print { .header, .footer form, .nav-toggle, .diapo__nav, .diapo__points { display: none; } }
