/* =========================================================
PORTADA · ESTILOS ESPECÍFICOS
========================================================= */

/* =========================================================
   HÉROE DE PORTADA
   ========================================================= */

.hero-medieval {
  background: linear-gradient(135deg, #f8f4ec 0%, #efe7d8 100%);
  border: 1px solid #ddd0b8;
  border-radius: 24px;
  padding: 3rem;
  box-shadow: 0 10px 30px rgba(58, 44, 24, 0.08);
  overflow: hidden;
}

.hero-title {
  color: #1f2937;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-bottom: 1.2rem;
}

.hero-placeholder {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;

  /* border: 2px dashed #c7b898; */
  border-radius: 20px;

  background: #eee6d8;
  color: #6b4e2e;

  font-size: 1.1rem;
  font-weight: 700;
}

@media (max-width: 991px) {
  .hero-medieval {
    padding: 2.2rem;
  }
}

@media (max-width: 768px) {
  .hero-medieval {
    padding: 1.5rem;
    border-radius: 20px;
  }

  .hero-title {
    font-size: 2rem;
  }
}

/* =========================================================
   PORTADA · BOTONES PRINCIPALES
   ========================================================= */

@media (max-width: 768px) {

  .btn-xl {
    padding: 10px 18px;
    font-size: 0.95rem;
  }

}

@media (max-width: 576px) {

  .btn-xl {
    padding: 8px 14px;
    font-size: 0.85rem;
  }
}

/* =========================================================
   EN PORTADA
   ========================================================= */

.portada-destacados {
    padding: 1.8rem;

    background: linear-gradient(
        135deg,
        #f8f4eb 0%,
        #f3ecdf 100%
    );

    border: 1px solid #dfcfb1;
    border-radius: 28px;
}

.destacados-cabecera {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.destacados-cabecera h2 {
    margin: 0;

    color: #1c2430;
    font-size: clamp(1.8rem, 3vw, 2.3rem);
    font-weight: 800;
}

.destacados-icono {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 66px;
    height: 66px;
    flex: 0 0 66px;

    font-size: 1.7rem;

    background: #ecd3a4;
    border-radius: 20px;
}

.destacado-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;

    background: #ffffff;
    border: 1px solid #e3ded4;
    border-radius: 22px;

    box-shadow: 0 8px 22px rgba(60, 43, 23, 0.06);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.destacado-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(60, 43, 23, 0.1);
}

.destacado-etiqueta {
    display: flex;
    align-items: center;
    gap: 0.45rem;

    margin-bottom: 1rem;

    color: #7a4a18;
    font-size: 0.88rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.destacado-card h3 {
    margin: 0 0 0.85rem;

    color: #20242b;
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.3;
}

.destacado-card p {
    color: #4e4e4e;
    line-height: 1.65;
}

.destacado-fecha {
    margin-bottom: 0.4rem;

    color: #8b6a3f !important;
    font-size: 0.95rem;
    font-weight: 700;
}

.destacado-enlace {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;

    margin-top: auto;
    padding-top: 0.8rem;

    color: black;
    font-weight: 700;
    text-decoration: none;
}

.destacado-enlace:hover {
    color: #9a5c1c;
    text-decoration: underline;
}

/* Cronología horizontal */

.cronologia-portada {
    display: flex;
    align-items: flex-start;
    width: 100%;
    max-width: 760px;
    margin-top: 2rem;
}

.cronologia-item {
    position: relative;
    flex: 1;
    text-align: center;
    padding-top: 1.8rem;
    color: #5f431f;
    font-weight: 600;
    font-size: 1rem;
}

/* Línea horizontal */
.cronologia-item::before {
    content: "";
    position: absolute;
    top: 7px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #d8c39f;
}

/* Evita que la línea sobresalga por los extremos */
.cronologia-item:first-child::before {
    left: 50%;
    width: 50%;
}

.cronologia-item:last-child::before {
    width: 50%;
}

/* Punto de cada periodo */
.cronologia-punto {
    position: absolute;
    top: 0;
    left: 50%;
    width: 16px;
    height: 16px;
    border: 3px solid #f5efe4;
    border-radius: 50%;
    background-color: #9b6a2f;
    transform: translateX(-50%);
    z-index: 2;
}

.cronologia-texto {
    display: block;
    line-height: 1.25;
}

/* Adaptación a móviles */
@media (max-width: 768px) {
    .cronologia-portada {
        flex-direction: column;
        align-items: stretch;
        margin-left: 0.5rem;
    }

    .cronologia-item {
        min-height: 58px;
        padding: 0 0 1.4rem 2.2rem;
        text-align: left;
    }

    .cronologia-item::before {
        top: 0;
        left: 7px;
        width: 2px;
        height: 100%;
    }

    .cronologia-item:first-child::before {
        top: 8px;
        left: 7px;
        width: 2px;
        height: calc(100% - 8px);
    }

    .cronologia-item:last-child::before {
        left: 7px;
        width: 2px;
        height: 8px;
    }

    .cronologia-punto {
        top: 0;
        left: 0;
        transform: none;
    }

    .cronologia-texto {
        padding-top: 0;
    }
}

/* =========================================================
   PORTADA · CAPÍTULOS E ÍNDICE LATERAL
   ========================================================= */

.historia-capitulos {
  width: 100%;
  margin: 3rem auto;
  padding: 1.75rem;

  background: linear-gradient(
    135deg,
    #f8f4eb 0%,
    #f3ecdf 100%
  );

  border: 1px solid #dfcfb1;
  border-radius: 28px;
}

.historia-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

/* ÍNDICE LATERAL */

.indice-lateral {
  position: sticky;
  top: 1rem;

  max-height: calc(100vh - 2rem);
  overflow-y: auto;

  padding: 1.4rem;

  background: #ffffff;
  border: 1px solid #e2ded6;
  border-radius: 22px;

  box-shadow: 0 8px 24px rgba(60, 43, 23, 0.07);

  scrollbar-width: thin;
  scrollbar-color: #8c8c8c transparent;
}

.indice-lateral::-webkit-scrollbar {
  width: 7px;
}

.indice-lateral::-webkit-scrollbar-track {
  background: transparent;
}

.indice-lateral::-webkit-scrollbar-thumb {
  background: #8c8c8c;
  border-radius: 999px;
}

.indice-titulo {
  margin: 0 0 1.2rem;
  color: #172033;
  font-size: 1.15rem;
  font-weight: 800;
}

.indice-nav {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.indice-enlace {
  display: flex;
  align-items: center;
  gap: 0.7rem;

  min-height: 58px;
  padding: 0.85rem 1rem;

  color: #233b61;
  font-size: 1rem;
  line-height: 1.3;
  text-decoration: none;

  background: #f8f9fb;
  border: 1px solid #bdccff;
  border-radius: 17px;

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.indice-enlace:hover,
.indice-enlace:focus-visible {
  color: #19345e;
  background: #edf2ff;
  border-color: #78a1ff;
  transform: translateX(3px);
}

.indice-icono {
  flex: 0 0 auto;
  width: 1.5rem;
  text-align: center;
}

/* COLUMNA DE CONTENIDO */

.capitulos-contenido {
  min-width: 0;
}

@media (max-width: 991.98px) {

  .historia-capitulos {
    margin-top: 2rem;
    padding: 1rem;
    border-radius: 22px;
  }

  .historia-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .indice-lateral {
    position: static;

    width: 100%;
    max-height: none;
    overflow: visible;

    padding: 1.2rem;
    border-radius: 20px;
  }

  .indice-enlace {
    min-height: 62px;
    padding: 0.9rem 1rem;
  }
}

@media (max-width: 575.98px) {

  .historia-capitulos {
    width: calc(100% - 1rem);
    margin: 1.5rem auto;
    padding: 0.75rem;
  }

  .indice-lateral {
    padding: 1rem;
  }

  .indice-titulo {
    font-size: 1.1rem;
  }

  .indice-enlace {
    font-size: 1rem;
  }
}
