/* Cuaderno de Ansel Arenas — hoja de estilo compartida para todos los poemas */

:root {
  --bg: #eae7db;
  --surface: #f6f4e9;
  --surface-line: rgba(43, 42, 34, 0.12);
  --ink: #2b2a22;
  --ink-soft: #5c5a4c;
  --ink-faint: #8a8778;
  --accent: #4b5d3a;
  --accent-soft: #6f8257;
  --accent-wash: rgba(75, 93, 58, 0.1);
  --shadow: rgba(43, 42, 34, 0.16);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1c16;
    --surface: #22241d;
    --surface-line: rgba(232, 230, 217, 0.12);
    --ink: #e9e7da;
    --ink-soft: #aba894;
    --ink-faint: #7c7a68;
    --accent: #9cb380;
    --accent-soft: #7f9968;
    --accent-wash: rgba(156, 179, 128, 0.12);
    --shadow: rgba(0, 0, 0, 0.4);
  }
}

:root[data-theme="dark"] {
  --bg: #1a1c16;
  --surface: #22241d;
  --surface-line: rgba(232, 230, 217, 0.12);
  --ink: #e9e7da;
  --ink-soft: #aba894;
  --ink-faint: #7c7a68;
  --accent: #9cb380;
  --accent-soft: #7f9968;
  --accent-wash: rgba(156, 179, 128, 0.12);
  --shadow: rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.pagina {
  max-width: 720px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 6rem;
}

.hoja {
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: 3px;
  box-shadow: 0 24px 48px -32px var(--shadow);
  padding: 3rem 3rem 3.5rem;
}

@media (max-width: 640px) {
  .pagina {
    padding: 2.5rem 0.9rem 4rem;
  }
  .hoja {
    padding: 2rem 1.4rem 2.4rem;
  }
}

.categoria {
  font-family: "Public Sans", "Segoe UI", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem;
}

.categoria a {
  color: inherit;
  text-decoration: none;
}

.categoria a:hover {
  text-decoration: underline;
}

h1.titulo {
  font-family: "Fraunces", Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(1.9rem, 1.5rem + 1.8vw, 2.7rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0 0 1.4rem;
  color: var(--ink);
}

.metadatos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1.15rem;
  font-family: "Public Sans", "Segoe UI", sans-serif;
  font-size: 0.86rem;
  color: var(--ink-soft);
  padding-bottom: 1.6rem;
  margin-bottom: 2.2rem;
  border-bottom: 1px solid var(--surface-line);
}

.metadatos .autor {
  color: var(--ink);
  font-weight: 600;
}

.metadatos .item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.metadatos svg {
  width: 15px;
  height: 15px;
  stroke: var(--ink-faint);
  fill: none;
  stroke-width: 1.6;
  flex-shrink: 0;
}

.poema {
  font-size: 1.14rem;
  line-height: 1.85;
  color: var(--ink);
}

.poema .estrofa {
  margin-bottom: 2rem;
}

.poema .estrofa:last-child {
  margin-bottom: 0;
}

.poema p {
  margin: 0;
}

.ornamento {
  display: flex;
  justify-content: center;
  margin: 2.6rem 0 0.4rem;
  color: var(--accent-soft);
  opacity: 0.75;
}

.ornamento svg {
  width: 28px;
  height: 28px;
}

.pie {
  margin-top: 2.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--surface-line);
  font-family: "Public Sans", "Segoe UI", sans-serif;
  font-size: 0.78rem;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pie a {
  color: var(--ink-faint);
}

@media (prefers-reduced-motion: no-preference) {
  .hoja {
    animation: aparecer 0.5s ease-out;
  }
}

@keyframes aparecer {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==== Enlace de vuelta al listado (páginas de poema) ==== */

.volver {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: "Public Sans", "Segoe UI", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  text-decoration: none;
  margin-bottom: 1.6rem;
}

.volver:hover {
  color: var(--accent);
}

/* ==== Navegación anterior / siguiente (páginas de poema) ==== */

.nav-poema {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 2.8rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--surface-line);
}

.nav-boton {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--surface-line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  font-family: "Public Sans", "Segoe UI", sans-serif;
  transition: border-color 0.15s ease, background 0.15s ease;
  max-width: 48%;
}

.nav-boton:hover {
  border-color: var(--accent-soft);
  background: var(--accent-wash);
}

.nav-boton--siguiente {
  text-align: right;
  margin-left: auto;
}

.nav-boton-etiqueta {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.nav-boton-titulo {
  font-family: "Fraunces", Georgia, serif;
  font-size: 0.95rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ==== Listado completo de poemas ==== */

.contenedor-listado {
  max-width: 1080px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

@media (max-width: 640px) {
  .contenedor-listado {
    padding: 2.5rem 0.9rem 4rem;
  }
}

.listado-cabecera {
  text-align: center;
  margin-bottom: 3rem;
}

.listado-titulo {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.5rem);
  margin: 0 0 0.6rem;
}

.listado-subtitulo {
  font-family: "Public Sans", "Segoe UI", sans-serif;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.grid-poemas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem;
}

.tarjeta-poema {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.tarjeta-poema:hover {
  border-color: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -24px var(--shadow);
}

.tarjeta-categoria {
  font-family: "Public Sans", "Segoe UI", sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.55rem;
}

.tarjeta-titulo {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.3;
  margin: 0 0 0.55rem;
}

.tarjeta-extracto {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 1rem;
  flex-grow: 1;
}

.tarjeta-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  font-family: "Public Sans", "Segoe UI", sans-serif;
  font-size: 0.74rem;
  color: var(--ink-faint);
  padding-top: 0.9rem;
  border-top: 1px solid var(--surface-line);
}

.tarjeta-meta .item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.tarjeta-meta svg {
  width: 13px;
  height: 13px;
  stroke: var(--ink-faint);
  fill: none;
  stroke-width: 1.6;
  flex-shrink: 0;
}
