
:root {
  --bg: #eef5fb;
  --paper: #ffffff;
  --text: #172033;
  --muted: #637083;
  --accent: #1769aa;
  --accent-dark: #0f4775;
  --accent-soft: #e2f0fb;
  --line: #cbdcea;
  --shadow: 0 18px 45px rgba(23, 105, 170, .12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(23,105,170,.12), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Arial, sans-serif;
  line-height: 1.75;
}

a {
  color: var(--accent);
  text-underline-offset: .18em;
}

a:hover {
  color: var(--accent-dark);
}

header {
  padding: 4.5rem 1.25rem 3.25rem;
  background:
    linear-gradient(135deg, rgba(10,40,70,.88), rgba(23,105,170,.88)),
    linear-gradient(135deg, #0f4775, #2393d2);
  color: #fff;
  text-align: center;
}

header h1 {
  max-width: 1050px;
  margin: 0 auto;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -.045em;
}

header p {
  max-width: 780px;
  margin: 1rem auto 0;
  color: rgba(255,255,255,.88);
  font-size: 1.08rem;
}

.page {
  max-width: 1040px;
  margin: -2rem auto 4rem;
  padding: 0 1.25rem;
}

nav {
  position: static;
  margin: 0 0 1.2rem;
  padding: .75rem;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

nav details {
  display: block;
}

nav details summary {
  display: none;
}

nav .links {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  justify-content: center;
}

nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: .55rem .9rem;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  text-decoration: none;
  font-weight: 650;
  font-size: .94rem;
}

nav a:hover {
  background: var(--accent);
  color: #fff;
}

main {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(1.6rem, 4vw, 4rem);
  box-shadow: var(--shadow);
}


.home-links {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: .65rem;
  margin: 1.75rem 0 2.5rem;
  text-align: center;
}


.meta {
  color: var(--muted);
  padding-bottom: 1.1rem;
  margin-bottom: 2.2rem;
  border-bottom: 1px solid var(--line);
  font-size: .96rem;
}

h2, h3 {
  color: var(--accent-dark);
  line-height: 1.25;
}

h2 {
  margin-top: 2.6rem;
  font-size: 1.55rem;
}

p {
  margin: 1.15rem 0;
  font-size: clamp(1.03rem, 2vw, 1.16rem);
}

blockquote {
  margin: 2.2rem 0;
  padding: 1.35rem 1.55rem;
  border-left: 6px solid var(--accent);
  border-radius: 0 18px 18px 0;
  background: var(--accent-soft);
}

footer {
  max-width: 1040px;
  margin: 0 auto 3rem;
  padding: 0 1.25rem;
  color: var(--muted);
  text-align: center;
  font-size: .92rem;
}

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

@media (max-width: 720px) {
  header {
    padding: 3.2rem 1rem 2.5rem;
  }

  .page {
    margin-top: -1.4rem;
  }

  nav .links {
    justify-content: flex-start;
  }

  nav a {
    flex: 1 1 auto;
  }

  main {
    border-radius: 22px;
  }
}


.article-body table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.article-body th, .article-body td { padding: .65rem .75rem; border: 1px solid var(--line, #dbe4ee); vertical-align: top; }
.article-body img { max-width: 100%; height: auto; }
.article-body center { text-align: center; }
.special-page .article-body ul, .special-page .article-body ol { padding-left: 1.4rem; }
.special-page .article-body a { overflow-wrap: anywhere; }


/* ============================================================
   ESTILOS REUTILIZABLES PARA PÁGINAS ESPECIALES
   Centralizados desde poemas.html y prologo.html
   ============================================================ */

/* Subtítulo o autor bajo el título principal */
.article-subtitle {
  margin: .45rem 0 0;
  color: #64748b;
  font-style: italic;
}

/* Títulos internos de secciones */
.article-body .section-title {
  margin-top: 2.6rem;
  color: #173f63;
  font-weight: 700;
  text-align: left;
}

/* Firma o datación final de un documento */
.article-body .signature {
  margin-top: 2rem;
  color: #173f63;
  font-weight: 700;
  text-align: right;
}

/* Separador ornamental entre secciones */
.article-body .section-separator {
  margin: 2rem 0;
  text-align: center;
  font-weight: 600;
  letter-spacing: .5rem;
}

/* Listas dentro de artículos */
.article-body ul,
.article-body ol {
  margin: 1rem 0 1.25rem 1.5rem;
}

.article-body li {
  margin: .45rem 0;
}

/* Títulos de poemas */
.article-body .poem-title {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: #173f63;
  font-weight: 700;
  font-size: 1.50rem;
  text-align: center;
}

.article-body .poem-title a[name] {
  color: #173f63;
  text-decoration: none;
}

/* Estrofas */
.article-body .poem-stanza {
  margin: 1.1rem auto;
  text-align: center;
  font-style: italic;
}

/* Fechas, firmas y notas breves asociadas a poemas */
.article-body .poem-meta {
  text-align: left;
  font-style: normal;
}

.article-body sup {
  font-size: .75em;
}

/* ============================================================
   PORTADA Y PÁGINA GENERAL DE ÍNDICES
   ============================================================ */

.portal-page {
  max-width: 1120px;
  margin: 2rem auto 4rem;
  padding: 0 1.25rem;
}

.portal-hero {
  padding: clamp(2rem, 6vw, 4.5rem);
  border: 1px solid #d7e2ef;
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(39,118,169,.13), transparent 24rem),
    linear-gradient(135deg, #f8fcff, #e7f1fa);
  box-shadow: 0 16px 40px rgba(17,73,116,.09);
  text-align: center;
}

.portal-hero h1 {
  max-width: 900px;
  margin: .25rem auto .9rem;
  color: #173f63;
  font-size: clamp(2.25rem, 6vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -.05em;
}

.indexes-hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.7rem);
}

.portal-eyebrow {
  margin: 0;
  color: #2a6f9e;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.portal-lead {
  max-width: 720px;
  margin: 0 auto;
  color: #59697a;
  font-size: clamp(1.02rem, 2.2vw, 1.18rem);
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: center;
  margin-top: 1.6rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: .72rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
}

.button-primary {
  color: #fff;
  background: #236b9c;
  box-shadow: 0 8px 20px rgba(35,107,156,.2);
}

.button-primary:hover {
  color: #fff;
  background: #174d73;
}

.button-secondary {
  color: #174d73;
  border-color: #b9d0e2;
  background: rgba(255,255,255,.78);
}

.button-secondary:hover {
  color: #174d73;
  border-color: #7daac9;
  background: #fff;
}

.home-feature {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  gap: 1.35rem;
  margin-top: 1.35rem;
}

.portrait-card,
.featured-quote {
  margin: 0;
  border: 1px solid #d7e2ef;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(17,73,116,.07);
}

.portrait-card {
  display: grid;
  min-height: 320px;
  overflow: hidden;
  place-items: center;
}

.portrait-card img {
  display: block;
  max-width: 100%;
  max-height: 390px;
  width: auto;
  height: auto;
}

.featured-quote {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.7rem, 4vw, 3.2rem);
  border-left: 1px solid #d7e2ef;
}

.featured-quote p {
  margin: 0;
  color: #25384a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.55;
}

.featured-quote footer {
  display: flex;
  flex-direction: column;

  width: 100%;
  align-self: stretch;
  align-items: flex-start;

  text-align: left;
  gap: .2rem;
  margin-top: 1.4rem;

  color: #657486;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .92rem;
}

.featured-quote strong {
  color: #173f63;
}

.portal-section {
  margin-top: 3rem;
}

.section-heading {
  margin-bottom: 1.1rem;
  text-align: center;
}

.section-heading h2,
.edition-card h2,
.search-banner h2 {
  margin: .15rem 0 0;
  color: #173f63;
  line-height: 1.2;
}

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

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

.portal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 1.45rem;
  border: 1px solid #d7e2ef;
  border-radius: 18px;
  color: inherit;
  background: #fff;
  box-shadow: 0 10px 26px rgba(17,73,116,.055);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.portal-card:hover {
  color: inherit;
  border-color: #9bbbd2;
  box-shadow: 0 16px 36px rgba(17,73,116,.11);
  transform: translateY(-3px);
}

.portal-card h2,
.portal-card h3 {
  margin: .35rem 0 .55rem;
  color: #173f63;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.22;
}

.portal-card h2 {
  font-size: 1.35rem;
}

.portal-card h3 {
  font-size: 1.18rem;
}

.portal-card p {
  margin: 0;
  color: #59697a;
  font-size: .98rem;
  line-height: 1.58;
}

.card-kicker {
  color: #2a6f9e;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.card-link {
  margin-top: auto;
  padding-top: 1.2rem;
  color: #236b9c;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .9rem;
  font-weight: 750;
}

.card-number {
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  color: #c5d8e7;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.portal-card-featured {
  background:
    radial-gradient(circle at top right, rgba(42,111,158,.09), transparent 12rem),
    #fff;
}

.edition-card,
.search-banner {
  display: grid;
  grid-template-columns: minmax(220px, .75fr) minmax(0, 1.5fr);
  gap: 1.5rem;
  align-items: center;
  margin-top: 2rem;
  padding: clamp(1.4rem, 4vw, 2.3rem);
  border: 1px solid #d7e2ef;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(17,73,116,.06);
}

.edition-card p,
.search-banner p {
  margin: .3rem 0 0;
  color: #59697a;
}

.search-banner {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 1.35rem;
  background: linear-gradient(135deg, #f8fcff, #edf5fa);
}

.indexes-grid {
  margin-top: 1.35rem;
}

@media (max-width: 900px) {
  .portal-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .portal-page {
    margin-top: 1rem;
    padding: 0 .75rem;
  }

  .portal-hero {
    border-radius: 20px;
  }

  .portal-hero h1 br {
    display: none;
  }

  .home-feature,
  .portal-grid,
  .portal-grid-compact,
  .edition-card,
  .search-banner {
    grid-template-columns: 1fr;
  }

  .portrait-card {
    min-height: 240px;
  }

  .portal-card {
    min-height: 0;
  }

  .search-banner .button {
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-card {
    transition: none;
  }
}


.home-page .home-hero {
  background: linear-gradient(
    135deg,
    #123f63 0%,
    #1d5f8c 55%,
    #3f83ad 100%
  );

  border-color: #2a6f9e;
  color: #fff;
}

.home-page .home-hero h1 {
  max-width: none;
  color: #fff;
  font-size: clamp(1.8rem, 5vw, 3.8rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.home-page .home-hero .portal-eyebrow {
  color: rgba(255, 255, 255, .75);
}

.home-page .home-hero .portal-lead {
  color: rgba(255, 255, 255, .9);
}

/* Centrado del encabezado de la página general de índices */
.indexes-page .indexes-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.indexes-page .indexes-hero .portal-eyebrow,
.indexes-page .indexes-hero h1,
.indexes-page .indexes-hero .portal-lead {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.indexes-page .indexes-hero .portal-eyebrow {
  margin-top: 0;
  margin-bottom: 0;
  padding: 0;
}




/* ============================================================
   Yugo en el encabezado de la portada
   ============================================================ */


.home-hero-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(.4rem, 1.5vw, 1rem);
  align-items: center;
}

.home-hero-logo img {
  display: block;
  width: clamp(45px, 9vw, 150px);
  height: auto;
}

@media (max-width: 480px) {
  .home-hero-content {
    grid-template-columns: 1fr;
  }

  .home-hero-logo {
    display: flex;
    justify-content: center;
  }

  .home-hero-logo img {
    width: 55px;
  }
}

/* ============================================================
   CABECERA COMPACTA DEL PORTAL
   ============================================================ */

.compact-site-header {
  padding: .65rem 0 .55rem;
}

.compact-site-header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
}

.compact-site-title {
  color: #fff;
  font-family: inherit;
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.compact-site-title:hover {
  color: #fff;
}

.compact-site-header .top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .35rem;
}

.compact-site-header .top-nav a {
  padding: .25rem .65rem;
}




.compact-logo-header {
  max-width: 1120px;
  margin: 1rem auto 0;
  padding: .55rem 1.1rem;
  border-radius: 20px;
}

.compact-logo-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.compact-logo img {
  display: block;
  width: 135px;
  height: auto;
}

.compact-logo-header .top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .4rem;
  transform: translateY(8px);
}

.compact-logo-header .top-nav a {
  padding: .35rem .7rem;
}

@media (max-width: 620px) {
  .compact-logo-header {
    margin: .75rem .75rem 0;
    padding: .55rem .75rem;
  }

  .compact-logo-header-inner {
    flex-direction: column;
    justify-content: center;
    gap: .35rem;
  }

  .compact-logo {
    display: flex;
    justify-content: center;
  }

  .compact-logo img {
    width: 125px;
  }

  .compact-logo-header .top-nav {
    justify-content: center;
    transform: none;
  }

  .compact-logo-header .top-nav a {
    font-size: .9rem;
  }
}


.compact-logo-header,
main.layout {
  width: calc(100% - 2rem);
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 720px) {
  .compact-logo-header,
  main.layout {
    width: calc(100% - 1.5rem);
  }
}

/* Cabecera y contenido: misma anchura en pantallas normales */
.compact-logo-header,
main.layout {
  width: calc(100% - 2rem);
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

/* En móvil, el cuerpo ocupa todo el ancho */
@media (max-width: 720px) {
  main.layout {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }
}


.compact-logo-header,
main.layout,
body:has(.compact-logo-header) > footer {
  width: calc(100% - 2rem);
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 720px) {
  main.layout,
  body:has(.compact-logo-header) > footer {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

/* ============================================================
   BUSCADOR 
   ============================================================ */

.search-page {
  width: calc(100% - 2rem);
  max-width: 1120px;
  margin: 1rem auto 4rem;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.search-hero {
  padding: .75rem 1rem 1.5rem;
  color: var(--text);
  background: transparent;
  text-align: center;
}

.search-hero h1 {
  max-width: none;
  margin: .2rem 0 .5rem;
  color: #173f63;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -.03em;
}

.search-hero p {
  max-width: 720px;
  margin: 0 auto;
  color: var(--muted);
}

.search-form {
  max-width: 820px;
  margin: 0 auto;
  padding: 1.25rem;
  border: 1px solid #d7e2ef;
  border-radius: 18px;
  background: #f8fbfe;
}

.search-form label {
  display: block;
  margin-bottom: .55rem;
  color: #173f63;
  font-weight: 700;
}

.search-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
}

.search-form input[type="search"] {
  width: 100%;
  min-height: 2.9rem;
  padding: .7rem .9rem;
  border: 1px solid #abc5d8;
  border-radius: 12px;
  color: var(--text);
  background: #fff;
  font: inherit;
  line-height: 1.2;
}

.search-form input[type="search"]:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(23, 105, 170, .2);
}

.search-help,
.search-message {
  max-width: 820px;
  margin: 1.25rem auto 0;
  padding: 1rem 1.2rem;
  border: 1px solid #d7e2ef;
  border-radius: 16px;
  background: #fff;
}

.search-help h2,
.search-message h2 {
  margin: 0 0 .35rem;
  font-size: 1.15rem;
}

.search-help p,
.search-message p {
  margin: 0;
  font-size: 1rem;
}

.search-error {
  border-color: #d8a7a7;
  background: #fff7f7;
}

.search-results {
  max-width: 900px;
  margin: 2rem auto 0;
}

.search-results-header {
  padding: 0 0 1rem;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.search-results-header h2 {
  margin: 0;
  font-size: 1.45rem;
}

.search-results-header p {
  margin: .2rem 0 0;
  color: var(--muted);
  font-size: .95rem;
}

.search-result-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-result {
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
}

.search-result:first-child {
  border-top: 0;
}

.search-result h3 {
  margin: 0;
  font-size: 1.18rem;
}

.search-result h3 a {
  text-decoration: none;
}

.search-result h3 a:hover {
  text-decoration: underline;
}

.search-result-file {
  margin: .25rem 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .82rem;
}

.search-result-snippet {
  margin: .45rem 0 0;
  color: #46586a;
  font-size: 1rem;
  line-height: 1.6;
}

.search-result mark {
  padding: 0 .08em;
  color: inherit;
  background: #fff0a8;
}

.search-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0 0;
  padding: .9rem 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.search-pagination a:last-child {
  justify-self: end;
}

@media (max-width: 720px) {
  .search-page {
    width: 100%;
    margin: .75rem 0 2.5rem;
    padding: 1rem;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .search-form-row {
    grid-template-columns: 1fr;
  }

  .search-form-row .button {
    width: 100%;
  }

  .search-pagination {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .search-pagination a:last-child {
    justify-self: center;
  }
}
