@import url("pied-de-page.css");

/* =====================================================================
   PAGES-COURS.CSS — pages de niveau de fredpeuriere.com
   (terminale-spe.html, 3.html, 4.html, NSI.html…)

   À charger APRÈS fred.css :
   <link rel="stylesheet" href="pages-cours.css">

   Reprend les couleurs du cours en ligne (/tspe/cours/) :
   bleu nuit, bleu, accent doré, papier millimétré.
   Ne change pas le HTML : la feuille restyle les classes existantes.

   SOMMAIRE
    1. Couleurs
    2. Titre de la page   (1er bandeau .bgimg-1, w3-padding-32)
    3. Titres des parties (bandeaux .bgimg-1, w3-padding-8)
    4. Titres des chapitres (h1.w3-text-chapitre / w3-text-chapitre2)
    5. Mobile
    6. Variante informatique (NSI, SNT) : <body class="info">
    7. Pied de page (fichier pied-de-page.css)
   ===================================================================== */


/* =====================================================================
   1. COULEURS
   ===================================================================== */
:root {
  --nuit: #0b2239;
  --bleu: #1f4e79;
  --bleu-titre: #123b63;
  --or: #f4c542;
  --gris-bleu: #5b6b8c;
  --papier: #fbfcfe;
}


/* =====================================================================
   2. TITRE DE LA PAGE
   Premier bandeau : papier millimétré, grand titre bleu nuit, trait doré
   (div.bgimg-1 l'emporte sur la règle .bgimg-1 écrite dans chaque page)
   ===================================================================== */
div.bgimg-1.w3-padding-32 {
  position: relative;
  overflow: hidden;
  opacity: 1;
  min-height: 0;
  margin: 67px 0 8px;                      /* 43 px de barre noire + 24 px d'espace */
  padding: 50px 20px 46px !important;
  text-align: center;
  background-color: var(--papier);
  background-image:
    /* ondes bleues à gauche, qui s'estompent vers le centre */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='160' viewBox='0 0 420 160'%3E%3Cdefs%3E%3ClinearGradient id='f'%3E%3Cstop offset='0' stop-color='%231f4e79'/%3E%3Cstop offset='.5' stop-color='%231f4e79'/%3E%3Cstop offset='1' stop-color='%231f4e79' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='none' stroke='url(%23f)' stroke-width='1.6'%3E%3Cpath opacity='.22' d='M0 80 Q26 30 52 80 T104 80 T156 80 T208 80 T260 80 T312 80 T364 80 T416 80'/%3E%3Cpath opacity='.12' d='M0 80 Q35 10 70 80 T140 80 T210 80 T280 80 T350 80 T420 80'/%3E%3Cpath opacity='.30' stroke='%23f4c542' d='M0 80 Q17 55 34 80 T68 80 T102 80 T136 80 T170 80 T204 80 T238 80'/%3E%3C/g%3E%3C/svg%3E"),
    /* atome à droite */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260' viewBox='0 0 260 260'%3E%3Cg fill='none' stroke='%231f4e79' stroke-width='1.3' opacity='.16'%3E%3Cellipse cx='130' cy='130' rx='115' ry='40' transform='rotate(-25 130 130)'/%3E%3Cellipse cx='130' cy='130' rx='115' ry='40' transform='rotate(35 130 130)'/%3E%3Cellipse cx='130' cy='130' rx='115' ry='40' transform='rotate(95 130 130)'/%3E%3C/g%3E%3Ccircle cx='130' cy='130' r='9' fill='%23f4c542' opacity='.55'/%3E%3Ccircle cx='233' cy='82' r='4' fill='%231f4e79' opacity='.3'/%3E%3Ccircle cx='60' cy='38' r='4' fill='%231f4e79' opacity='.3'/%3E%3C/svg%3E"),
    /* papier millimétré */
    linear-gradient(rgba(31, 78, 121, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 78, 121, 0.06) 1px, transparent 1px),
    radial-gradient(ellipse 60% 120% at 50% 0%, #ffffff 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, #ffffff 0%, #e9f0f7 100%);
  background-repeat: no-repeat, no-repeat, repeat, repeat, no-repeat, no-repeat;
  background-position: left -30px center, right -50px center, center, center, center, center;
  background-size: 420px 160px, 260px 260px, 28px 28px, 28px 28px, 100% 100%, 100% 100%;
  background-attachment: scroll;
  border: 1px solid #d6e0ea;
  border-radius: 18px;
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.7),
    0 10px 28px rgba(11, 34, 57, 0.10);
}

/* bande dorée en haut de la carte */
div.bgimg-1.w3-padding-32::before {
  content: "";
  display: block;               /* annule le display:table de .w3-row:before */
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--nuit) 0%, var(--bleu) 40%, var(--or) 50%, var(--bleu) 60%, var(--nuit) 100%);
}

div.bgimg-1.w3-padding-32 > span {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 0;
  font-size: clamp(30px, 4.6vw, 50px) !important;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.01em !important;
  color: var(--nuit) !important;
  background: none !important;
  text-shadow: 0 2px 0 #ffffff;
}

/* sous le titre : trait – losange – trait */
div.bgimg-1.w3-padding-32 > span::after {
  content: "";
  display: block;
  width: 150px;
  height: 14px;
  margin: 18px auto 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='14'%3E%3Cpath d='M0 7 H62 M88 7 H150' stroke='%23f4c542' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M75 0 L82 7 L75 14 L68 7 Z' fill='%231f4e79'/%3E%3C/svg%3E") center / 150px 14px no-repeat;
}

/* bandeau imbriqué (4.html, 6.html) : pas de double cadre ni de double décor */
div.bgimg-1.w3-padding-32 div.bgimg-1.w3-padding-32 {
  margin: 0;
  padding: 0 !important;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

div.bgimg-1.w3-padding-32 div.bgimg-1.w3-padding-32::before {
  display: none;
}


/* =====================================================================
   3. TITRES DES PARTIES
   Bandeau bleu nuit, titre blanc espacé, petit trait doré
   ===================================================================== */
div.bgimg-1.w3-padding-8 {
  position: relative;
  overflow: hidden;
  opacity: 1;
  min-height: 0;
  margin: 0;
  padding: 14px 20px !important;
  text-align: center;
  background-color: var(--nuit);
  background-image:
    /* ondes dorées très discrètes, à gauche et à droite */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='120' viewBox='0 0 360 120'%3E%3Cdefs%3E%3ClinearGradient id='f'%3E%3Cstop offset='0' stop-color='%23f4c542'/%3E%3Cstop offset='.55' stop-color='%23f4c542'/%3E%3Cstop offset='1' stop-color='%23f4c542' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='none' stroke='url(%23f)' stroke-width='1.5'%3E%3Cpath opacity='.35' d='M0 60 Q22.5 20 45 60 T90 60 T135 60 T180 60 T225 60 T270 60 T315 60 T360 60'/%3E%3Cpath opacity='.18' d='M0 60 Q30 5 60 60 T120 60 T180 60 T240 60 T300 60 T360 60'/%3E%3Cpath opacity='.12' d='M0 60 Q15 40 30 60 T60 60 T90 60 T120 60 T150 60 T180 60 T210 60 T240 60 T270 60 T300 60 T330 60 T360 60'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='120' viewBox='0 0 360 120'%3E%3Cg fill='none' stroke='%23ffffff'%3E%3Ccircle cx='300' cy='60' r='14' opacity='.10'/%3E%3Cellipse cx='300' cy='60' rx='70' ry='26' opacity='.10' transform='rotate(-20 300 60)'/%3E%3Cellipse cx='300' cy='60' rx='70' ry='26' opacity='.10' transform='rotate(40 300 60)'/%3E%3Cellipse cx='300' cy='60' rx='70' ry='26' opacity='.10' transform='rotate(100 300 60)'/%3E%3C/g%3E%3Ccircle cx='300' cy='60' r='5' fill='%23f4c542' opacity='.45'/%3E%3C/svg%3E"),
    /* halo lumineux au centre */
    radial-gradient(ellipse 55% 140% at 50% 0%, rgba(84, 140, 200, 0.35) 0%, rgba(84, 140, 200, 0) 70%),
    linear-gradient(90deg, #0b2239 0%, #163a5c 50%, #0b2239 100%);
  background-repeat: no-repeat;
  background-position: left -30px center, right -14px center, center, center;
  background-size: 240px 80px, 240px 80px, 100% 100%, 100% 100%;
  background-attachment: scroll;
  border-radius: 14px;
  box-shadow:
    inset 0 0 0 1px rgba(244, 197, 66, 0.28),   /* filet doré intérieur */
    0 8px 22px rgba(11, 34, 57, 0.22);
}

/* liseré doré en haut du bandeau */
div.bgimg-1.w3-padding-8::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 220px;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, rgba(244, 197, 66, 0), var(--or), rgba(244, 197, 66, 0));
}

/* titre : encadré de deux traits dorés terminés par un losange */
div.bgimg-1.w3-padding-8 > span {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 0 70px;
  font-size: clamp(18px, 2.2vw, 23px) !important;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.14em !important;
  color: #ffffff !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='10'%3E%3Cpath d='M0 5 H40' stroke='%23f4c542' stroke-width='2'/%3E%3Cpath d='M46 1 L50 5 L46 9 L42 5 Z' fill='%23f4c542'/%3E%3C/svg%3E") left center / 52px 10px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='10'%3E%3Cpath d='M12 5 H52' stroke='%23f4c542' stroke-width='2'/%3E%3Cpath d='M6 1 L10 5 L6 9 L2 5 Z' fill='%23f4c542'/%3E%3C/svg%3E") right center / 52px 10px no-repeat !important;
}

/* page sans grand titre (spe.html) : le premier bandeau ne passe pas sous la barre noire */
.w3-main > div.bgimg-1.w3-padding-8:first-child {
  margin-top: 43px;
}

/* les filets gris des bandeaux ne servent plus */
div.bgimg-1 > hr.w3-opacity {
  display: none;
}


/* =====================================================================
   4. TITRES DES CHAPITRES
   Bleu soutenu, plus gras, trait doré dessous
   ===================================================================== */
h1.w3-text-chapitre,
h1.w3-text-chapitre2 {
  margin: 0 0 6px;
  font-size: 22px !important;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.04em;
  color: var(--bleu-titre) !important;
  text-align: center;
  white-space: normal;      /* plus de titre coupé par « … » */
  overflow: visible;
}

/* titres des deux colonnes du haut (devoirs, programmes) un peu plus grands */
h1.w3-text-chapitre {
  font-size: 24px !important;
}

/* <span class="w3-text-chapitre2"> placé dans un h1 : même style que le h1 */
h1 > span.w3-text-chapitre2 {
  font-size: inherit !important;
  color: inherit !important;
  white-space: normal;
}

h1.w3-text-chapitre::after,
h1.w3-text-chapitre2::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin: 12px auto 0;
  border-radius: 3px;
  background: var(--or);
}

/* h1 vide au-dessus du bloc « progression » (4.html, 6.html) : pas de trait seul */
h1.w3-text-chapitre:has(+ div.bgimg-3)::after {
  display: none;
}

/* le filet gris sous chaque titre de chapitre est remplacé par le trait doré */
h1.w3-text-chapitre + hr.w3-opacity,
h1.w3-text-chapitre2 + hr.w3-opacity {
  display: none;
}


/* =====================================================================
   5. MOBILE
   ===================================================================== */
@media (max-width: 600px) {

  div.bgimg-1.w3-padding-32 {
    margin-top: 100px;                     /* la barre noire passe sur deux lignes */
    padding: 34px 12px 30px !important;
    border-radius: 14px;
    background-size: 260px 100px, 160px 160px, 28px 28px, 28px 28px, 100% 100%, 100% 100%;
    background-position: left -60px center, right -60px center, center, center, center, center;
  }

  div.bgimg-1.w3-padding-8 {
    padding: 12px 10px !important;
    border-radius: 10px;
  }

  div.bgimg-1.w3-padding-8 > span {
    padding: 0 40px;
    letter-spacing: 0.08em !important;
    background-size: 30px 10px, 30px 10px !important;
  }

  div.bgimg-1.w3-padding-8 {
    background-size: 240px 80px, 240px 80px, 100% 100%, 100% 100%;
  }

  h1.w3-text-chapitre,
  h1.w3-text-chapitre2 {
    font-size: 20px !important;
  }
}


/* =====================================================================
   6. VARIANTE INFORMATIQUE (NSI, SNT)
   Activer avec <body class="info">
   Bleu clair et ardoise des cartes informatique de l'accueil,
   police « code », motifs de code et de circuits.
   ===================================================================== */
body.info {
  --info-nuit: #11161d;    /* fond des cartes informatique de l'accueil */
  --info-fonce: #3d4a5c;
  --info-bleu: #a9bccf;    /* bleu clair de l'accueil */
  --info-clair: #dde6ef;
  --info-trait: #8aa0b8;   /* bleu clair un peu plus soutenu, lisible sur fond blanc */
}

/* ----- titre de la page ----- */
body.info div.bgimg-1.w3-padding-32 {
  background-color: #fbfcfe;
  background-image:
    /* code binaire à gauche, qui s'estompe vers le centre */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='160' viewBox='0 0 420 160'%3E%3Cdefs%3E%3ClinearGradient id='f'%3E%3Cstop offset='0' stop-color='%233d4a5c'/%3E%3Cstop offset='.45' stop-color='%233d4a5c'/%3E%3Cstop offset='1' stop-color='%233d4a5c' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg font-family='Consolas,Menlo,monospace' font-size='15' fill='url(%23f)' letter-spacing='3'%3E%3Ctext x='14' y='42' opacity='.22'%3E01001110 01010011 01001001%3C/text%3E%3Ctext x='38' y='72' opacity='.14'%3E10110 00101 11010 0110%3C/text%3E%3Ctext x='8' y='102' opacity='.22'%3Edef f(n): return n*2%3C/text%3E%3Ctext x='30' y='132' opacity='.14'%3E11100101 00011010 1011%3C/text%3E%3C/g%3E%3C/svg%3E"),
    /* circuit imprimé à droite */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260' viewBox='0 0 260 260'%3E%3Cg fill='none' stroke='%233d4a5c' stroke-width='1.6' opacity='.22'%3E%3Cpath d='M0 70 H70 L100 100 H180'/%3E%3Cpath d='M0 130 H120 L140 110 H260'/%3E%3Cpath d='M0 190 H60 L90 160 H150 L170 180 H260'/%3E%3Cpath d='M200 0 V60 L180 80 V110'/%3E%3Cpath d='M230 260 V200 L210 180'/%3E%3C/g%3E%3Cg fill='%233d4a5c' opacity='.35'%3E%3Ccircle cx='180' cy='100' r='4'/%3E%3Ccircle cx='180' cy='110' r='4'/%3E%3Ccircle cx='150' cy='160' r='4'/%3E%3Ccircle cx='210' cy='180' r='4'/%3E%3C/g%3E%3Crect x='96' y='118' width='40' height='26' rx='4' fill='%238aa0b8' opacity='.45'/%3E%3C/svg%3E"),
    /* points d'une grille d'éditeur */
    radial-gradient(rgba(61, 74, 92, 0.16) 1px, transparent 1.4px),
    radial-gradient(ellipse 60% 120% at 50% 0%, #ffffff 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, #ffffff 0%, #e9eef4 100%);
  background-repeat: no-repeat, no-repeat, repeat, no-repeat, no-repeat;
  background-position: left 0 center, right -40px center, center, center, center;
  background-size: 420px 160px, 260px 260px, 18px 18px, 100% 100%, 100% 100%;
  border-color: #cfd8e3;
}

body.info div.bgimg-1.w3-padding-32::before {
  background: linear-gradient(90deg, var(--info-nuit) 0%, var(--info-fonce) 40%, var(--info-clair) 50%, var(--info-fonce) 60%, var(--info-nuit) 100%);
}

body.info div.bgimg-1.w3-padding-32 > span {
  font-family: Consolas, Menlo, "Courier New", monospace;
  font-weight: 700;
  letter-spacing: 0.02em !important;
  color: var(--info-nuit) !important;
}

/* « > » devant le titre, comme sur la page d'accueil */
body.info div.bgimg-1.w3-padding-32 > span::before {
  content: "> ";
  color: #8aa0b8;
}

/* sous le titre : invite de commande « >_ » avec curseur clignotant */
body.info div.bgimg-1.w3-padding-32 > span::after {
  width: 170px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='18'%3E%3Cpath d='M0 9 H66 M104 9 H170' stroke='%238aa0b8' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M74 3 L81 9 L74 15' fill='none' stroke='%233d4a5c' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3Crect x='85' y='13' width='12' height='3' fill='%233d4a5c'%3E%3Canimate attributeName='opacity' values='1;1;0;0' keyTimes='0;.5;.5;1' dur='1.1s' repeatCount='indefinite'/%3E%3C/rect%3E%3C/svg%3E") center / 170px 18px no-repeat;
}

/* ----- bandeaux des parties ----- */
body.info div.bgimg-1.w3-padding-8 {
  background-color: var(--info-nuit);
  background-image:
    /* circuit à gauche */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='120' viewBox='0 0 360 120'%3E%3Cdefs%3E%3ClinearGradient id='f'%3E%3Cstop offset='0' stop-color='%23a9bccf'/%3E%3Cstop offset='.5' stop-color='%23a9bccf'/%3E%3Cstop offset='1' stop-color='%23a9bccf' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='none' stroke='url(%23f)' stroke-width='1.5' opacity='.45'%3E%3Cpath d='M0 30 H80 L110 60 H220 L240 40 H330'/%3E%3Cpath d='M0 90 H60 L80 70 H170 L190 90 H300'/%3E%3C/g%3E%3Cg fill='%23a9bccf' opacity='.5'%3E%3Ccircle cx='110' cy='60' r='3.5'/%3E%3Ccircle cx='80' cy='70' r='3.5'/%3E%3Ccircle cx='190' cy='90' r='3.5'/%3E%3C/g%3E%3C/svg%3E"),
    /* binaire à droite */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='120' viewBox='0 0 360 120'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='1' x2='0'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='.5' stop-color='%23ffffff'/%3E%3Cstop offset='1' stop-color='%23ffffff' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg font-family='Consolas,Menlo,monospace' font-size='14' fill='url(%23g)' letter-spacing='3' text-anchor='end'%3E%3Ctext x='350' y='38' opacity='.16'%3E1001 0011 1010%3C/text%3E%3Ctext x='350' y='66' opacity='.10'%3E0010 1110 0101%3C/text%3E%3Ctext x='350' y='94' opacity='.16'%3E1100 1001 0110%3C/text%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(ellipse 55% 140% at 50% 0%, rgba(169, 188, 207, 0.22) 0%, rgba(169, 188, 207, 0) 70%),
    linear-gradient(90deg, #11161d 0%, #232c38 50%, #11161d 100%);
  box-shadow:
    inset 0 0 0 1px rgba(169, 188, 207, 0.30),
    0 8px 22px rgba(17, 22, 29, 0.22);
}

body.info div.bgimg-1.w3-padding-8::before {
  background: linear-gradient(90deg, rgba(169, 188, 207, 0), var(--info-bleu), rgba(169, 188, 207, 0));
}

body.info div.bgimg-1.w3-padding-8 > span {
  font-family: Consolas, Menlo, "Courier New", monospace;
  letter-spacing: 0.08em !important;
  color: #dde6ef !important;
}

/* titre de partie : encadré de chevrons « < … /> » façon balise */
body.info div.bgimg-1.w3-padding-8 > span {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='14'%3E%3Cpath d='M0 7 H34' stroke='%23a9bccf' stroke-width='2'/%3E%3Cpath d='M48 2 L41 7 L48 12' fill='none' stroke='%23a9bccf' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") left center / 52px 14px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='14'%3E%3Cpath d='M6 12 L11 2' stroke='%23a9bccf' stroke-width='2.2' stroke-linecap='round'/%3E%3Cpath d='M14 2 L21 7 L14 12' fill='none' stroke='%23a9bccf' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M26 7 H52' stroke='%23a9bccf' stroke-width='2'/%3E%3C/svg%3E") right center / 52px 14px no-repeat !important;
}

/* ----- bouton « ANNALES BAC NSI » de la barre du haut : bleu clair au lieu du vert ----- */
body.info .w3-bar .nav-cours {
  background-color: #dde6ef !important;
  color: #2b3644 !important;
}
body.info .w3-bar .nav-cours:hover {
  background-color: #f4c542 !important;
  color: #0b2239 !important;
}

/* ----- titres des chapitres ----- */
body.info h1.w3-text-chapitre,
body.info h1.w3-text-chapitre2 {
  color: #2b3644 !important;
}

body.info h1.w3-text-chapitre::after,
body.info h1.w3-text-chapitre2::after {
  background: var(--info-trait);
}

@media (max-width: 600px) {
  body.info div.bgimg-1.w3-padding-32 {
    background-size: 260px 100px, 160px 160px, 18px 18px, 100% 100%, 100% 100%;
    background-position: left -40px center, right -60px center, center, center, center;
  }
  body.info div.bgimg-1.w3-padding-8 > span {
    background-size: 30px 14px, 30px 14px !important;
  }
}


/* =====================================================================
   7. PIED DE PAGE : voir pied-de-page.css (importée en tête de fichier,
      et utilisée seule par index.html)
   ===================================================================== */


/* =====================================================================
   8. CADRES DE CONTENU DE MÊME HAUTEUR DANS UNE LIGNE
   Dans une ligne de chapitres (:is(.w3-row, .w3-row-padding) > .w3-third / .w3-half), les cadres
   .w3-border s'allongent jusqu'à la hauteur du plus grand de la ligne,
   et leurs bas sont alignés. Sur téléphone, les colonnes restent empilées.
   ===================================================================== */
@media (min-width: 601px) {

  :is(.w3-row, .w3-row-padding):has(> .w3-third .w3-border, > .w3-half .w3-border) {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
  }

  /* chaque colonne : empilement vertical, le cadre prend la place restante */
  :is(.w3-row, .w3-row-padding) > .w3-third:has(.w3-border),
  :is(.w3-row, .w3-row-padding) > .w3-half:has(.w3-border) {
    display: flex;
    flex-direction: column;
    float: none;
  }

  :is(.w3-row, .w3-row-padding) > .w3-third > .w3-border,
  :is(.w3-row, .w3-row-padding) > .w3-half > .w3-border,
  :is(.w3-row, .w3-row-padding) > .w3-third > .w3-container:has(> .w3-border),
  :is(.w3-row, .w3-row-padding) > .w3-half > .w3-container:has(> .w3-border) {
    flex-grow: 1;
  }

  /* autres enfants directs de la ligne (<p>&nbsp;</p>, <hr>…) : sur une ligne à part,
     pour ne pas décaler les colonnes */
  :is(.w3-row, .w3-row-padding):has(> .w3-third .w3-border, > .w3-half .w3-border) > :not(.w3-third):not(.w3-half) {
    flex-basis: 100%;
  }

  /* cadre placé dans un .w3-container intermédiaire : il remplit ce conteneur */
  :is(.w3-row, .w3-row-padding) > .w3-third > .w3-container:has(> .w3-border),
  :is(.w3-row, .w3-row-padding) > .w3-half > .w3-container:has(> .w3-border) {
    display: flex;
    flex-direction: column;
  }
  .w3-container:has(> .w3-border) > .w3-border {
    flex-grow: 1;
  }

  /* paragraphes vides après le cadre : remplacés par une marge identique partout */
  :is(.w3-row, .w3-row-padding) > .w3-third > .w3-border ~ p,
  :is(.w3-row, .w3-row-padding) > .w3-half > .w3-border ~ p,
  :is(.w3-row, .w3-row-padding) > .w3-third > .w3-container:has(> .w3-border) ~ p,
  :is(.w3-row, .w3-row-padding) > .w3-half > .w3-container:has(> .w3-border) ~ p {
    display: none;
  }
  :is(.w3-row, .w3-row-padding) > .w3-third > .w3-border,
  :is(.w3-row, .w3-row-padding) > .w3-half > .w3-border,
  :is(.w3-row, .w3-row-padding) > .w3-third > .w3-container:has(> .w3-border),
  :is(.w3-row, .w3-row-padding) > .w3-half > .w3-container:has(> .w3-border) {
    margin-bottom: 24px;
  }
}


/* =====================================================================
   9. MENUS DÉROULANTS « EXERCICES » ET « ANIMATIONS »
   <div class="dropdown"> <button>Exercices</button>
     <div class="dropdown-content"> … </div></div>
   Variante animations : <div class="dropdown anims">.
   S'ouvre au survol (ordinateur) ou au toucher (téléphone, via :focus-within).
   ===================================================================== */
div.dropdown {
  position: relative;
  display: inline-block;
  margin: 4px 0 10px;
}

/* bouton : étiquette arrondie bleu clair, flèche ▾ */
div.dropdown > button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px !important;
  font-family: inherit;
  font-size: 15px !important;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none !important;
  text-transform: none;
  color: #1f4e79 !important;
  background: #eaf1f8 !important;
  border: 1px solid #c5d5e6 !important;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
div.dropdown > button::before {
  content: "📄";
  font-size: 14px;
}
div.dropdown > button::after {
  content: "▾";
  font-size: 12px;
  opacity: 0.7;
}

div.dropdown:hover > button,
div.dropdown:focus-within > button {
  color: #0b2239 !important;
  background: #f4c542 !important;
  border-color: #e0b02c !important;
}

/* variante animations : orange (couleur des liens d'animation) et ▶ */
div.dropdown.anims > button {
  color: #c2410c !important;
  background: #fff1e6 !important;
  border-color: #f6c9a8 !important;
}
div.dropdown.anims > button::before {
  content: "▶";
  font-size: 11px;
}
div.dropdown.anims:hover > button,
div.dropdown.anims:focus-within > button {
  color: #ffffff !important;
  background: #ea580c !important;
  border-color: #ea580c !important;
}

/* contenu : carte blanche sous le bouton */
div.dropdown > div.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  min-width: min(440px, 86vw);
  max-width: 92vw;
  margin-top: 6px;
  padding: 10px 16px;
  opacity: 1;
  line-height: 1.8;
  text-align: left;
  background: #ffffff;
  border: 1px solid #d6e0ea;
  border-top: 3px solid #1f4e79;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(11, 34, 57, 0.18);
}
div.dropdown.anims > div.dropdown-content {
  border-top-color: #ea580c;
}

/* pont invisible entre le bouton et la carte (le survol ne se perd pas) */
div.dropdown > div.dropdown-content::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}

div.dropdown:hover > div.dropdown-content,
div.dropdown:focus-within > div.dropdown-content {
  display: block;
}

div.dropdown > div.dropdown-content blockquote {
  margin: 0;
}
div.dropdown > div.dropdown-content p {
  margin: 4px 0;
}
div.dropdown > div.dropdown-content a {
  display: inline;
  padding: 1px 2px;
}

/* --- z-index : le menu ouvert passe au-dessus de tout ce qui suit ---
   Les colonnes (w3-opacity-min) et certaines lignes (animations AOS) créent
   chacune leur propre « calque » : on remonte la colonne et la ligne du menu ouvert. */
:is(.w3-row, .w3-row-padding):has(.dropdown:hover, .dropdown:focus-within),
:is(.w3-row, .w3-row-padding) > div:has(.dropdown:hover, .dropdown:focus-within),
.w3-border:has(.dropdown:hover, .dropdown:focus-within) {
  position: relative;
  z-index: 50;
}

/* colonne semi-transparente (w3-opacity-min) : opaque tant que son menu est ouvert,
   sinon le menu laisse voir ce qu'il recouvre */
:is(.w3-row, .w3-row-padding) > div:has(.dropdown:hover, .dropdown:focus-within) {
  opacity: 1 !important;
}

/* la barre du haut, le voile et le menu latéral restent au-dessus de la ligne
   remontée (z-index 50), dans le même ordre qu'avant : barre < voile < menu */
div.w3-top {
  z-index: 60;
}
div.w3-overlay {
  z-index: 61;
}
nav.w3-sidebar {
  z-index: 62;
}


/* =====================================================================
   10. BADGE DANS LE TITRE DE LA PAGE
   <span class="badge-spe">spécialité</span> placé dans le titre
   ===================================================================== */
.badge-spe {
  display: inline-block;
  position: relative;
  top: -0.35em;
  margin-left: 0.5em;
  padding: 4px 12px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  vertical-align: middle;
  color: #0b2239;
  background: #f4c542;
  border-radius: 999px;
  text-shadow: none;
}
body.info .badge-spe {
  color: #11161d;
  background: #dde6ef;
  border: 1px solid #a9bccf;
}
@media (max-width: 600px) {
  .badge-spe {
    font-size: 12px;
    padding: 3px 9px;
  }
}
