/* ============================================================
   Centre d'Études Reggio Massalia — Mathématiques
   Feuille de style principale — mobile-first
   ============================================================ */

/* ---------- Variables ---------- */
:root {
  --bleu:   #234B61;   /* bleu foncé — texte principal / titres */
  --vert:   #16B599;   /* émeraude */
  --or:     #B59C44;
  --ocre:   #B5651D;
  --orange: #B56700;

  --bleu-clair: #eef3f5;
  --gris-texte: #3b5563;
  --blanc: #ffffff;

  --font: "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;

  --maxw: 1100px;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(35, 75, 97, 0.10);
  --shadow-hover: 0 12px 34px rgba(35, 75, 97, 0.18);
  --transition: 0.25s ease;
}

/* ---------- Reset léger ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* compense le header fixe */
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--bleu);
  line-height: 1.6;
  background: var(--blanc);
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

ul { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0; }

/* ---------- Utilitaires ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section { padding: 4rem 0; }

.c-orange { color: var(--orange); }
.c-vert   { color: var(--vert); }
.c-bleu   { color: var(--bleu); }

.section__title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  color: var(--bleu);
  margin-bottom: 2.5rem;
  position: relative;
}
.section__title::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--vert), var(--or));
  margin: 0.8rem auto 0;
}
.section__title--left { text-align: left; }
.section__title--left::after { margin-left: 0; }

.section__subtitle {
  text-align: center;
  font-style: italic;
  color: var(--gris-texte);
  margin: -1.8rem 0 2.5rem;
  font-size: 0.95rem;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-block;
  background: var(--vert);
  color: var(--blanc);
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 14px rgba(22, 181, 153, 0.30);
}
.btn:hover {
  background: #12a087;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(22, 181, 153, 0.38);
}
.btn--sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  box-shadow: none;
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(35, 75, 97, 0.08);
  transition: box-shadow var(--transition);
}
.nav--scrolled { box-shadow: 0 4px 18px rgba(35, 75, 97, 0.10); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}
.nav__brand { display: flex; align-items: center; gap: 0.6rem; }
.nav__logo { width: 38px; height: 38px; object-fit: contain; }
.nav__brand-text {
  font-weight: 700;
  color: var(--bleu);
  font-size: 0.98rem;
  line-height: 1.15;
  white-space: nowrap;
}
.nav__links { display: flex; align-items: center; gap: 1.2rem; }
.nav__links a { font-weight: 600; color: var(--bleu); transition: color var(--transition); }
.nav__links a:not(.btn):hover { color: var(--vert); }

/* masque les liens texte quand la place manque, garde le CTA */
@media (max-width: 900px) {
  .nav__links a:not(.btn) { display: none; }
}
@media (max-width: 620px) {
  .nav__brand-text { display: none; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: var(--blanc);
  padding: 3rem 0 4rem;
  text-align: center;
}
.hero__inner { display: flex; flex-direction: column; align-items: center; }

.hero__title { margin-bottom: 2rem; }
.hero__title-line {
  display: block;
  font-size: clamp(1.6rem, 5vw, 2.8rem);
  font-weight: 800;
  color: var(--bleu);
}
.hero__title-math {
  display: block;
  font-size: clamp(1.3rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-top: 0.3rem;
}

.hero__illustration {
  margin: 0 0 1rem;
  max-width: 860px;
  width: 100%;
}
.hero__illustration img {
  width: 100%;
  /* fond blanc identique à l'image : les bords se fondent sans contraste.
     Le léger dégradé sur les bords adoucit toute transition résiduelle. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 6%, #000 94%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 6%, #000 94%, transparent 100%);
}

.hero__accroche {
  font-size: clamp(1.3rem, 3.4vw, 1.7rem);
  font-weight: 700;
  color: var(--bleu);
  margin: 1.8rem 0 0.4rem;
}
.hero__soustitre {
  color: var(--gris-texte);
  font-size: 1.05rem;
  margin: 0 0 1.6rem;
}

.hero__examens {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  max-width: 720px;
}
.hero__examens li {
  background: var(--blanc);
  border: 1px solid rgba(35, 75, 97, 0.14);
  color: var(--bleu);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.hero__cta { margin-top: 2.2rem; }

/* ============================================================
   OFFRES
   ============================================================ */
.direction { background: var(--bleu-clair); }

.offres__cta { text-align: center; margin-top: 2.4rem; }

.temoignages { background: var(--bleu-clair); text-align: center; }
.temoignages .section__subtitle {
  color: var(--ocre);
  font-style: normal;
  font-weight: 700;
  font-size: clamp(1.15rem, 2.6vw, 1.4rem);
}
.temoignages__sub {
  font-size: clamp(1.15rem, 2.6vw, 1.4rem);
  font-weight: 700;
  color: var(--ocre);
  margin: 2.8rem 0 1.2rem;
}
.temoignages__figure { margin: 0 auto 1rem; max-width: 700px; }
.temoignages__img {
  width: 100%;
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.temoignages__doc { margin: 0 auto 1.8rem; max-width: 700px; }
.temoignages__docimg {
  width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid rgba(35, 75, 97, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.temoignages figcaption {
  margin-top: 0.3rem;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--gris-texte);
}

.offres__visuel-wrap { margin: 0 auto 2.5rem; text-align: center; }
.offres__visuel {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  border-radius: var(--radius);
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
}

.card {
  background: var(--blanc);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--vert);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.card__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.7rem;
}
.card__text {
  margin: 0;
  color: var(--gris-texte);
}

/* ============================================================
   DIRECTION
   ============================================================ */
.direction__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  text-align: center;
}

.direction__photo-wrap { flex-shrink: 0; }
.direction__photo {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid var(--vert);
  box-shadow: var(--shadow);
}

.direction__name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--bleu);
  margin: 0.5rem 0 1rem;
}
.direction__list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.direction__list li {
  color: var(--gris-texte);
  text-align: left;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--bleu);
  color: #dbe7ec;
  padding: 3rem 0 1.5rem;
  text-align: center;
}
.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.footer__logo {
  width: 70px;
  height: 70px;
  object-fit: contain;
  filter: brightness(0) invert(1); /* rend le logo blanc sur fond foncé */
  opacity: 0.95;
}
.footer__title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  color: #dbe7ec;
  margin-bottom: 1rem;
}
.footer__title-accent {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--blanc);
}
.footer__list { display: flex; flex-direction: column; gap: 0.5rem; }
.footer__list a { transition: color var(--transition); }
.footer__list a:hover { color: var(--vert); }

.footer__copy {
  margin: 2.5rem 0 0;
  font-size: 0.85rem;
  color: rgba(219, 231, 236, 0.6);
}

/* ============================================================
   BREAKPOINTS — tablette / desktop
   ============================================================ */
@media (min-width: 720px) {
  .cards { grid-template-columns: repeat(2, 1fr); }

  .direction__inner {
    flex-direction: row;
    align-items: center;
    text-align: left;
  }
  .direction__photo { width: 240px; height: 240px; }
}

@media (min-width: 1000px) {
  /* 4 offres alignées sur une rangée en grand écran */
  .offres .cards { grid-template-columns: repeat(4, 1fr); }
  .pillars { grid-template-columns: repeat(3, 1fr); }
  .events__grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Animation d'apparition (JS) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   MISSION & APPROCHE
   ============================================================ */
.approche__lead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  max-width: 820px;
  margin: 0 auto 2.5rem;
  text-align: center;
}
.approche__visuel {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius);
}
.approche__intro {
  font-size: 1.1rem;
  color: var(--gris-texte);
  margin: 0;
}

.pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
}
.pillar {
  background: var(--blanc);
  border: 1px solid rgba(35, 75, 97, 0.10);
  border-radius: var(--radius);
  padding: 2rem 1.6rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.pillar:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.pillar__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bleu-clair);
  color: var(--vert);
  font-size: 1.3rem;
  margin-bottom: 1rem;
}
.pillar__title { font-size: 1.25rem; margin-bottom: 0.6rem; }
.pillar__text { margin: 0; color: var(--gris-texte); }

.approche__origine {
  max-width: 760px;
  margin: 2.6rem auto 0;
  padding: 1.4rem 1.6rem;
  background: var(--bleu-clair);
  border-left: 4px solid var(--or);
  border-radius: 12px;
  color: var(--gris-texte);
  font-size: 0.98rem;
}
.approche__origine strong { color: var(--bleu); display: block; margin-bottom: 0.3rem; }

/* ============================================================
   ÉVÉNEMENTS
   ============================================================ */
.events__visuel-wrap { margin: 0 auto 2.5rem; text-align: center; }
.events__visuel {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  border-radius: var(--radius);
}
.events__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
}
.event {
  display: flex;
  gap: 1.2rem;
  background: var(--blanc);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.event:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.event__badge {
  flex-shrink: 0;
  width: 84px;
  border-radius: 14px;
  color: var(--blanc);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.3rem;
  text-align: center;
  line-height: 1.1;
}
.event__badge--vert   { background: var(--vert); }
.event__badge--orange { background: var(--orange); }
.event__badge--or     { background: var(--or); }
.event__badge--bleu   { background: var(--bleu); }
.event__day { font-size: 1.4rem; font-weight: 800; }
.event__month { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.event__body { min-width: 0; }
.event__title {
  font-size: 1.2rem;
  color: var(--bleu);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.event__tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--vert);
  color: var(--blanc);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.event__when { font-weight: 600; color: var(--orange); margin: 0 0 0.4rem; font-size: 0.92rem; }
.event__text { margin: 0; color: var(--gris-texte); }

/* ============================================================
   TARIFS / HORAIRES / INSCRIPTIONS
   ============================================================ */
.tarifs { background: var(--bleu-clair); }
.tarifs__subtitle {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 700;
  margin: 2.5rem 0 1.2rem;
}
.tarifs__subtitle:first-of-type { margin-top: 0; }
.tarifs__note { font-size: 0.85rem; color: var(--gris-texte); font-style: italic; margin: 0.8rem 0 0; }

/* --- utilitaires --- */
.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;
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); box-shadow: var(--shadow); }

/* --- Grille tarifaire --- */
.price-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--blanc);
  min-width: 720px;
  font-size: 0.92rem;
}
.price-table thead th {
  background: var(--bleu);
  color: var(--blanc);
  text-align: left;
  padding: 0.8rem 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}
.price-table th[scope="row"] { text-align: left; font-weight: 700; color: var(--bleu); }
.price-table td,
.price-table th[scope="row"] {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(35, 75, 97, 0.10);
  vertical-align: middle;
}
.price-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-table .row-note { font-weight: 500; color: var(--gris-texte); font-style: italic; }

/* Fonds de ligne = teintes claires des 4 couleurs d'événements (vert / or / ocre / bleu) */
.row-bleu th[scope="row"], .row-bleu td { background: #E7EFF3; }  /* bleu   */
.row-vert th[scope="row"], .row-vert td { background: #E2F6F1; }  /* vert   */
.row-ocre th[scope="row"], .row-ocre td { background: #F6E7D1; }  /* ocre   */
.row-or   th[scope="row"], .row-or   td { background: #F4EEDA; }  /* or     */

/* Colonne #Étudiants : chiffres centrés et alignés */
.price-table .students { text-align: center; white-space: nowrap; }
.price-table thead th.students { text-align: center; }

/* Colonne Horaires : toujours sur deux lignes, pas de retour sauvage */
.price-table .hours { white-space: nowrap; line-height: 1.3; }

/* --- Fallback captures --- */
.fallback { margin-top: 1.4rem; font-size: 0.9rem; color: var(--gris-texte); }
.fallback summary { cursor: pointer; font-weight: 600; color: var(--bleu); }
.fallback__note { margin: 0.6rem 0 0; }
.fallback code { background: var(--bleu-clair); padding: 0.1rem 0.35rem; border-radius: 5px; font-size: 0.85em; }

/* --- Téléchargement conditions générales --- */
.tarifs__download { margin: 0.6rem 0 0; font-size: 0.85rem; }
.tarifs__download a {
  color: var(--bleu);
  font-weight: 500;
  text-decoration: none;
}
.tarifs__download a::before {
  content: "▸";
  color: var(--orange);
  margin-right: 0.4rem;
}
.tarifs__download a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* --- Inscriptions --- */
.inscription {
  background: var(--blanc);
  border-radius: var(--radius);
  padding: 1.8rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.inscription__banners {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.6rem;
  text-align: left;
}
.inscription__banner {
  display: flex;
  gap: 0.9rem;
  background: var(--bleu-clair);
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
}
.inscription__banner-icon { font-size: 1.4rem; line-height: 1.4; flex-shrink: 0; }
.inscription__banner p { margin: 0; color: var(--gris-texte); }
.inscription__banner strong { color: var(--bleu); }
.inscription__banner a { color: var(--vert); font-weight: 600; }
.inscription__btn { background: var(--orange); box-shadow: 0 4px 14px rgba(181, 103, 0, 0.30); }
.inscription__btn:hover { background: #9c5900; box-shadow: 0 8px 20px rgba(181, 103, 0, 0.38); }

@media (min-width: 720px) {
  .inscription__banners { grid-template-columns: 1fr 1fr; }
}

/* ---------- Accessibilité : mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
