/* ==========================================================================
   IDO — Feuille de style des pages statiques (site vitrine / SEO / AdSense)
   Adaptée en priorité aux écrans PC, responsive jusqu'au mobile.
   Couleurs officielles : vert IDO #2A7872, crème #FAF0E3.
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  --ido-green-900: #0f3d39;
  --ido-green-800: #19534e;
  --ido-green-700: #1f605a;
  --ido-green: #2a7872;
  --ido-green-400: #4aa29b;
  --ido-green-100: #bedfdc;
  --ido-green-50: #e5f2f1;

  --ido-cream: #faf0e3;
  --ido-cream-dark: #f2e6d6;
  --ido-sand: #e9d8c1;
  --ido-accent: #f2a541;        /* orange chaud pour les appels à l'action */
  --ido-accent-dark: #d98a22;

  --text-strong: #14231f;
  --text: #2c3e3b;
  --text-muted: #5f6f6c;
  --white: #ffffff;

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;

  --shadow-sm: 0 2px 8px rgba(15, 61, 57, 0.06);
  --shadow: 0 12px 32px rgba(15, 61, 57, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 61, 57, 0.14);

  --font: 'Cairo', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --header-h: 76px;
  --content-max: 1080px;   /* largeur de lecture du contenu central */
  --rail-w: 160px;         /* largeur des bannières latérales (160x600) */
  --gutter: 32px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(42, 120, 114, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(242, 165, 65, 0.08), transparent 60%),
    var(--ido-cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }
a { color: var(--ido-green); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--ido-green-800); }

h1, h2, h3, h4 { color: var(--text-strong); line-height: 1.25; font-weight: 800; }
h1 { font-size: clamp(2rem, 1.2rem + 2.6vw, 3.4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.1rem); margin: 2.4rem 0 1rem; }
h3 { font-size: 1.25rem; margin: 1.6rem 0 .6rem; }
p { margin-bottom: 1rem; }
ul, ol { margin: 0 0 1.2rem 1.4rem; }
li { margin-bottom: .45rem; }
strong { color: var(--text-strong); }

:focus-visible { outline: 3px solid var(--ido-accent); outline-offset: 3px; border-radius: 6px; }

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

/* ---------- 3. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(250, 240, 227, 0.78);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(42, 120, 114, 0.10);
}
.site-header .bar {
  max-width: calc(var(--content-max) + 2 * (var(--rail-w) + var(--gutter) * 2));
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ido-green-900); }
.brand img { width: 44px; height: 44px; border-radius: 12px; box-shadow: var(--shadow-sm); }
.brand span { font-size: 1.6rem; font-weight: 800; letter-spacing: .04em; }
.brand small { display: block; font-size: .72rem; font-weight: 600; color: var(--text-muted); letter-spacing: .02em; margin-top: -6px; }

.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a {
  position: relative;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600; font-size: .95rem;
  color: var(--text);
}
.main-nav a:hover { background: var(--ido-green-50); color: var(--ido-green-800); }
.main-nav a[aria-current="page"] { color: var(--ido-green); background: var(--ido-green-50); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  font-family: inherit; font-weight: 700; font-size: .98rem;
  border: 0; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
}
.btn-primary {
  color: var(--white) !important;
  background: linear-gradient(135deg, var(--ido-green-400), var(--ido-green) 55%, var(--ido-green-800));
  box-shadow: 0 8px 22px rgba(42, 120, 114, 0.30);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(42, 120, 114, 0.38); }
.btn-accent {
  color: var(--ido-green-900) !important;
  background: linear-gradient(135deg, #ffc46b, var(--ido-accent));
  box-shadow: 0 8px 22px rgba(242, 165, 65, 0.32);
}
.btn-accent:hover { transform: translateY(-2px); background: linear-gradient(135deg, #ffcf85, var(--ido-accent-dark)); }
.btn-ghost { color: var(--ido-green-800) !important; background: var(--white); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid rgba(42, 120, 114, .2); background: var(--white);
  cursor: pointer; font-size: 1.3rem; color: var(--ido-green);
}

/* ---------- 4. Mise en page PC : rails publicitaires + contenu ---------- */
.page-shell {
  flex: 1;
  width: 100%;
  max-width: calc(var(--content-max) + 2 * (var(--rail-w) + var(--gutter) * 2));
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--rail-w);
  gap: var(--gutter);
  align-items: start;
}

.ad-rail {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  width: var(--rail-w);
  min-height: 600px;
  margin-top: 40px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.ad-rail .ad-label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-muted); opacity: .7;
}
.ad-rail ins.adsbygoogle { display: block; width: var(--rail-w); height: 600px; }
/* Tant qu'aucun slot n'est configuré, on n'affiche pas un cadre vide */
.ad-rail[data-empty="true"] { visibility: hidden; }

.content { min-width: 0; padding: 40px 0 64px; }

/* Écrans très larges : format Half Page 300x600 */
@media (min-width: 1600px) {
  :root { --rail-w: 300px; --content-max: 1120px; }
}

/* Sous 1280 px : pas de rails, contenu pleine largeur */
@media (max-width: 1279px) {
  .page-shell { grid-template-columns: minmax(0, 1fr); max-width: calc(var(--content-max) + 2 * var(--gutter)); }
  .ad-rail { display: none; }
}

/* ---------- 5. Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 56px;
  border-radius: var(--radius-lg);
  color: var(--white);
  background:
    radial-gradient(600px 300px at 90% 10%, rgba(255, 255, 255, .16), transparent 60%),
    radial-gradient(500px 300px at 0% 100%, rgba(242, 165, 65, .28), transparent 60%),
    linear-gradient(135deg, var(--ido-green-800), var(--ido-green) 50%, var(--ido-green-400));
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}
.hero::after {
  content: ""; position: absolute; inset: auto -80px -120px auto;
  width: 360px; height: 360px; border-radius: 50%;
  background: rgba(255, 255, 255, .07);
  z-index: -1;
  animation: float 9s ease-in-out infinite;
}
.hero h1 { color: var(--white); margin: 10px 0 16px; max-width: 18ch; }
.hero p.lead { font-size: 1.2rem; max-width: 56ch; opacity: .94; margin-bottom: 28px; }
.hero .eyebrow {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); font-weight: 700; font-size: .82rem; letter-spacing: .06em;
}
.hero .actions { display: flex; flex-wrap: wrap; gap: 14px; }

.page-title {
  padding: 48px 0 8px;
}
.page-title .eyebrow { color: var(--ido-green); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; }
.page-title p.lead { font-size: 1.15rem; color: var(--text-muted); max-width: 62ch; margin-top: 12px; }

/* ---------- 6. Cartes & grilles ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(42, 120, 114, .06);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card h3 { margin-top: 0; }
.card .icon {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center;
  font-size: 1.7rem; margin-bottom: 18px;
  background: linear-gradient(135deg, var(--ido-green-50), var(--ido-green-100));
}

.grid { display: grid; gap: 24px; margin: 32px 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.prose {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px 56px;
  box-shadow: var(--shadow);
  margin-top: 24px;
}
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { max-width: 75ch; }

.steps { counter-reset: step; list-style: none; margin: 24px 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 22px 64px;
  margin: 0;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  font-weight: 800; color: var(--white);
  background: linear-gradient(135deg, var(--ido-green-400), var(--ido-green));
  box-shadow: 0 6px 16px rgba(42, 120, 114, .28);
}
.steps li::after {
  content: ""; position: absolute; left: 21px; top: 50px; bottom: 4px;
  width: 2px; background: var(--ido-green-100);
}
.steps li:last-child::after { display: none; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 32px 0; }
.stat { text-align: center; padding: 24px 12px; border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-sm); }
.stat b { display: block; font-size: 2rem; color: var(--ido-green); line-height: 1.1; }
.stat span { font-size: .9rem; color: var(--text-muted); }

.callout {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 20px 24px; border-radius: var(--radius);
  background: var(--ido-green-50); border-left: 4px solid var(--ido-green);
  margin: 24px 0;
}

.cta-band {
  margin-top: 48px;
  padding: 40px 48px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--ido-green-900), var(--ido-green-700));
  color: var(--white);
  box-shadow: var(--shadow-lg);
}
.cta-band h2 { color: var(--white); margin: 0 0 6px; font-size: 1.6rem; }
.cta-band p { margin: 0; opacity: .85; }

/* ---------- 7. Formulaire contact ---------- */
.form { display: grid; gap: 18px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form label { font-weight: 700; font-size: .92rem; color: var(--ido-green-800); display: block; margin-bottom: 6px; }
.form input, .form select, .form textarea {
  width: 100%;
  padding: 14px 16px;
  font: inherit; font-size: 1rem;
  border-radius: 12px;
  border: 2px solid #e4e9e8;
  background: #f9fbfb;
  color: var(--text-strong);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.form textarea { min-height: 160px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--ido-green); background: var(--white);
  box-shadow: 0 0 0 4px rgba(42, 120, 114, .14);
}

/* ---------- 8. Footer ---------- */
.site-footer {
  margin-top: auto;
  background: var(--ido-green-900);
  color: rgba(255, 255, 255, .78);
  padding: 56px var(--gutter) 28px;
}
.site-footer .cols {
  max-width: calc(var(--content-max) + 2 * (var(--rail-w) + var(--gutter)));
  margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
}
.site-footer h4 { color: var(--white); font-size: 1rem; margin-bottom: 14px; }
.site-footer a { color: rgba(255, 255, 255, .78); display: block; padding: 3px 0; }
.site-footer a:hover { color: var(--ido-accent); }
.site-footer .legal {
  max-width: calc(var(--content-max) + 2 * (var(--rail-w) + var(--gutter)));
  margin: 40px auto 0; padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: .85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

/* ---------- 9. Animations ---------- */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.hero, .page-title { animation: rise .8s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 10. Responsive (tablette / mobile) ---------- */
@media (max-width: 1024px) {
  .grid-4, .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
  .prose { padding: 36px 32px; }
}

@media (max-width: 760px) {
  :root { --gutter: 18px; --header-h: 64px; }
  body { font-size: 16px; }
  .nav-toggle { display: grid; place-items: center; }
  .main-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 12px var(--gutter) 20px;
    background: var(--ido-cream);
    border-bottom: 1px solid rgba(42, 120, 114, .12);
    box-shadow: var(--shadow);
    display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav .btn { margin-top: 6px; }
  .hero { padding: 40px 26px; }
  .grid-2, .grid-3, .grid-4, .form .row { grid-template-columns: 1fr; }
  .prose { padding: 28px 20px; border-radius: var(--radius); }
  .cta-band { padding: 28px 24px; }
  .site-footer .cols { grid-template-columns: 1fr; gap: 28px; }
}

/* RTL (si une version arabe est ajoutée) */
[dir="rtl"] .steps li { padding: 0 64px 22px 0; }
[dir="rtl"] .steps li::before { left: auto; right: 0; }
[dir="rtl"] .steps li::after { left: auto; right: 21px; }
[dir="rtl"] .callout { border-left: 0; border-right: 4px solid var(--ido-green); }
[dir="rtl"] ul, [dir="rtl"] ol { margin: 0 1.4rem 1.2rem 0; }
