/* =====================================================================
   MATALO - Maquette : lot 117, pages « Maths par niveau » (maths-cm1.html, puis CP, CE1, CE2, CM2)
   S'ajoute a vitrine.css (memes variables, boutons, sections, parchemins, FAQ).
   ===================================================================== */

/* ---------- Hero (v2 : « CM1 » en tres gros) ---------- */
.hero-niveau { padding-top: clamp(28px, 4vw, 48px); }
.hero-niveau .conteneur { grid-template-columns: 1.1fr .9fr; align-items: center; }
.ariane { font-size: .88rem; color: #bfe6ec; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ariane a { color: #fff7e6; text-decoration: none; font-weight: 600; }
.ariane a:hover { text-decoration: underline; }
.ariane i { font-size: .65rem; opacity: .7; }
.hero .titre-niveau { margin: 0 0 14px; font-family: "Montserrat", var(--police); line-height: .95; text-shadow: none; }
.titre-niveau .niv-geant { display: block; font-weight: 800; font-size: clamp(6rem, 16vw, 11rem); letter-spacing: -2px; color: var(--or-300);
  text-shadow: 0 6px 0 var(--or-700), 0 14px 26px rgba(0,0,0,.35); }
.titre-niveau .h1-suite { display: block; margin-top: 14px; font-weight: 800; font-size: clamp(1.5rem, 3.2vw, 2.3rem); color: #fff; letter-spacing: .2px; }
.hero-niveau .accroche { max-width: 600px; }
.hero-niveau .boutons { margin: 22px 0 22px; }
.chiffres-niv { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, auto); gap: 10px; justify-content: start; }
.chiffres-niv li { background: rgba(0,0,0,.22); border-radius: 14px; padding: 8px 14px; text-align: center; box-shadow: inset 0 1px 2px rgba(0,0,0,.3); }
.chiffres-niv b { display: block; font-family: "Montserrat", var(--police); font-weight: 800; font-size: 1.5rem; color: var(--or-300); line-height: 1.1; }
.chiffres-niv span { font-size: .82rem; color: #d7f3f6; }
/* carte « Au programme du CM1 » */
.carte-programme { padding: 26px 24px 20px; transform: rotate(1deg); }
.carte-programme h2 { font-family: var(--police-titre); font-weight: 400; font-size: 2rem; color: var(--bois-700); margin: 0 4px 12px; display: flex; gap: 10px; align-items: center; }
.carte-programme h2 i { font-size: 1.3rem; color: var(--or-700); }
.carte-programme ul { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.carte-programme li { display: flex; align-items: center; gap: 12px; background: #fffaf0; border-radius: 14px; padding: 6px 12px 6px 6px; box-shadow: inset 0 0 0 1px rgba(154,91,46,.15); }
.carte-programme img { flex: none; width: 46px; height: 46px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 3px 6px -3px rgba(0,0,0,.4); }
.carte-programme b { display: block; color: var(--bois-900); font-size: .98rem; line-height: 1.2; }
.carte-programme small { color: var(--encre-3); font-size: .8rem; font-weight: 600; }
.carte-programme .lien-fleche { margin-left: 6px; }

/* ---------- Pied de page : reseaux sociaux (comme presentation.html, lot 113) ---------- */
.pied .reseaux { margin-top: 16px; }
.pied .reseaux .titre-reseaux { display: block; color: #fff; font-weight: 600; margin-bottom: 8px; }
.pied .reseaux ul { display: flex; gap: 10px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.pied .reseaux a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; border-radius: 999px; background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.pied .reseaux a:hover { background: rgba(255,255,255,.18); }
.pied .reseaux svg { width: 26px; height: 26px; flex: none; border-radius: 50%; }

/* ---------- Univers ---------- */
.univers-niv { display: grid; grid-template-columns: 300px 1fr; gap: clamp(28px, 5vw, 60px); align-items: center; }
.visuel-univers-niv { position: relative; width: 300px; height: 300px; }
.visuel-univers-niv .decor { width: 270px; height: 270px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 6px #fff, var(--ombre); }
.visuel-univers-niv .perso { position: absolute; width: 110px; height: 110px; border-radius: 50%; object-fit: cover; background: #fff; box-shadow: 0 0 0 5px var(--or-500), var(--ombre-s); }
.visuel-univers-niv .perso.g { left: -10px; bottom: 0; }
.visuel-univers-niv .perso.f { right: 0; bottom: 20px; }
.etiquette-g { display: inline-flex; gap: 8px; align-items: center; font-size: .82rem; text-transform: uppercase; letter-spacing: 1.4px; font-weight: 700; color: var(--bois-500); margin-bottom: 10px; }
.titre-g { font-family: var(--police-titre); font-weight: 400; font-size: clamp(2rem, 4vw, 2.9rem); color: var(--bois-700); }
.univers-niv p { color: var(--encre-2); }
.univers-niv .motifs-univers li { background: #fffaf0; color: var(--bois-700); box-shadow: inset 0 0 0 1px rgba(154,91,46,.2); }
.univers-niv .motifs-univers i { color: var(--or-700); }

/* ---------- Notions par domaine ---------- */
.domaines { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.domaine { display: flex; gap: 16px; align-items: flex-start; padding: 20px 22px; background: #fffaf0; border-radius: 16px; box-shadow: inset 0 0 0 1px rgba(154,91,46,.15), var(--ombre-s); }
.domaine .ic { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.25rem; }
.domaine h3 { font-size: 1.15rem; margin: 2px 0 6px; color: var(--bois-900); }
.domaine p { margin: 0 0 8px; color: var(--encre-2); font-size: .97rem; }
.domaine ul { margin: 0; padding-left: 1.1em; color: var(--encre); font-size: .92rem; }
.domaine li { margin: 2px 0; }
.domaine li::marker { color: var(--or-700); }

/* ---------- Progression par periode ---------- */
.periodes-niv { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; align-items: start; }
.periode-niv { background: #fffaf0; border-radius: 16px; padding: 14px 12px 10px; box-shadow: inset 0 0 0 1px rgba(154,91,46,.15), var(--ombre-s); }
.periode-niv h3 { font-family: var(--police-titre); font-weight: 400; font-size: 1.6rem; color: var(--bois-700); text-align: center; margin: 0 0 10px; }
.periode-niv h3 small { display: block; font-family: var(--police); font-size: .78rem; color: var(--encre-3); font-weight: 600; margin-top: 2px; }
.periode-niv ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.periode-niv li { display: flex; gap: 8px; align-items: flex-start; padding: 6px; border-radius: 12px; }
.periode-niv li.rev { background: #fff1c7; }
.periode-niv img { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 3px 6px -3px rgba(0,0,0,.4); }
.periode-niv b { display: block; font-size: .85rem; color: var(--bois-900); line-height: 1.2; }
.periode-niv em { display: inline-block; font-style: normal; font-size: .68rem; font-weight: 700; background: var(--or-500); color: var(--bois-900); border-radius: 999px; padding: 0 7px; margin: 2px 0; }
.periode-niv small { display: block; font-size: .78rem; color: var(--encre-2); line-height: 1.3; margin-top: 2px; }
.cta-centre { text-align: center; margin: 28px 0 0; }

/* ---------- Demo integree (iframe demo_integree.html) ---------- */
.cadre-demo { border-radius: 22px; overflow: hidden; box-shadow: var(--ombre); background: #0b3954; }
.cadre-demo iframe { display: block; width: 100%; height: 820px; border: 0; }

/* ---------- Enseignants / parents ---------- */
.deux-publics { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.public { padding: 26px 26px 24px; }
.public .ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; margin-bottom: 10px; }
.public h2 { font-family: var(--police-titre); font-weight: 400; font-size: 1.9rem; color: var(--bois-700); }
.public .liste-coches li { color: var(--encre-2); }

/* ---------- Tarifs ---------- */
.tarifs-niveau { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 900px; margin: 0 auto; }
.tarif { padding: 24px; text-align: center; }
.tarif h3 { color: var(--bois-700); font-size: 1.3rem; }
.tarif .prix { font-size: 1.05rem; color: var(--encre-2); }
.tarif .prix b { font-family: "Montserrat", var(--police); font-weight: 800; font-size: 1.7rem; color: var(--bois-900); }
.tarif p { color: var(--encre-2); }

/* ---------- Autres niveaux ---------- */
.liste-niveaux { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.liste-niveaux a, .liste-niveaux span { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 16px 10px; border-radius: 16px; background: rgba(255,255,255,.1); color: #fff; text-decoration: none; transition: background .15s, transform .15s; }
.liste-niveaux a:hover { background: rgba(255,255,255,.18); transform: translateY(-3px); }
.liste-niveaux li[aria-current] span { background: var(--or-500); color: var(--bois-900); }
.liste-niveaux img { width: 72px; height: 72px; border-radius: 50%; box-shadow: 0 0 0 3px #fff; }
.liste-niveaux b { font-size: 1.1rem; }
.liste-niveaux small { font-size: .82rem; opacity: .85; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .periodes-niv { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .univers-niv { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .univers-niv .motifs-univers { justify-content: center; }
  .domaines, .deux-publics, .tarifs-niveau { grid-template-columns: 1fr; }
  .hero-niveau .conteneur { grid-template-columns: 1fr; }
  .carte-programme { transform: none; }
  .periodes-niv { grid-template-columns: repeat(2, 1fr); }
  .liste-niveaux { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .chiffres-niv { grid-template-columns: repeat(2, 1fr); }
  .periodes-niv { grid-template-columns: 1fr; }
  .liste-niveaux { grid-template-columns: repeat(2, 1fr); }
  .visuel-univers-niv { width: 240px; height: 240px; }
  .visuel-univers-niv .decor { width: 220px; height: 220px; }
  .visuel-univers-niv .perso { width: 86px; height: 86px; }
}

/* ---------- Couleurs du haut de page selon l'univers du niveau (le CM1 garde l'ocean) ---------- */
.page-niveau[data-theme="CP"] .hero-niveau {
  background: radial-gradient(700px 320px at 85% -6%, rgba(255,240,150,.45), transparent 60%),
              linear-gradient(180deg, #5aa83a 0%, #3f842a 55%, #2c611d 100%);
}
.page-niveau[data-theme="CE1"] .hero-niveau {
  background: radial-gradient(900px 420px at 15% -5%, rgba(255,215,106,.25), transparent 60%),
              linear-gradient(180deg, #8a2a3c 0%, #5e2140 55%, #2a1f3a 100%);
}
.page-niveau[data-theme="CE2"] .hero-niveau {
  background: radial-gradient(900px 420px at 50% -8%, rgba(255,236,150,.22), transparent 60%),
              linear-gradient(180deg, #1f5c38 0%, #164a2e 50%, #0f3a24 100%);
}
.page-niveau[data-theme="CM2"] .hero-niveau {
  background: radial-gradient(900px 500px at 10% -10%, rgba(140,111,240,.45), transparent 60%),
              radial-gradient(800px 500px at 110% 25%, rgba(255,93,143,.22), transparent 60%),
              linear-gradient(180deg, #171a52 0%, #0e1038 50%, #07081f 100%);
}
.page-niveau:not([data-theme="CM1"]) .hero-niveau::before { background-image: none; animation: none; }
.page-niveau[data-theme="CM2"] .hero-niveau::before {
  background-image: radial-gradient(1.5px 1.5px at 20px 30px, rgba(255,255,255,.7), transparent),
                    radial-gradient(1px 1px at 90px 80px, rgba(255,255,255,.5), transparent),
                    radial-gradient(1.5px 1.5px at 150px 20px, rgba(255,255,255,.6), transparent);
  background-size: 180px 120px;
}
