/* Amiku Kids · estilos del sitio.
   Todo es propio: tipografías autoalojadas (SIL OFL 1.1), sin recursos de afuera. Sin estilos en línea (la CSP los bloquea). */

@font-face { font-family: "Sniglet"; src: url("../fonts/sniglet-extrabold.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/nunito-variable.woff2") format("woff2"); font-weight: 200 1000; font-style: normal; font-display: optional; }

:root {
  --cielo: #a6d5e8; --cielo-2: #c9e6f1; --cielo-pie: #add7e7;
  --pasto: #7cb85f; --pasto-oscuro: #1f3d0d; --cafe: #6b4a3a; --crema: #fffaf0; --rosa: #f4a3be;
  --texto: #3f3346; --suave: #5b5062;
  --titulos: "Sniglet", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  --cuerpo: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --radio: 22px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--crema); color: var(--texto); font: 400 18px/1.6 var(--cuerpo); }
img, video { max-width: 100%; height: auto; }
a { color: var(--cafe); }
h1, h2, h3 { font-family: var(--titulos); font-weight: 800; color: var(--cafe); line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: clamp(26px, 4.4vw, 38px); text-align: center; }
h3 { font-size: 20px; }
p { margin: 0 0 .8em; }
.envoltura { max-width: 1120px; margin: 0 auto; padding: 0 18px; }
.solo-lectores { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.saltar { position: absolute; left: 12px; top: -60px; background: var(--crema); color: var(--cafe); padding: 8px 14px; border-radius: 10px; z-index: 10; }
.saltar:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--cafe); outline-offset: 3px; border-radius: 6px; }

/* botones */
.boton { display: inline-block; min-height: 44px; background: var(--pasto); color: var(--pasto-oscuro); font-weight: 800; text-decoration: none; padding: 12px 24px; border-radius: 999px; border: 0; cursor: pointer; font-family: var(--cuerpo); font-size: 17px; line-height: 1.2; transition: transform .15s; }
.boton:hover { transform: translateY(-2px); }
.boton.suave { background: var(--crema); color: var(--cafe); }
.boton.grande { font-size: 20px; padding: 15px 32px; }
.boton.chico { font-size: 15px; padding: 0 16px; min-height: 44px; display: inline-flex; align-items: center; }
.historia .boton.suave { border: 2px solid var(--cafe); padding: 0 14px; }

/* barra */
.barra { background: var(--crema); border-bottom: 1px solid rgba(107, 74, 58, .15); }
.barra-in { display: flex; align-items: center; flex-wrap: wrap; gap: 0 14px; padding: 6px 14px; max-width: 1120px; margin: 0 auto; }
.barra .marca { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--titulos); font-weight: 800; font-size: 24px; color: var(--cafe); }
.barra .marca img { display: block; height: 44px; width: auto; }
.pagina .hoja .fecha { color: var(--suave); font-size: 15px; }
.barra nav { order: 3; flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 0 10px; }
.barra nav a { text-decoration: none; font-weight: 700; padding: 0 6px; min-height: 44px; display: inline-flex; align-items: center; }
.barra nav a:hover { text-decoration: underline; }


.aviso-idioma { font-size: 15px; color: var(--suave); }

/* hindi: la tipografía de la marca no trae devanagari; se ve con la del sistema, con más aire entre líneas */
:lang(hi) body, body:lang(hi) { line-height: 1.8; }
:lang(hi) h1, :lang(hi) h2, :lang(hi) h3, :lang(hi) .lema { line-height: 1.45; letter-spacing: 0; }
:lang(hi) .historia .tipo { text-transform: none; letter-spacing: 0; }

/* hero */
.hero { background: var(--cielo-pie) url("../img/hero-m.webp") center bottom / cover no-repeat; padding: 34px 0 clamp(70px, 14vw, 170px); }
.hero-in { display: grid; gap: 26px; align-items: center; }
.hero-logo { display: block; width: min(460px, 86%); height: auto; margin: 0 auto 6px; }
.hero-texto { text-align: center; }
.lema { font-family: var(--titulos); font-size: clamp(22px, 3.6vw, 30px); color: var(--cafe); margin: 6px 0 2px; }
.lema-2 { margin: 0 0 18px; color: var(--texto); }
.hero .botones { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.avance { margin: 0; text-align: center; }
.avance a { display: block; border-radius: var(--radio); overflow: hidden; border: 5px solid var(--crema); box-shadow: 0 6px 0 rgba(107, 74, 58, .18); background: var(--cielo-2); }
.avance video { display: block; width: 100%; height: auto; }
.avance figcaption { font-size: 15px; margin-top: 8px; color: var(--texto); }
.pausa { margin-top: 8px; background: var(--crema); color: var(--cafe); border: 2px solid var(--cafe); border-radius: 999px; padding: 0 18px; min-height: 44px; font: 700 15px var(--cuerpo); cursor: pointer; }
@media (min-width: 860px) { .hero-in { grid-template-columns: 1.05fr 1fr; } }

/* secciones */
.seccion { padding: 54px 0; }
.seccion > .envoltura > .intro { text-align: center; max-width: 640px; margin: -4px auto 26px; color: var(--texto); }

/* carrusel */
.historias { background: var(--cielo-2); }
.carrusel { position: relative; }
.carrusel-pista { overscroll-behavior-x: contain; display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 18px; padding: 8px 18px 18px; scrollbar-width: thin; }
.historia { flex: 0 0 min(260px, 74vw); scroll-snap-align: start; background: var(--crema); border-radius: var(--radio); overflow: hidden; box-shadow: 0 4px 0 rgba(107, 74, 58, .15); display: flex; flex-direction: column; }
.historia .portada { display: block; }
.historia .portada img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; }
.historia .info { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.historia .tipo { font-size: 14px; font-weight: 800; color: var(--cafe); text-transform: uppercase; letter-spacing: .04em; }
.historia h3 { margin: 0; }
.historia .pregunta { margin: 0; font-weight: 700; }
.historia .detalle { margin: 0; font-size: 15px; color: var(--suave); }
.historia .acciones { margin-top: auto; padding-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.carrusel-mando { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 4px; }
.flecha { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--cafe); background: var(--crema); color: var(--cafe); font: 800 26px/1 var(--cuerpo); cursor: pointer; display: grid; place-items: center; padding: 0 0 4px; }
.flecha:hover { background: #f9d0dd; }
.contador { margin: 0; min-width: 150px; text-align: center; font-weight: 700; color: var(--cafe); }

/* amigos */
.amigos { background: var(--crema); }
.lista-amigos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.amigo { border-radius: var(--radio); padding: 16px 10px 14px; text-align: center; }
.amigo.apa { background: #cfe6fb; } .amigo.mei { background: #f9d0dd; } .amigo.inti { background: #fbe8a6; }
.amigo.kaya { background: #e3d4c6; } .amigo.upepo { background: #e3f0f7; }
.amigo .foto { position: relative; height: 128px; }
.amigo .foto img { position: absolute; left: 50%; top: 0; height: 100%; width: auto; max-width: 100%; transform: translateX(-50%); object-fit: contain; transition: opacity .2s, transform .25s; }
.amigo .foto .otra { opacity: 0; }
.amigo b { display: block; font-family: var(--titulos); font-size: 22px; color: var(--cafe); margin-top: 8px; }
.amigo span { color: var(--texto); font-size: 16px; }
@media (hover: hover) {
  .amigo:hover .foto img { transform: translateX(-50%) rotate(-3deg) scale(1.04); }
  .amigo:hover .foto .otra { opacity: 1; }
  .amigo:hover .foto .base.con-otra { opacity: 0; }
}

/* notas para adultos */
.notas { background: var(--crema) url("../img/fondo-notas.webp") center / cover no-repeat; }
.notas .tarjeta { max-width: 720px; margin: 0 auto; background: rgba(255, 250, 240, .86); border-radius: 28px; padding: 26px clamp(18px, 4vw, 38px); text-align: center; }
.notas .tarjeta p { margin-bottom: 14px; }
.notas .nota-corta { background: var(--crema); border: 2px solid rgba(107, 74, 58, .2); border-radius: 18px; padding: 14px 18px; text-align: left; margin: 18px 0; }
.notas .nota-corta h3 { margin-bottom: 4px; }
.confianza { font-weight: 700; color: var(--cafe); }

/* redes y pie */
.redes { background: var(--cielo-pie); padding: 40px 0 10px; text-align: center; }
.redes .botones { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.paisaje { width: 100%; height: clamp(150px, 21vw, 330px); background: var(--cielo-pie) url("../img/pie.webp") center bottom / cover no-repeat; }
.pie-tarjeta { max-width: 640px; margin: -46px auto 0; position: relative; background: var(--crema); border-radius: 24px 24px 0 0; padding: 18px 22px 30px; text-align: center; font-size: 16px; }
.pie-tarjeta p { margin: 4px 0; }
.pie-tarjeta nav a { display: inline-flex; align-items: center; min-height: 44px; }
.pie-tarjeta nav { display: flex; gap: 0 22px; justify-content: center; flex-wrap: wrap; font-weight: 700; margin-bottom: 6px; }
.pie-tarjeta .sello { color: var(--suave); font-size: 15px; }

/* páginas interiores */
.pagina { background: var(--cielo-2); padding: 34px 0 54px; }
.pagina .hoja { max-width: 760px; margin: 0 auto; background: var(--crema); border-radius: 28px; padding: 28px clamp(18px, 4vw, 40px); }
.pagina .hoja h1 { font-size: clamp(28px, 5vw, 40px); margin-bottom: .3em; }
.pagina .volver { max-width: 760px; margin: 0 auto 14px; }
.contacto-foto { display: block; width: 100%; height: auto; border-radius: 18px; margin: 0 0 18px; aspect-ratio: 4 / 3; object-fit: cover; }
.correo { font-family: var(--cuerpo); font-weight: 800; font-size: clamp(20px, 4.4vw, 28px); color: var(--cafe); word-break: break-word; }
.articulo { max-width: 740px; margin: 0 auto; background: var(--crema) url("../img/fondo-notas.webp") center top / cover no-repeat; border-radius: 28px; padding: 30px clamp(18px, 4vw, 44px) 34px; }
.articulo .antetitulo { text-transform: uppercase; letter-spacing: .06em; font-size: 14px; font-weight: 800; color: var(--cafe); margin: 0 0 4px; }
.articulo h1 { font-size: clamp(28px, 5vw, 42px); margin-bottom: .1em; }
.articulo h2 { text-align: left; font-size: 24px; margin: 1.3em 0 .3em; }
.articulo .bajada { font-size: 20px; font-weight: 700; color: var(--cafe); margin-bottom: 1em; }
.articulo sup a { text-decoration: none; font-weight: 800; padding: 0 1px; }
.articulo .firma { font-family: var(--titulos); color: var(--cafe); margin-top: 1.2em; }
.articulo .fuentes { padding-left: 1.4em; font-size: 16px; }
.articulo .fuentes li { margin-bottom: 8px; overflow-wrap: anywhere; }
.articulo .fuentes-pie { font-size: 15px; color: var(--suave); }
.articulo .casa { background: #eaf3de; border-radius: 16px; padding: 12px 16px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* página 404 */
.pagina-404 { text-align: center; }
.pagina-404 .img-404 { display: block; width: min(260px, 70%); height: auto; margin: 0 auto 6px; }
.pagina-404 h1 { font-size: clamp(44px, 12vw, 72px); margin: 0; }

/* amigos: segunda pose al tocar (celular) además de al pasar el cursor */
.amigo { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.amigo.alterna .foto img { transform: translateX(-50%) rotate(-3deg) scale(1.04); }
.amigo.alterna .foto .otra { opacity: 1; }
.amigo.alterna .foto .base.con-otra { opacity: 0; }

/* buscador y filtros de historias (solo aparece con JavaScript) */
.historia[hidden] { display: none; }
.buscador { padding: 0 18px; margin: 0 auto 14px; max-width: 720px; }
.buscador[hidden] { display: none; }
.campo { position: relative; display: flex; align-items: center; }
.campo .lupa { position: absolute; left: 14px; fill: none; stroke: var(--cafe); stroke-width: 2.4; stroke-linecap: round; pointer-events: none; }
.campo input { width: 100%; min-height: 50px; padding: 0 48px 0 46px; border: 2px solid var(--cafe); border-radius: 999px; background: var(--crema); color: var(--texto); font: 400 18px var(--cuerpo); }
.campo input::placeholder { color: var(--suave); opacity: 1; }
.campo input::-webkit-search-cancel-button { display: none; }
.limpiar { position: absolute; right: 6px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--cafe); font: 800 26px/1 var(--cuerpo); cursor: pointer; display: grid; place-items: center; padding: 0 0 3px; }
.limpiar[hidden] { display: none; }
.filtros { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.chip { min-height: 44px; padding: 0 18px; border: 2px solid var(--cafe); border-radius: 999px; background: var(--crema); color: var(--cafe); font: 800 16px var(--cuerpo); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--cafe); color: var(--crema); }
.resultados { text-align: center; margin: 10px 0 0; min-height: 1.6em; font-weight: 700; color: var(--cafe); }

/* selector de idioma: banderas a la derecha de la barra */
.derecha { order: 2; margin-left: auto; display: flex; align-items: center; gap: 4px; }
.derecha .boton { display: none; }
.idiomas { display: flex; gap: 2px; }
.idiomas a { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; border: 2px solid transparent; }
.idiomas a:hover { border-color: rgba(107, 74, 58, .35); }
.idiomas a[aria-current="true"] { background: var(--cielo-2); border-color: var(--cafe); }
.idiomas img { display: block; width: 28px; height: auto; border-radius: 3px; outline: 1px solid rgba(63, 51, 70, .35); }
@media (min-width: 720px) {
  .barra nav { order: 0; flex: 1 1 auto; justify-content: center; }
  .barra .marca { flex: 0 0 auto; }
  .derecha { margin-left: 0; gap: 10px; }
  .derecha .boton { display: inline-flex; }
}

/* tipografía: la de la marca (Sniglet) solo en títulos grandes; lo chico va en Nunito para que se lea bien («Upepo», «ciclo») */
h3, .amigo b, .articulo h2 { font-family: var(--cuerpo); font-weight: 900; letter-spacing: 0; }
.amigo b { font-size: 23px; }
.articulo h2 { font-size: 24px; }

/* avance: etiqueta y botón sobre fondo crema (antes el texto se perdía sobre el paisaje) */
.avance-pie { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-top: 12px; }
.avance figcaption { margin: 0; background: var(--crema); color: var(--cafe); font-weight: 800; font-size: 15px; padding: 0 16px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 999px; }
.avance .pausa { margin-top: 0; }

/* tarjetas de historias: un solo botón principal y la nota como enlace chico */
.historia .acciones { flex-direction: column; align-items: flex-start; gap: 0; }
.enlace-nota { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; font-size: 15px; font-weight: 700; color: var(--cafe); text-decoration: underline; text-underline-offset: 3px; }

/* «Detrás de cada capítulo»: bloques separados y poco texto */
.notas .envoltura { display: grid; gap: 18px; max-width: 720px; }
.notas .tarjeta p { margin-bottom: 12px; }
.notas .tarjeta h2 { margin-bottom: .35em; }
.guinos { margin: 0; text-align: center; background: rgba(255, 250, 240, .9); border-radius: 18px; padding: 14px 18px; color: var(--texto); }
.garantia { text-align: center; background: rgba(255, 250, 240, .9); border-radius: 18px; padding: 16px 18px 18px; }
.garantia h3 { font-size: 18px; margin: 0 0 10px; color: var(--cafe); }
.insignias { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.insignias li { background: #eaf3de; color: var(--pasto-oscuro); font-weight: 800; font-size: 15px; padding: 7px 14px; border-radius: 999px; }
.insignias li::before { content: "✓ "; }

/* redes: una fila de botones chicos con su ícono */
.redes { padding: 30px 0 8px; }
.redes h2 { font-size: 24px; margin-bottom: 12px; }
.redes-fila { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.boton.red { display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; font-size: 15px; background: var(--crema); color: var(--cafe); }
.boton.red.youtube { background: var(--pasto); color: var(--pasto-oscuro); }
.ico { width: 20px; height: 20px; fill: currentColor; flex: none; }

/* pie: arcoíris que cierra, logo, lema, enlaces y bandera de Chile */
.paisaje { position: relative; overflow: hidden; }
.arcoiris { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); width: min(420px, 88%); height: auto; }
.pie-tarjeta { padding: 20px 22px 28px; }
.pie-logo { display: block; width: 170px; height: auto; margin: 0 auto 6px; }
.lema-pie { font-family: var(--cuerpo); font-weight: 900; font-size: 18px; color: var(--cafe); margin: 4px 0 6px; }
.pie-enlaces { display: flex; gap: 0 22px; justify-content: center; flex-wrap: wrap; font-weight: 700; }
.hecho { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0 0; font-weight: 800; color: var(--suave); }
.hecho img { width: 24px; height: auto; border-radius: 2px; outline: 1px solid rgba(63, 51, 70, .35); }

.pie-enlaces a, .barra nav a { min-width: 44px; justify-content: center; }

@media (min-width: 720px) { .hero { background-image: url("../img/hero.webp"); } }
