/* =========================================================
   ALEGSA Literatura
   Archivo: /Literatura/literatura.css
   Estilo editorial, literario, elegante y responsive
   ========================================================= */

:root {
  --bg: #f5efe6;
  --bg-soft: #fbf7f1;
  --paper: rgba(255, 251, 246, 0.96);
  --paper-2: rgba(250, 244, 236, 0.96);
  --surface: #fffdfa;
  --surface-soft: #f8f1e7;
  --ink: #241b16;
  --ink-soft: #4f4339;
  --muted: #7b6b5f;
  --line: #dccdbd;
  --line-strong: #c8b49f;

  --primary: #6b2d33;
  --primary-2: #512127;
  --primary-3: #8a3b45;
  --accent: #b78a3e;
  --accent-2: #d8b26b;
  --accent-soft: #f2e3c1;

  --success: #166b4e;
  --warning: #9a5f16;
  --danger: #a33434;
  --info: #3e5d8f;

  --shadow-sm: 0 6px 18px rgba(36, 27, 22, 0.06);
  --shadow: 0 16px 38px rgba(36, 27, 22, 0.10);
  --shadow-lg: 0 24px 64px rgba(36, 27, 22, 0.14);

  --radius-sm: 14px;
  --radius: 22px;
  --radius-lg: 30px;

  --container: 1160px;

  --font-ui: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: Georgia, "Times New Roman", Times, serif;
  --font-reading: Georgia, "Times New Roman", Times, serif;

  --topbar-h: 78px;
}

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

html {
  scroll-behavior: smooth;
}

html:focus-within {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.6;
  background:
    radial-gradient(circle at top right, rgba(183, 138, 62, 0.11), transparent 20%),
    radial-gradient(circle at left 15%, rgba(107, 45, 51, 0.08), transparent 22%),
    linear-gradient(180deg, #fbf7f2 0%, #f3ece1 45%, #efe6da 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection {
  background: rgba(183, 138, 62, 0.22);
  color: var(--ink);
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

a:hover {
  color: var(--primary-2);
  text-decoration: underline;
}

p {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.15rem;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 .65rem;
  color: var(--ink);
  line-height: 1.12;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.01em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

h3 {
  font-size: 1.38rem;
}

h4 {
  font-size: 1.12rem;
}

[id] {
  scroll-margin-top: calc(var(--topbar-h) + 1rem);
}

.container {
  width: min(var(--container), calc(100% - 1.4rem));
  margin-inline: auto;
}

/* =========================================================
   TOPBAR / NAVEGACIÓN
   ========================================================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background:
    linear-gradient(180deg, rgba(251, 247, 241, 0.94), rgba(248, 242, 234, 0.88));
  border-bottom: 1px solid rgba(200, 180, 159, 0.65);
  box-shadow: 0 8px 24px rgba(36, 27, 22, 0.05);
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(183, 138, 62, 0.55), transparent);
}

.topbar-inner {
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 0;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: .16rem;
  text-decoration: none;
  min-width: max-content;
}

.brand:hover {
  text-decoration: none;
}

.brand-kicker {
  color: var(--accent);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.brand-title {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.46rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .42rem;
  flex-wrap: wrap;
}

.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .48rem;
  padding: .62rem .86rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--ink-soft);
  background: transparent;
  font-size: .95rem;
  font-weight: 650;
  white-space: nowrap;
  text-decoration: none;
}

.nav a::before {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.08rem;
  opacity: .82;
  font-size: .92rem;
  line-height: 1;
  transform: translateY(-.02em);
}

/* Compatibilidad actual + futura con clases nuevas */
.nav a.nav-home::before,
.nav a:nth-child(1)::before {
  content: "⌂";
}

.nav a.nav-cuentos::before,
.nav a:nth-child(2)::before {
  content: "✦";
}

.nav a.nav-poesias::before,
.nav a:nth-child(3)::before {
  content: "❦";
}

.nav a.nav-ensayos::before,
.nav a:nth-child(4)::before {
  content: "✒";
}

.nav a.nav-autores::before,
.nav a:nth-child(5)::before {
  content: "◌";
}

.nav a.nav-novedades::before {
  content: "◷";
}

.nav a.nav-colaborar::before,
.nav a:nth-child(6)::before {
  content: "✍";
}

.nav a.nav-foro::before,
.nav a:nth-child(7)::before {
  content: "☰";
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--primary-2);
  background: rgba(255, 253, 250, 0.92);
  border-color: rgba(200, 180, 159, 0.7);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.nav a[aria-current="page"] {
  background:
    linear-gradient(180deg, rgba(255, 251, 245, 0.96), rgba(248, 238, 226, 0.94));
  color: var(--primary-2);
}

.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset: auto 16px 8px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--primary-3));
}

/* =========================================================
   MAIN
   ========================================================= */

main {
  flex: 1 0 auto;
  padding: 1.25rem 0 2.5rem;
}

/* =========================================================
   BLOQUES BASE
   ========================================================= */

.card,
.flash,
.empty-state,
.hero {
  position: relative;
  background:
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  border: 1px solid rgba(220, 205, 189, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card,
.flash,
.empty-state {
  padding: 1.15rem 1.2rem;
}

.card {
  overflow: hidden;
}

.card::before,
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(130deg, rgba(255,255,255,0.22), transparent 32%);
  opacity: .7;
}

.card:hover {
  border-color: rgba(183, 138, 62, 0.55);
  box-shadow: 0 20px 44px rgba(36, 27, 22, 0.12);
}

/* =========================================================
   HERO
   ========================================================= */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, .85fr);
  gap: 1.1rem;
  padding: 1.35rem;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(216, 178, 107, 0.16), transparent 20%),
    linear-gradient(135deg, #2a1f1b 0%, #4b2830 38%, #6b2d33 68%, #8a5d2f 100%);
  border-color: rgba(123, 76, 48, 0.48);
  box-shadow: var(--shadow-lg);
}

.hero::after {
  content: "“";
  position: absolute;
  right: 1rem;
  bottom: -1.2rem;
  font-family: var(--font-display);
  font-size: clamp(8rem, 16vw, 13rem);
  line-height: 1;
  color: rgba(255,255,255,0.06);
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h2 {
  margin: .2rem 0 .75rem;
  color: #fff;
  font-size: clamp(2.15rem, 4.7vw, 3.4rem);
  line-height: 1.02;
}

.hero p {
  color: rgba(255, 245, 236, 0.90);
  max-width: 62ch;
}

.hero .meta,
.hero .help {
  color: rgba(255, 241, 226, 0.76);
}

.hero .actions {
  margin-top: 1rem;
}

.hero-links {
  align-self: start;
  background: rgba(255, 247, 238, 0.10);
  border: 1px solid rgba(255, 241, 226, 0.16);
  border-radius: calc(var(--radius) - 4px);
  padding: 1rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.hero-links h3 {
  color: #fff;
  margin-bottom: .7rem;
}

.hero-links .help {
  margin-top: .7rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  padding: .5rem .76rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.16);
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none;
}

.chip:hover {
  background: rgba(255,255,255,0.16);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

/* =========================================================
   BOTONES Y ACCIONES
   ========================================================= */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: .72rem 1rem;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(180deg, var(--primary-3), var(--primary));
  color: #fff;
  box-shadow: 0 10px 24px rgba(107, 45, 51, 0.20);
}

.btn-primary:hover {
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  color: #fff;
}

.btn-secondary {
  background: rgba(255, 251, 246, 0.88);
  color: var(--ink);
  border-color: rgba(200, 180, 159, 0.85);
}

.btn-secondary:hover {
  background: #fff;
  color: var(--primary-2);
}

.hero .btn-primary {
  background: linear-gradient(180deg, #fffdf9, #f5ece0);
  color: var(--primary-2);
  border-color: rgba(255,255,255,0.24);
}

.hero .btn-primary:hover {
  background: linear-gradient(180deg, #ffffff, #efe2d1);
}

.hero .btn-secondary {
  background: rgba(255,255,255,0.10);
  color: #fff;
  border-color: rgba(255,255,255,0.16);
}

.hero .btn-secondary:hover {
  background: rgba(255,255,255,0.16);
  color: #fff;
}

.link-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .48rem .76rem;
  border-radius: 999px;
  background: rgba(242, 227, 193, 0.58);
  color: var(--primary-2);
  border: 1px solid rgba(183, 138, 62, 0.22);
  font-size: .88rem;
  font-weight: 800;
  text-decoration: none;
}

.link-pill::after {
  content: "→";
  opacity: .82;
}

.link-pill:hover {
  background: rgba(242, 227, 193, 0.78);
  text-decoration: none;
}

/* =========================================================
   TITULARES / TEXTOS AUXILIARES
   ========================================================= */

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.3rem 0 .8rem;
}

.section-title h3 {
  margin: 0;
}

.section-title p {
  margin: .18rem 0 0;
  color: var(--muted);
  font-size: .95rem;
}

.meta {
  color: var(--primary-3);
  font-size: .73rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .18em;
}

.help {
  color: var(--muted);
  font-size: .94rem;
}

/* =========================================================
   GRIDS
   ========================================================= */

.grid {
  display: grid;
  gap: 1rem;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* =========================================================
   CABECERAS / PERFILES / INTRO
   ========================================================= */

.intro-card,
.author-profile,
.article-head {
  display: grid;
  gap: .62rem;
}

.intro-card p:last-child,
.author-profile p:last-child,
.article-head p:last-child {
  margin-bottom: 0;
}

.article-head {
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(247, 239, 229, 0.98));
}

.author-profile {
  background:
    linear-gradient(180deg, rgba(255, 251, 246, 0.98), rgba(246, 238, 228, 0.98));
}

/* =========================================================
   TARJETAS DE TEXTOS / AUTORES
   ========================================================= */

.text-card,
.author-card {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  min-height: 100%;
}

.text-card::after,
.author-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, rgba(183, 138, 62, 0.85), rgba(107, 45, 51, 0.55));
  opacity: .88;
}

.text-card h4,
.author-card h4 {
  margin: 0;
  font-size: 1.1rem;
}

.text-card h4 a,
.author-card h4 a {
  color: var(--ink);
  text-decoration: none;
}

.text-card h4 a:hover,
.author-card h4 a:hover {
  color: var(--primary);
  text-decoration: none;
}

.summary {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.72;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .38rem .68rem;
  border-radius: 999px;
  background: rgba(242, 227, 193, 0.58);
  color: var(--primary-2);
  border: 1px solid rgba(183, 138, 62, 0.18);
  font-size: .82rem;
  font-weight: 800;
}

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

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

.stars {
  display: inline-flex;
  align-items: center;
  gap: .1rem;
  color: #cc8e17;
}

.stars .star {
  color: #ccbca8;
}

.stars .star.on {
  color: #d89a1c;
}

.stars-score {
  margin-left: .4rem;
  color: var(--ink);
  font-size: .82rem;
  font-weight: 700;
}

/* =========================================================
   BREADCRUMBS / META DE ARTÍCULOS
   ========================================================= */

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .42rem;
  font-size: .88rem;
  color: var(--muted);
  margin-bottom: .2rem;
}

.breadcrumbs a {
  color: var(--primary);
  font-weight: 700;
}

.crumb-sep {
  opacity: .55;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .48rem;
}

.article-meta .badge {
  background: rgba(255, 248, 239, 0.9);
}

/* =========================================================
   TEXTO LITERARIO
   ========================================================= */

.prose {
  max-width: 78ch;
  margin-inline: auto;
  color: #2a211c;
  font-family: var(--font-reading);
  font-size: clamp(1.08rem, 1.2vw, 1.18rem);
  line-height: 1.95;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.prose.dropcap::first-letter {
  float: left;
  margin: .08em .08em 0 0;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 3.5em;
  line-height: .78;
}

/* =========================================================
   PAGINACIÓN
   ========================================================= */

.page-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .62rem .88rem;
  border-radius: 999px;
  background: rgba(255, 251, 246, 0.88);
  border: 1px solid rgba(220, 205, 189, 0.95);
  color: var(--ink);
  font-weight: 800;
  min-height: 44px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  flex-wrap: wrap;
}

.disabled {
  opacity: .42;
  pointer-events: none;
}

/* =========================================================
   FLASH / MENSAJES
   ========================================================= */

.flash {
  margin-bottom: 1rem;
  font-weight: 700;
}

.flash-success {
  color: #134b39;
  background: linear-gradient(180deg, rgba(235, 251, 243, 0.98), rgba(225, 246, 236, 0.98));
  border-color: rgba(22, 107, 78, 0.25);
}

.flash-info {
  color: #314d7a;
  background: linear-gradient(180deg, rgba(239, 244, 253, 0.98), rgba(229, 237, 249, 0.98));
  border-color: rgba(62, 93, 143, 0.24);
}

.flash-warning {
  color: #815116;
  background: linear-gradient(180deg, rgba(255, 249, 236, 0.98), rgba(252, 243, 218, 0.98));
  border-color: rgba(154, 95, 22, 0.24);
}

.flash-error {
  color: #7e2323;
  background: linear-gradient(180deg, rgba(253, 239, 239, 0.98), rgba(250, 232, 232, 0.98));
  border-color: rgba(163, 52, 52, 0.24);
}

/* =========================================================
   ESTADO VACÍO
   ========================================================= */

.empty-state {
  text-align: center;
}

.empty-state h3 {
  margin-bottom: .45rem;
}

.empty-state p {
  max-width: 62ch;
  margin-inline: auto;
  color: var(--muted);
}

.empty-state .actions {
  justify-content: center;
  margin-top: .95rem;
}

/* =========================================================
   FORMULARIOS
   ========================================================= */

.form {
  display: grid;
  gap: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.field {
  display: grid;
  gap: .42rem;
}

.field-full {
  grid-column: 1 / -1;
}

.field label,
.checkline {
  color: var(--ink);
  font-size: .93rem;
  font-weight: 750;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: .84rem .94rem;
  border-radius: 15px;
  border: 1px solid rgba(220, 205, 189, 0.95);
  background: rgba(255, 253, 250, 0.92);
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #9b8c7f;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(107, 45, 51, 0.48);
  box-shadow: 0 0 0 4px rgba(107, 45, 51, 0.10);
  background: #fff;
}

.field textarea {
  min-height: 124px;
  resize: vertical;
}

.counter {
  color: var(--muted);
  font-size: .82rem;
}

.checkline {
  display: flex;
  align-items: flex-start;
  gap: .62rem;
  line-height: 1.5;
}

.checkline input {
  width: auto;
  min-height: 0;
  margin-top: .24rem;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* =========================================================
   VALORACIÓN
   ========================================================= */

.vote-form {
  display: grid;
  gap: 1rem;
}

.vote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .7rem;
}

.vote-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .24rem;
  min-height: 96px;
  padding: .95rem;
  border-radius: 18px;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.vote-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  filter: saturate(1.04);
}

.vote-stars {
  letter-spacing: .12em;
  font-size: 1rem;
}

.vote-5 {
  color: #104d39;
  background: linear-gradient(180deg, #eefaf4, #dff4e9);
  border-color: rgba(22, 107, 78, 0.16);
}

.vote-4 {
  color: #3d4f77;
  background: linear-gradient(180deg, #f2f4fb, #e4ebf8);
  border-color: rgba(62, 93, 143, 0.16);
}

.vote-3 {
  color: #8a5a17;
  background: linear-gradient(180deg, #fff8eb, #f9efd5);
  border-color: rgba(183, 138, 62, 0.18);
}

.vote-2 {
  color: #9b5b21;
  background: linear-gradient(180deg, #fff3e8, #f8e1ca);
  border-color: rgba(198, 124, 51, 0.16);
}

.vote-1 {
  color: #8b2f2f;
  background: linear-gradient(180deg, #fdf1f1, #f7dddd);
  border-color: rgba(163, 52, 52, 0.16);
}

/* =========================================================
   COMENTARIOS
   ========================================================= */

.comments {
  display: grid;
  gap: .85rem;
}

.comment {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: .95rem 1rem;
  border: 1px solid rgba(220, 205, 189, 0.92);
  border-radius: 18px;
  background: rgba(255, 252, 248, 0.92);
  box-shadow: var(--shadow-sm);
}

.comment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .7rem;
  flex-wrap: wrap;
}

.comment-meta {
  color: var(--muted);
  font-size: .84rem;
}

.comment-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  line-height: 1.78;
}

.section-divider {
  border: 0;
  border-top: 1px solid rgba(220, 205, 189, 0.9);
  margin: 1rem 0;
}

/* =========================================================
   CTA
   ========================================================= */

.cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0 1.2rem;
  background:
    radial-gradient(circle at top right, rgba(216, 178, 107, 0.10), transparent 22%),
    linear-gradient(135deg, rgba(255, 251, 246, 0.98), rgba(245, 235, 221, 0.96));
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
}

.group-block {
  margin-bottom: 1.25rem;
}

/* =========================================================
   ÍNDICE DE GÉNEROS / CATEGORÍAS
   Preparado para la próxima versión del index.php
   ========================================================= */

.section-index {
  margin: 1rem 0 1.2rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: rgba(255, 249, 241, 0.9);
  border: 1px dashed rgba(183, 138, 62, 0.34);
}

.section-index-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: .7rem;
}

.section-index-title h3 {
  margin: 0;
  font-size: 1.08rem;
}

.section-index-list {
  display: flex;
  flex-wrap: wrap;
  gap: .52rem;
}

.section-index-list a {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  padding: .48rem .76rem;
  border-radius: 999px;
  background: rgba(242, 227, 193, 0.52);
  border: 1px solid rgba(183, 138, 62, 0.2);
  color: var(--primary-2);
  font-weight: 760;
  font-size: .9rem;
  text-decoration: none;
}

.section-index-list a::before {
  content: "§";
  opacity: .68;
  font-size: .88rem;
}

.section-index-list a:hover {
  background: rgba(242, 227, 193, 0.75);
}

.genre-anchor {
  position: relative;
}

.genre-anchor::before {
  content: "";
  display: block;
  height: 0;
  scroll-margin-top: calc(var(--topbar-h) + 1rem);
}

/* =========================================================
   BARRA DE FILTROS / ORDEN
   Preparado para "Novedades" y listados futuros
   ========================================================= */

.listing-tools,
.sort-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .9rem;
  flex-wrap: wrap;
  margin: 1rem 0 1.15rem;
  padding: .9rem 1rem;
  border-radius: 18px;
  background: rgba(255, 251, 246, 0.88);
  border: 1px solid rgba(220, 205, 189, 0.92);
  box-shadow: var(--shadow-sm);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
}

.toolbar-label {
  color: var(--muted);
  font-size: .88rem;
  font-weight: 700;
}

.toolbar-select,
.toolbar-input,
.sort-toolbar select {
  min-height: 42px;
  padding: .62rem .82rem;
  border-radius: 12px;
  border: 1px solid rgba(220, 205, 189, 0.95);
  background: #fffdfa;
  color: var(--ink);
  font: inherit;
}

.sort-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.sort-tab {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 40px;
  padding: .5rem .76rem;
  border-radius: 999px;
  border: 1px solid rgba(220, 205, 189, 0.95);
  background: rgba(255, 253, 250, 0.86);
  color: var(--ink-soft);
  font-size: .9rem;
  font-weight: 750;
  text-decoration: none;
}

.sort-tab:hover,
.sort-tab.is-active {
  background: rgba(242, 227, 193, 0.7);
  border-color: rgba(183, 138, 62, 0.35);
  color: var(--primary-2);
  text-decoration: none;
}

.results-meta {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}

/* =========================================================
   FOOTER
   ========================================================= */

.footer {
  margin-top: auto;
  padding: 1.4rem 0 1.8rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid rgba(220, 205, 189, 0.86);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
}

.footer a {
  color: var(--primary);
  font-weight: 750;
  text-decoration: none;
}

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

/* =========================================================
   MEJORAS MÓVILES IMPORTANTES
   - menú superior mucho más compacto
   ========================================================= */

@media (max-width: 960px) {
  .hero,
  .grid-3,
  .grid-2,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .section-title,
  .cta-banner,
  .pager,
  .footer-inner,
  .listing-tools,
  .sort-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  :root {
    --topbar-h: 68px;
  }

  .container {
    width: min(var(--container), calc(100% - 1rem));
  }

  .topbar-inner {
    min-height: auto;
    gap: .5rem;
    padding: .58rem 0 .45rem;
    align-items: stretch;
  }

  .brand {
    gap: .08rem;
  }

  .brand-kicker {
    font-size: .62rem;
    letter-spacing: .16em;
  }

  .brand-title {
    font-size: 1.2rem;
  }

  /* Menú superior compacto, horizontal y desplazable */
  .nav {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    gap: .38rem;
    padding-bottom: .12rem;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .nav::-webkit-scrollbar {
    height: 5px;
  }

  .nav::-webkit-scrollbar-thumb {
    background: rgba(183, 138, 62, 0.34);
    border-radius: 999px;
  }

  .nav a {
    flex: 0 0 auto;
    scroll-snap-align: start;
    font-size: .86rem;
    padding: .46rem .72rem;
    min-height: 38px;
    gap: .36rem;
    border-color: rgba(220, 205, 189, 0.5);
    background: rgba(255, 251, 246, 0.76);
  }

  .nav a::before {
    width: .9rem;
    font-size: .84rem;
  }

  .hero {
    padding: 1.1rem;
    border-radius: 24px;
  }

  .hero h2 {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
  }

  .card,
  .flash,
  .empty-state {
    padding: 1rem;
  }

  .prose {
    font-size: 1.05rem;
    line-height: 1.88;
  }

  .vote-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 540px) {
  main {
    padding-top: .9rem;
  }

  .section-title {
    margin-top: 1rem;
  }

  .brand-title {
    font-size: 1.08rem;
  }

  .brand-kicker {
    display: none;
  }

  .nav a {
    padding: .42rem .66rem;
    font-size: .83rem;
    border-radius: 999px;
  }

  .nav a::before {
    width: .82rem;
    font-size: .78rem;
  }

  .hero-links,
  .section-index,
  .listing-tools,
  .sort-toolbar {
    padding: .88rem;
  }

  .vote-grid {
    grid-template-columns: 1fr;
  }

  .comment,
  .page-chip {
    border-radius: 15px;
  }

  .article-meta,
  .chip-list,
  .section-index-list {
    gap: .42rem;
  }
}

/* =========================================================
   ACCESIBILIDAD / MOVIMIENTO REDUCIDO
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  html,
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* =========================================================
   IMPRESIÓN
   ========================================================= */

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .topbar,
  .footer,
  .btn,
  .vote-form,
  .form,
  .cta-banner,
  .hero-links,
  .nav,
  .flash {
    display: none !important;
  }

  .container {
    width: 100%;
  }

  .card,
  .hero {
    box-shadow: none;
    border: 1px solid #ccc;
    background: #fff;
  }

  .prose {
    max-width: 100%;
    font-size: 12pt;
    line-height: 1.7;
  }
}