/* Paquete ayuda-legal — corrección del frontend 13-sep-2026 (docs/auditoria/frontend-vistas-2026-09-13.md). */

/* ---------------------------------------------------------------------------
 * Centro de ayuda: tarjetas enteras clicables (AYU-16).
 * Sólo el título era enlace; en móvil tocar la descripción no hacía nada. El
 * ::after del enlace cubre la tarjeta: sigue habiendo UN solo enlace (un lector
 * de pantalla no oye el mismo destino dos veces) y el foco lo marca la tarjeta.
 * ------------------------------------------------------------------------ */
.ayuda-tarjeta {
  position: relative;
}

.ayuda-tarjeta__titulo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--ac-txt);
}

.ayuda-tarjeta__titulo > i {
  color: var(--ac-acento);
  width: 1.25rem;
  text-align: center;
}

.ayuda-tarjeta__enlace {
  color: inherit;
  text-decoration: none;
}

.ayuda-tarjeta__enlace::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.ayuda-tarjeta__enlace:focus-visible {
  outline: none;
}

.ayuda-tarjeta:focus-within {
  outline: 2px solid var(--ac-acento);
  outline-offset: 2px;
}

.ayuda-tarjeta p {
  margin: 0;
  color: var(--ac-txt-2);
}

.ayuda-tarjeta p + p {
  margin-top: 0.5rem;
}

.ayuda-soporte__contacto {
  font-family: var(--ac-fuente-codigo);
  color: var(--ac-txt) !important;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------------------
 * Secciones y tabla de contenido de FAQ, reglas e instrucciones.
 * ------------------------------------------------------------------------ */
.ayuda-toc,
.ayuda-seccion {
  margin-bottom: var(--ac-espacio, 1rem);
}

.ayuda-seccion > h2 {
  margin: 0;
  padding: 0.9rem 1.15rem 0;
  font-size: 1.15rem;
}

.ayuda-seccion > .academy-prose,
.ayuda-toc > .academy-prose {
  padding: 0.5rem 1.15rem 1rem;
  margin: 0;
}

.ayuda-toc ol {
  padding-left: 2.4rem;
}

/* DIS-AA-05: los enlaces del índice medían 36px de alto en móvil. */
.ayuda-toc li a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* El destino de un ancla queda bajo la barra superior fija si no se reserva. */
.ayuda-seccion,
.academy-faq details {
  scroll-margin-top: 5rem;
}

.academy-prose pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------------------
 * Niveles de experiencia (AYU-04).
 * ------------------------------------------------------------------------ */
/*
 * DIS-AA-02: a 390px la tercera columna quedaba cortada («% DE ALUM») sin
 * indicio de que se pudiera desplazar, y el contenedor no era enfocable. Ahora
 * la tabla cabe en móvil (celdas y encabezados más compactos, chip bajo el
 * nombre; medido a 390px: 330 de 330) y el contenedor es una región enfocable,
 * desplazable con teclado si un nivel con cifras largas la hiciera desbordar.
 * Sin sombra de «hay más»: su capa de cubierta no casaba con el fondo del panel
 * y pintaba una franja oscura aunque la tabla cupiera.
 */
.ayuda-tabla-scroll {
  overflow-x: auto;
}

.ayuda-tabla-scroll:focus-visible {
  outline: 2px solid var(--ac-acento);
  outline-offset: -2px;
}

/* Selectores con .ayuda-tabla-scroll delante: este bloque va ANTES de las reglas
   base de .ayuda-niveles y, con la misma especificidad, perdía contra ellas
   (medido: el padding seguía en 18.4px y la tabla medía 381px en 330). */
@media (max-width: 575.98px) {
  .ayuda-tabla-scroll .ayuda-niveles th,
  .ayuda-tabla-scroll .ayuda-niveles td {
    padding: 0.5rem 0.5rem;
  }

  .ayuda-tabla-scroll .ayuda-niveles thead th {
    font-size: 0.72rem;
    letter-spacing: 0;
  }

  .ayuda-tabla-scroll .ayuda-cifra {
    font-size: 0.85rem;
  }

  .ayuda-niveles .ayuda-chip-actual {
    display: table;
    margin: 0.3rem 0 0;
  }
}

.ayuda-niveles {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--ac-fuente);
}

.ayuda-niveles th,
.ayuda-niveles td {
  padding: 0.6rem 1.15rem;
  border-top: 1px solid var(--ac-linea);
  text-align: left;
  color: var(--ac-txt-2);
  font-weight: 400;
}

.ayuda-niveles thead th {
  border-top: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ac-txt-3);
}

.ayuda-niveles tbody th {
  color: var(--ac-txt);
  font-weight: 600;
}

.ayuda-cifra {
  font-family: var(--ac-fuente-cifras);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ayuda-niveles tr.es-actual {
  background: var(--ac-acento-suave);
}

.ayuda-niveles tr.es-actual th {
  box-shadow: inset 3px 0 0 var(--ac-acento);
}

.ayuda-chip-actual {
  margin-left: 0.5rem;
  vertical-align: middle;
  border-color: var(--ac-acento);
  color: var(--ac-acento);
}

/* ---------------------------------------------------------------------------
 * Créditos (movido desde el registerCss de credits/index.php).
 * ------------------------------------------------------------------------ */
.academy-credits__list { display: flex; flex-direction: column; }
.academy-credit { padding: 1.25rem 0; border-top: 1px solid var(--ac-linea); }
.academy-credit:first-child { border-top: 0; padding-top: 0; }
.academy-credit:last-child { padding-bottom: 0; }
.academy-credit > h2 { margin: 0 0 0.75rem; font-size: 18px; }
.academy-credit__body > :first-child { margin-top: 0; }
.academy-credit__body > :last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------------------
 * Documentos legales (AYU-02/05).
 * ------------------------------------------------------------------------ */
.ayuda-legal-documento {
  max-width: 80ch;
}

.ayuda-legal-documento .academy-prose {
  max-width: 72ch;
}

.ayuda-legal-pendiente {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--ac-aviso);
  border-radius: var(--ac-r);
  background: var(--ac-aviso-suave);
  color: var(--ac-txt);
}

.ayuda-legal-pendiente p,
.ayuda-legal-pendiente ul {
  margin: 0;
}

.ayuda-legal-pendiente ul {
  margin-top: 0.4rem;
  padding-left: 1.2rem;
}

/* Dato que la institución no ha aportado: visible, nunca disimulado. */
.ayuda-faltante {
  padding: 0 0.3em;
  border-radius: var(--ac-r-sm);
  background: var(--ac-aviso-suave);
  color: var(--ac-aviso);
  font-weight: 600;
}
