/* Web de Cristina B. Rabanedo — estilos */

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fuentes/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fuentes/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fuentes/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Grandstander";
  src: url("../fuentes/grandstander-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Grandstander";
  src: url("../fuentes/grandstander-latin-800-normal.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}

:root {
  --tinta: #2b2152;        /* texto: violeta noche */
  --tinta-suave: #4f4772;
  --papel: #ffffff;
  --mauricio: #6d3f96;     /* enlaces y botones */
  --mauricio-claro: #efe6f7;
  --cielo: #e3f1f9;
  --sol: #fff2c6;
  --piel: #f7ece2;
  --gris: #f1f0f4;
  --hierba: #6f9f3f;
  --foco: #f2b705;
  --radio: 18px;
  --ancho: 68rem;
  --texto: 38rem;
  --titulo: "Grandstander", "Comic Sans MS", system-ui, sans-serif;
  --cuerpo: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--cuerpo);
  font-size: 1.125rem;
  line-height: 1.6;
}

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

h1, h2, h3 {
  font-family: var(--titulo);
  font-weight: 800;
  line-height: 1.12;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); }
h2 { font-size: clamp(2rem, 4.5vw, 2.9rem); }
h3 { font-size: clamp(1.5rem, 3vw, 1.9rem); }
p { margin: 0 0 1em; }

a { color: var(--mauricio); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .16em; }

:focus-visible {
  outline: 3px solid var(--foco);
  outline-offset: 3px;
  border-radius: 4px;
}

.saltar {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--tinta); color: #fff; padding: .6rem 1rem; border-radius: 8px;
}
.saltar:focus { top: 1rem; }

.contenedor { width: min(100% - 2rem, var(--ancho)); margin-inline: auto; }
.estrecho { max-width: var(--texto); }

/* Cabecera */
.cabecera { border-bottom: 1px solid var(--gris); background: var(--papel); }
.cabecera .contenedor {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem 1.5rem; padding-block: .9rem;
}
.marca {
  font-family: var(--titulo); font-weight: 800; font-size: 1.45rem;
  color: var(--tinta); text-decoration: none;
}
.menu ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0; padding: 0; }
.menu a { color: var(--tinta); text-decoration: none; font-weight: 700; padding-block: .3rem; display: inline-block; }
.menu a:hover, .menu a[aria-current="page"] { color: var(--mauricio); text-decoration: underline; text-decoration-thickness: .14em; }

/* Botones */
.boton {
  display: inline-block; font-weight: 700; text-decoration: none;
  padding: .75rem 1.3rem; border-radius: 999px; border: 2px solid var(--mauricio);
  background: var(--mauricio); color: #fff; line-height: 1.2;
}
.boton:hover { background: #57307a; border-color: #57307a; }
.boton.secundario { background: transparent; color: var(--mauricio); }
.boton.secundario:hover { background: var(--mauricio-claro); }
.botones { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* Portada */
.portada { padding-block: clamp(2.5rem, 6vw, 4.5rem) 0; }
.portada .contenedor {
  display: grid; gap: 2.5rem; align-items: center;
  grid-template-columns: 1.15fr .85fr;
}
.portada h1 { margin-bottom: .35em; }
.portada .entradilla { font-size: clamp(1.2rem, 2.2vw, 1.4rem); max-width: 30rem; color: var(--tinta-suave); }
.portada figure { margin: 0; }
.portada figure img { border-radius: 46% 54% 42% 58% / 52% 44% 56% 48%; aspect-ratio: 1; object-fit: cover; }

/* La estantería: portadas de pie sobre el césped */
.estanteria { margin-top: clamp(2rem, 5vw, 3.5rem); }
.estanteria ul {
  list-style: none; margin: 0; padding: 0 1rem;
  display: flex; justify-content: center; align-items: flex-end;
  gap: clamp(.6rem, 2.5vw, 2rem); flex-wrap: nowrap;
}
.estanteria li { flex: 0 1 9.5rem; }
.estanteria a { display: block; border-radius: 6px; }
.estanteria img {
  width: 100%; border-radius: 4px 6px 6px 4px;
  box-shadow: 0 1px 0 rgba(43, 33, 82, .15), 6px 8px 0 -2px rgba(43, 33, 82, .12);
  transition: transform .2s ease;
}
.estanteria a:hover img, .estanteria a:focus-visible img { transform: translateY(-8px) rotate(-1.5deg); }
@media (prefers-reduced-motion: reduce) { .estanteria img { transition: none; } }
.cesped { display: block; width: 100%; height: clamp(40px, 7vw, 96px); margin-top: -18px; }
.estanteria ul { position: relative; z-index: 1; }

/* Libros */
.seccion { padding-block: clamp(3rem, 7vw, 5rem); }
.seccion > .contenedor > h2 { margin-bottom: .3em; }
.seccion .intro { color: var(--tinta-suave); max-width: var(--texto); margin-bottom: 2.2rem; }

.libro {
  display: grid; grid-template-columns: minmax(9rem, 15rem) 1fr; gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start; padding: clamp(1.5rem, 4vw, 2.75rem); border-radius: var(--radio);
  margin-bottom: 1.5rem; scroll-margin-top: 1rem;
}
.libro .cubierta img { width: 100%; border-radius: 4px; box-shadow: 6px 8px 0 -2px rgba(43, 33, 82, .14); }
.libro h3 { margin-bottom: .25em; }
.libro .datos { margin: 0 0 1rem; color: var(--tinta-suave); font-size: 1rem; }
.libro .datos dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.libro .datos dd { display: inline; margin: 0; }
.libro .datos dd + dt + dd::before { content: " / "; }
.libro .texto { max-width: var(--texto); }
.libro .boton { margin-top: .4rem; }
.libro--viaje { background: var(--cielo); }
.libro--visibles { background: var(--sol); }
.libro--mauricio { background: var(--mauricio-claro); }
.libro--fecho { background: var(--gris); }
.libro--noches { background: var(--piel); }

.trailer { margin: 1.6rem 0 0; max-width: 36rem; }
.trailer video { width: 100%; border-radius: 12px; background: #000; }
.trailer figcaption { font-size: 1rem; color: var(--tinta-suave); margin-top: .5rem; }

/* Presentaciones (avance en portada) */
.avance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.8rem; }
.avance img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; }

/* Galería */
.galeria { list-style: none; margin: 0; padding: 0; columns: 3 16rem; column-gap: 1rem; }
.galeria li { break-inside: avoid; margin-bottom: 1rem; }
.galeria a { display: block; border-radius: 12px; }
.galeria img { width: 100%; border-radius: 12px; }

.visor {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh; margin: 0;
}
.visor::backdrop { background: rgba(23, 17, 44, .92); }
.visor[open] { display: grid; place-items: center; }
.visor img { max-width: min(92vw, 1100px); max-height: 82vh; width: auto; border-radius: 8px; }
.visor .controles { display: flex; gap: .75rem; justify-content: center; margin-top: 1rem; }
.visor button {
  font: inherit; font-weight: 700; color: var(--tinta); background: #fff; border: 0;
  border-radius: 999px; padding: .6rem 1.1rem; cursor: pointer;
}
.visor .marco { display: flex; flex-direction: column; align-items: center; padding: 1rem; }
.visor p { color: #fff; margin: .75rem 0 0; text-align: center; max-width: 40rem; }

/* Sobre mí */
.sobre .contenedor { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.sobre figure { margin: 0; position: sticky; top: 1.5rem; }
.sobre figure img { border-radius: var(--radio); }
.linea { list-style: none; margin: 0; padding: 0; border-left: 3px solid var(--mauricio-claro); }
.linea li { position: relative; padding: 0 0 1.75rem 1.75rem; }
.linea li::before {
  content: ""; position: absolute; left: -.6rem; top: .55rem; width: .95rem; height: .95rem;
  border-radius: 50%; background: var(--papel); border: 3px solid var(--mauricio);
}
.linea h2 { font-size: 1.6rem; margin-bottom: .3em; color: var(--mauricio); }

/* Contacto */
.contacto { background: var(--cielo); }
.contacto .contenedor { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); }
.formulario { display: grid; gap: 1.1rem; }
.campo label, .campo legend { display: block; font-weight: 700; margin-bottom: .3rem; }
.campo .ayuda { font-size: .95rem; color: var(--tinta-suave); margin: -.15rem 0 .4rem; }
.campo input[type="text"], .campo input[type="email"], .campo select, .campo textarea {
  width: 100%; font: inherit; color: var(--tinta); background: #fff;
  border: 2px solid #9a93b8; border-radius: 10px; padding: .65rem .8rem;
}
.campo textarea { min-height: 9rem; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--mauricio); }
.casilla { display: flex; gap: .65rem; align-items: flex-start; }
.casilla input { width: 1.3rem; height: 1.3rem; margin-top: .2rem; accent-color: var(--mauricio); flex: none; }
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.formulario button { justify-self: start; font-family: inherit; font-size: inherit; cursor: pointer; }
.casilla label { font-weight: 400; }

.aviso { border-radius: 12px; padding: 1rem 1.2rem; font-weight: 700; }
.aviso.ok { background: #e2f3d6; }
.aviso.error { background: #fde3e3; }

/* Pie */
.pie { background: var(--tinta); color: #fff; padding-block: 2.5rem; }
.pie a { color: #fff; }
.pie .contenedor { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; justify-content: space-between; align-items: flex-start; }
.pie ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.pie p { margin: 0; }
.pie .marca { color: #fff; }

/* Páginas de texto (aviso legal, 404, gracias) */
.texto-legal h2 { font-size: 1.6rem; margin-top: 1.6em; }

/* Móvil */
@media (max-width: 760px) {
  body { font-size: 1.0625rem; }
  .portada .contenedor, .sobre .contenedor, .contacto .contenedor { grid-template-columns: 1fr; }
  .portada figure { max-width: 20rem; }
  .sobre figure { position: static; max-width: 22rem; }
  .libro { grid-template-columns: 1fr; }
  .libro .cubierta { max-width: 13rem; }
  .estanteria ul { gap: .45rem; padding: 0 .5rem; }
  .avance { grid-template-columns: repeat(2, 1fr); }
  .avance li:nth-child(3) { display: none; }
}

/* Utilidades */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.avance { list-style: none; padding: 0; }
