/* ============================================================
   Estilos comunes de las páginas de sesión
   ============================================================ */

.sesion-hero {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 10% 0%, rgba(138,196,47,0.10) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
}
@media (max-width: 600px) {
  .sesion-hero { padding: 28px 0 22px; }
}
.sesion-hero .crumbs {
  font-size: var(--fs-sm);
  color: var(--text-3);
  margin-bottom: var(--sp-2);
}
.sesion-hero .crumbs a { color: var(--text-3); }
.sesion-hero .crumbs a:hover { color: var(--efc-green); }
.sesion-hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  margin-bottom: var(--sp-2);
}
.sesion-hero h1 .accent { color: var(--efc-green); }
.sesion-hero .sub {
  font-size: var(--fs-lg);
  color: var(--text-2);
  max-width: 760px;
  margin-bottom: var(--sp-3);
}
.sesion-hero .meta {
  display: flex; flex-wrap: wrap; gap: 10px;
}

/* Layout dos columnas: TOC sticky a la izquierda + contenido a la derecha
   (orden HTML: aside.toc primero, main después) */
.sesion-body {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: var(--sp-5);
  padding: var(--sp-5) 0;
}
@media (max-width: 980px) {
  .sesion-body {
    grid-template-columns: 1fr;
    gap: var(--sp-3);
  }
  .toc { position: static !important; max-height: none !important; }
}

.toc {
  position: sticky;
  top: 96px;
  align-self: start;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--rad-md);
  padding: var(--sp-3);
  max-height: calc(100vh - 120px);
  overflow: auto;
}
.toc h4 {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-3);
}
.toc ol {
  list-style: none;
  padding: 0; margin: 0;
  counter-reset: toc;
}
.toc li { counter-increment: toc; margin-bottom: 8px; }
.toc li a {
  display: flex; align-items: flex-start; gap: 10px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
  line-height: 1.45;
}
.toc li a::before {
  content: counter(toc);
  background: rgba(138,196,47,0.18);
  color: var(--efc-green);
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-weight: 800; font-size: 12px;
  flex: 0 0 22px;
}
.toc li a:hover {
  background: rgba(138,196,47,0.10);
  color: var(--text-1);
}
.toc li a.active {
  background: rgba(138,196,47,0.18);
  color: var(--text-1);
}

/* Secciones del contenido */
.seccion {
  margin-bottom: var(--sp-6);
  padding-top: var(--sp-3);
  scroll-margin-top: 88px;
}
.seccion h2 {
  margin-top: 0;
  display: flex; align-items: center; gap: 14px;
}
.seccion h2 .n {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: var(--efc-green);
  color: var(--efc-black);
  border-radius: 12px;
  font-size: 1.3rem;
  flex: 0 0 44px;
}

/* Video embebido */
.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--rad-md);
  overflow: hidden;
  margin: var(--sp-3) 0;
  border: 1px solid var(--border);
}
.video-wrap iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.video-cap {
  font-size: var(--fs-sm);
  color: var(--text-3);
  margin-top: -8px;
  margin-bottom: var(--sp-3);
}

/* Audio narrado */
.audio-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: var(--sp-3) 0;
  padding: 14px 18px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: var(--rad-md);
}
.audio-row .ico {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--efc-green);
  color: var(--efc-black);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex: 0 0 38px;
}
.audio-row audio { flex: 1; min-width: 0; }
.audio-row .label {
  font-size: var(--fs-sm);
  color: var(--text-3);
}

/* Diagramas / ilustraciones SVG */
.diagrama {
  background: linear-gradient(180deg, #0c1424 0%, #08111f 100%);
  border: 1px solid var(--border);
  border-radius: var(--rad-md);
  padding: var(--sp-4);
  margin: var(--sp-3) 0;
  display: flex; flex-direction: column; align-items: center;
}
.diagrama .leyenda {
  font-size: var(--fs-sm);
  color: var(--text-3);
  margin-top: 14px;
  text-align: center;
}

/* Comparativa lado-a-lado */
.compara {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr 1fr;
  margin: var(--sp-3) 0;
}
@media (max-width: 720px) { .compara { grid-template-columns: 1fr; } }
.compara > div {
  padding: var(--sp-3);
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: var(--rad-md);
}
.compara h5 {
  margin: 0 0 10px;
  font-size: var(--fs-lg);
  color: var(--efc-green);
}

/* Callout */
.callout {
  border-left: 4px solid var(--efc-orange);
  background: rgba(255, 122, 0, 0.08);
  padding: var(--sp-3);
  border-radius: 0 var(--rad-md) var(--rad-md) 0;
  margin: var(--sp-3) 0;
}
.callout strong { color: var(--efc-orange); }

/* Mini-quiz */
.quiz {
  background: var(--panel);
  border: 2px solid var(--efc-green);
  border-radius: var(--rad-md);
  padding: var(--sp-4);
  margin: var(--sp-4) 0;
}
.quiz h4 {
  margin: 0 0 var(--sp-3);
  color: var(--efc-green);
  font-size: var(--fs-lg);
}
.quiz-q { margin-bottom: var(--sp-3); }
.quiz-q p { font-weight: 700; margin-bottom: 8px; color: var(--text-1); }
.quiz-opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  margin-bottom: 8px;
  background: #0d1424;
  color: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: var(--fs-base);
  font-weight: 500;
  line-height: 1.4;
  transition: all 0.15s;
}
.quiz-opt:hover {
  border-color: var(--efc-green);
  background: #111c33;
}
.quiz-opt.correct {
  background: rgba(138,196,47,0.18);
  border-color: var(--efc-green);
  color: #d4f59a;
  font-weight: 700;
}
.quiz-opt.wrong {
  background: rgba(232,80,80,0.18);
  border-color: rgba(232,80,80,0.5);
  color: #ffb4b4;
  font-weight: 700;
}

/* Footer de sesión: marcar completada y navegar */
.sesion-foot {
  margin-top: var(--sp-5);
  padding: var(--sp-4);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--rad-lg);
  text-align: center;
}
.sesion-foot h3 { color: var(--efc-green); margin-top: 0; }
.sesion-foot .row {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
  margin-top: var(--sp-3);
}

/* Tooltip simple para glosario */
.term-en[data-tip] { position: relative; }
.term-en[data-tip]:hover::after,
.term-en[data-tip]:focus::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%; bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  border: 1px solid var(--efc-green);
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  z-index: 100;
  pointer-events: none;
}
