/* =====================================================================
   BASE — reinicio, tipografía, componentes compartidos
   (botones, stickers, notas a mano, resaltes a marcador, barra superior)
   ===================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  position: relative;
  font-family: var(--fuente-base);
  font-size: var(--t-base);
  line-height: 1.55;
  color: var(--tinta);
  background: var(--papel);
  overflow-x: hidden;
  overflow-x: clip;   /* evita el desplazamiento lateral sin romper la barra fija */
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 3px solid var(--naranja-marcador); outline-offset: 3px; border-radius: 6px; }

.contenedor { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.solo-lectores {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.saltar {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--tinta); color: var(--blanco); padding: 10px 16px; border-radius: var(--radio-s);
  transition: top .2s;
}
.saltar:focus { top: 12px; }

/* ---------- Botones ---------- */
.boton {
  --fondo: var(--naranja-cohete);
  display: inline-flex; align-items: center; gap: .6em;
  padding: .95em 1.5em;
  border-radius: 999px;
  background: var(--fondo);
  color: var(--tinta);
  font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em;
  text-decoration: none;
  box-shadow: 0 4px 0 0 var(--tinta);
  transition: transform .25s var(--rebote), box-shadow .25s var(--curva), background-color .2s;
}
.boton:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 7px 0 0 var(--tinta); }
.boton:active { transform: translateY(2px); box-shadow: 0 1px 0 0 var(--tinta); }
.boton svg { width: 1.25em; height: 1.25em; flex: none; transition: transform .35s var(--rebote); }
.boton:hover svg { transform: translate(3px, -3px) rotate(8deg); }
.boton--s { padding: .62em 1.1em; font-size: .92rem; box-shadow: 0 3px 0 0 var(--tinta); }
.boton--s:hover { box-shadow: 0 5px 0 0 var(--tinta); }

/* ---------- Stickers: rótulos inspirados en las etiquetas «MODO AULA» del render ---------- */
.sticker {
  display: inline-block;
  font-family: var(--fuente-rotulo);
  font-size: var(--t-rotulo);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.2;
  padding: .7em 1.05em;
  border-radius: 8px;
  transform: rotate(var(--giro, -2deg));
  box-shadow: var(--sombra-s);
}
.sticker--noche   { background: var(--azul-noche); color: var(--blanco); }
.sticker--blanco  { background: var(--blanco); color: var(--violeta); }
.sticker--violeta { background: var(--violeta); color: var(--blanco); }
.sticker--tinta   { background: var(--tinta); color: var(--blanco); }

/* ---------- Notas escritas a mano (Shantell Sans: letra de marcador) ---------- */
.nota-mano {
  font-family: var(--fuente-mano);
  font-weight: 600;
  font-size: var(--t-mano);
  line-height: 1.15;
}

/* ---------- Resalte «a marcador»: se dibuja al entrar en pantalla ---------- */
.marcador {
  position: relative;
  display: inline-block;
  isolation: isolate;
  transition: color .3s .35s;
}
.marcador::before {
  content: "";
  position: absolute; z-index: -1;
  inset: .08em -.12em .02em -.14em;
  background: var(--naranja-marcador);
  border-radius: .12em .3em .16em .38em / .38em .16em .3em .12em;
  transform: skewX(-6deg) rotate(-1.2deg) scaleX(0);
  transform-origin: left center;
  transition: transform .65s var(--curva);
}
.marcador.activo { color: var(--tinta); }
.marcador.activo::before { transform: skewX(-6deg) rotate(-1.2deg) scaleX(1); }

/* Subrayado de marcador (para títulos sobre fondo claro) */
.subrayado {
  position: relative; display: inline-block; isolation: isolate;
}
.subrayado::after {
  content: "";
  position: absolute; z-index: -1;
  left: -.06em; right: -.08em; bottom: .02em; height: .32em;
  background: var(--rosa-orbita);
  opacity: .9;
  border-radius: .2em .5em .3em .6em;
  transform: rotate(-1deg) scaleX(0);
  transform-origin: left center;
  transition: transform .7s var(--curva) .15s;
}
.subrayado.activo::after { transform: rotate(-1deg) scaleX(1); }

/* Trazos SVG que se dibujan (pathLength="1") */
.trazo { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .8s var(--curva); }
.activo .trazo, .trazo.activo { stroke-dashoffset: 0; }

/* ---------- Aviso Feria Effix ---------- */
.aviso-effix {
  background: var(--tinta);
  color: var(--lila-texto);
  font-size: .82rem;
  text-align: center;
  padding: .55rem var(--gutter);
}
.aviso-effix strong { color: var(--blanco); font-weight: 600; }
.aviso-effix .punto-vivo {
  display: inline-block; width: .55em; height: .55em; margin-right: .5em; border-radius: 50%;
  background: var(--rosa-orbita); vertical-align: .05em;
  box-shadow: 0 0 0 0 rgba(253, 58, 106, .7);
  animation: latido 2s infinite;
}
@keyframes latido { 70% { box-shadow: 0 0 0 .5em rgba(253, 58, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(253, 58, 106, 0); } }

/* ---------- Barra superior ---------- */
.barra {
  position: sticky; top: 0; z-index: 50;
  background: var(--violeta);
  color: var(--blanco);
  transition: box-shadow .3s;
}
.barra__fila {
  display: flex; align-items: center; gap: 24px;
  min-height: 76px;
}
.barra--solida { box-shadow: 0 10px 30px -18px rgba(15, 20, 70, .8); }
.barra__logo { flex: none; }
.barra__logo img { width: 132px; }
.barra__nav { display: flex; gap: 28px; margin-left: auto; }
.barra__nav a {
  text-decoration: none; font-weight: 500; font-size: .95rem; position: relative; padding: 4px 0;
}
.barra__nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 3px; border-radius: 3px;
  background: var(--naranja-marcador); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--curva);
}
.barra__nav a:hover::after { transform: scaleX(1); }
.barra__menu { display: none; }

@media (max-width: 860px) {
  .barra__fila { min-height: 64px; gap: 12px; }
  .barra__logo img { width: 112px; }
  .barra__menu {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 12px; margin-left: 4px;
    background: rgba(255, 255, 255, .14);
  }
  .barra__menu span, .barra__menu span::before, .barra__menu span::after {
    display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; position: relative;
    transition: transform .25s var(--curva), background-color .2s;
  }
  .barra__menu span::before, .barra__menu span::after { content: ""; position: absolute; left: 0; }
  .barra__menu span::before { top: -6px; } .barra__menu span::after { top: 6px; }
  .barra__menu[aria-expanded="true"] span { background: transparent; }
  .barra__menu[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
  .barra__menu[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }
  .barra .boton--s { margin-left: auto; }
  .barra__nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0; margin: 0;
    background: var(--violeta); padding: 8px var(--gutter) 20px;
    box-shadow: 0 20px 30px -20px rgba(15, 20, 70, .8);
    display: none;
  }
  .barra__nav.abierto { display: flex; }
  .barra__nav a { padding: 14px 0; font-size: 1.1rem; border-bottom: 1px solid rgba(255, 255, 255, .15); }
}

/* ---------- Botón flotante de WhatsApp ---------- */
.wa-flotante {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--whatsapp); color: var(--blanco);
  box-shadow: 0 4px 0 0 var(--tinta), var(--sombra);
  transition: transform .3s var(--rebote);
}
.wa-flotante:hover { transform: translateY(-3px) rotate(-6deg); }
.wa-flotante svg { width: 30px; height: 30px; }

/* ---------- Espacios para assets pendientes (A-xx) ----------
   En producción muestran un respaldo digno (texto). Con ?pendientes=1 en la
   URL se resaltan todos, con su código, para revisión interna. */
.ver-pendientes [data-asset] {
  position: relative;
  outline: 2px dashed var(--rosa-orbita);
  outline-offset: 4px;
}
.ver-pendientes [data-asset]::after {
  content: attr(data-asset) " · " attr(data-asset-desc);
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 70;
  width: max-content; max-width: 260px;
  font: 600 11px/1.3 var(--fuente-base); letter-spacing: 0; text-transform: none;
  color: var(--blanco); background: var(--rosa-orbita);
  padding: 4px 8px; border-radius: 6px;
  transform: none;
}

/* ---------- Movimiento reducido: todo queda dibujado y quieto ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
}
