/* ============================================================
   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);
}
/* Pastilles cliquables (page ressources) : le lien remplit toute la pastille */
.hero__examens a {
  display: block;
  margin: -0.4rem -0.9rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.hero__examens a:hover,
.hero__examens a:focus-visible { background: var(--vert); color: #fff; }

.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;
  color: var(--vert);
}
.card__text {
  margin: 0;
  color: var(--gris-texte);
}

/* Une couleur par offre, alignée sur la grille tarifaire */
.card--bleu { border-top-color: var(--bleu); }
.card--bleu .card__title { color: var(--bleu); }
.card--vert { border-top-color: var(--vert); }
.card--vert .card__title { color: var(--vert); }
.card--ocre { border-top-color: var(--ocre); }
.card--ocre .card__title { color: var(--ocre); }
.card--or { border-top-color: var(--or); }
.card--or .card__title { color: var(--or); }

/* ============================================================
   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; }
.approche__origine a { color: var(--vert); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.approche__origine a:hover { color: #12a087; }

/* ============================================================
   ÉVÉNEMENTS
   ============================================================ */
.events__visuel-wrap { margin: 0 auto 2.5rem; text-align: center; }
.events__sub {
  font-size: clamp(1.15rem, 2.6vw, 1.4rem);
  font-weight: 700;
  color: var(--ocre);
  text-align: center;
  margin: 2.6rem 0 1.4rem;
}
.events__sub:first-of-type { margin-top: 0; }
.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__name { font-weight: 500; font-style: italic; font-size: 0.92rem; color: var(--gris-texte); }
.event__when { font-weight: 600; color: var(--orange); margin: 0 0 0.4rem; font-size: 0.92rem; }
.event__where { margin: 0 0 0.5rem; font-size: 0.88rem; color: var(--gris-texte); }
.event__where a { color: var(--vert); font-weight: 600; }
.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; }

.planning-figure {
  margin: 0;
  background: var(--blanc);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.planning-frame {
  display: block;
  width: 100%;
  height: 640px; /* valeur par défaut, ajustée par script.js */
  border: 0;
}

/* ---- Grille horaire hebdomadaire (fragment planning.html) ---- */
.planning-grid__scroll { box-shadow: none; border-radius: 0; }
.planning-grid {
  display: grid;
  grid-template-columns: 84px repeat(6, minmax(92px, 1fr));
  grid-template-rows: 36px repeat(26, 19px);
  min-width: 680px;
  background: var(--blanc);
}
.planning-grid__head-cell {
  background: var(--bleu);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.planning-grid__time-cell {
  font-size: 0.68rem;
  color: var(--gris-texte);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  border-top: 1px solid #e2e8ec;
}
.planning-grid__band {
  border-top: 1px solid #eef2f4;
  border-left: 1px solid #eef2f4;
}
.planning-grid__band:nth-child(6n) { border-right: 1px solid #eef2f4; }
.planning-grid__activity {
  margin: 1px;
  border-radius: 5px;
  background: var(--accent, var(--vert));
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2px 3px;
  overflow: hidden;
  z-index: 1;
}
.planning-grid__activity-title { font-weight: 700; font-size: 0.72rem; line-height: 1.1; }
.planning-grid__activity-sub { font-size: 0.6rem; opacity: 0.92; line-height: 1.05; margin-top: 1px; }
.planning-grid__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--gris-texte);
}
.planning-grid__legend-item { display: flex; align-items: center; gap: 0.45rem; }
.planning-grid__legend-dot { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 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); }

.inscription__downloads {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: left;
  max-width: 640px;
  margin: 1.6rem auto 0;
}
.inscription__downloads a {
  color: var(--bleu);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
}
.inscription__downloads a::before { content: "▸"; color: var(--orange); margin-right: 0.5rem; }
.inscription__downloads a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Sous-groupe « conditions particulières » */
.inscription__group-label {
  display: inline-block;
  color: var(--bleu);
  font-weight: 600;
  font-size: 0.95rem;
}
.inscription__group-label::before { content: "▸"; color: var(--orange); margin-right: 0.5rem; }
.inscription__sublist {
  list-style: none;
  margin: 0.5rem 0 0 1.6rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.inscription__sublist a::before { content: "–"; color: var(--orange); margin-right: 0.5rem; }
.inscription__sublist a { font-size: 0.92rem; }

@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; }
}

/* ============================================================
   PAGE RESSOURCES (ultreia.html)
   ============================================================ */

/* Rythme des fonds de section */
#exercer.res-section,
#suseia.res-section { background: var(--bleu-clair); }

/* Sous-titres de section (ocre, comme le reste du site) */
.res-sub {
  font-size: clamp(1.15rem, 2.6vw, 1.45rem);
  font-weight: 700;
  color: var(--ocre);
  margin: 2.6rem 0 1.3rem;
}
.res-sub:first-of-type { margin-top: 0; }
.res-subsub {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--bleu);
  margin: 2rem 0 1rem;
}

/* Paragraphes d'introduction / de corps */
.res-lead {
  color: var(--gris-texte);
  font-size: 1.05rem;
  margin: 0 0 1.5rem;
}
.res-lead--center { text-align: center; max-width: 760px; margin-inline: auto; }
.res-para {
  color: var(--gris-texte);
  max-width: 820px;
  margin: 0 auto 1.6rem;
  line-height: 1.7;
}
.res-note {
  text-align: center;
  font-style: italic;
  color: var(--gris-texte);
  margin: 0 0 1.8rem;
}

/* Grille de ressources */
.res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.4rem;
  margin-bottom: 1.6rem;
}
.res-grid--3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
@media (min-width: 900px) {
  .res-grid--3 { grid-template-columns: repeat(3, 1fr); }
}

/* Carte ressource */
.res {
  display: flex;
  flex-direction: column;
  background: var(--blanc);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-top: 4px solid var(--vert);
  transition: transform var(--transition), box-shadow var(--transition);
}
.res:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.res__media {
  background: var(--bleu-clair);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem;
}
.res__media img {
  width: 100%;
  height: 150px;
  object-fit: contain;
}
/* Photos rondes sur fond blanc : le carré blanc se fond dans la zone média */
.res__media img.photo-blend { mix-blend-mode: multiply; }
.res__body { padding: 1.2rem 1.3rem; display: flex; flex-direction: column; gap: 0.5rem; }
.res__title { font-size: 1.05rem; font-weight: 700; color: var(--bleu); margin: 0; line-height: 1.3; }
.res__title a { color: var(--vert); }
.res__title a:hover { text-decoration: underline; }
.yt-icon,
.ch-flag { width: 1em; height: 1em; vertical-align: -0.15em; margin-left: 0.3em; flex-shrink: 0; }
.uk-flag { height: 1em; width: auto; vertical-align: -0.15em; margin-left: 0.35em; flex-shrink: 0; }
.inline-logo { height: 1em; width: auto; margin-left: auto; flex-shrink: 0; }
/* Titre contenant un logo (Cambridge, EPFL) : logo poussé à droite, à hauteur du texte */
.res__title:has(.inline-logo) { display: flex; align-items: center; gap: 0.4rem; }
.res__text { margin: 0; color: var(--gris-texte); font-size: 0.95rem; }
.res__text a { color: var(--vert); font-weight: 600; }
.res__dl { margin: 0.2rem 0 0; font-size: 0.85rem; }
.res__dl a {
  color: var(--bleu);
  font-weight: 500;
  text-decoration: none;
}
.res__dl a::before { content: "▸"; color: var(--orange); margin-right: 0.4rem; }
.res__dl a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Variantes */
.res--quote { border-top-color: var(--or); }
.res__quote {
  margin: 0;
  font-style: italic;
  color: var(--gris-texte);
  border-left: 3px solid var(--or);
  padding-left: 0.9rem;
  font-size: 0.95rem;
  line-height: 1.6;
}
.res__quote cite { display: block; margin-top: 0.5rem; font-style: normal; font-weight: 600; color: var(--bleu); font-size: 0.82rem; }
.res--debate { border-top-color: var(--orange); text-align: center; }
.res--debate .res__title { color: var(--orange); }

/* Encadré d'appel à l'action */
.res-cta {
  background: var(--bleu-clair);
  border-left: 4px solid var(--vert);
  border-radius: 12px;
  padding: 1.3rem 1.5rem;
  margin: 2rem auto 0;
  max-width: 860px;
  color: var(--gris-texte);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.4rem;
}
.res-cta .btn { flex-shrink: 0; }
.res-cta a:not(.btn) { color: var(--vert); font-weight: 600; }

/* Bandeau de transition ULTREIA */
.ultreia-divider {
  background: var(--bleu);
  color: #fff;
  text-align: center;
  padding: 3rem 0;
}
.ultreia-divider__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem 4rem;
}
.ultreia-divider__pair { min-width: 220px; }
.ultreia-divider__word {
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
}
.ultreia-divider__sub {
  font-style: italic;
  color: var(--or);
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  margin: 0.6rem 0 0;
}

/* Galerie de livres (Suseia — Inspirations) */
.books {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.6rem 1.2rem;
  margin-bottom: 1rem;
}
.book { margin: 0; text-align: center; }
.book img {
  width: 100%;
  height: 210px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--blanc);
  box-shadow: var(--shadow);
  padding: 6px;
}
.book figcaption {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: var(--gris-texte);
  line-height: 1.35;
}

/* Vers (Cyrano) */
.res-verse {
  text-align: center;
  font-style: italic;
  color: var(--bleu);
  font-size: 1.1rem;
  line-height: 1.8;
  margin: 0 auto 1.5rem;
}
.res-verse__cue { color: var(--ocre); font-weight: 600; }

/* Figure (poème) — se fond dans le fond, sans halo */
.res-figure { margin: 0 auto 1rem; max-width: 640px; text-align: center; }
.res-figure__img {
  width: 100%;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  mix-blend-mode: multiply; /* fait disparaître le fond blanc de l'image sur le fond de section */
}

/* Publication scientifique */
.paper {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  background: var(--blanc);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  max-width: 860px;
  margin: 0 auto;
}
.paper__thumb { flex-shrink: 0; display: block; }
.paper__thumb img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(35, 75, 97, 0.12);
}
.paper__title { font-size: 1.1rem; color: var(--bleu); margin: 0 0 0.6rem; line-height: 1.35; }
.paper__meta { margin: 0 0 0.3rem; font-size: 0.9rem; color: var(--gris-texte); }
.paper__links { margin: 0.9rem 0 0; display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.9rem; }
.paper__links a { color: var(--vert); font-weight: 600; word-break: break-word; }
.paper__dl { color: var(--bleu) !important; }

@media (min-width: 760px) {
  .paper { flex-direction: row; align-items: flex-start; }
  .paper__thumb { width: 240px; }
}

/* Zone cliquable « ULTREIA » sur l'illustration de la page 1 */
.hero__illustration { position: relative; }
.hero__ultreia-link {
  position: absolute;
  /* Recouvre la bulle « ULTREIA. » (texte vert) */
  top: 25.5%;
  left: 10.5%;
  width: 22%;
  height: 12%;
  border-radius: 50%;
  z-index: 2;
}
/* Zone volontairement invisible : aucun contour ni fond au survol */


/* ============================================================
   ACCÈS PROTÉGÉ — verrou par code (page Ressources)
   ============================================================ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(120% 90% at 50% -10%, var(--bleu-clair) 0%, var(--blanc) 60%);
}
.rm2-unlocked .gate { display: none; }
html.rm2-locked, html.rm2-locked body { overflow: hidden; }
.gate__box {
  width: 100%;
  max-width: 360px;
  background: var(--blanc);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.gate__logo { width: 64px; height: 64px; object-fit: contain; margin: 0 auto; }
.gate__title { color: var(--bleu); font-size: 1.4rem; margin: 0; }
.gate__hint { color: var(--gris-texte); margin: 0; font-size: 0.95rem; }
.gate__input {
  padding: 0.75rem 1rem;
  border: 1px solid rgba(35, 75, 97, 0.20);
  border-radius: 10px;
  font-size: 1.1rem;
  text-align: center;
  letter-spacing: 0.15em;
}
.gate__input:focus { outline: 2px solid var(--vert); border-color: var(--vert); }
.gate__btn { border: 0; cursor: pointer; }
.gate__error { color: #c0392b; margin: 0; font-size: 0.9rem; }
