/* ==========================================================================
   BASE LEGAL - SET DE ESTILOS PARA ESPECIALIDADES, GUÍAS TEMÁTICAS Y ARTÍCULOS
   Rutas: /especialidad/, Pilares (Guías Temáticas) y Clusters (Artículos de Guía)
   Mobile-First, refinado, armonioso con la identidad visual de Base Legal.
   ========================================================================== */

:root {
  --esp-primary: #1d295f;
  --esp-primary-dark: #121a3e;
  --esp-primary-light: #2c3e80;
  --esp-gold: #c59b27;
  --esp-gold-bright: #d4af37;
  --esp-gold-light: #fef7e7;
  --esp-gold-border: #f6d88c;
  --esp-bg-soft: #f8fafc;
  --esp-bg-accent: #eef2f9;
  --esp-text-dark: #0f172a;
  --esp-text-body: #334155;
  --esp-text-muted: #64748b;
  --esp-border: #e2e8f0;
  --esp-border-hover: #cbd5e1;
  --esp-radius-sm: 6px;
  --esp-radius-md: 10px;
  --esp-radius-lg: 16px;
  --esp-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --esp-shadow-md: 0 6px 18px rgba(15, 23, 42, 0.08);
  --esp-shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.12);
  --esp-transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   1. Contenedores Principales
   -------------------------------------------------------------------------- */
.esp-container {
  width: 98%;
  max-width: 980px;
  margin: 0.4rem auto 3.5rem;
  padding: 1.15rem 1.15rem;
  background-color: rgba(255, 255, 255, 0.985);
  border-radius: var(--esp-radius-lg);
  box-shadow: var(--esp-shadow-lg);
  color: var(--esp-text-body);
  font-family: 'Montserrat', sans-serif;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-top: none !important;
}

@media (min-width: 768px) {
  .esp-container {
    padding: 1.85rem 3.25rem;
    margin: 0.65rem auto 4.5rem;
  }
}

/* --------------------------------------------------------------------------
   0. Barra de Progreso Superior (Scroll-Driven Reading Indicator)
   -------------------------------------------------------------------------- */
.esp-reading-progress-bar {
  display: none !important;
}
  top: 0;
  left: 0;
  width: 100%;
  height: 3.5px;
  background: linear-gradient(90deg, var(--esp-primary) 0%, var(--esp-gold) 100%);
  z-index: 99999;
  transform-origin: 0 50%;
  transform: scaleX(0);
}

@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: scroll())) {
    @keyframes esp-grow-progress {
      from { transform: scaleX(0); }
      to { transform: scaleX(1); }
    }
    .esp-reading-progress-bar {
      animation: esp-grow-progress auto linear;
      animation-timeline: scroll();
    }
  }
}

/* Reducción de espacio muerto entre la barra de navegación y el contenedor */
.main-content {
  padding-top: 0.5rem !important;
}

@media (min-width: 768px) {
  .main-content {
    padding-top: 0.85rem !important;
  }
}

/* Modificador cuando .faq-container aloja un artículo de serie (cluster) */
.faq-container.esp-article-container {
  background-color: #ffffff;
  border-radius: var(--esp-radius-lg);
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
  color: var(--esp-text-body);
  font-family: 'Montserrat', sans-serif;
  box-sizing: border-box;
  padding: 1.15rem 1.15rem;
  max-width: 820px;
  margin: 0.4rem auto 3.5rem !important;
  border: 1px solid rgba(226, 232, 240, 0.85);
}

@media (min-width: 768px) {
  .faq-container.esp-article-container {
    padding: 1.85rem 3.25rem;
    margin: 0.65rem auto 4.5rem !important;
  }
}

/* --------------------------------------------------------------------------
   2. Migas de Pan (Breadcrumbs) y Volver Atrás
   -------------------------------------------------------------------------- */
.esp-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--esp-text-muted);
  margin-bottom: 0.85rem;
  line-height: 1.4;
}

.esp-breadcrumb a {
  color: var(--esp-primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--esp-transition);
}

.esp-breadcrumb a:hover {
  color: var(--esp-gold);
  text-decoration: underline;
}

.esp-breadcrumb__sep {
  color: #94a3b8;
  font-size: 0.8rem;
  user-select: none;
}

.esp-breadcrumb__current {
  color: var(--esp-text-body);
  font-weight: 600;
}

.esp-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--esp-primary);
  text-decoration: none;
  margin-bottom: 1.5rem;
  padding: 0.4rem 0.85rem;
  background: var(--esp-bg-soft);
  border: 1px solid var(--esp-border);
  border-radius: var(--esp-radius-sm);
  transition: var(--esp-transition);
}

.esp-back-link:hover {
  background: var(--esp-bg-accent);
  color: var(--esp-primary-dark);
  transform: translateX(-3px);
}

/* --------------------------------------------------------------------------
   3. Barra de Seguimiento de la Guía (Guide Tracker - Top de Artículo)
   -------------------------------------------------------------------------- */
.esp-guide-tracker {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: linear-gradient(135deg, #f8fafc 0%, #edf2f9 100%);
  border: 1px solid var(--esp-border);
  border-radius: var(--esp-radius-md);
  padding: 0.55rem 0.95rem;
  margin-bottom: 1.15rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.esp-guide-tracker__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.esp-guide-tracker__left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.esp-guide-tracker__icon {
  font-size: 1rem;
  line-height: 1;
}

.esp-guide-tracker__guide-link {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--esp-primary);
  text-decoration: none;
  transition: var(--esp-transition);
}

.esp-guide-tracker__guide-link:hover {
  color: var(--esp-gold);
}

.esp-guide-tracker__badge {
  display: inline-flex;
  align-items: center;
  background: var(--esp-primary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.esp-guide-tracker__next-quick {
  font-size: 0.8rem;
  color: var(--esp-primary);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  background: #ffffff;
  border: 1px solid var(--esp-border);
  border-radius: var(--esp-radius-sm);
  transition: var(--esp-transition);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.esp-guide-tracker__next-quick:hover {
  background: var(--esp-primary);
  color: #ffffff;
  border-color: var(--esp-primary);
  transform: translateX(2px);
}

.esp-guide-progress-bar {
  width: 100%;
  height: 4px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.esp-guide-progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--esp-primary), var(--esp-gold-bright));
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* --------------------------------------------------------------------------
   4. Títulos y Cabeceras Editoriales
   -------------------------------------------------------------------------- */
.esp-header {
  margin-bottom: 1.25rem;
}

.esp-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}

.esp-title,
.esp-article-container h1,
.esp-article-title {
  text-align: start !important;
  font-size: clamp(1.42rem, 1.2rem + 0.75vw, 1.95rem) !important;
  font-weight: 700 !important;
  color: #121a3e !important;
  margin: 0.25rem 0 0.6rem !important;
  line-height: 1.28 !important;
  letter-spacing: -0.018em !important;
  text-wrap: balance;
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

.esp-title__accent {
  display: inline-block;
  width: 36px;
  height: 3px;
  background: linear-gradient(90deg, var(--esp-primary), var(--esp-gold));
  border-radius: 2px;
  margin-bottom: 0.85rem;
}

.esp-description {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--esp-text-body);
  margin-bottom: 1.5rem;
}

.esp-meta-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--esp-text-muted);
  margin-bottom: 1.25rem;
}

.esp-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  background: var(--esp-bg-soft);
  border: 1px solid var(--esp-border);
  border-radius: var(--esp-radius-sm);
  font-size: 0.78rem;
  color: var(--esp-text-body);
}

.esp-meta-chip strong {
  color: var(--esp-primary);
  font-weight: 600;
}

/* Badges de Estado */
.esp-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 9999px;
  line-height: 1;
}

.esp-badge--draft {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.esp-badge--published {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.esp-badge--pending {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: lowercase;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  margin-left: auto;
  white-space: nowrap;
}

.esp-badge--current {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #ffffff;
  background: var(--esp-gold);
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   5. Tipografía y Placer de Lectura Editorial (.esp-reading-content)
   Diseñado para máxima retención, calidez visual y confort ergonómico.
   -------------------------------------------------------------------------- */
.esp-reading-content {
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  font-size: 1.16rem;
  line-height: 1.88;
  color: #1e242d;
  letter-spacing: -0.003em;
  max-width: 70ch;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .esp-reading-content {
    font-size: 1.2rem;
    line-height: 1.9;
  }
}

.esp-reading-content p {
  margin-bottom: 1.7rem;
  text-align: start !important;
  text-wrap: pretty;
}

/* Párrafo de apertura (Lead) */
.esp-reading-content > p:first-of-type,
.esp-reading-content .article-content > p:first-of-type {
  font-size: 1.26rem;
  line-height: 1.75;
  color: #1a2238;
  font-weight: 400;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .esp-reading-content > p:first-of-type,
  .esp-reading-content .article-content > p:first-of-type {
    font-size: 1.32rem;
  }
}

/* Headings con contraste tipográfico elegante y jerarquía equilibrada */
.esp-reading-content h2,
.article-content h2 {
  font-family: 'Montserrat', sans-serif !important;
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  color: #121a3e !important;
  margin: 2.4rem 0 0.95rem !important;
  line-height: 1.32 !important;
  letter-spacing: -0.015em !important;
  text-wrap: balance;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.esp-reading-content h2:first-of-type,
.article-content h2:first-of-type {
  margin-top: 1rem !important;
}

.esp-reading-content h2::before,
.article-content h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.15em;
  background: linear-gradient(180deg, var(--esp-primary), #2c3e80);
  border-radius: 2px;
  flex-shrink: 0;
  margin-top: 0.12em;
}

.esp-reading-content h3,
.article-content h3 {
  font-family: 'Montserrat', sans-serif !important;
  font-size: 1.18rem !important;
  font-weight: 700 !important;
  color: #1d295f !important;
  margin: 1.8rem 0 0.75rem !important;
  line-height: 1.35 !important;
  text-wrap: balance;
}

.esp-reading-content ul,
.esp-reading-content ol {
  margin: 1.35rem 0 1.85rem 1.25rem;
  line-height: 1.75;
}

.esp-reading-content li {
  margin-bottom: 0.65rem;
}

/* Cajas de notas y advertencias (.article-box) - Cero bordes chillones ni subrayados */
.esp-reading-content .article-box,
.article-box {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-left: none !important;
  border-radius: 12px !important;
  padding: 1.5rem 1.75rem !important;
  margin: 2.2rem 0 !important;
  box-shadow: none !important;
}

.esp-reading-content .article-box h3,
.article-box h3 {
  border-bottom: none !important;
  padding-bottom: 0 !important;
  margin: 0 0 0.65rem 0 !important;
  font-family: 'Montserrat', sans-serif !important;
  font-size: 1.22rem !important;
  font-weight: 700 !important;
  color: #121a3e !important;
}

.esp-reading-content .article-box p,
.article-box p {
  margin-bottom: 0 !important;
  color: #334155 !important;
  font-size: 1.05rem !important;
  line-height: 1.75 !important;
}

/* Listas de puntos destacados (.article-list-highlights) - Lectura limpia sin bordes de acento */
.esp-reading-content .article-list-highlights,
.article-list-highlights {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.esp-reading-content .article-list-highlights li,
.article-list-highlights li {
  background: #f8fafc !important;
  border: 1px solid #eef2f6 !important;
  border-top: none !important;
  border-left: none !important;
  border-radius: 10px !important;
  padding: 1.2rem 1.5rem !important;
  margin-bottom: 0 !important;
  font-size: 1.05rem !important;
  line-height: 1.75 !important;
  color: #334155 !important;
  box-shadow: none !important;
  transition: background 0.18s ease;
}

.esp-reading-content .article-list-highlights li:hover,
.article-list-highlights li:hover {
  background: #f1f5f9 !important;
  transform: none !important;
  box-shadow: none !important;
}

.esp-reading-content .article-list-highlights li > strong:first-of-type,
.article-list-highlights li > strong:first-of-type {
  font-family: 'Montserrat', sans-serif;
  color: #121a3e;
  font-size: 1.06rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.esp-reading-content .article-list-highlights li > strong:first-of-type::before,
.article-list-highlights li > strong:first-of-type::before {
  content: "•";
  color: #1d295f;
  font-size: 1.4rem;
  line-height: 0;
  box-shadow: none !important;
  background: none !important;
  width: auto !important;
  height: auto !important;
}

/* --------------------------------------------------------------------------
   Paginador Minimalista de Capítulos (.esp-simple-pager)
   Cero ruido: solo navegación limpia "← Anterior" / "Siguiente →"
   -------------------------------------------------------------------------- */
.esp-simple-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 2.75rem 0 2rem;
  padding-top: 0;
  border-top: none;
  box-sizing: border-box;
}

.esp-simple-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.15rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--esp-primary);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.18s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.esp-simple-btn:hover {
  background: var(--esp-primary);
  color: #ffffff !important;
  border-color: var(--esp-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(29, 41, 95, 0.12);
}

.esp-simple-btn--prev:hover {
  transform: translateX(-2px);
}

.esp-simple-btn--next:hover {
  transform: translateX(2px);
}
.esp-next-card {
  margin: 2.75rem 0 2rem;
  background: linear-gradient(145deg, #ffffff 0%, #f9fbfd 100%);
  border: 1px solid var(--esp-border);
  border-radius: var(--esp-radius-lg);
  padding: 1.75rem 1.75rem;
  box-shadow: 0 8px 24px rgba(29, 41, 95, 0.06);
  transition: var(--esp-transition);
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .esp-next-card {
    padding: 2.25rem 2.5rem;
  }
}

.esp-next-card:hover {
  border-color: var(--esp-border-hover);
  box-shadow: 0 14px 32px rgba(29, 41, 95, 0.1);
  transform: translateY(-2px);
}

.esp-next-card--complete {
  background: linear-gradient(145deg, #ffffff 0%, #f0fdf4 100%);
  border-color: #bbf7d0;
}

.esp-next-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.esp-next-card__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--esp-gold-hover);
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
}

.esp-next-card__pill--success {
  color: #065f46;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.esp-next-card__step {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--esp-text-muted);
}

.esp-next-card__title {
  margin: 0 0 0.65rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--esp-primary);
  line-height: 1.32;
}

@media (min-width: 768px) {
  .esp-next-card__title {
    font-size: 1.55rem;
  }
}

.esp-next-card__summary {
  font-size: 0.98rem;
  color: var(--esp-text-body);
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

.esp-next-card__action {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.esp-btn--next-hero {
  background: linear-gradient(135deg, var(--esp-primary) 0%, var(--esp-primary-dark) 100%);
  color: #ffffff !important;
  font-size: 1rem;
  padding: 0.9rem 1.75rem;
  border-radius: var(--esp-radius-md);
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(29, 41, 95, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  transition: var(--esp-transition);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.esp-btn--next-hero:hover {
  background: var(--esp-primary-dark);
  box-shadow: 0 8px 24px rgba(29, 41, 95, 0.35);
  transform: translateX(4px);
  color: #ffffff !important;
}

.esp-btn--next-hero .esp-btn__arrow {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 1.15rem;
}

.esp-btn--next-hero:hover .esp-btn__arrow {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   7. Paginador de 3 Vías (Anterior / Índice / Siguiente)
   -------------------------------------------------------------------------- */
.esp-series-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.85rem;
  align-items: stretch;
  margin: 2rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--esp-border);
}

@media (max-width: 640px) {
  .esp-series-pager {
    grid-template-columns: 1fr;
  }
}

.esp-pager-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.85rem 1.15rem;
  background: var(--esp-bg-soft);
  border: 1px solid var(--esp-border);
  border-radius: var(--esp-radius-md);
  text-decoration: none;
  transition: var(--esp-transition);
  box-sizing: border-box;
}

.esp-pager-btn:hover {
  background: #ffffff;
  border-color: var(--esp-primary);
  box-shadow: var(--esp-shadow-sm);
  transform: translateY(-2px);
}

.esp-pager-btn--prev {
  text-align: left;
}

.esp-pager-btn--next {
  text-align: right;
}

.esp-pager-btn--index {
  text-align: center;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

.esp-pager-btn--disabled {
  opacity: 0.55;
  cursor: default;
  background: #f1f5f9;
}

.esp-pager-btn--disabled:hover {
  background: #f1f5f9;
  border-color: var(--esp-border);
  box-shadow: none;
  transform: none;
}

.esp-pager-btn__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--esp-text-muted);
}

.esp-pager-btn__title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--esp-primary);
  line-height: 1.35;
}

/* --------------------------------------------------------------------------
   8. Temario Desplegable de la Guía (.esp-series-toc-accordion)
   -------------------------------------------------------------------------- */
.esp-series-toc-accordion {
  margin: 2rem 0;
  background: #ffffff;
  border: 1px solid var(--esp-border);
  border-radius: var(--esp-radius-md);
  overflow: hidden;
  box-shadow: var(--esp-shadow-sm);
}

.esp-series-toc-summary {
  padding: 1rem 1.25rem;
  background: var(--esp-bg-soft);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--esp-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: var(--esp-transition);
  list-style: none;
}

.esp-series-toc-summary::-webkit-details-marker {
  display: none;
}

.esp-series-toc-summary:hover {
  background: var(--esp-bg-accent);
}

.esp-toc-toggle-icon {
  font-size: 0.75rem;
  color: var(--esp-text-muted);
  transition: transform 0.2s ease;
}

.esp-series-toc-accordion[open] .esp-toc-toggle-icon {
  transform: rotate(180deg);
}

.esp-series-toc-body {
  padding: 1rem 1.25rem;
  background: #ffffff;
  border-top: 1px solid var(--esp-border);
}

/* --------------------------------------------------------------------------
   9. Listado de Artículos / Capítulos (.esp-cluster-list)
   -------------------------------------------------------------------------- */
.esp-cluster-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.esp-cluster-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  background: var(--esp-bg-soft);
  border: 1px solid var(--esp-border);
  border-radius: var(--esp-radius-sm);
  transition: var(--esp-transition);
  text-decoration: none;
}

.esp-cluster-item:hover {
  background: #ffffff;
  border-color: var(--esp-primary);
  box-shadow: 0 4px 12px rgba(29, 41, 95, 0.08);
  transform: translateX(4px);
}

.esp-cluster-item--active {
  background: linear-gradient(135deg, #fffdf8 0%, #fdf8eb 100%) !important;
  border: 1.5px solid var(--esp-gold) !important;
  box-shadow: 0 2px 8px rgba(197, 155, 39, 0.15) !important;
}

.esp-cluster-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: var(--esp-bg-accent);
  color: var(--esp-primary);
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 50%;
  border: 1px solid rgba(29, 41, 95, 0.12);
  transition: var(--esp-transition);
}

.esp-cluster-item:hover .esp-cluster-num {
  background: var(--esp-primary);
  color: #ffffff;
}

.esp-cluster-num--active {
  background: var(--esp-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 5px rgba(29, 41, 95, 0.3);
}

.esp-cluster-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--esp-primary);
  text-decoration: none;
  flex: 1;
  line-height: 1.45;
  transition: var(--esp-transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.esp-cluster-item:hover .esp-cluster-title {
  color: var(--esp-primary-dark);
  font-weight: 600;
}

.esp-cluster-title--active {
  color: var(--esp-primary-dark) !important;
  font-weight: 700 !important;
}

.esp-cluster-arrow {
  color: #94a3b8;
  font-size: 1.1rem;
  line-height: 1;
  transition: var(--esp-transition);
  margin-left: 0.5rem;
}

.esp-cluster-item:hover .esp-cluster-arrow {
  color: var(--esp-gold);
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   10. Tarjetas de Especialidad y Página Pilar (Topic Guides)
   -------------------------------------------------------------------------- */
.esp-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.25rem;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2f9 100%);
  border: 1px solid var(--esp-border);
  border-radius: var(--esp-radius-md);
  margin-bottom: 2.25rem;
  box-shadow: var(--esp-shadow-sm);
}

.esp-stats-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.esp-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #ffffff;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--esp-border);
  font-size: 0.88rem;
  color: var(--esp-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.esp-stat-chip strong {
  color: var(--esp-primary);
  font-weight: 700;
}

.esp-stats-link {
  color: var(--esp-primary);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--esp-transition);
}

.esp-stats-link:hover {
  color: var(--esp-gold);
  transform: translateX(3px);
}

.esp-card {
  background: #ffffff;
  border: 1px solid var(--esp-border);
  border-radius: var(--esp-radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--esp-shadow-sm);
  transition: var(--esp-transition);
  position: relative;
}

@media (min-width: 768px) {
  .esp-card {
    padding: 2rem 2.25rem;
  }
}

.esp-card:hover {
  border-color: var(--esp-border-hover);
  box-shadow: var(--esp-shadow-md);
}

.esp-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.esp-card__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
}

.esp-card__title a {
  color: var(--esp-primary);
  text-decoration: none;
  transition: var(--esp-transition);
}

.esp-card__title a:hover {
  color: var(--esp-gold);
}

.esp-card__summary {
  color: var(--esp-text-body);
  font-size: 0.98rem;
  line-height: 1.6;
  margin: 0 0 1.25rem;
}

.esp-card__footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--esp-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.esp-card__footer .esp-btn {
  flex: 1 1 240px;
  max-width: 320px;
}

/* --------------------------------------------------------------------------
   11. Botones Genéricos (.esp-btn)
   -------------------------------------------------------------------------- */
.esp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--esp-radius-sm);
  transition: var(--esp-transition);
  cursor: pointer;
  line-height: 1.2;
  white-space: normal;
  text-align: center;
}

.esp-btn--primary {
  background: linear-gradient(135deg, var(--esp-primary) 0%, var(--esp-primary-light) 100%);
  color: #ffffff !important;
  border: none;
  box-shadow: 0 6px 16px rgba(29, 41, 95, 0.25);
}

.esp-btn--primary:hover {
  background: linear-gradient(135deg, var(--esp-primary-light) 0%, var(--esp-primary-dark) 100%);
  box-shadow: 0 8px 20px rgba(29, 41, 95, 0.35);
  transform: translateY(-2px);
}

.esp-btn--outline {
  background: #ffffff;
  color: var(--esp-primary) !important;
  border: 2px solid var(--esp-primary);
  box-shadow: 0 2px 8px rgba(29, 41, 95, 0.08);
}

.esp-btn--outline:hover {
  background: var(--esp-primary);
  color: #ffffff !important;
  border-color: var(--esp-primary);
  box-shadow: 0 6px 16px rgba(29, 41, 95, 0.2);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   12. Syllabus de la Guía Temática (Página de Pilar)
   -------------------------------------------------------------------------- */
.esp-syllabus {
  margin: 2.5rem 0;
  padding: 1.75rem 1.5rem;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--esp-border);
  border-radius: var(--esp-radius-md);
  box-shadow: var(--esp-shadow-sm);
}

@media (min-width: 768px) {
  .esp-syllabus {
    padding: 2.25rem;
  }
}

.esp-syllabus__title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--esp-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.esp-syllabus__subtitle {
  font-size: 0.92rem;
  color: var(--esp-text-muted);
  margin: 0 0 1.5rem;
}

/* --------------------------------------------------------------------------
   13. Tarjeta de Contacto / Asesoramiento Legal
   -------------------------------------------------------------------------- */
.esp-contact-card {
  margin-top: 2.75rem;
  padding: 1.75rem 2rem;
  background: linear-gradient(135deg, var(--esp-primary-light) 0%, var(--esp-primary) 100%);
  border-radius: var(--esp-radius-md);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
  box-shadow: 0 10px 25px rgba(29, 41, 95, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.esp-contact-card__info h4 {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
  color: #ffffff;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.esp-contact-card__info p {
  margin: 0;
  font-size: 0.95rem;
  color: #f1f5f9;
  line-height: 1.55;
}

.esp-contact-card .esp-btn {
  background: var(--esp-gold);
  color: #1a1a1a !important;
  border-color: var(--esp-gold);
  font-weight: 700;
  padding: 0.9rem 2rem;
  font-size: 1.05rem;
  box-shadow: 0 6px 16px rgba(197, 155, 39, 0.4);
  border-radius: var(--esp-radius-md);
}

.esp-contact-card .esp-btn:hover {
  background: var(--esp-gold-bright);
  border-color: var(--esp-gold-bright);
  color: #000000 !important;
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   14. Barra Flotante de Lectura Rápida (.esp-floating-reader-pill)
   -------------------------------------------------------------------------- */
.esp-floating-reader-pill {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(140%);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(18, 26, 62, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  padding: 0.55rem 0.85rem 0.55rem 1.15rem;
  border-radius: 9999px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.18);
  z-index: 9000;
  font-family: 'Montserrat', sans-serif;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  max-width: 92vw;
  box-sizing: border-box;
}

.esp-floating-reader-pill--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.esp-floating-reader-pill__info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.esp-floating-reader-pill__step {
  font-weight: 700;
  color: #fde68a;
  white-space: nowrap;
}

.esp-floating-reader-pill__sep {
  opacity: 0.4;
}

.esp-floating-reader-pill__current-title {
  color: #cbd5e1;
  display: none;
}

@media (min-width: 640px) {
  .esp-floating-reader-pill__current-title {
    display: inline;
  }
}

.esp-floating-reader-pill__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--esp-gold);
  color: #121a3e;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.38rem 0.85rem;
  border-radius: 9999px;
  text-decoration: none;
  transition: background 0.18s, transform 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
}

.esp-floating-reader-pill__btn:hover {
  background: #d4af37;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   15. Tarjeta de Puntos Clave / Key Takeaways (.esp-takeaways-card)
   -------------------------------------------------------------------------- */
.esp-takeaways-card {
  background: #fbfcfe;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--esp-primary);
  border-radius: var(--esp-radius-md);
  padding: 1.35rem 1.5rem;
  margin: 1.75rem 0 2.25rem;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
}

.esp-takeaways-card__header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.esp-takeaways-card__icon {
  font-size: 1.25rem;
}

.esp-takeaways-card__title {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #121a3e;
}

.esp-takeaways-card__list {
  margin: 0;
  padding-left: 1.25rem;
  list-style: disc;
  color: #334155;
  font-size: 0.98rem;
  line-height: 1.65;
}

.esp-takeaways-card__list li {
  margin-bottom: 0.5rem;
}

.esp-takeaways-card__list li strong {
  color: #1d295f;
}
