/* Valhalla Typology — Academia (Etapa 5).
   Hoja DEDICADA, cargada solo en /academia/. Estética Valhalla forjada:
   la puerta (dorado #d9a441/#f1cf75, bronce, atardecer #e87b2e,
   turquesa #2aa198, roca) sobre base #04070f; Cinzel títulos, Manrope cuerpo.
   Tokens y componentes base viven en style.css (sistema «Valhalla
   forjada»); aquí solo lo propio de Academia: rangos con material
   distinto por escalón, test, expediente, Temas Selectos, rúbrica
   como escala visible y reconocimiento como galería.
   Móvil primero (390px): una columna, botones grandes, sin
   desbordamiento horizontal. */

main.wrap h1 {
  font-size: clamp(1.7rem, 5vw, 2.2rem);
  font-weight: 900;
  letter-spacing: .02em;
  line-height: 1.12;
  color: var(--gold-soft);
  margin: .1em 0 .3em;
}
main.wrap h2 {
  font-size: 1.35rem;
  letter-spacing: .06em;
  color: var(--gold-soft);
  margin: 1.4em 0 .5em;
}
main.wrap h3 { color: var(--gold-soft); }

.acad-card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin: 12px 0;
  overflow-wrap: break-word;
  box-shadow: var(--shadow-inset-top), var(--shadow-flat);
}
.acad-card h3 { margin-top: 0; }
.acad-card ul, .acad-card ol { margin: .4em 0 .9em; padding-left: 1.3em; }
.acad-card li { margin: .25em 0; }

/* Mi progreso: la tarjeta manda, con filete dorado a la izquierda. */
#acad-progress .acad-card { border-left: 4px solid var(--gold); }
#acad-progress .acad-card p:first-child { font-size: 1.05rem; }
#acad-progress .acad-card p:first-child strong {
  font-family: var(--font-head);
  color: var(--gold-soft);
  letter-spacing: .03em;
}

/* ---------- Catálogo de rangos: seis escalones, seis materiales ----------
   La progresión se lee por el material, no por seis tarjetas clonadas:
   1 piedra · 2 brasa · 3 marea · 4 reliquia · 5 roca con filo dorado ·
   6 reliquia dorada (Maestro). El número es un sello, no «1. » de lista. */
.acad-rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  counter-reset: acad-rank;
}
.acad-rank {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  overflow-wrap: break-word;
  background: linear-gradient(180deg, var(--card-2), var(--card));
}
/* 1 · Nuevo Aprendiz — pizarra: plana, radio casi recto, sin sombra. */
.acad-rank-list > li:nth-child(1) {
  background: var(--bg-2);
  border-radius: var(--r-sharp);
  box-shadow: none;
}
/* 2 · Aprendiz — brasa, filete atardecer. */
.acad-rank-list > li:nth-child(2) {
  background: linear-gradient(180deg, var(--surface-ember), var(--surface-rock));
  border-left: 4px solid var(--sunset);
  box-shadow: var(--shadow-flat);
}
/* 3 · Observador — marea, filete turquesa. */
.acad-rank-list > li:nth-child(3) {
  background: linear-gradient(180deg, var(--surface-tide), var(--bg-2));
  border-left: 4px solid var(--teal);
  box-shadow: var(--shadow-flat);
}
/* 4 · Tipeador Aprendiz — reliquia: roca cálida, doble borde, runa. */
.acad-rank-list > li:nth-child(4) {
  background: linear-gradient(180deg, var(--surface-rock-2), var(--surface-rock));
  border: 1px solid rgba(217, 164, 65, .38);
  box-shadow: 0 0 0 1px var(--line),
    inset 0 0 0 1px rgba(217, 164, 65, .16),
    var(--shadow-depth);
}
/* 5 · Tipeador — roca con filo dorado a la izquierda. */
.acad-rank-list > li:nth-child(5) {
  background: linear-gradient(180deg, var(--surface-rock-2), var(--bg-2));
  border-left: 4px solid var(--gold);
  box-shadow: var(--shadow-depth);
}
/* 6 · Maestro Tipeador — reliquia dorada: la pieza mayor. */
.acad-rank-list > li:nth-child(6) {
  background: linear-gradient(180deg, var(--surface-rock-2), var(--surface-rock));
  border: 1px solid var(--gold);
  box-shadow: 0 0 0 1px rgba(217, 164, 65, .35), var(--shadow-depth);
}
.acad-rank-list > li:nth-child(4)::before,
.acad-rank-list > li:nth-child(6)::before {
  content: var(--rune-mark);
  position: absolute;
  top: 8px;
  right: 12px;
  color: var(--gold-dim);
  opacity: .55;
  font-size: 1rem;
  line-height: 1;
  pointer-events: none;
}
/* Estado con marca además de color: banda superior grabada. */
.acad-rank.approved { border-top: 3px solid var(--gold); }
.acad-rank.current { border-top: 3px solid var(--teal); }
.acad-rank-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.acad-rank-head h3 {
  margin: 0;
  font-size: 1.1rem;
  counter-increment: acad-rank;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
/* Sello numerado del escalón (A2: progresión, no lista numerada). */
.acad-rank-head h3::before {
  content: counter(acad-rank);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--gold-dim);
  outline: 1px solid rgba(217, 164, 65, .25);
  outline-offset: 2px;
  background: var(--surface-rock);
  color: var(--gold-bright);
  font-family: var(--font-head);
  font-weight: 900;
  font-size: .95rem;
}
.acad-rank-status { margin-left: auto; }
.acad-rank-req { color: var(--muted); font-size: .95rem; }
.acad-rank-req strong { color: var(--text); }
.acad-materials { margin: 10px 0 0; padding-left: 1.2em; }
.acad-materials li {
  margin: 0;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.acad-materials li:last-child { border-bottom: none; }
.acad-materials .read { color: var(--ok); font-weight: 700; }
.acad-materials .unread { color: var(--sunset-soft); }
.acad-rank-actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.acad-block-note {
  color: var(--sunset-soft);
  font-size: .92rem;
  margin: 10px 0 0;
  border-left: 3px solid var(--sunset);
  padding-left: 10px;
}
.acad-social-note {
  color: var(--teal-bright);
  font-size: .92rem;
  margin: 10px 0 0;
  border-left: 3px solid var(--teal);
  padding-left: 10px;
}

/* ---------- Test: preguntas con jerarquía, opciones forjadas ---------- */
.acad-question {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 14px 0;
}
.acad-question:first-of-type { border-top: none; }
.acad-question legend, .acad-question .q-text {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
  margin-bottom: 8px;
  overflow-wrap: break-word;
}
.acad-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 8px 40px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 6px 0;
  cursor: pointer;
  overflow-wrap: break-word;
  background: var(--bg-2);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.acad-option:hover {
  border-color: var(--gold-dim);
  background: var(--surface-rock-2);
}
.acad-option input { margin-top: 4px; flex: none; width: 18px; height: 18px; accent-color: var(--gold); }
.acad-option:has(input:checked) {
  border-color: var(--gold);
  background: rgba(217, 164, 65, .12);
  box-shadow: inset 0 0 0 1px rgba(217, 164, 65, .35);
}
/* Sello de opción elegida (A4: la elegida se marca, no solo se tiñe). */
.acad-option:has(input:checked)::after {
  content: "✓";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: var(--surface-rock);
  color: var(--gold-bright);
  font-size: .8rem;
  font-weight: 700;
}
/* Resultado como veredicto (A5: no solo un número de color). */
.acad-verdict { border-top: 4px solid var(--gold); }
.acad-verdict.pass { border-top-color: var(--ok); }
.acad-verdict.fail { border-top-color: var(--sunset); }
.acad-score {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: .02em;
  color: var(--gold-soft);
  margin: .4em 0;
}
.acad-score.pass { color: var(--ok); }
.acad-score.fail { color: var(--sunset-soft); }
.acad-verdict p strong {
  font-family: var(--font-head);
  letter-spacing: .04em;
}

/* ---------- Expediente: bloques densos, rúbrica legible ---------- */
.acad-typing {
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold-dim);
  border-radius: 2px;
  padding: 14px;
  margin: 12px 0;
  background: var(--bg-2);
  box-shadow: none;
}
.acad-typing h4 {
  margin: 0 0 4px;
  font-family: var(--font-head);
  font-size: 1rem;
  letter-spacing: .03em;
  color: var(--gold-soft);
}
.acad-review {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 10px 0;
  background: var(--bg-2);
  font-size: .95rem;
}
/* Escala de rúbrica como escala visible (A6: no píldoras sueltas). */
.acad-review .rubric-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}
.acad-review .rubric-levels .badge {
  font-family: var(--font-head);
  text-transform: none;
  letter-spacing: .02em;
  font-size: .8rem;
  background: var(--surface-rock);
  border-color: var(--gold-dim);
  color: var(--gold-soft);
}

/* ---------- Temas Selectos: cuatro módulos, cuatro materiales ---------- */
.acad-topics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  counter-reset: acad-topic;
}
@media (min-width: 640px) {
  .acad-topics { grid-template-columns: 1fr 1fr; }
}
.acad-topic {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  overflow-wrap: break-word;
  background: linear-gradient(180deg, var(--card-2), var(--card));
}
.acad-topic:nth-child(1) {
  background: linear-gradient(180deg, var(--surface-ember), var(--surface-rock));
  border-left: 4px solid var(--sunset);
  box-shadow: var(--shadow-flat);
}
.acad-topic:nth-child(2) {
  background: linear-gradient(180deg, var(--surface-tide), var(--bg-2));
  border-left: 4px solid var(--teal);
  box-shadow: var(--shadow-flat);
}
.acad-topic:nth-child(3) {
  background: linear-gradient(180deg, var(--surface-rock-2), var(--surface-rock));
  border: 1px solid rgba(217, 164, 65, .38);
  box-shadow: 0 0 0 1px var(--line),
    inset 0 0 0 1px rgba(217, 164, 65, .16),
    var(--shadow-depth);
}
.acad-topic:nth-child(3)::before {
  content: var(--rune-mark);
  position: absolute;
  top: 8px;
  right: 12px;
  color: var(--gold-dim);
  opacity: .55;
  font-size: 1rem;
  line-height: 1;
  pointer-events: none;
}
.acad-topic:nth-child(4) {
  background: var(--bg-2);
  border-radius: var(--r-sharp);
  box-shadow: none;
}
.acad-topic.accredited { border-top: 3px solid var(--teal); }
.acad-topic h3 {
  margin-top: 0;
  counter-increment: acad-topic;
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Numeración romana del módulo, en sello. */
.acad-topic h3::before {
  content: counter(acad-topic, upper-roman);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--gold-dim);
  outline: 1px solid rgba(217, 164, 65, .25);
  outline-offset: 2px;
  background: var(--surface-rock);
  color: var(--gold-bright);
  font-family: var(--font-head);
  font-weight: 900;
  font-size: .9rem;
}
.acad-topic .resources { margin: 8px 0 0; padding-left: 1.2em; }
.acad-topic .resources li { margin: .3em 0; }

/* ---------- Rúbrica publicada: escala de cuatro peldaños ---------- */
.acad-rubric { border-left: 4px solid var(--gold); }
.acad-scale {
  list-style: none;
  padding: 0;
  margin: .6em 0 1em;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  counter-reset: acad-level;
}
@media (min-width: 640px) {
  .acad-scale { grid-template-columns: repeat(4, 1fr); }
}
.acad-scale li {
  counter-increment: acad-level;
  border: 1px solid var(--line);
  border-top: 3px solid var(--bronze);
  border-radius: 12px;
  padding: 12px;
  background: var(--bg-2);
  font-size: .92rem;
}
.acad-scale li:nth-child(2) { border-top-color: var(--gold-dim); }
.acad-scale li:nth-child(3) { border-top-color: var(--gold); }
.acad-scale li:nth-child(4) {
  border-top-color: var(--gold-bright);
  background: linear-gradient(180deg, var(--surface-rock-2), var(--surface-rock));
}
.acad-scale li strong {
  display: block;
  font-family: var(--font-head);
  color: var(--gold-soft);
  margin-bottom: 4px;
}
.acad-scale li strong::before {
  content: counter(acad-level, upper-roman) ". ";
  color: var(--gold-dim);
}

/* ---------- Reconocimiento: galería de candidatos ---------- */
.acad-candidates {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 640px) {
  .acad-candidates { grid-template-columns: 1fr 1fr; }
}
#acad-recognition .acad-card h3:not(:first-child) { margin-top: 1.2em; }
.acad-candidate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--bg-2);
}
.acad-candidate > span:first-child {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--text);
}
.acad-candidate .votes {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--gold-bright);
  white-space: nowrap;
  border: 1px solid var(--gold-dim);
  background: var(--surface-rock);
  border-radius: 999px;
  padding: 4px 12px;
}
.acad-vote-form label { display: block; margin: 12px 0 4px; }

/* ---------- Avisos y vacíos con identidad (A8) ---------- */
.acad-empty {
  color: var(--muted);
  font-style: italic;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
}
.acad-api-note {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--gold-dim);
  background: var(--bg-2);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: .95rem;
  box-shadow: var(--shadow-flat);
}
.acad-api-note::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
}
.acad-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.acad-actions .btn { flex: 1 1 auto; }
@media (min-width: 640px) {
  .acad-actions .btn { flex: 0 0 auto; }
}

/* Móvil 390px: sin desbordamiento horizontal; los botones ocupan
   todo el ancho disponible y el texto se parte donde toca. */
@media (max-width: 480px) {
  .acad-rank, .acad-card, .acad-topic { padding: 14px; }
  .acad-rank-status { margin-left: 0; }
  .btn { width: 100%; }
  .acad-rank-actions .btn { width: 100%; }
  .acad-candidate { align-items: flex-start; }
}
