/* ==========================================================================
   ISSTMADD — Feuille de style principale
   Institut Supérieur des Sciences, de Technologies, de Management
   et de Développement Durable
   ========================================================================== */

:root {
  /* Couleurs */
  --bleu-nuit: #0B2545;
  --bleu-institut: #1B4D8F;
  --bleu-clair: #2E6FBE;
  --rouge: #C81E3A;
  --rouge-fonce: #9E1730;
  --or: #B8860B;
  --orange: #E67E22;
  --orange-fonce: #C6660F;
  --creme: #F7F5F0;
  --blanc: #FFFFFF;
  --encre: #1A1A1A;
  --gris: #6B7178;
  --gris-clair: #D8D5CC;
  --ligne: rgba(11, 37, 69, 0.12);

  /* Typographie */
  --serif: "Source Serif 4", "Georgia", serif;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "Courier New", monospace;

  /* Échelle */
  --taille-h1: clamp(2.4rem, 5vw, 4.2rem);
  --taille-h2: clamp(1.9rem, 3.4vw, 2.8rem);
  --taille-h3: clamp(1.3rem, 2vw, 1.6rem);

  /* Mise en page */
  --largeur-max: 1180px;
  --marge: clamp(1.25rem, 4vw, 3rem);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--encre);
  background: var(--creme);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Safety net against any element that overflows the viewport width on
     narrow screens (a wide row in the header, a table, …): clips only the
     X axis, so position: sticky (which needs a normal Y scroll box) keeps
     working. */
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  color: var(--bleu-nuit);
}

h1 { font-size: var(--taille-h1); letter-spacing: -0.01em; }
h2 { font-size: var(--taille-h2); letter-spacing: -0.005em; }
h3 { font-size: var(--taille-h3); }

p { margin: 0 0 1rem; }

a {
  color: var(--bleu-institut);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

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

.conteneur {
  max-width: var(--largeur-max);
  margin: 0 auto;
  padding: 0 var(--marge);
}

/* Focus visible — accessibilité */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--rouge);
  outline-offset: 2px;
}

/* Effet de tilt 3D léger (js/main.js) : la transition assure un retour
   fluide à l'état plat quand le curseur quitte la carte. */
[data-tilt] {
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
  will-change: transform;
}

/* --------------------------------------------------------------------------
   Eyebrow / label de section
   -------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rouge);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}
.eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 1px;
  background: var(--rouge);
}

/* --------------------------------------------------------------------------
   Barre de contact diagonale (topbar) — bande fine juste au-dessus du
   menu principal. Placée hors de .en-tete (qui est sticky) : elle défile
   normalement avec la page, et seul le menu reste collé en haut une fois
   qu'on a scrollé au-delà. Masquée sous 900px — les coordonnées restent
   accessibles via le bouton "Contacter" du menu et la page Contact.
   -------------------------------------------------------------------------- */
.topbar {
  position: relative;
  display: flex;
  min-height: 40px;
  font-family: var(--sans);
  font-size: 0.82rem;
  overflow: hidden;
  isolation: isolate;
}
.topbar__band {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  padding: 0.55rem 1.6rem;
  color: rgba(247, 245, 240, 0.92);
  position: relative;
  white-space: nowrap;
}
.topbar__band--gauche {
  flex: 1 1 auto;
  background: linear-gradient(100deg, var(--bleu-nuit), var(--bleu-institut));
  padding-right: 3.2rem;
  /* Pointe diagonale vers la bande dorée de droite. */
  -webkit-clip-path: polygon(0 0, 100% 0, calc(100% - 34px) 100%, 0 100%);
  clip-path: polygon(0 0, 100% 0, calc(100% - 34px) 100%, 0 100%);
  margin-right: -34px;
  z-index: 2;
}
.topbar__band--droite {
  flex: 0 0 auto;
  background: linear-gradient(100deg, var(--or), #d9ab2e);
  padding-left: 3.2rem;
  justify-content: flex-end;
  z-index: 1;
}
.topbar__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none !important;
  line-height: 1.2;
}
.topbar__item:hover span { text-decoration: underline; text-underline-offset: 3px; }
.topbar__icone { width: 15px; height: 15px; flex: none; opacity: 0.95; }
/* Deux numéros sous une seule icône téléphone : chaque numéro est son
   propre lien tel:, séparé par une barre oblique discrète. */
.topbar__telephones a { color: inherit; text-decoration: none !important; }
.topbar__telephones a:hover { text-decoration: underline; text-underline-offset: 3px; }
.topbar__tel-sep { opacity: 0.5; }
.topbar__separateur {
  width: 1px;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.16);
  margin: 0.25rem 0;
}
.topbar__reseaux { display: flex; align-items: center; gap: 0.85rem; }
.topbar__reseaux a {
  display: flex;
  color: rgba(247, 245, 240, 0.92);
  opacity: 0.92;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.topbar__reseaux a:hover { opacity: 1; transform: translateY(-1px); }
.topbar__reseaux svg { width: 15px; height: 15px; fill: currentColor; }

@media (max-width: 900px) {
  .topbar { display: none; }
}

/* --------------------------------------------------------------------------
   En-tête / Navigation
   -------------------------------------------------------------------------- */
.en-tete {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--blanc);
  border-bottom: 1px solid var(--ligne);
}

.barre-nav {
  display: flex;
  align-items: center;
  height: 78px;
}

.logo-lien {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-lien:hover { text-decoration: none; }

.logo-image {
  height: 44px;
  width: auto;
  display: block;
}

.logo-marque {
  width: 42px;
  height: 42px;
  border-radius: 2px;
  background: var(--bleu-nuit);
  color: var(--creme);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.logo-marque::after {
  content: "";
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 14px;
  height: 14px;
  background: var(--rouge);
}

.logo-texte {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.logo-sigle {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.22rem;
  color: var(--bleu-nuit);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.logo-sous {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--gris);
  text-transform: uppercase;
  white-space: normal;
  max-width: 6.6rem;
  line-height: 1.25;
}

.nav-liens {
  display: flex;
  list-style: none;
  padding: 0;
  gap: 0.9rem;
  margin-left: 0.6rem;
}
.nav-liens > li { position: relative; flex-shrink: 0; }
.nav-liens a {
  color: var(--encre);
  font-size: 0.85rem;
  font-weight: 500;
  position: relative;
  padding: 0.4rem 0.1rem;
}
.nav-liens a:hover { text-decoration: none; color: var(--or); font-weight: 700; }
.nav-liens a.actif { color: var(--bleu-institut); }
.nav-liens a.actif::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--rouge);
}

/* Méga-menu plein-largeur (survol) — inspiré du menu de l'École polytechnique :
   panneau pleine largeur sous l'en-tête, fondu de bas en haut, liste de
   raccourcis éditoriale plutôt qu'une simple boîte déroulante. */
.nav-liens > li > a.a-sous-menu {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.nav-liens > li > a.a-sous-menu::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--rouge);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-liens > li:hover > a.a-sous-menu::before,
.nav-liens > li:focus-within > a.a-sous-menu::before {
  transform: scaleX(1);
}
.nav-liens > li > a.a-sous-menu::after {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-left: 0.4rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.45;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-liens > li:hover > a.a-sous-menu::after,
.nav-liens > li:focus-within > a.a-sous-menu::after {
  transform: rotate(225deg) translateY(1px);
  opacity: 1;
}

.nav-backdrop {
  position: fixed;
  /* --entete-bas est calculée en JS (js/main.js) à partir de la position
     réelle du bas de .en-tete : la valeur fixe de 79px ne suffit plus
     depuis l'ajout de la topbar au-dessus du menu (elle décale le bas du
     header quand on est tout en haut de la page, avant que .en-tete ne
     devienne "sticky" à top:0). */
  inset: var(--entete-bas, 79px) 0 0 0;
  background: rgba(11,37,69,0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
  z-index: 150;
}
nav:hover ~ .nav-backdrop,
nav:focus-within ~ .nav-backdrop {
  opacity: 1;
  visibility: visible;
}

.sous-menu {
  position: fixed;
  top: var(--entete-bas, 79px);
  left: 2.5cm;
  right: 2.5cm;
  background: var(--blanc);
  border-top: 1px solid var(--ligne);
  box-shadow: 0 28px 48px rgba(11,37,69,.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s;
  z-index: 200;
}
.nav-liens > li:hover .sous-menu,
.nav-liens > li:focus-within .sous-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.sous-menu-interieur {
  max-width: var(--largeur-max);
  margin: 0 auto;
  padding: 2.6rem var(--marge) 3rem;
}
.sous-menu-grille {
  display: flex;
  flex-direction: column;
  max-width: 460px;
}
.sous-menu-grille a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.9rem 0;
  font-size: 0.98rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--encre);
  border-bottom: 1px solid var(--ligne);
  transition: color 0.15s ease, padding-left 0.15s ease;
}
.sous-menu-grille a::after {
  content: "→";
  flex-shrink: 0;
  color: var(--rouge);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.sous-menu-grille a:hover {
  color: var(--bleu-institut);
  padding-left: 0.4rem;
  text-decoration: none;
}
.sous-menu-grille a:hover::after { opacity: 1; transform: translateX(0); }
.sous-menu-grille a.sous-menu-tout { color: var(--bleu-institut); font-weight: 700; }

@media (max-width: 900px) {
  .nav-backdrop { display: none; }
}

.nav-droite { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }
.nav-droite .bouton-rouge { padding-left: 1rem; padding-right: 1rem; }

.en-tete .conteneur { padding-left: 0.6rem; padding-right: 0.6rem; }

@media (max-width: 1200px) {
  .nav-liens > li > a.a-sous-menu { font-size: 0.72rem; }
}

.bascule-langue { display: flex; align-items: center; border: 1px solid var(--gris-clair); border-radius: 4px; overflow: hidden; font-family: var(--mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.03em; }
.bascule-langue a { display: block; padding: 0.35rem 0.55rem; color: var(--gris); text-decoration: none !important; }
.bascule-langue a:hover { background: var(--creme); }
.bascule-langue a.lang-actif { background: var(--bleu-institut); color: var(--blanc); }
.menu-mobile .bascule-langue { margin-top: 1.2rem; align-self: flex-start; }

.bouton {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.7rem 1.4rem;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  text-decoration: none !important;
}
.bouton-rouge {
  background: var(--rouge);
  color: var(--blanc);
}
.bouton-rouge:hover { background: var(--rouge-fonce); }
.bouton-contour {
  background: transparent;
  border-color: var(--bleu-nuit);
  color: var(--bleu-nuit);
}
.bouton-contour:hover { background: var(--bleu-nuit); color: var(--blanc); }
.bouton-contour-clair {
  background: transparent;
  border-color: rgba(255,255,255,0.4);
  color: var(--blanc);
}
.bouton-contour-clair:hover { background: rgba(255,255,255,0.12); }
.bouton-orange {
  background: var(--orange);
  color: var(--blanc);
}
.bouton-orange:hover { background: var(--orange-fonce); }

.bascule-menu {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
}
.bascule-menu span {
  width: 24px;
  height: 2px;
  background: var(--bleu-nuit);
  display: block;
}

/* Recherche globale */
.bouton-recherche {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--gris-clair);
  background: transparent;
  color: var(--bleu-nuit);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.bouton-recherche:hover {
  background: var(--bleu-nuit);
  color: var(--blanc);
  border-color: var(--bleu-nuit);
}

.recherche-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 37, 69, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 1.25rem 1.25rem;
  opacity: 0;
  animation: recherche-fondu 0.18s ease forwards;
}
.recherche-overlay[hidden] { display: none; }
@keyframes recherche-fondu { to { opacity: 1; } }

.recherche-panneau {
  background: var(--blanc);
  border-radius: 10px;
  width: 100%;
  max-width: 640px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  transform: translateY(-12px);
  animation: recherche-glisse 0.22s ease forwards;
}
@keyframes recherche-glisse { to { transform: translateY(0); } }

.recherche-champ {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--ligne);
}
.recherche-champ svg { color: var(--gris); flex-shrink: 0; }
.recherche-champ input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--encre);
  background: transparent;
}
.recherche-fermer {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--gris);
  font-size: 1.1rem;
  padding: 0.25rem;
  line-height: 1;
}
.recherche-fermer:hover { color: var(--rouge); }

.recherche-resultats { max-height: 55vh; overflow-y: auto; padding: 0.5rem; }
.recherche-message { padding: 1.75rem 1rem; text-align: center; color: var(--gris); font-size: 0.92rem; }
.recherche-resultat {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  text-decoration: none !important;
  color: var(--encre);
  transition: background 0.12s ease;
}
.recherche-resultat:hover { background: var(--creme); }
.recherche-resultat-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.recherche-resultat-titre { font-weight: 600; font-size: 0.95rem; }
.recherche-resultat-meta {
  font-size: 0.72rem;
  color: var(--gris);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}
.recherche-resultat-extrait {
  font-size: 0.83rem;
  color: var(--gris);
  line-height: 1.5;
}
.recherche-resultat mark {
  background: rgba(200, 30, 58, 0.16);
  color: var(--rouge-fonce);
  border-radius: 2px;
  padding: 0 0.1em;
}

@media (max-width: 640px) {
  .recherche-overlay { padding: 5vh 0.75rem 0.75rem; }
}

/* --------------------------------------------------------------------------
   Pied de page
   -------------------------------------------------------------------------- */
.pied {
  background: var(--bleu-nuit);
  color: rgba(247,245,240,0.78);
  margin-top: 6rem;
}
.pied-haut {
  padding: 4.5rem 0 3rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 3rem;
  border-bottom: 1px solid rgba(247,245,240,0.12);
}
.pied h4 {
  color: var(--creme);
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  font-weight: 600;
}
.pied ul { list-style: none; margin: 0; padding: 0; }
.pied li { margin-bottom: 0.65rem; font-size: 0.92rem; }
.pied a { color: rgba(247,245,240,0.78); }
.pied a:hover { color: var(--blanc); }
.pied-marque .logo-sigle { color: var(--creme); }
.pied-marque .logo-sous { color: rgba(247,245,240,0.55); }
.pied-marque p { font-size: 0.9rem; max-width: 320px; margin-top: 1rem; color: rgba(247,245,240,0.7); }
.reseaux-sociaux { display: flex; gap: 0.6rem; margin-top: 1.2rem; }
.reseau-lien {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(247,245,240,0.1); color: rgba(247,245,240,0.85); transition: background 0.15s ease, color 0.15s ease;
}
.reseau-lien:hover { background: var(--rouge); color: var(--blanc); text-decoration: none; }
.reseau-lien svg { width: 16px; height: 16px; fill: currentColor; }
.pied-bas {
  padding: 1.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: rgba(247,245,240,0.55);
}
.pied-bas a { color: rgba(247,245,240,0.55); }

/* --------------------------------------------------------------------------
   Composants partagés
   -------------------------------------------------------------------------- */
.section { padding: 5.5rem 0; }
.section-creme { background: var(--creme); }
.section-blanche { background: var(--blanc); }
.section-marine { background: var(--bleu-nuit); color: rgba(247,245,240,0.85); }
.section-marine h2, .section-marine h3 { color: var(--creme); }

.fil-ariane {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--gris);
  padding: 1.5rem 0;
}
.fil-ariane a { color: var(--gris); }
.fil-ariane .courant { color: var(--rouge); }

.entete-page {
  /* Dégradé bleu marine → transparence commun à tous les héros de page
     intérieure (voir .hero-admissions / .hero-programmes / etc. dans
     pages.css) : une seule source de vérité pour que toutes les pages
     gardent la même logique de couleur/opacité. */
  --hero-degrade: linear-gradient(100deg, rgba(11,37,69,0.95) 0%, rgba(11,37,69,0.88) 32%, rgba(11,37,69,0.58) 62%, rgba(11,37,69,0.36) 100%);
  --hero-degrade-mobile: linear-gradient(180deg, rgba(11,37,69,0.92) 0%, rgba(11,37,69,0.88) 55%, rgba(11,37,69,0.72) 100%);
  background: var(--bleu-nuit);
  color: var(--creme);
  padding: 4rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}
.entete-page::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 340px; height: 100%;
  background: linear-gradient(135deg, transparent 40%, rgba(200,30,58,0.18) 40%, rgba(200,30,58,0.18) 41%, transparent 41%);
}
.entete-page h1 { color: var(--blanc); }
.entete-page .eyebrow { color: #ff8a9b; }
.entete-page .eyebrow::before { background: #ff8a9b; }
.entete-page p.intro {
  max-width: 640px;
  font-size: 1.08rem;
  color: rgba(247,245,240,0.82);
  margin-top: 1rem;
}

.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.grille-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }

.carte {
  background: var(--blanc);
  border: 1px solid var(--ligne);
  padding: 2rem;
}

.bouton-large {
  padding: 0.9rem 1.9rem;
  font-size: 0.95rem;
}

hr.separateur {
  border: none;
  border-top: 1px solid var(--ligne);
  margin: 3rem 0;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .nav-liens { display: none; }
  .bascule-menu { display: flex; }
  .pied-haut { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
  .grille-2 { grid-template-columns: 1fr; }
  .grille-3 { grid-template-columns: 1fr; }

  /* Header bar is tight on phones: Recherche + Candidater + Menu all have
     to fit next to the logo. Drop the wordmark (keep just the mark) and the
     FR/EN switcher — it already has a second copy inside .menu-mobile
     (see .menu-mobile .bascule-langue above) — and trim the remaining
     controls a little so nothing gets clipped down to ~320px-wide phones. */
  .logo-texte { display: none; }
  .logo-image { height: 36px; }
  .nav-droite { gap: 0.4rem; }
  .nav-droite .bascule-langue { display: none; }
  .nav-droite .bouton-rouge {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    font-size: 0.82rem;
  }
  .bouton-recherche { width: 32px; height: 32px; }
}

@media (max-width: 560px) {
  .pied-haut { grid-template-columns: 1fr; }
  .pied-bas { flex-direction: column; gap: 0.6rem; align-items: flex-start; }
  .nav-droite .bouton-contour { display: none; }
}

/* Menu mobile */
.menu-mobile {
  display: none;
  position: fixed;
  inset: 78px 0 0 0;
  background: var(--blanc);
  z-index: 99;
  padding: 1rem var(--marge) 2rem;
  overflow-y: auto;
}
.menu-mobile.ouvert { display: block; }
.menu-mobile ul { list-style: none; padding: 0; margin: 0; }
.menu-mobile li { border-bottom: 1px solid var(--ligne); }
.menu-mobile a {
  display: block;
  padding: 1.1rem 0.2rem;
  color: var(--bleu-nuit);
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
}
.menu-mobile a:hover { text-decoration: none; color: var(--rouge); }
.menu-mobile .bouton { margin-top: 1.5rem; width: 100%; justify-content: center; }

.menu-mobile-ligne { display: flex; align-items: center; justify-content: space-between; }
.menu-mobile-ligne a { flex-grow: 1; }
.mobile-sous-toggle {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border: 1px solid var(--ligne);
  border-radius: 50%;
  background: none;
  color: var(--bleu-institut);
  font-size: 0.85rem;
  transition: transform 0.2s ease, background 0.15s ease;
}
.mobile-sous-toggle[aria-expanded="true"] { transform: rotate(180deg); background: var(--creme); }
.sous-liste-mobile {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.sous-liste-mobile.ouvert { max-height: 600px; }
.sous-liste-mobile a {
  display: block;
  padding: 0.8rem 0.2rem 0.8rem 1rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gris);
  border-top: 1px solid var(--ligne);
}
.sous-liste-mobile a:hover { color: var(--bleu-institut); }
.sous-liste-mobile a.sous-menu-tout { color: var(--bleu-institut); font-weight: 600; }

/* --------------------------------------------------------------------------
   Révélation au défilement — éléments réutilisables sur tout le site
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal].reveal-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* Cartes de valeur (À propos) — interaction au survol */
.valeur-carte {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.valeur-carte:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(11,37,69,.12);
  border-color: var(--bleu-institut);
}

/* Chiffres clés — mise en avant au survol : la statistique grossit et change de couleur */
.chiffre-cle { transition: transform 0.2s ease; }
.chiffre-cle:hover { transform: scale(1.05); }
.chiffre-cle .valeur {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
}
.chiffre-cle:hover .valeur {
  transform: scale(1.18);
  color: var(--rouge);
}

/* Cartes génériques (.carte) — utilisées pour les sites/campus */
.carte { transition: transform 0.25s ease, box-shadow 0.25s ease; }
.carte:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(11,37,69,.1); }

/* --------------------------------------------------------------------------
   Assistant virtuel (chatbot) — bouton flottant bas-droite + fenêtre de
   conversation. Injecté sur toutes les pages via js/main.js. Réponses
   statiques/FAQ pour l'instant ; le back-end (RAG + LLM) viendra plus tard
   sans changer cette interface.
   -------------------------------------------------------------------------- */
.chatbot-bouton {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--rouge);
  color: var(--blanc);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(200, 30, 58, 0.4);
  z-index: 400;
  transition: transform 0.2s ease, background 0.2s ease;
}
.chatbot-bouton:hover { background: var(--rouge-fonce); transform: scale(1.06); }
.chatbot-bouton svg { width: 26px; height: 26px; }
.chatbot-bouton .chatbot-icone-fermer { display: none; }
.chatbot-bouton[aria-expanded="true"] .chatbot-icone-ouvrir { display: none; }
.chatbot-bouton[aria-expanded="true"] .chatbot-icone-fermer { display: block; }
.chatbot-pastille {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #2ecc71;
  border: 2px solid var(--blanc);
}

.chatbot-panneau {
  position: fixed;
  right: 1.5rem;
  bottom: calc(1.5rem + 74px);
  width: 360px;
  max-width: calc(100vw - 2.5rem);
  height: 500px;
  max-height: calc(100vh - 8rem);
  background: var(--blanc);
  border-radius: 14px;
  box-shadow: 0 26px 60px rgba(11, 37, 69, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 400;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}
.chatbot-panneau.ouvert {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.chatbot-panneau[hidden] { display: flex; } /* surchargé par JS, transition gérée via .ouvert */

.chatbot-entete {
  background: var(--bleu-nuit);
  color: var(--blanc);
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chatbot-entete-texte { display: flex; flex-direction: column; gap: 0.15rem; }
.chatbot-entete-texte strong { font-size: 0.95rem; }
.chatbot-entete-texte span {
  font-size: 0.72rem;
  color: rgba(247, 245, 240, 0.75);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.chatbot-entete-texte span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ecc71;
  display: inline-block;
}
.chatbot-fermer {
  background: none;
  border: none;
  color: rgba(247, 245, 240, 0.8);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.3rem;
  line-height: 1;
}
.chatbot-fermer:hover { color: var(--blanc); }

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: var(--creme);
}
.chatbot-msg {
  max-width: 82%;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.5;
}
.chatbot-msg a { color: inherit; text-decoration: underline; }
.chatbot-msg-bot {
  align-self: flex-start;
  background: var(--blanc);
  color: var(--encre);
  border-bottom-left-radius: 3px;
  box-shadow: 0 2px 8px rgba(11, 37, 69, 0.08);
}
.chatbot-msg-utilisateur {
  align-self: flex-end;
  background: var(--bleu-nuit);
  color: var(--blanc);
  border-bottom-right-radius: 3px;
}

.chatbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1rem 0.85rem;
  flex-shrink: 0;
  background: var(--creme);
}
.chatbot-suggestion {
  background: var(--blanc);
  border: 1px solid var(--ligne);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--bleu-institut);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.chatbot-suggestion:hover { background: var(--bleu-institut); color: var(--blanc); }

.chatbot-saisie {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--ligne);
  flex-shrink: 0;
  background: var(--blanc);
}
.chatbot-saisie input {
  flex: 1;
  border: 1px solid var(--gris-clair);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-family: var(--sans);
  font-size: 0.86rem;
  outline: none;
}
.chatbot-saisie input:focus { border-color: var(--bleu-institut); }
.chatbot-saisie button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--rouge);
  color: var(--blanc);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.chatbot-saisie button:hover { background: var(--rouge-fonce); }
.chatbot-saisie button svg { width: 16px; height: 16px; }

@media (max-width: 480px) {
  .chatbot-panneau {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    bottom: calc(1.25rem + 68px);
    height: calc(100vh - 7.5rem);
  }
  .chatbot-bouton { right: 1.1rem; bottom: 1.1rem; }
}
