/*
Theme Name: INSTIDAR
Theme URI: https://instidar.com
Author: INSTIDAR
Description: Le thème de la plateforme INSTIDAR — soutien scolaire marocain, collège et lycée. Reprend la charte de la plateforme : papier et menthe, vert Instidar, jamais de blanc pur en fond.
Version: 1.0.0
Requires at least: 7.0
Requires PHP: 8.2
License: GPL-2.0-or-later
Text Domain: instidar
*/

/* ---------------------------------------------------------------------------
   Jetons de la charte. Une seule source pour les couleurs, les rayons et les
   ombres : les changer ici les change partout.
   ------------------------------------------------------------------------ */

:root {
  --papier: #f4f6f3;
  --menthe: #e6f1ea;
  --surface: #ffffff;

  --encre: #1b2b22;
  /* Contrastes mesurés sur le fond papier : 5,2:1 et 4,5:1. Les teintes
     précédentes tombaient à 4,2 et 2,8 — sous le seuil lisible. */
  --encre-douce: #5b6b62;
  --encre-pale: #667269;
  --ligne: #e6eae7;

  --vert: #2e7d4f;
  --vert-sombre: #1f5c3a;
  --pousse: #43a047;
  --soleil: #f2b233;
  --soleil-pale: #fdf1da;
  --alerte: #b3402e;

  --pied: #1b2b22;
  --pied-texte: #e6f1ea;
  --pied-ligne: #33453a;

  --r-bouton: 10px;
  --r-carte: 16px;
  --r-puce: 12px;

  --largeur: 1200px;
  --police: "Lexend", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --police-arabe: "Noto Sans Arabic", var(--police);
}

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

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--police);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

[dir="rtl"] body { font-family: var(--police-arabe); }

h1, h2, h3, h4 { letter-spacing: -0.025em; line-height: 1.18; margin: 0 0 12px; text-wrap: balance; }
h1 { font-size: clamp(34px, 5vw, 48px); font-weight: 700; line-height: 1.14; }
h2 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 700; }
h3 { font-size: 18px; font-weight: 600; }
p { margin: 0 0 16px; }
a { color: var(--vert); }
img { max-width: 100%; height: auto; }

.contenant { width: min(100%, var(--largeur)); margin-inline: auto; padding-inline: 40px; }
.section { padding: 88px 0; }
.section--menthe { background: var(--menthe); }
.section--surface { background: var(--surface); }
.section--bandeau { padding: 56px 0; border-block: 1px solid var(--ligne); }
.centre { text-align: center; }
.mesure { max-width: 62ch; margin-inline: auto; }

/* --- Entête --------------------------------------------------------------- */

.entete {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--papier) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ligne);
}
.entete__barre { display: flex; align-items: center; gap: 24px; height: 74px; }
.marque { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--encre); text-decoration: none; }
.marque__pastille { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--vert); color: #fff; font-size: 17px; }
.navigation { display: flex; gap: 20px; list-style: none; padding: 0; margin-block: 0; margin-inline-start: 0; white-space: nowrap; }
.navigation a { color: var(--encre-douce); font-weight: 600; text-decoration: none; }
.navigation a:hover { color: var(--vert); }
.navigation a[aria-current="page"] { color: var(--vert); text-decoration: underline; text-underline-offset: 5px; }
.entete__actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }

/* --- Dépliage du menu sur petit écran ------------------------------------- */

.menu-bascule {
  display: none;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
  background: var(--surface);
  color: var(--encre);
  border: 1px solid var(--ligne);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 900px) {
  .contenant { padding-inline: 20px; }
  /* Hauteur minimale, pas fixe : le menu déplié doit agrandir l'entête,
     sinon il déborde par-dessus la page sans fond. */
  .entete__barre { gap: 14px; flex-wrap: wrap; height: auto; min-height: 74px; padding-block: 13px; }
  .menu-bascule { display: inline-flex; }

  /* Replié : retiré de l'ordre de tabulation aussi, pas seulement de la vue.
     Un lien invisible mais focusable envoie le curseur dans le vide. */
  .navigation-zone {
    display: none;
    flex-basis: 100%;
    order: 10;
  }
  .navigation-zone.est-ouvert { display: block; }
  .navigation-zone .navigation {
    flex-direction: column;
    gap: 0;
    margin-inline-start: 0;
    padding-bottom: 12px;
  }
  .navigation-zone .navigation li { border-top: 1px solid var(--ligne); }
  .navigation-zone .navigation a { display: block; padding: 14px 2px; }

  /* Langue et compte rejoignent le menu déplié : sur la barre, ils
     débordaient de 180 px à 320 px de large. Le sélecteur de frère suit
     l'état ouvert/fermé que pose déjà le script du pied de page. */
  .entete__actions {
    display: none;
    flex-basis: 100%;
    order: 11;
    flex-wrap: wrap;
    margin-inline-start: 0;
    padding-block: 16px;
    border-top: 1px solid var(--ligne);
  }
  .navigation-zone.est-ouvert ~ .entete__actions { display: flex; }
  .entete__actions .ins-langues { flex-basis: 100%; }
  .entete__actions .ins-langue { flex: 1; text-align: center; }
  .entete__actions .bouton { flex: 1 1 auto; justify-content: center; }
}

@media (min-width: 901px) {
  .navigation-zone { margin-inline-start: auto; }
}

/* --- Commutateur de langue ------------------------------------------------ */

.ins-langues {
  display: inline-flex;
  border: 1px solid var(--ligne);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}

.ins-langue {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--encre-douce);
  text-decoration: none;
}

.ins-langue:hover { color: var(--vert); }

.ins-langue.est-active {
  background: var(--vert);
  color: #fff;
}

/* --- Droite à gauche ------------------------------------------------------- */

[dir="rtl"] .heros__texte,
[dir="rtl"] .mesure { margin-inline: 0; }

[dir="rtl"] .etapes__numero { margin-inline: auto; }

[dir="rtl"] blockquote,
[dir="rtl"] ul,
[dir="rtl"] ol { padding-inline-start: 1.2em; padding-inline-end: 0; }

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

.bouton {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--vert); color: #fff;
  border: 1px solid var(--vert); border-radius: 999px;
  padding: 13px 24px; font-weight: 700; font-size: 15px;
  text-decoration: none; cursor: pointer;
  white-space: nowrap;
}
.bouton:hover { background: var(--vert-sombre); border-color: var(--vert-sombre); color: #fff; }
.bouton--clair { background: var(--surface); color: var(--vert); border-color: var(--ligne); }
.bouton--clair:hover { background: var(--menthe); color: var(--vert-sombre); border-color: var(--vert); }

/* --- Héros ---------------------------------------------------------------- */

.heros { padding: 76px 0 64px; }
.heros__grille { display: grid; gap: 56px; align-items: center; grid-template-columns: 1.05fr 1fr; }
@media (max-width: 900px) { .heros__grille { grid-template-columns: 1fr; } }
.puce {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--menthe); color: var(--vert-sombre);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 700;
}
.heros__texte { font-size: 18px; color: var(--encre-douce); max-width: 520px; }
.heros__boutons { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0 18px; }
.heros__note { font-size: 13.5px; color: var(--encre-pale); }
.heros__visuel { background: linear-gradient(160deg, var(--menthe), var(--surface)); border: 1px solid var(--ligne); border-radius: 24px; padding: 32px; }

/* --- Bandeau de confiance ------------------------------------------------- */

.confiance { background: var(--menthe); padding: 26px 0; }
.confiance__liste { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; list-style: none; margin: 0; padding: 0; }
.confiance__liste li { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 15px; }
.confiance__pastille { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-puce); background: var(--surface); color: var(--vert); }

/* --- Cartes --------------------------------------------------------------- */

.grille { display: grid; gap: 20px; list-style: none; padding: 0; margin: 40px 0 0; }
/* min(…, 100%) : une colonne minimale plus large que l'écran (320 px dans
   280 px utiles) forçait un défilement horizontal sur téléphone. */
.grille--4 { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.grille--3 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.grille--2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }

.carte {
  background: var(--surface); border: 1px solid var(--ligne);
  border-radius: var(--r-carte); padding: 26px;
  display: flex; flex-direction: column; gap: 10px; height: 100%;
}
.carte__icone { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-puce); background: var(--menthe); color: var(--vert); font-size: 20px; }
.carte p { color: var(--encre-douce); font-size: 14.5px; margin: 0; }

.surtitre { text-transform: uppercase; letter-spacing: 0.08em; font-size: 12.5px; font-weight: 700; color: var(--vert); margin-bottom: 10px; }
.chapeau { color: var(--encre-douce); font-size: 17px; }

/* --- Deux promesses ------------------------------------------------------- */

.promesse { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--r-carte); padding: 32px; height: 100%; display: flex; flex-direction: column; }
.promesse__points { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 20px; }
.promesse__points li { display: flex; gap: 12px; }
.promesse__coche { color: var(--pousse); font-weight: 700; }
.promesse__points p { margin: 4px 0 0; font-size: 14.5px; color: var(--encre-douce); }

/* --- Étapes --------------------------------------------------------------- */

.etapes { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); list-style: none; padding: 0; margin: 40px 0 0; }
.etapes li { text-align: center; }
.etapes__numero { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 18px; border-radius: 999px; background: var(--vert); color: #fff; font-weight: 700; font-size: 19px; }

/* --- Chiffres ------------------------------------------------------------- */

.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 28px; text-align: center; list-style: none; padding: 0; margin: 0; }
.chiffres strong { display: block; font-size: 34px; font-weight: 700; color: var(--vert); font-variant-numeric: tabular-nums; }
.chiffres span { color: var(--encre-douce); font-size: 14.5px; }

/* --- Questions ------------------------------------------------------------ */

.question { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--r-carte); padding: 20px 24px; margin-bottom: 12px; }
.question summary { font-weight: 700; cursor: pointer; }
.question p { margin: 12px 0 0; color: var(--encre-douce); }

/* --- Appel final ---------------------------------------------------------- */

.appel { background: var(--vert); color: #fff; border-radius: 24px; padding: 56px 40px; text-align: center; }
.appel h2 { color: #fff; }
.appel p { color: color-mix(in srgb, #fff 82%, transparent); max-width: 56ch; margin-inline: auto; }
.appel .bouton { background: #fff; color: var(--vert); border-color: #fff; margin-top: 22px; }
.appel .bouton:hover { background: var(--menthe); color: var(--vert-sombre); }

/* --- Contenu d'article ---------------------------------------------------- */

.contenu { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--r-carte); padding: 40px; }
.contenu > *:last-child { margin-bottom: 0; }

/* --- Pied ----------------------------------------------------------------- */

.pied { background: var(--pied); color: var(--pied-texte); padding: 56px 0 32px; margin-top: 80px; }
.pied a { color: var(--pied-texte); text-decoration: none; }
.pied a:hover { text-decoration: underline; }
.pied__grille { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.pied__liste { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.pied__bas { border-top: 1px solid var(--pied-ligne); margin-top: 40px; padding-top: 24px; font-size: 13.5px; color: color-mix(in srgb, var(--pied-texte) 70%, transparent); }

/* --- Accessibilité -------------------------------------------------------- */

a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--pousse);
  outline-offset: 2px;
}
/* Propriété logique : en arabe (rtl), un « left: -9999px » tombe du côté
   défilable et ajoutait 9 999 px de défilement horizontal. */
.saut-contenu { position: absolute; inset-inline-start: -9999px; }
.saut-contenu:focus { inset-inline-start: 16px; top: 12px; z-index: 100; background: var(--surface); padding: 10px 16px; border-radius: var(--r-bouton); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ===========================================================================
   Identité reprise de la plateforme : marque, illustration, animations.
   Les valeurs sont celles de app/globals.css et des composants React, pour que
   les deux versions soient superposables et non « ressemblantes ».
   ======================================================================== */

/* --- Marque --------------------------------------------------------------- */

.marque { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.marque__nom {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-transform: lowercase;
  color: var(--encre);
}
.marque--sombre .marque__nom { color: var(--pied-texte); }

/* --- Animations ----------------------------------------------------------- */

@keyframes ins-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes ins-float2 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes ins-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes ins-twinkle { 0%, 100% { opacity: .5; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes ins-grow { from { width: 0; } }

.ins-float { animation: ins-float 6s ease-in-out infinite; }
.ins-float2 { animation: ins-float2 7s ease-in-out infinite 1s; }
.ins-spin { animation: ins-spin 40s linear infinite; }
.ins-twinkle { animation: ins-twinkle 3.5s ease-in-out infinite; }
.ins-twinkle2 { animation: ins-twinkle 4.5s ease-in-out infinite 1.2s; }
.ins-grow { animation: ins-grow 1.4s cubic-bezier(.22,1,.36,1) .6s both; }

/* Le contenu est visible par défaut ; seul ce qui est hors écran est armé. */
.ins-reveal { transition: opacity .7s cubic-bezier(.22,1,.36,1), transform .7s cubic-bezier(.22,1,.36,1); }
.ins-reveal.ins-armed { opacity: 0; transform: translateY(18px); }
.ins-reveal.ins-in { opacity: 1; transform: none; }
.ins-d1 { transition-delay: .1s; }
.ins-d2 { transition-delay: .2s; }
.ins-d3 { transition-delay: .3s; }

.carte, .promesse { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.carte:hover, .promesse:hover { transform: translateY(-4px); box-shadow: 0 14px 32px rgba(27, 43, 34, .09); }

@media (prefers-reduced-motion: reduce) {
  .ins-reveal, .ins-reveal.ins-armed { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* --- Illustration du héros ------------------------------------------------ */

.art {
  position: relative;
  height: 460px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(140deg, #E6F1EA 0%, #CFE8DA 48%, #F4F6F3 100%);
}

@media (max-width: 560px) { .art { height: 380px; } }

.art__tache { position: absolute; filter: blur(28px); }
.art__tache--une {
  top: -80px; inset-inline-end: -64px; width: 320px; height: 320px;
  border-radius: 48% 52% 45% 55% / 55% 45% 55% 45%;
  background: color-mix(in srgb, var(--vert) 15%, transparent);
}
.art__tache--deux {
  bottom: -70px; inset-inline-start: -40px; width: 260px; height: 260px;
  border-radius: 52% 48% 55% 45% / 45% 55% 45% 55%;
  background: color-mix(in srgb, var(--pousse) 18%, transparent);
}
.art__orbite {
  position: absolute; top: 52px; inset-inline-start: 44px;
  width: 140px; height: 140px; border-radius: 999px;
  border: 1.5px dashed color-mix(in srgb, var(--vert) 40%, transparent);
}
.art__etincelle { position: absolute; display: block; }
.art__etincelle--grande { top: 34px; inset-inline-end: 42px; color: var(--vert); }
.art__etincelle--petite { bottom: 56px; inset-inline-end: 110px; color: var(--pousse); }

.art__carte {
  position: absolute;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(27, 43, 34, .12);
}
.art__carte--cours {
  inset-inline-start: 44px; top: 132px;
  width: 296px; max-width: calc(100% - 5.5rem);
  padding: 18px 20px;
}
.art__carte--progres {
  inset-inline-end: 38px; bottom: 88px;
  width: 232px; max-width: calc(100% - 5rem);
  padding: 16px 18px;
}
.art__entete { display: flex; align-items: center; gap: 12px; }
.art__pastille {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--menthe); flex-shrink: 0;
}
.art__pastille--vert { color: var(--vert); }
.art__pastille--pousse { color: var(--pousse); width: 36px; height: 36px; border-radius: 11px; }
.art__titre { margin: 0; font-size: 16px; font-weight: 700; color: var(--encre); }
.art__titre--petit { font-size: 15px; }
.art__soustitre { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--encre-pale); }
.art__progression { margin-top: 14px; }
.art__ligne { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: var(--encre-douce); }
.art__part { color: var(--vert); }
.art__jauge { margin-top: 6px; height: 8px; border-radius: 999px; background: var(--menthe); overflow: hidden; }
.art__jauge-pleine { height: 100%; width: 64%; border-radius: 999px; background: var(--vert); }
.art__barres { margin-top: 12px; display: flex; align-items: flex-end; gap: 6px; height: 44px; }
.art__barre { flex: 1; border-radius: 4px 4px 2px 2px; background: var(--menthe); }
.art__barre--forte { background: var(--pousse); }

/* --- Icônes en place ------------------------------------------------------ */

.carte__icone svg, .confiance__pastille svg, .puce svg, .bouton svg { display: block; }
.puce svg { color: var(--vert); }
.bouton svg { margin-inline-start: 2px; }
[dir="rtl"] .bouton svg, [dir="rtl"] .ins-fleche { transform: scaleX(-1); }

.promesse__coche {
  display: grid; place-items: center;
  width: 22px; height: 22px; flex-shrink: 0;
  color: var(--pousse);
}
