/* Sitio de CuentaClaro. Lo copia sitio.py a salida/sitio/recursos/, con los colores de cada show al final. */

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("nunito.24049eb07d.woff2") format("woff2");
}

@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("literata.9adbeac5b1.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --papel: #fbf6ee;
  --papel-hondo: #f3eadc;
  --tarjeta: #fffdf9;
  --tinta: #2a211b;
  --tinta-suave: #6a5a4c;
  --linea: #e6dac8;
  --sombra: 0 1px 2px rgb(70 45 20 / 0.06), 0 10px 30px -12px rgb(70 45 20 / 0.18);
  --radio: 16px;
  --ui: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --lectura: "Literata", "Iowan Old Style", Georgia, serif;
  --ancho: 68rem;
  --ancho-lectura: 37rem;
  /* --acento, --acento-fuerte y --acento-texto los agrega sitio.py al final, para la marca y para cada show. */
}

@media (prefers-color-scheme: dark) {
  :root {
    --papel: #17130f;
    --papel-hondo: #110e0b;
    --tarjeta: #211b16;
    --tinta: #efe6d8;
    --tinta-suave: #b6a794;
    --linea: #3a3029;
    --sombra: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px -12px rgb(0 0 0 / 0.6);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--ui);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

:focus-visible {
  outline: 3px solid var(--acento-texto);
  outline-offset: 3px;
  border-radius: 6px;
}

.contenedor {
  width: 100%;
  max-width: var(--ancho);
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 40rem) {
  .contenedor {
    padding-inline: 1.5rem;
  }
}

.saltar {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--tarjeta);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  z-index: 50;
}

.saltar:focus {
  left: 0.5rem;
}

/* ---------- cabecera y pie ---------- */

main {
  flex: 1;
}

.sitio-cabecera {
  padding-block: 1.1rem;
}

.marca {
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
}

.sitio-pie {
  margin-top: 5rem;
  padding-block: 2.5rem 3rem;
  background: var(--papel-hondo);
  color: var(--tinta-suave);
  font-size: 0.95rem;
}

.sitio-pie .contenedor {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 48rem) {
  .sitio-pie .contenedor {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.sitio-pie h2 {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tinta);
}

.sitio-pie p,
.sitio-pie ul {
  margin: 0;
}

.sitio-pie ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

.sitio-pie a {
  text-decoration-color: var(--linea);
  text-underline-offset: 0.2em;
}

.sitio-pie a:hover {
  color: var(--tinta);
}

/* ---------- piezas comunes ---------- */

.antetitulo {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--acento-texto);
}

.seccion {
  margin-top: 4rem;
}

.seccion > h2 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.8rem);
}

.boton {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  background: var(--acento-fuerte);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.boton:hover {
  transform: translateY(-1px);
  box-shadow: var(--sombra);
}

.boton svg {
  width: 1.1em;
  height: 1.1em;
  fill: currentColor;
}

.plataformas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plataformas a {
  display: inline-block;
  padding: 0.45rem 0.95rem;
  border: 1.5px solid var(--linea);
  border-radius: 999px;
  background: var(--tarjeta);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
}

.plataformas a:hover {
  border-color: var(--acento-texto);
  color: var(--acento-texto);
}

.datos {
  margin: 0;
  color: var(--tinta-suave);
  font-size: 0.95rem;
}

.datos span + span::before {
  content: "·";
  margin-inline: 0.45em;
}

/* ---------- inicio ---------- */

.portada-inicio {
  padding-block: 2.5rem 1rem;
  text-align: center;
}

.portada-inicio h1 {
  max-width: 18ch;
  margin: 0 auto;
  font-size: clamp(2.2rem, 1.4rem + 3.6vw, 3.9rem);
  letter-spacing: -0.025em;
}

.portada-inicio .presentacion {
  max-width: 38rem;
  margin: 1.25rem auto 1.75rem;
  font-size: 1.15rem;
  color: var(--tinta-suave);
}

.shows {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 40rem) {
  .shows {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

@media (min-width: 64rem) {
  .shows {
    grid-template-columns: repeat(4, 1fr);
  }
}

.show-tarjeta {
  height: 100%;
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  align-items: start;
  align-content: start;
  padding: 0.75rem;
  border-radius: var(--radio);
  background: var(--tarjeta);
  box-shadow: var(--sombra);
  text-decoration: none;
  transition: transform 0.2s ease;
}

.show-tarjeta:hover {
  transform: translateY(-3px);
}

.show-tarjeta img {
  border-radius: 10px;
  aspect-ratio: 1;
  object-fit: cover;
}

.show-tarjeta h3 {
  margin: 0.2rem 0 0.35rem;
  font-size: 1.2rem;
}

.show-tarjeta p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--tinta-suave);
}

.show-tarjeta .cuantos {
  margin-top: 0.5rem;
  font-weight: 800;
  color: var(--acento-texto);
}

@media (min-width: 64rem) {
  .show-tarjeta {
    grid-template-columns: 1fr;
    padding: 0.75rem 0.75rem 1.1rem;
  }

  .show-tarjeta div {
    padding-inline: 0.35rem;
  }
}

.como {
  display: grid;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 48rem) {
  .como {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

.como h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.como p {
  margin: 0;
  color: var(--tinta-suave);
}

/* ---------- listas de cuentos ---------- */

.cuentos {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 48rem) {
  .cuentos.en-dos {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

.cuento-tarjeta {
  height: 100%;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem;
  border-radius: var(--radio);
  background: var(--tarjeta);
  border: 1px solid var(--linea);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.cuento-tarjeta:hover {
  border-color: var(--acento-texto);
  transform: translateY(-2px);
}

.cuento-tarjeta img {
  flex: none;
  width: 4.5rem;
  border-radius: 8px;
}

.cuento-tarjeta h3 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.cuento-tarjeta .resumen {
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
  color: var(--tinta-suave);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vacio {
  color: var(--tinta-suave);
}

/* ---------- página de un show ---------- */

.show-cabecera {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  padding-top: 1rem;
}

@media (min-width: 44rem) {
  .show-cabecera {
    grid-template-columns: 17rem 1fr;
    gap: 2.5rem;
  }
}

.show-cabecera img {
  width: min(17rem, 70vw);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}

.show-cabecera h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
}

.show-cabecera .descripcion {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  color: var(--tinta-suave);
  max-width: 36rem;
}

.escuchalo {
  margin: 0 0 0.6rem;
  font-weight: 800;
  font-size: 0.95rem;
}

.rss {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: var(--tinta-suave);
  overflow-wrap: anywhere;
}

/* ---------- página de un cuento ---------- */

.migas {
  margin: 0.5rem 0 1.5rem;
  font-size: 0.92rem;
  color: var(--tinta-suave);
}

.migas a {
  text-decoration-color: var(--linea);
  text-underline-offset: 0.2em;
}

.migas span {
  margin-inline: 0.4em;
}

.lectura {
  max-width: var(--ancho-lectura);
  margin-inline: auto;
}

.cuento-cabecera {
  display: flex;
  gap: 1.1rem;
  align-items: center;
}

.cuento-cabecera img {
  flex: none;
  width: 5.5rem;
  border-radius: 12px;
  box-shadow: var(--sombra);
}

.cuento-cabecera h1 {
  margin: 0 0 0.3rem;
  font-size: clamp(1.9rem, 1.4rem + 2vw, 2.7rem);
}

.cuento-cabecera .autor {
  margin: 0 0 0.2rem;
  font-weight: 700;
  font-size: 1.05rem;
}

.lectura > .resumen {
  margin: 1.5rem 0;
  font-size: 1.1rem;
  color: var(--tinta-suave);
}

/* El reproductor queda a la vista mientras se lee el cuento. */
.reproductor {
  position: sticky;
  top: 0.6rem;
  z-index: 10;
  margin: 1.5rem 0 2.5rem;
}

.reproductor audio {
  width: 100%;
}

.controles {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem 0.5rem 0.5rem;
  border-radius: 999px;
  background: var(--tarjeta);
  border: 1px solid var(--linea);
  box-shadow: var(--sombra);
}

.controles[hidden] {
  display: none;
}

.controles button {
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  background: none;
}

.controles .play {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: var(--acento-fuerte);
  color: #fff;
  transition: transform 0.15s ease;
}

.controles .play:hover {
  transform: scale(1.05);
}

.controles .play svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
}

.controles .play .pausa,
.reproductor.sonando .play .triangulo {
  display: none;
}

.reproductor.sonando .play .pausa {
  display: block;
}

.controles .salto {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  color: var(--tinta-suave);
}

.controles .salto:hover {
  color: var(--tinta);
  background: var(--papel-hondo);
}

.controles .salto svg {
  width: 1.6rem;
  height: 1.6rem;
}

.pista {
  flex: 1;
  min-width: 0;
}

.pista .titulo-pista {
  margin: 0;
  font-weight: 800;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.barra {
  width: 100%;
  margin: 0.15rem 0 0;
  accent-color: var(--acento-fuerte);
  cursor: pointer;
}

.tiempos {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--tinta-suave);
  font-variant-numeric: tabular-nums;
}

.texto {
  font-family: var(--lectura);
  font-size: 1.2rem;
  line-height: 1.75;
}

.texto p {
  margin: 0 0 1.1em;
  hyphens: auto;
}

.texto h2 {
  margin: 2.2em 0 0.8em;
  font-family: var(--ui);
  font-size: 1.35rem;
}

.texto h2:first-child {
  margin-top: 0;
}

.texto .escena {
  border: 0;
  margin: 2.2em 0;
  text-align: center;
  color: var(--acento-texto);
}

.texto .escena::after {
  content: "✦   ✦   ✦";
  white-space: pre;
  font-size: 0.8rem;
}

.ficha {
  margin-top: 3rem;
  padding: 1.5rem;
  border-radius: var(--radio);
  background: var(--papel-hondo);
  font-size: 0.97rem;
  color: var(--tinta-suave);
}

.ficha p {
  margin: 0 0 0.75rem;
}

.ficha a {
  color: var(--tinta);
  text-underline-offset: 0.2em;
}

.ficha .escuchalo {
  margin-top: 1.25rem;
  color: var(--tinta);
}

/* ---------- páginas sueltas ---------- */

.pagina-simple {
  max-width: var(--ancho-lectura);
  margin-inline: auto;
  padding-top: 1rem;
}

.pagina-simple h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem);
  margin: 0 0 1.25rem;
}

.pagina-simple p {
  margin: 0 0 1em;
}

.pagina-simple a {
  color: var(--acento-texto);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* Colores de la marca y de cada show. Los agrega sitio.py desde shows.json. */

:root {
  --acento: #9a4a3a;
  --acento-fuerte: #9a4a3a;
  --acento-texto: #9a4a3a;
}

.show-cuentos-clasicos {
  --acento: #8e3b46;
  --acento-fuerte: #8e3b46;
  --acento-texto: #8e3b46;
}

.show-cuentos-del-mundo {
  --acento: #2f5d8c;
  --acento-fuerte: #2f5d8c;
  --acento-texto: #2f5d8c;
}

.show-cuentos-en-nuestra-lengua {
  --acento: #2e6b4f;
  --acento-fuerte: #2e6b4f;
  --acento-texto: #2e6b4f;
}

.show-fabulas {
  --acento: #b0702a;
  --acento-fuerte: #a56927;
  --acento-texto: #945e23;
}

@media (prefers-color-scheme: dark) {
  :root {
    --acento-texto: #b27569;
  }
  .show-cuentos-clasicos {
    --acento-texto: #b0767e;
  }
  .show-cuentos-del-mundo {
    --acento-texto: #6587aa;
  }
  .show-cuentos-en-nuestra-lengua {
    --acento-texto: #608f79;
  }
  .show-fabulas {
    --acento-texto: #b37633;
  }
}
