/* ============================================================
   Hoja común para los índices cronológico y sistemático
   ============================================================ */

.index-hero {
  margin-bottom: 1.25rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid #d7e2ef;
  border-radius: 22px;
  background: linear-gradient(135deg, #f7fbff, #e7f1fa);
  box-shadow: 0 14px 34px rgba(17, 73, 116, .08);
}

.index-hero h1 {
  margin: .15rem 0 .5rem;
  color: #173f63;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -.04em;
}

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

.index-range,
.index-summary {
  margin: 0;
  color: #657486;
  font-family: system-ui, sans-serif;
}

.index-entry {
  position: relative;
  display: grid;
  grid-template-columns: minmax(125px, 170px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid #e6edf3;
}

.index-entry:last-child {
  border-bottom: 0;
}

.index-entry:hover {
  background: #f8fbfe;
}

.entry-date {
  color: #215e89;
  font-family: system-ui, sans-serif;
  font-size: .92rem;
  font-weight: 750;
  line-height: 1.45;
}

.index-entry-content h3,
.entry-content h3 {
  margin: 0;
  font-family: system-ui, sans-serif;
  font-size: 1.03rem;
  line-height: 1.4;
}

.index-entry-content h3 a,
.entry-content h3 a {
  color: #173f63;
  text-decoration: none;
}

.index-entry-content h3 a:hover,
.entry-content h3 a:hover {
  color: #2876a9;
  text-decoration: underline;
  text-underline-offset: .18em;
}

.entry-description {
  margin-top: .35rem;
  color: #59697a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: .94rem;
  line-height: 1.55;
}

@media (max-width: 720px) {
  .index-entry {
    grid-template-columns: 1fr;
    gap: .35rem;
    padding: 1rem;
  }

  .entry-date {
    font-size: .82rem;
    letter-spacing: .025em;
    text-transform: uppercase;
  }
}

/* ---------------- Índice cronológico ---------------- */

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

.year-nav {
  position: -webkit-sticky;
  position: sticky;
  top: .5rem;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  justify-content: center;
  margin-bottom: 1.25rem;
  padding: .75rem;
  border: 1px solid #d7e2ef;
  border-radius: 16px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 8px 24px rgba(17,73,116,.09);
  backdrop-filter: blur(8px);
}

.year-nav a {
  min-width: 3.9rem;
  padding: .5rem .7rem;
  border-radius: 999px;
  color: #19496f;
  background: #eaf3fa;
  font-family: system-ui, sans-serif;
  font-size: .9rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.year-nav a:hover,
.year-nav a:focus-visible {
  color: #fff;
  background: #236b9c;
}

.timeline {
  overflow: hidden;
  border: 1px solid #d7e2ef;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(17,73,116,.07);
}

.timeline-section {
  padding: 1.15rem 1.4rem;
  border-top: 1px solid #d7e2ef;
  border-bottom: 1px solid #d7e2ef;
  background: linear-gradient(90deg, #e8f2fa, #f7fbff);
}

.timeline-section:first-child {
  border-top: 0;
}

.timeline-section h2 {
  max-width: 850px;
  margin: 0 auto;
  color: #173f63;
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.45;
  text-align: center;
}

.timeline-section h2 a {
  color: inherit;
}

.year-anchor {
  position: absolute;
  top: -5.5rem;
}

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

  .year-nav {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    border-radius: 12px;
  }

  .year-nav a {
    flex: 0 0 auto;
  }

  .timeline {
    border-radius: 14px;
  }

  .timeline-section {
    padding: 1rem;
  }
}

/* ---------------- Índice sistemático ---------------- */

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

.intro-card {
  margin-bottom: 1.25rem;
  padding: 1.35rem 1.5rem;
  border: 1px solid #d7e2ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(17,73,116,.06);
}

.intro-card p {
  margin: .7rem 0;
}

.intro-card ol {
  padding-left: 1.35rem;
}

.intro-card a {
  color: #215e89;
}

.system-content {
  overflow: hidden;
  border: 1px solid #d7e2ef;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(17,73,116,.07);
}

.system-section {
  scroll-margin-top: 1rem;
}

.system-section h2,
.system-section h3,
.system-section h4,
.system-section h5 {
  margin: 0;
  font-family: system-ui, sans-serif;
  line-height: 1.35;
}

.level-1 {
  padding: 1.4rem 1.5rem;
  background: linear-gradient(90deg, #1f5e8d, #2e79aa);
  color: #fff;
}

.level-1 h2 {
  color: #fff;
  font-size: 1.25rem;
}

.level-2 {
  padding: 1.15rem 1.5rem;
  border-top: 1px solid #cfe0ed;
  border-bottom: 1px solid #cfe0ed;
  background: #dcecf7;
}

.level-2 h3 {
  color: #173f63;
  font-size: 1.08rem;
}

.level-3 {
  padding: .95rem 1.5rem;
  border-top: 1px solid #e1eaf1;
  background: #eef5fa;
}

.level-3 h4 {
  color: #215e89;
  font-size: 1rem;
}

.level-4 {
  padding: .8rem 1.5rem;
  border-top: 1px solid #e7edf2;
  background: #f8fbfd;
}

.level-4 h5 {
  color: #3c5d74;
  font-size: .94rem;
}

.system-context {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e6edf3;
  color: #526476;
  background: #fbfdff;
  font-family: Georgia, "Times New Roman", serif;
  text-align: center;
}

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

  .level-1,
  .level-2,
  .level-3,
  .level-4 {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}


/* ---------------- Índices menores ---------------- */

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

.minor-index-list {
  overflow: hidden;
  border: 1px solid #d7e2ef;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(17,73,116,.07);
}

.minor-entry .entry-date:empty {
  display: none;
}

.minor-entry:has(.entry-date:empty) {
  grid-template-columns: 1fr;
}

.index-hero,
.index-hero .eyebrow,
.index-hero h1,
.index-hero .index-range,
.index-hero .index-summary {
  text-align: center;
}

.index-hero .eyebrow,
.index-hero h1,
.index-hero .index-range,
.index-hero .index-summary {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

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

  .minor-index-list {
    border-radius: 14px;
  }
}
