/* Portada exclusiva de El Aula de Fran. La barra compartida vive en includes/barra.* */
html:has(body.aula-magia){overflow-x:hidden}
body.aula-magia{
  --aula-noche:#06143d;--aula-rosa:#f72aa7;--aula-oro:#ffca42;--aula-tinta:#101b4d;
  background:#eef6ff;overflow-x:hidden;
}

/* Conserva el espacio y el DOM que necesita la navegación común. */
body.aula-magia .fm-horizonte{
  height:clamp(82px,7.8vw,108px);background:linear-gradient(180deg,#050d2b,#071a4c);
  border-bottom:1px solid rgba(160,194,255,.18);
}
body.aula-magia .fm-banda{
  min-height:620px;padding:clamp(28px,3vw,48px) var(--gutter) 112px;isolation:isolate;
  background-color:#06143d;
  background-image:url("https://i.imgur.com/zc2STcB.png");
  background-size:cover;background-position:center center;background-repeat:no-repeat;
}
body.aula-magia .fm-banda::before{
  content:"";position:absolute;inset:0;z-index:0;pointer-events:none;
  background:linear-gradient(90deg,rgba(3,15,53,.18),transparent 48%);
}
body.aula-magia .fm-banda::after{bottom:-26px;height:27px;background:linear-gradient(174deg,#06143d 0 48%,transparent 49%)}
body.aula-magia .fm-migas{display:none}
body.aula-magia .fm-banda-grid{
  grid-template-columns:minmax(0,1.02fr) minmax(420px,.98fr);gap:clamp(18px,3vw,52px);
  max-width:1440px;min-height:500px;
}
body.aula-magia .fm-banda-texto{padding:16px 0 0;position:relative;z-index:3}
body.aula-magia .fm-banda h1{
  max-width:760px;margin:0 0 8px;color:#fff;font-size:clamp(3.15rem,5.5vw,6.3rem);
  font-weight:850;line-height:.94;letter-spacing:-.06em;text-wrap:balance;text-shadow:0 4px 24px rgba(0,0,0,.28);
}
body.aula-magia .fm-banda-subt{
  display:inline-block;margin:0 0 22px;color:#fff;font-size:clamp(1.55rem,2.7vw,2.7rem);
  font-weight:650;font-style:italic;letter-spacing:-.035em;text-decoration:underline;
  text-decoration-color:#e879f9;text-decoration-thickness:5px;text-underline-offset:9px;
}
body.aula-magia .fm-banda-parrafo{
  max-width:61ch;margin:0 0 22px;color:#edf4ff;font-size:clamp(1rem,1.2vw,1.16rem);line-height:1.55;text-wrap:pretty;
}
body.aula-magia .fm-cifras{gap:12px 28px;margin:0 0 24px;color:#fff}
body.aula-magia .fm-cifras li{
  display:grid;grid-template-columns:36px auto;grid-template-rows:auto auto;column-gap:10px;
  align-items:center;min-width:104px;font-size:.78rem;font-weight:650;
}
body.aula-magia .fm-cifras li::before{
  content:"";grid-row:1/3;width:34px;height:34px;border-radius:10px;background:#67d8ff;
  box-shadow:0 8px 24px rgba(29,194,255,.22);
}
body.aula-magia .fm-cifras li:nth-child(2)::before{background:#43e0bb}
body.aula-magia .fm-cifras li:nth-child(3)::before{background:#ff83d8;border-radius:50%}
body.aula-magia .fm-cifras li:nth-child(4)::before{
  background:var(--aula-oro);clip-path:polygon(0 35%,25% 58%,50% 14%,75% 58%,100% 35%,90% 90%,10% 90%);
}
body.aula-magia .fm-cifra{font-family:var(--f-cuerpo);font-size:1.28rem;line-height:1;font-weight:850;color:#fff}
body.aula-magia .fm-banda-acciones{display:block;max-width:640px}
body.aula-magia .fm-buscar{
  max-width:100%;margin:0 0 18px;padding:6px;background:#fff;border:4px solid rgba(255,255,255,.34);
  border-radius:999px;box-shadow:0 15px 36px rgba(0,8,42,.3),inset 0 0 0 1px #d9e5ff;
}
body.aula-magia .fm-buscar input{
  min-height:52px;padding:0 22px;border:0;background:#fff;color:var(--aula-tinta);border-radius:999px 0 0 999px;font-size:1rem;
}
body.aula-magia .fm-buscar input::placeholder{color:#65739b}
body.aula-magia .fm-buscar button{
  min-width:112px;min-height:52px;border:0;border-radius:999px;background:linear-gradient(135deg,#ff35b3,#ee1893);
  color:#fff;box-shadow:0 8px 20px rgba(239,24,147,.28);
}
body.aula-magia .fm-buscar button svg{width:22px;height:22px}
body.aula-magia .fm-botones{gap:14px}
body.aula-magia .fm-boton{
  min-height:56px;padding:0 28px;border-radius:14px;font-size:1rem;font-weight:800;box-shadow:0 12px 28px rgba(0,8,42,.2);
}
body.aula-magia .fm-boton--primario{background:linear-gradient(135deg,#ff3cb7,#ee1794);color:#fff}
body.aula-magia .fm-boton--primario::before{content:"🚀";font-size:1.2rem}
body.aula-magia .fm-boton.fm-boton--primario:hover{background:linear-gradient(135deg,#ff5ac2,#f523a2)}
body.aula-magia .fm-boton--secundario{background:rgba(7,17,58,.34);border-color:#dc83ff;color:#fff}
body.aula-magia .fm-boton--secundario::before{content:"♛";color:#ffd64f;font-size:1.35rem}
body.aula-magia .fm-banda-imagen{align-self:end;margin:0 0 -98px 0;z-index:2;pointer-events:none}
body.aula-magia .fm-banda-imagen::before{
  content:"";position:absolute;width:75%;aspect-ratio:1;left:13%;bottom:8%;border-radius:50%;
  background:radial-gradient(circle,rgba(255,190,47,.2),transparent 68%);filter:blur(12px);z-index:-1;
}
body.aula-magia .fm-banda-imagen img.fran-mago{
  width:min(100%,650px);max-height:none;height:auto;object-fit:contain;
  filter:drop-shadow(0 28px 35px rgba(0,4,30,.5));transform-origin:50% 100%;
}

body.aula-magia main{position:relative;background:linear-gradient(180deg,#eef6ff 0,#fff 44%,#f7faff 100%)}
body.aula-magia .fm-atajos{
  position:relative;z-index:5;display:grid;grid-template-columns:repeat(8,1fr);gap:8px;
  max-width:1440px;margin:-40px auto 0;padding:12px;border:1px solid #dfeaff;border-radius:20px;
  background:rgba(255,255,255,.96);box-shadow:0 18px 50px rgba(17,45,105,.16);
}
body.aula-magia .fm-atajos a{
  display:flex;min-width:0;min-height:112px;flex-direction:column;align-items:center;justify-content:center;gap:9px;
  padding:13px 8px;border-radius:14px;background:linear-gradient(180deg,#f4f9ff,#e9f4ff);color:var(--aula-tinta);
  font-size:.83rem;line-height:1.15;font-weight:750;text-align:center;text-decoration:none;
  transition:transform .2s ease,box-shadow .2s ease,background .2s ease;
}
body.aula-magia .fm-atajos a:hover,body.aula-magia .fm-atajos a:focus-visible{
  transform:translateY(-4px);background:#fff;box-shadow:0 10px 24px rgba(23,68,148,.14);
}
body.aula-magia .fm-atajos span{font-size:2rem;filter:drop-shadow(0 4px 6px rgba(19,50,110,.12))}

body.aula-magia #categorias{padding:44px var(--gutter) 54px}
body.aula-magia .fm-seccion-cabecera{
  display:flex;align-items:end;justify-content:space-between;gap:20px;max-width:1440px;margin:0 auto 22px;
}
body.aula-magia .fm-seccion-cabecera h2{font-size:clamp(1.65rem,2.5vw,2.35rem);font-weight:850;color:var(--aula-tinta)}
body.aula-magia .fm-seccion-cabecera h2 span{filter:drop-shadow(0 4px 5px rgba(255,183,0,.2))}
body.aula-magia .fm-seccion-cabecera p{margin:0;color:#334780;font-style:italic;font-weight:600}
body.aula-magia .fm-mosaico{
  grid-template-columns:repeat(12,1fr);grid-auto-rows:minmax(178px,auto);gap:14px;max-width:1440px;padding:0;margin:0 auto;
}
body.aula-magia .cat{
  min-height:178px;padding:22px;border:1px solid rgba(255,255,255,.7);border-radius:17px;
  box-shadow:0 12px 27px rgba(24,57,122,.11),inset 0 1px rgba(255,255,255,.7);
  transition:transform .22s ease,box-shadow .22s ease,filter .22s ease;
}
body.aula-magia .cat::before{background:linear-gradient(180deg,rgba(255,255,255,.05),rgba(13,28,75,.08))}
body.aula-magia .cat::after{
  content:"→";position:absolute;right:18px;bottom:18px;display:grid;place-items:center;width:36px;height:36px;
  border-radius:50%;background:var(--aula-tinta);color:#fff;font-size:1.2rem;font-weight:800;
  box-shadow:0 7px 14px rgba(8,24,70,.2);transition:transform .2s ease;
}
body.aula-magia .cat:hover{transform:translateY(-5px);box-shadow:0 18px 34px rgba(24,57,122,.16);filter:saturate(1.06)}
body.aula-magia .cat:hover::after{transform:translateX(3px)}
body.aula-magia .cat-glifo{width:auto;height:auto;top:auto;right:auto;left:22px;bottom:20px;font-size:2.4rem}
/* El titulo lleva la tipografia de titulares (redonda, gruesa) a
   buen tamano; el contador pasa a la monoespaciada de las cifras del
   sitio (como en la cabecera) y mas pequena, floja y espaciada, para
   que se note a simple vista cual es el titulo y cual es el dato. */
body.aula-magia .cat-nombre{
  padding-right:0;margin-bottom:.3rem;
  font-size:clamp(1.3rem,1.8vw,1.62rem);line-height:1.08;letter-spacing:-.01em;
  color:var(--aula-tinta);
}
body.aula-magia .cat--xl .cat-nombre{font-size:clamp(1.5rem,2.3vw,2rem)}
body.aula-magia .cat-cifra{
  font-family:var(--f-mono);font-size:.76rem;letter-spacing:.02em;
  color:#25386c;font-weight:600;opacity:.85;
}
body.aula-magia .cat[data-slug] .cat-nombre{
  font-weight:800;color:var(--aula-tinta);
  -webkit-text-stroke:5px #fff;paint-order:stroke fill;
  text-shadow:0 2px 8px rgba(16,27,77,.22);
}
body.aula-magia .cat[data-slug] .cat-cifra{
  font-weight:600;color:#2c3d73;opacity:.9;
  -webkit-text-stroke:2.5px #fff;paint-order:stroke fill;
}
body.aula-magia .cat[data-slug]{
  background-image:var(--cat-art);background-repeat:no-repeat;
  background-position:right -4px bottom -6px;
  /* "contain" ajusta la imagen entera dentro de la tarjeta conservando
     su proporcion: nunca se recorta y nunca desborda, sea el aspecto
     que sea la imagen o el ancho de la ventana. */
  background-size:contain;
}
body.aula-magia .cat--xl[data-slug]{background-position:right 10px bottom -6px}
body.aula-magia .cat[data-slug="infantil"]{--cat-art:url("https://i.imgur.com/QdEE5gN.png")}
body.aula-magia .cat[data-slug="primaria"]{--cat-art:url("https://i.imgur.com/78NKeUt.png")}
body.aula-magia .cat[data-slug="plastica"]{--cat-art:url("https://i.imgur.com/rTAtfQL.png")}
body.aula-magia .cat[data-slug="especial"]{--cat-art:url("https://i.imgur.com/U3SogwU.png")}
body.aula-magia .cat[data-slug="audicion-lenguaje"]{--cat-art:url("https://i.imgur.com/RVLogQF.png")}
body.aula-magia .cat[data-slug="musical"]{--cat-art:url("https://i.imgur.com/gZTmNNL.png")}
body.aula-magia .cat[data-slug="fisica"]{--cat-art:url("https://i.imgur.com/PtWa8Hf.png")}
body.aula-magia .cat[data-slug="ingles"]{--cat-art:url("https://i.imgur.com/MPxx7yW.png")}
body.aula-magia .cat[data-slug="religion"]{--cat-art:url("https://i.imgur.com/f7D38EH.png")}
body.aula-magia .cat[data-slug="digitales"]{--cat-art:url("https://i.imgur.com/AVGF28W.png")}
body.aula-magia .cat[data-slug="calendario"]{--cat-art:url("https://i.imgur.com/tx9s22z.png")}
body.aula-magia .cat[data-slug="gamificaciones"]{--cat-art:url("https://i.imgur.com/UIkYYeL.png")}
body.aula-magia .cat[data-slug="juegos-educativos"]{--cat-art:url("https://i.imgur.com/i3UNMkA.png")}
body.aula-magia .cat[data-slug="recompensas-concursos"]{--cat-art:url("https://i.imgur.com/13AGcsc.png")}
body.aula-magia .cat[data-slug="realidad-virtual"]{--cat-art:url("https://i.imgur.com/xHG9Tyn.png")}
body.aula-magia .cat[data-slug="peliculas"]{--cat-art:url("https://i.imgur.com/LFtA5Jl.png")}
body.aula-magia .cat[data-slug] .cat-nombre,
body.aula-magia .cat[data-slug] .cat-cifra{max-width:64%}
body.aula-magia .cat--l[data-slug] .cat-nombre,
body.aula-magia .cat--l[data-slug] .cat-cifra{max-width:56%}
body.aula-magia .cat--xl[data-slug] .cat-nombre,
body.aula-magia .cat--xl[data-slug] .cat-cifra{max-width:58%}
body.aula-magia .cat[data-slug] .cat-glifo{display:none}

body.aula-magia .fm-premium{
  padding:58px var(--gutter) 72px;color:#fff;
  background:
    radial-gradient(circle at 12% 22%,rgba(255,204,61,.75) 0 2px,transparent 3px),
    radial-gradient(circle at 82% 35%,rgba(255,255,255,.55) 0 1px,transparent 2px),
    linear-gradient(135deg,#06143d,#15105c 68%,#40155f);
  background-size:125px 111px,91px 83px,auto;
}
body.aula-magia .fm-seccion-cabecera--noche h2,body.aula-magia .fm-seccion-cabecera--noche p{color:#fff}
body.aula-magia .fm-premium-grid{max-width:1440px;gap:18px}
body.aula-magia .fm-premium-col{
  padding:clamp(24px,3vw,40px);border:1px solid rgba(255,255,255,.2);border-radius:22px;
  background:rgba(255,255,255,.1);box-shadow:0 18px 38px rgba(0,0,25,.2);backdrop-filter:blur(10px);
}
body.aula-magia .fm-premium-col--premium{
  background:linear-gradient(135deg,rgba(247,42,167,.22),rgba(119,63,229,.19));border-color:rgba(231,128,255,.55);
}
body.aula-magia .fm-premium .bigbtn{background:linear-gradient(135deg,#ff3cb7,#ee1794);border:0;border-radius:999px}
body.aula-magia footer.fm-pie{
  min-height:300px;margin-top:0;padding-top:190px;border-top:1px solid rgba(255,255,255,.12);
  background-color:#040c28;background-image:url("https://i.imgur.com/bNXOzyR.jpeg");
  background-size:cover;background-position:center center;background-repeat:no-repeat;
}
body.aula-magia .fm-pie-contenido{
  position:relative;z-index:1;max-width:1440px;padding:18px 22px;border-radius:16px;
  background:rgba(4,12,40,.78);backdrop-filter:blur(8px);
}

@media (max-width:1100px){
  body.aula-magia .fm-banda{min-height:590px;padding-bottom:86px}
  body.aula-magia .fm-banda-grid{grid-template-columns:minmax(0,1.05fr) minmax(340px,.95fr)}
  body.aula-magia .fm-banda-imagen{margin-right:-12vw;margin-bottom:-73px}
  body.aula-magia .fm-atajos{grid-template-columns:repeat(4,1fr);margin-left:var(--gutter);margin-right:var(--gutter)}
  /* De 12 a 4 columnas: en un portatil o una tablet el ancho por
     columna con 12 se quedaba tan estrecho que la ilustracion y el
     texto de cada tarjeta chocaban. */
  body.aula-magia .fm-mosaico{grid-template-columns:repeat(4,1fr)}
  body.aula-magia .cat,body.aula-magia .cat--l{grid-column:span 2;grid-row:auto}
  body.aula-magia .cat--xl{grid-column:span 4;grid-row:span 2}
}
@media (max-width:760px){
  body.aula-magia .fm-horizonte{height:96px}
  body.aula-magia .fm-banda{min-height:0;padding:30px var(--gutter) 76px}
  body.aula-magia .fm-banda-grid{display:flex;flex-direction:column;gap:8px}
  body.aula-magia .fm-banda-texto{padding-top:0}
  body.aula-magia .fm-banda h1{font-size:clamp(3rem,15vw,4.7rem)}
  body.aula-magia .fm-banda-subt{font-size:clamp(1.35rem,7vw,2.05rem);text-decoration-thickness:4px}
  body.aula-magia .fm-banda-parrafo{font-size:.98rem}
  body.aula-magia .fm-cifras{display:grid;grid-template-columns:1fr 1fr;gap:12px}
  body.aula-magia .fm-buscar{padding:4px}
  body.aula-magia .fm-buscar button{min-width:58px}
  body.aula-magia .fm-botones{display:grid;grid-template-columns:1fr 1fr}
  body.aula-magia .fm-boton{padding:0 13px;font-size:.88rem;text-align:center}
  body.aula-magia .fm-banda-imagen{order:2;margin:-8px auto -69px;width:min(100%,520px)}
  body.aula-magia .fm-banda-imagen img.fran-mago{width:100%}
  body.aula-magia .fm-atajos{grid-template-columns:repeat(2,1fr);margin:-22px 12px 0;padding:8px;border-radius:16px}
  body.aula-magia .fm-atajos a{min-height:94px;font-size:.76rem}
  body.aula-magia .fm-atajos span{font-size:1.65rem}
  body.aula-magia #categorias{padding:36px var(--gutter) 42px}
  body.aula-magia .fm-seccion-cabecera{display:block;margin-bottom:18px}
  body.aula-magia .fm-seccion-cabecera p{margin-top:7px;font-size:.9rem}
  body.aula-magia .fm-mosaico{grid-template-columns:1fr;grid-auto-rows:auto;gap:12px}
  body.aula-magia .cat,body.aula-magia .cat--l,body.aula-magia .cat--xl{grid-column:1;grid-row:auto;min-height:145px}
  body.aula-magia .fm-premium{padding:46px var(--gutter) 56px}
  body.aula-magia .fm-premium-grid{grid-template-columns:1fr}
}

/* ================================================================
   VIDA — animaciones propias sobre las ilustraciones ya existentes
   (mascota, fondos y tarjetas de categoría). Todo con prefijo am- y
   apagado bajo prefers-reduced-motion al final de este bloque; la
   variante estática ya la cubre .mv-flota en movimiento.css.
   ================================================================ */

/* Aura dorada que respira detrás de la mascota */
body.aula-magia .fm-banda-imagen{position:relative}
body.aula-magia .am-aura{
  position:absolute;z-index:-1;left:50%;bottom:6%;width:78%;aspect-ratio:1;translate:-50% 0;
  border-radius:50%;pointer-events:none;
  background:radial-gradient(circle,rgba(255,204,61,.32),rgba(255,204,61,.1) 55%,transparent 72%);
  filter:blur(6px);animation:am-respira 4.5s ease-in-out infinite;
}
@keyframes am-respira{0%,100%{opacity:.7;scale:1}50%{opacity:1;scale:1.09}}

/* La mascota deja de flotar solo en vertical: además se balancea y
   respira un poco de escala, y reacciona al ratón (JS le pone --mx/--my). */
body.aula-magia .fm-banda-imagen img.fran-mago{
  --mx:0px;--my:0px;
  translate:var(--mx) var(--my);
  transition:translate .4s cubic-bezier(.2,.8,.2,1);
}
body.aula-magia .fran-mago.am-vivo{animation:am-mago 7s ease-in-out infinite!important}
@keyframes am-mago{
  0%,100%{transform:translateY(0) rotate(-1.1deg) scale(1)}
  50%{transform:translateY(-10px) rotate(1.3deg) scale(1.015)}
}

/* Motas de polvo mágico que suben alrededor de la mascota (las crea
   el pequeño script al final de index.html; aquí solo su aspecto). */
body.aula-magia .am-chispas{position:absolute;inset:0;z-index:1;overflow:visible;pointer-events:none}
body.aula-magia .am-chispa{
  position:absolute;width:6px;height:6px;background:#ffd166;opacity:0;
  clip-path:polygon(50% 0,63% 38%,100% 50%,63% 62%,50% 100%,37% 62%,0 50%,37% 38%);
  animation:am-sube linear infinite;animation-delay:var(--rd,0s);
  animation-duration:var(--du,6s);left:var(--lx,50%);bottom:var(--ly,10%);
}
@keyframes am-sube{
  0%{opacity:0;transform:translateY(0) scale(.5) rotate(0deg)}
  14%{opacity:1}
  75%{opacity:.8}
  100%{opacity:0;transform:translateY(-150px) scale(1.15) rotate(160deg)}
}

/* Ken Burns muy suave en los dos fondos ilustrados grandes */
body.aula-magia .fm-banda{animation:am-panea 22s ease-in-out infinite alternate}
body.aula-magia footer.fm-pie{animation:am-panea 26s ease-in-out infinite alternate}
@keyframes am-panea{
  0%{background-position:46% center}
  100%{background-position:54% center}
}

/* Tarjetas de categoría: la ilustración se acerca un pelín al pasar
   el ratón, y cada tarjeta guarda un destello ambiental propio. */
body.aula-magia .cat[data-slug]{
  transition:transform .22s ease,box-shadow .22s ease,filter .22s ease,background-size .5s cubic-bezier(.2,.8,.2,1);
}

body.aula-magia .cat[data-slug] .am-destello{
  position:absolute;top:14px;left:16px;width:9px;height:9px;z-index:1;pointer-events:none;
  background:#fff;clip-path:polygon(50% 0,61% 39%,100% 50%,61% 61%,50% 100%,39% 61%,0 50%,39% 39%);
  opacity:0;animation:am-destella 5s ease-in-out infinite;animation-delay:var(--dd,0s);
}
@keyframes am-destella{0%,78%,100%{opacity:0;scale:.6}84%{opacity:.9;scale:1}90%{opacity:0;scale:.6}}
body.aula-magia .fm-mosaico > :nth-child(1) .am-destello{--dd:.2s}
body.aula-magia .fm-mosaico > :nth-child(2) .am-destello{--dd:1.1s}
body.aula-magia .fm-mosaico > :nth-child(3) .am-destello{--dd:2s}
body.aula-magia .fm-mosaico > :nth-child(4) .am-destello{--dd:2.9s}
body.aula-magia .fm-mosaico > :nth-child(5) .am-destello{--dd:.6s}
body.aula-magia .fm-mosaico > :nth-child(6) .am-destello{--dd:1.5s}
body.aula-magia .fm-mosaico > :nth-child(7) .am-destello{--dd:2.4s}
body.aula-magia .fm-mosaico > :nth-child(8) .am-destello{--dd:3.3s}
body.aula-magia .fm-mosaico > :nth-child(9) .am-destello{--dd:.4s}
body.aula-magia .fm-mosaico > :nth-child(10) .am-destello{--dd:1.3s}
body.aula-magia .fm-mosaico > :nth-child(11) .am-destello{--dd:2.2s}
body.aula-magia .fm-mosaico > :nth-child(12) .am-destello{--dd:3.1s}
body.aula-magia .fm-mosaico > :nth-child(13) .am-destello{--dd:.8s}
body.aula-magia .fm-mosaico > :nth-child(14) .am-destello{--dd:1.7s}
body.aula-magia .fm-mosaico > :nth-child(15) .am-destello{--dd:2.6s}
body.aula-magia .fm-mosaico > :nth-child(16) .am-destello{--dd:3.5s}

@media (prefers-reduced-motion:reduce){
  body.aula-magia .am-aura,body.aula-magia .fran-mago.am-vivo,body.aula-magia .am-chispa,
  body.aula-magia .fm-banda,footer.fm-pie,body.aula-magia .am-destello{animation:none}
  body.aula-magia .fm-banda-imagen img.fran-mago{transition:none}
}
