/* =========================================================================
   Edición web — guía docente de diseño web
   Hoja de estilos única, 100% local (sin dependencias externas).
   Modo claro, pensado para estudiantes sin conocimientos previos:
   colores suaves, un único acento (verde) y sin jerga técnica.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Reset básico
   ------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

ul, ol { margin: 0; padding: 0; }
figure { margin: 0; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

a { color: inherit; text-decoration: none; }

/* -------------------------------------------------------------------------
   2. Tokens de diseño (colores, tipografía, espaciado, formas)
   ------------------------------------------------------------------------- */
:root {
  /* Fondo y superficies (modo claro) */
  --bg: #f7f9f3;
  --surface: #ffffff;
  --surface-alt: #eef6e1;
  --surface-muted: #f2f4ee;
  --border: #e3e8da;
  --border-strong: #cfd8c2;

  /* Texto */
  --text: #23291d;
  --text-body: #454f42;
  --text-muted: #78826f;

  /* Acento principal — verde, sustituye al azul */
  --primary: #92d050;
  --primary-strong: #6ea832;
  --primary-softer: #b9e186;
  --primary-soft-bg: #e6f5d6;
  --on-primary: #1c2b0d;

  /* Estados */
  --success: #4caf50;
  --warning: #e0a721;

  /* Tipografía — familias locales del sistema, sin cargas externas */
  --font-display: "Segoe UI Semibold", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  /* Radios */
  --radius-sm: .5rem;
  --radius-md: .75rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;
  --radius-full: 9999px;

  /* Espaciado */
  --gutter-xs: .25rem;
  --gutter-sm: .5rem;
  --gutter-md: 1rem;
  --gutter-lg: 1.5rem;
  --gutter-xl: 2rem;
  --gutter-2xl: 3rem;
  --gutter-3xl: 4.5rem;

  /* Elevación */
  --shadow-card: 0 1px 2px rgba(35, 41, 29, .04), 0 10px 26px -14px rgba(35, 41, 29, .18);
  --shadow-hover: 0 16px 32px -14px rgba(110, 168, 50, .38);

  --topbar-h: 4.25rem;
  --sidebar-w: 300px;
}

/* -------------------------------------------------------------------------
   3. Base tipográfica
   ------------------------------------------------------------------------- */
body {
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text);
  letter-spacing: -.01em;
  line-height: 1.25;
  margin: 0;
}

p { margin: 0 0 var(--gutter-md); color: var(--text-body); }
p:last-child { margin-bottom: 0; }

::selection { background: var(--primary-softer); color: var(--on-primary); }

/* Scrollbar (progresivo, no rompe si el navegador no lo soporta) */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); }

/* El topbar queda fijo (sticky) sobre el contenido: sin este hueco, saltar a
   una sección con el índice o con un enlace #ancla la dejaría tapada detrás
   de la barra. scroll-padding-top le dice al navegador que reserve ese
   espacio al calcular cualquier salto a un ancla, sea cual sea el destino. */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 1rem); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* -------------------------------------------------------------------------
   4. Barra superior (topbar)
   ------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gutter-md);
  padding: 0 var(--gutter-md);
  max-width: 1440px;
  margin: 0 auto;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: var(--gutter-lg);
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-shrink: 0;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.topbar__nav-link {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem .9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .85rem;
  color: var(--text-body);
  white-space: nowrap;
}

.topbar__nav-link svg { width: 1rem; height: 1rem; flex-shrink: 0; color: var(--primary-strong); }

.topbar__nav-link:hover { background: var(--surface-alt); border-color: var(--border-strong); }

.topbar__nav-link.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.topbar__nav-link.is-active svg { color: var(--on-primary); }

.brand__mark {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.brand__title span { color: var(--primary-strong); }

.topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--gutter-sm);
}

.progress-pill {
  display: none;
  align-items: center;
  gap: .5rem;
  padding: .4rem .85rem;
  border-radius: var(--radius-full);
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: .8rem;
}

.progress-pill__dot {
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: var(--primary-strong);
}

.menu-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  color: var(--text);
}

.menu-toggle:hover { background: var(--surface-alt); }

/* -------------------------------------------------------------------------
   5. Layout general (sidebar + contenido)
   ------------------------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  align-items: start;
  max-width: 1440px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: var(--gutter-lg) var(--gutter-md) var(--gutter-2xl);
}

.sidebar__hint {
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 0 .5rem var(--gutter-md);
}

.content {
  min-width: 0;
  padding: 0 var(--gutter-md);
}

.content__inner {
  max-width: 860px;
  margin: 0 auto;
  padding: var(--gutter-xl) 0 var(--gutter-3xl);
}

/* Overlay para el sidebar en móvil */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(35, 41, 29, .35);
}

/* -------------------------------------------------------------------------
   6. Menú lateral tipo acordeón
   ------------------------------------------------------------------------- */
.acc-menu { display: flex; flex-direction: column; gap: .35rem; }

.acc-group {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.acc-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .65rem .75rem;
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .85rem;
  transition: background-color .2s ease, color .2s ease;
}

.acc-header:hover { background: var(--surface-alt); }

.acc-group.is-open > .acc-header {
  background: #f4f4f4;
  color: var(--text);
}

.acc-group.is-current > .acc-header {
  background: var(--surface-alt);
  color: var(--primary-strong);
}

.acc-header__label {
  display: flex;
  align-items: center;
  gap: .55rem;
  text-align: left;
}

.acc-header__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--primary-strong);
  font-family: var(--font-display);
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.acc-group.is-open .acc-header__index {
  background: #f4f4f4;
  color: var(--text);
}

.acc-group.is-current .acc-header__index {
  background: var(--primary);
  color: var(--on-primary);
}

.acc-chevron {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--text-muted);
  transition: transform .3s ease;
  flex-shrink: 0;
}

.acc-group.is-open .acc-chevron { transform: rotate(180deg); }
.acc-group.is-current .acc-chevron { color: var(--primary-strong); }

.acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .35s ease;
}

.acc-group.is-open .acc-panel { grid-template-rows: 1fr; }

.acc-panel__inner { overflow: hidden; }

.acc-links {
  display: flex;
  flex-direction: column;
  padding: .25rem 0 .5rem .5rem;
  border-left: 1px solid var(--border);
  margin-left: 1.2rem;
}

.acc-link {
  padding: .45rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-size: .85rem;
  position: relative;
  transition: background-color .2s ease, color .2s ease;
}

.acc-link:hover { color: var(--text); background: var(--surface-alt); }

.acc-link.is-active {
  color: var(--primary-strong);
  background: var(--primary-soft-bg);
  font-weight: 600;
}

.acc-link.is-active::before {
  content: "";
  position: absolute;
  left: -1.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: .4rem;
  height: .4rem;
  border-radius: 50%;
  background: var(--primary);
}

.sidebar-top-link {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .65rem .75rem;
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .85rem;
}

.sidebar-top-link:hover { background: var(--surface-alt); color: var(--primary-strong); }

.sidebar-top-link.is-active {
  background: var(--surface-alt);
  color: var(--primary-strong);
}

.sidebar-top-link.is-active .acc-header__index { background: var(--primary); color: var(--on-primary); }

.sidebar-top-link.is-active::before { content: none; }

/* -------------------------------------------------------------------------
   7. Cabecera de la guía (hero)
   ------------------------------------------------------------------------- */
.hero {
  padding-bottom: var(--gutter-2xl);
  margin-bottom: var(--gutter-2xl);
  border-bottom: 1px solid var(--border);
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .8rem;
  border-radius: var(--radius-full);
  background: var(--primary-soft-bg);
  color: var(--primary-strong);
  font-size: .74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: var(--gutter-md);
}

.hero__badge .dot {
  width: .4rem; height: .4rem; border-radius: 50%;
  background: var(--primary-strong);
}

.hero h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 700;
  margin-bottom: var(--gutter-md);
}

.hero h1 span { color: var(--primary-strong); }

.hero p { font-size: 1.05rem; max-width: 62ch; }

/* -------------------------------------------------------------------------
   8. Bloque de tema (topic)
   ------------------------------------------------------------------------- */
.topic {
  padding: var(--gutter-2xl) 0;
  border-bottom: 1px solid var(--border);
}

.topic:last-of-type { border-bottom: 0; }

.topic__eyebrow {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .74rem;
  color: var(--primary-strong);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .6rem;
}

.topic__eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.topic__title {
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  margin-bottom: .75rem;
}

.topic__lead {
  font-size: 1.02rem;
  max-width: 68ch;
  margin-bottom: var(--gutter-lg);
}

.topic__explain {
  display: flex;
  flex-direction: column;
  gap: var(--gutter-md);
  margin-bottom: var(--gutter-lg);
}

.topic__explain h3 {
  font-size: .98rem;
  color: var(--text);
  margin-bottom: .4rem;
}

.topic__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.topic__list li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--text-body);
  font-size: .96rem;
}

.topic__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: var(--primary);
}

.topic__list strong { color: var(--text); }

/* Callouts (consejos) */
.callout {
  display: flex;
  gap: .75rem;
  padding: var(--gutter-md);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.callout__icon {
  width: 2rem; height: 2rem;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: var(--primary-soft-bg);
  color: var(--primary-strong);
}

.callout p { font-size: .92rem; color: var(--text-body); }
.callout strong { color: var(--text); }

/* -------------------------------------------------------------------------
   9. Panel de ejemplo (vista previa / demo interactiva)
   ------------------------------------------------------------------------- */
.demo-window {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
}

.win-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1rem;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.win-bar svg { width: 1rem; height: 1rem; color: var(--primary-strong); flex-shrink: 0; }

.win-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .78rem;
  color: var(--primary-strong);
}

.demo-window__body {
  padding: var(--gutter-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  background: var(--surface);
}

/* -------------------------------------------------------------------------
   10. Botones
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1.35rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .92rem;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, opacity .2s ease;
}

.btn--primary {
  color: var(--on-primary);
  background: var(--primary);
  box-shadow: 0 10px 22px -10px rgba(110, 168, 50, .55);
}
.btn--primary:hover { transform: translateY(-2px); background: var(--primary-softer); }

.btn--secondary {
  color: var(--primary-strong);
  background: var(--surface);
  border: 1.5px solid var(--primary);
}
.btn--secondary:hover { background: var(--primary-soft-bg); }

.btn--ghost { color: var(--primary-strong); font-weight: 700; padding-left: .4rem; padding-right: .4rem; }
.btn--ghost:hover { text-decoration: underline; }

.btn:focus-visible, a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--primary-strong);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   11. Breadcrumb
   ------------------------------------------------------------------------- */
.breadcrumb-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  font-size: .92rem;
}

.breadcrumb-list li { display: flex; align-items: center; gap: .5rem; color: var(--border-strong); }
.breadcrumb-list a { color: var(--text-body); display: flex; align-items: center; gap: .4rem; }
.breadcrumb-list a:hover { color: var(--primary-strong); }
.breadcrumb-list [aria-current="page"] { color: var(--primary-strong); font-weight: 700; }

/* -------------------------------------------------------------------------
   12. Listas de ejemplo
   ------------------------------------------------------------------------- */
.list-showcase {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gutter-md);
  width: 100%;
}

.list-card {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: var(--gutter-lg);
}

.list-card h4 {
  font-family: var(--font-display);
  font-size: .8rem;
  color: var(--primary-strong);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .8rem;
}

.demo-ul, .demo-ol { list-style: none; display: flex; flex-direction: column; gap: .6rem; font-size: .95rem; color: var(--text-body); }
.demo-ul li { position: relative; padding-left: 1.3rem; }
.demo-ul li::before { content: ""; position: absolute; left: 0; top: .5em; width: .5rem; height: .5rem; border-radius: 50%; background: var(--primary); }
.demo-ol { counter-reset: step; }
.demo-ol li { position: relative; padding-left: 1.7rem; }
.demo-ol li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute; left: 0; top: -.05rem;
  width: 1.3rem; height: 1.3rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-size: .7rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.demo-ol li.is-disabled { color: var(--text-muted); }
.demo-ol li.is-disabled::before { background: var(--border-strong); color: var(--surface); }

/* -------------------------------------------------------------------------
   13. Imagen / figure de ejemplo (sin ficheros externos)
   ------------------------------------------------------------------------- */
.img-figure { width: 100%; }

.img-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  color: var(--on-primary);
  position: relative;
  overflow: hidden;
}

.img-placeholder svg { width: 2.5rem; height: 2.5rem; opacity: .8; }
.img-placeholder span { font-size: .78rem; font-weight: 600; opacity: .85; }

.img-placeholder.ph-1 { background: linear-gradient(135deg, #cdeaa4, #92d050); }
.img-placeholder.ph-2 { background: linear-gradient(135deg, #a9e3cf, #59c2a0); }
.img-placeholder.ph-3 { background: linear-gradient(135deg, #f3e6ab, #e0c33f); color: #34290a; }
.img-placeholder.ph-4 { background: linear-gradient(135deg, #d7e8b0, #b3d16a); }
.img-placeholder.ph-5 { background: linear-gradient(135deg, #bfe6cf, #7fc99b); }

figcaption {
  margin-top: .6rem;
  font-size: .82rem;
  color: var(--text-muted);
  text-align: center;
}

.img-photo {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--border);
}

/* -------------------------------------------------------------------------
   14. Enlaces — showcase
   ------------------------------------------------------------------------- */
.link-showcase { display: flex; flex-direction: column; gap: .6rem; width: 100%; }

.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .8rem 1rem;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.link-row a {
  color: var(--primary-strong);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

.link-row a:hover { text-decoration: underline; }

.link-row span.hint { font-size: .78rem; color: var(--text-muted); }

/* -------------------------------------------------------------------------
   15. Acordeón (demo interactiva dentro del contenido)
   ------------------------------------------------------------------------- */
.accordion-demo { width: 100%; display: flex; flex-direction: column; gap: .6rem; }

.acc-demo-item {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.acc-demo-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
}

.acc-demo-header svg {
  width: 1.2rem; height: 1.2rem;
  color: var(--primary-strong);
  transition: transform .3s ease;
  flex-shrink: 0;
}

.acc-demo-item.is-open .acc-demo-header svg { transform: rotate(180deg); }
.acc-demo-item.is-open .acc-demo-header { color: var(--primary-strong); }

.acc-demo-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .3s ease;
}

.acc-demo-item.is-open .acc-demo-panel { grid-template-rows: 1fr; }

.acc-demo-panel__inner { overflow: hidden; }

.acc-demo-panel p {
  padding: 0 1.1rem 1.1rem;
  font-size: .92rem;
  color: var(--text-body);
}

/* -------------------------------------------------------------------------
   16. Tabs (demo interactiva)
   ------------------------------------------------------------------------- */
.tabs-demo { width: 100%; }

.tabs-demo__list {
  display: flex;
  gap: .3rem;
  background: var(--surface-muted);
  padding: .3rem;
  border-radius: var(--radius-md);
  margin-bottom: var(--gutter-lg);
  flex-wrap: wrap;
}

.tabs-demo__tab {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.tabs-demo__tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--primary-strong);
  box-shadow: var(--shadow-card);
}

.tabs-demo__panel {
  display: flex;
  align-items: center;
  gap: var(--gutter-lg);
  font-size: .92rem;
  color: var(--text-body);
}
.tabs-demo__panel[hidden] { display: none; }
.tabs-demo__panel__icon {
  width: 4.5rem; height: 4.5rem;
  border-radius: var(--radius-lg);
  background: var(--primary-soft-bg);
  color: var(--primary-strong);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tabs-demo__panel__icon svg { width: 2.25rem; height: 2.25rem; }
.tabs-demo__panel h4 { color: var(--text); font-size: 1.05rem; margin-bottom: .4rem; }

/* -------------------------------------------------------------------------
   17. Sliders (imagen / información) — un slide visible con puntos
   ------------------------------------------------------------------------- */
.slider { width: 100%; position: relative; }

.slider__viewport { overflow: hidden; border-radius: var(--radius-md); }

.slider__track {
  display: flex;
  transition: transform .45s cubic-bezier(.16, 1, .3, 1);
}

.slider__slide {
  flex: 0 0 100%;
  min-width: 0;
}

.slider__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--gutter-md);
}

.slider__btn {
  width: 2.4rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--text);
  flex-shrink: 0;
}

.slider__btn:hover { background: var(--primary-soft-bg); color: var(--primary-strong); }
.slider__btn svg { width: 1.1rem; height: 1.1rem; }

.slider__dots { display: flex; align-items: center; gap: .5rem; }

.slider__dot {
  width: .6rem; height: .6rem;
  border-radius: 50%;
  background: var(--border-strong);
  transition: background-color .2s ease, transform .2s ease;
}

.slider__dot.is-active {
  background: var(--primary);
  transform: scale(1.25);
}

/* Slide de imagen */
.slide-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  padding: var(--gutter-lg);
  text-align: center;
}

/* Slide de información (pasos numerados) */
.slide-info {
  padding: var(--gutter-xl) var(--gutter-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .85rem;
  text-align: center;
  background: var(--surface-alt);
}

.slide-info__number {
  width: 3rem; height: 3rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.slide-info__title { font-size: 1.05rem; color: var(--text); }
.slide-info__text { font-size: .92rem; color: var(--text-body); max-width: 40ch; margin: 0 auto; }

/* -------------------------------------------------------------------------
   18. Tarjeta
   ------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--gutter-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--gutter-sm);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  transition: transform .25s ease, box-shadow .25s ease;
  width: 100%;
  max-width: 260px;
}

.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--primary-softer); }

.card__icon {
  width: 3.5rem; height: 3.5rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft-bg);
  color: var(--primary-strong);
  margin-bottom: .3rem;
}
.card__icon svg { width: 1.75rem; height: 1.75rem; }

.card__title { font-size: 1.05rem; color: var(--text); }
.card__text { font-size: .88rem; color: var(--text-body); }

.card__action {
  margin-top: .4rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: var(--radius-full);
  background: var(--surface-muted);
  color: var(--primary-strong);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .03em;
}
.card__action:hover { background: var(--primary-soft-bg); }

.card-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gutter-md);
  justify-content: center;
  width: 100%;
}

/* -------------------------------------------------------------------------
   19. Slider de tarjetas (carrusel horizontal con scroll-snap)
   ------------------------------------------------------------------------- */
.card-slider { position: relative; width: 100%; }

.card-slider__viewport {
  display: flex;
  gap: var(--gutter-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: .25rem .25rem .75rem;
  scroll-padding-left: .25rem;
}

.card-slider__viewport .card {
  scroll-snap-align: start;
  flex: 0 0 210px;
}

.card-slider__controls {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: var(--gutter-sm);
}

/* -------------------------------------------------------------------------
   20. Call to action
   ------------------------------------------------------------------------- */
.cta-banner {
  width: 100%;
  border-radius: var(--radius-xl);
  padding: var(--gutter-2xl) var(--gutter-xl);
  background: linear-gradient(135deg, var(--surface-alt), var(--surface));
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--gutter-sm);
}

.cta-banner__icon {
  width: 4rem; height: 4rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .5rem;
}
.cta-banner__icon svg { width: 2rem; height: 2rem; }

.cta-banner h3 { font-size: 1.4rem; max-width: 26ch; }
.cta-banner p { max-width: 46ch; }
.cta-banner__actions { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; margin-top: .5rem; }

/* -------------------------------------------------------------------------
   21. Vista previa de página (mockups navbar / header / footer)
   ------------------------------------------------------------------------- */
.anatomy-browser {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.mock-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .8rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.mock-navbar__brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: .88rem; color: var(--text); }
.mock-navbar__brand i { width: 1.4rem; height: 1.4rem; border-radius: .4rem; background: var(--primary); display: block; }
.mock-navbar__links { display: flex; gap: 1rem; font-size: .8rem; color: var(--text-muted); }
.mock-navbar__links span:first-child { color: var(--primary-strong); font-weight: 700; }
.mock-navbar__cta { padding: .4rem .9rem; border-radius: var(--radius-full); background: var(--primary); color: var(--on-primary); font-size: .74rem; font-weight: 700; }

.mock-header {
  padding: 2rem 1rem;
  text-align: center;
  background: var(--primary-soft-bg);
}
.mock-header h5 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: .4rem; color: var(--text); }
.mock-header p { font-size: .82rem; max-width: 32ch; margin: 0 auto; }

.mock-footer {
  padding: 1rem 1rem;
  background: var(--surface-muted);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .76rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: .5rem;
}
.mock-footer__cols { display: flex; gap: 1.2rem; }

/* Vista de conjunto: navbar + header + body + footer, una debajo de otra */
.page-overview {
  display: flex;
  flex-direction: column;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.po-row { display: flex; align-items: stretch; }
.po-row + .po-row { border-top: 1px solid var(--border); }

.po-row__label {
  position: relative;
  width: 96px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  text-align: right;
  padding-right: .8rem;
  border-right: 3px solid var(--primary);
  background: var(--surface);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--primary-strong);
}

.po-row__label::before, .po-row__label::after {
  content: "";
  position: absolute;
  right: -4px;
  width: 10px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}
.po-row__label::before { top: 0; }
.po-row__label::after { bottom: 0; }

.po-row__frame {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.mock-body-mini { padding: 1.1rem 1rem; background: var(--surface); }
.mock-body-mini h6 {
  font-family: var(--font-display);
  font-size: .78rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: .9rem;
}
.mock-body-mini__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .6rem;
  margin-bottom: .9rem;
}
.mock-body-mini__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  text-align: center;
  padding: .6rem .3rem;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}
.mock-body-mini__item span.icon {
  width: 1.9rem; height: 1.9rem;
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary-strong);
  display: flex; align-items: center; justify-content: center;
}
.mock-body-mini__item small { font-size: .66rem; font-weight: 700; color: var(--text); }
.mock-body-mini__row {
  display: flex;
  gap: .7rem;
  align-items: center;
  padding: .7rem;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}
.mock-body-mini__row .swatch { width: 3rem; height: 2.4rem; border-radius: var(--radius-sm); background: linear-gradient(135deg, #b9e186, #6ea832); flex-shrink: 0; }
.mock-body-mini__row .lines { flex: 1; display: flex; flex-direction: column; gap: .35rem; }
.mock-body-mini__row .lines span { display: block; height: 6px; border-radius: 3px; background: var(--border-strong); }
.mock-body-mini__row .lines span:nth-child(1) { width: 70%; }
.mock-body-mini__row .lines span:nth-child(2) { width: 45%; }

/* Diagrama simple de las zonas de una página (para "Body") */
.page-diagram { width: 100%; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
.page-diagram__band { display: flex; align-items: center; justify-content: center; padding: 1.1rem; font-family: var(--font-display); font-weight: 700; font-size: .85rem; }
.page-diagram__band--header { background: var(--primary-soft-bg); color: var(--primary-strong); }
.page-diagram__band--main { background: var(--surface); color: var(--text); min-height: 6.5rem; border-top: 1px dashed var(--border-strong); border-bottom: 1px dashed var(--border-strong); }
.page-diagram__band--footer { background: var(--surface-muted); color: var(--text-muted); }

/* -------------------------------------------------------------------------
   22. Pie de página del sitio
   ------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--gutter-xl) var(--gutter-md);
  text-align: center;
  color: var(--text-muted);
  font-size: .85rem;
}

.site-footer strong { color: var(--text-body); }

/* -------------------------------------------------------------------------
   23. Utilidades
   ------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gutter-md); width: 100%; }
.flex-wrap-row { display: flex; flex-wrap: wrap; gap: var(--gutter-md); align-items: center; width: 100%; }

/* -------------------------------------------------------------------------
   24. Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    width: min(var(--sidebar-w), 82vw);
    height: calc(100vh - var(--topbar-h));
    z-index: 50;
    transform: translateX(-105%);
    transition: transform .3s ease;
  }

  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay { display: block; }

  .menu-toggle { display: flex; }

  .list-showcase { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .tabs-demo__panel { flex-direction: column; text-align: center; }
}

@media (max-width: 640px) {
  .mock-navbar__links { display: none; }
  .mock-body-mini__grid { grid-template-columns: 1fr; }

  .topbar__left { gap: .6rem; }
  .brand__title { font-size: 1rem; }
  .topbar__nav-link { padding: .35rem .6rem; font-size: .78rem; }

  .po-row { flex-direction: column; }
  .po-row__label {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    padding: .5rem .75rem;
    border-right: 0;
    border-bottom: 2px solid var(--primary);
  }
  .po-row__label::before, .po-row__label::after { display: none; }
}

@media (min-width: 720px) {
  .progress-pill { display: flex; }
}

/* -------------------------------------------------------------------------
   20. Webs de ejemplo — tarjetas que enlazan a las páginas de ejemplo
   ------------------------------------------------------------------------- */
.example-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter-lg);
}

.example-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.example-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--primary-softer); }

.example-card__preview {
  aspect-ratio: 16/11;
  padding: .8rem .8rem 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  overflow: hidden;
}
.example-card__preview-bar { display: flex; align-items: center; gap: .3rem; flex-shrink: 0; }
.example-card__preview-dot { width: .45rem; height: .45rem; border-radius: 50%; background: rgba(255,255,255,.55); }
.example-card__preview-stage {
  flex: 1;
  border-radius: .6rem .6rem 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.example-card__preview-stage svg { width: 2rem; height: 2rem; }

.example-card__body { padding: 1.15rem 1.25rem 1.35rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.example-card__tag { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--primary-strong); }
.example-card__title { font-size: 1.08rem; color: var(--text); }
.example-card__text { font-size: .87rem; color: var(--text-body); flex: 1; }
.example-card__link {
  margin-top: .3rem;
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .85rem; font-weight: 700; color: var(--primary-strong);
}
.example-card__link svg { width: 1rem; height: 1rem; transition: transform .2s ease; }
.example-card__link:hover svg { transform: translateX(2px); }

@media (max-width: 860px) {
  .example-grid { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------------------
   21. Grid y grid masonry
   ------------------------------------------------------------------------- */
.grid-demo {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter-md);
  width: 100%;
}
.grid-demo__item {
  aspect-ratio: 1/1;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.grid-demo__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 640px) {
  .grid-demo { grid-template-columns: repeat(2, 1fr); }
}

.masonry-demo {
  columns: 3 180px;
  column-gap: var(--gutter-md);
  width: 100%;
}
.masonry-demo__item {
  position: relative;
  break-inside: avoid;
  margin-bottom: var(--gutter-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.masonry-demo__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.masonry-demo__caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: .35rem;
  padding: .5rem .65rem;
  background: linear-gradient(0deg, rgba(28,43,13,.72), transparent);
  color: #fff;
  font-size: .76rem;
  font-weight: 700;
}
.masonry-demo__caption svg { width: 1rem; height: 1rem; flex-shrink: 0; }
@media (max-width: 640px) {
  .masonry-demo { columns: 2 140px; }
}

/* -------------------------------------------------------------------------
   21b. Disposición web (ancho de contenido y patrones de maquetación)
   ------------------------------------------------------------------------- */
.width-demo {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-muted);
}
.width-demo__row + .width-demo__row { border-top: 1px dashed var(--border-strong); }
.width-demo__caption {
  margin: 0;
  padding: .8rem 1.1rem 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .74rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.width-demo__viewport { padding: .8rem 1.6rem 1.2rem; }
.width-demo__viewport--full { padding-left: 0; padding-right: 0; }
.width-demo__block {
  border-radius: var(--radius-sm);
  padding: .8rem .6rem;
  text-align: center;
  font-size: .78rem;
  font-weight: 700;
}
.width-demo__block--boxed {
  max-width: 62%;
  margin: 0 auto;
  background: var(--primary-soft-bg);
  border: 1.5px dashed var(--primary-strong);
  color: var(--primary-strong);
}
.width-demo__block--full {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: var(--on-primary);
  border-radius: 0;
}
@media (max-width: 480px) {
  .width-demo__block--boxed { max-width: 82%; }
  .width-demo__viewport { padding-left: .8rem; padding-right: .8rem; }
}

.layout-pair-grid { display: grid; gap: var(--gutter-md); }
@media (min-width: 640px) { .layout-pair-grid { grid-template-columns: 1fr 1fr; } }
.layout-pair-grid .demo-window { margin-bottom: 0; }

.sidebar-demo { display: flex; min-height: 170px; }
.sidebar-demo--right { flex-direction: row-reverse; }
.sidebar-demo__aside {
  flex: 0 0 34%;
  background: var(--surface-alt);
  border-right: 1px solid var(--border);
  padding: .9rem .7rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.sidebar-demo--right .sidebar-demo__aside { border-right: none; border-left: 1px solid var(--border); }
.sidebar-demo__aside span { display: block; height: .5rem; border-radius: .25rem; background: var(--border-strong); }
.sidebar-demo__aside span:first-child { width: 65%; background: var(--primary-strong); }
.sidebar-demo__main {
  flex: 1;
  min-width: 0;
  padding: .9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  justify-content: center;
}
.sidebar-demo__main span { display: block; height: .5rem; border-radius: .25rem; background: var(--border-strong); }
.sidebar-demo__main span:first-child { width: 55%; height: .75rem; background: var(--text-muted); }
.sidebar-demo__main span:nth-child(3) { width: 85%; }
.sidebar-demo__main span:nth-child(4) { width: 70%; }

.lp-diagram {
  height: 96px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-muted);
  padding: .35rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-bottom: .8rem;
  overflow: hidden;
}
.lp-bar { flex-shrink: 0; height: .5rem; border-radius: .2rem; background: var(--primary-strong); }
.lp-row { flex: 1; display: flex; gap: .3rem; min-height: 0; }
.lp-col { border-radius: .2rem; }
.lp-col--nav { flex: 0 0 24%; background: var(--primary); }
.lp-col--main { flex: 1; background: var(--surface-alt); border: 1px dashed var(--border-strong); }

.device-row { display: flex; align-items: flex-end; justify-content: center; gap: var(--gutter-lg); flex-wrap: wrap; }
.device-mock { display: flex; flex-direction: column; align-items: center; gap: .55rem; }
.device-mock__label {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .74rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.device-mock__frame {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: .4rem;
}
.device-mock__frame .lp-diagram { height: 100%; margin-bottom: 0; border: none; background: none; padding: 0; }
.device-mock--mobile .device-mock__frame { width: 84px; height: 150px; }
.device-mock--mobile .lp-row { flex-direction: column; }
.device-mock--tablet .device-mock__frame { width: 148px; height: 150px; }
.device-mock--desktop .device-mock__frame { width: 268px; height: 150px; }
@media (max-width: 480px) {
  .device-row { gap: var(--gutter-md); }
  .device-mock--desktop .device-mock__frame { width: 220px; }
}

/* -------------------------------------------------------------------------
   22. Webs de inspiración
   ------------------------------------------------------------------------- */
.inspiration-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gutter-md);
}
.inspiration-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .55rem;
  box-shadow: var(--shadow-card);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.inspiration-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--primary-softer); }

.inspiration-card__logo-wrap {
  width: 4rem; height: 4rem;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  margin-bottom: .2rem;
}
.inspiration-card__logo-wrap img { width: 60%; height: 60%; object-fit: contain; display: block; }
.inspiration-card__fallback {
  display: none;
  align-items: center; justify-content: center;
  width: 100%; height: 100%;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--primary-strong);
  background: var(--primary-soft-bg);
}

.inspiration-card__name { font-family: var(--font-display); font-weight: 700; color: var(--text); font-size: .98rem; }
.inspiration-card__domain { font-size: .78rem; color: var(--text-muted); }
.inspiration-card__link {
  margin-top: .3rem;
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .82rem; font-weight: 700; color: var(--primary-strong);
}
.inspiration-card__link svg { width: .9rem; height: .9rem; }
.inspiration-card__link:hover { text-decoration: underline; }

@media (max-width: 900px) { .inspiration-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .inspiration-grid { grid-template-columns: 1fr; } }

/* -------------------------------------------------------------------------
   26. Clases — bloque de código (fiel al PDF de cada clase)
   ------------------------------------------------------------------------- */
.class-intro {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .74rem;
  color: var(--primary-strong);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: var(--gutter-2xl) 0 .6rem;
}
.class-intro::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.class-divider {
  margin: 0 0 var(--gutter-lg);
  padding-bottom: var(--gutter-lg);
  border-bottom: 1px solid var(--border-strong);
}

.code-window {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #1a2033;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  margin-bottom: var(--gutter-md);
}

.code-window .win-bar {
  background: #141827;
  border-bottom: 1px solid #2a3150;
}

.code-window .win-bar svg { color: #8fd15f; }
.code-window .win-label { color: #9fb08a; }

.code-window__body {
  margin: 0;
  padding: var(--gutter-lg);
  overflow-x: auto;
  font-family: "Cascadia Code", "Consolas", "SFMono-Regular", Menlo, Monaco, monospace;
  font-size: .86rem;
  line-height: 1.7;
  color: #d7ddd0;
  tab-size: 2;
}

.code-window__body .ct { color: #ec80b8; }   /* etiqueta */
.code-window__body .ca { color: #7bc9f2; }   /* atributo */
.code-window__body .cs { color: #f2b880; }   /* valor / cadena */
.code-window__body .cc { color: #7e8aa3; font-style: italic; }  /* comentario */
.code-window__body .cm { color: #6d7590; }   /* texto tenue / contexto */
.code-window__body .cw-swatch {
  display: inline-block;
  width: .78em; height: .78em;
  margin-right: .2em;
  border-radius: .18em;
  vertical-align: -.1em;
  border: 1px solid rgba(255, 255, 255, .28);
}
.code-window__body .hl {
  background: rgba(146, 208, 80, .16);
  border-bottom: 2px solid var(--primary);
  border-radius: .2em;
  padding: .05em .15em;
  margin: -0.05em -.15em;
}

.demo-window--result .win-bar svg { color: var(--primary-strong); }

.class-resource-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.class-resource-list li {
  position: relative;
  padding-left: 1.4rem;
  font-size: .95rem;
}
.class-resource-list li::before {
  content: "";
  position: absolute;
  left: 0; top: .6em;
  width: .4rem; height: .4rem;
  border-radius: 50%;
  background: var(--primary);
}
.class-resource-list a { color: var(--primary-strong); font-weight: 600; }
.class-resource-list a:hover { text-decoration: underline; }

.class-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  overflow: hidden;
  border-radius: var(--radius-md);
}
.class-summary-table th {
  background: #6b7d55;
  color: #fff;
  text-align: left;
  padding: .6rem .8rem;
  font-family: var(--font-display);
  font-weight: 600;
}
.class-summary-table td {
  padding: .55rem .8rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}
.class-summary-table tr:nth-child(even) td { background: var(--surface-muted); }
.class-summary-table code { font-family: "Cascadia Code", Consolas, monospace; color: var(--primary-strong); }

.correct-incorrect-grid {
  display: grid;
  gap: var(--gutter-md);
}
@media (min-width: 640px) { .correct-incorrect-grid { grid-template-columns: 1fr 1fr; } }
.correct-incorrect-grid .code-window { margin-bottom: 0; }
.correct-incorrect-grid .code-window.is-wrong .win-bar svg { color: #e2685f; }
.correct-incorrect-grid .code-window.is-wrong .win-label { color: #e2a29d; }
.correct-incorrect-grid .code-window.is-right .win-bar svg { color: #8fd15f; }
.correct-incorrect-grid .code-window.is-right .win-label { color: #9fb08a; }

.exercise-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin-bottom: var(--gutter-lg);
}
.exercise-list li {
  position: relative;
  padding-left: 1.4rem;
  font-size: .96rem;
  color: var(--text-body);
}
.exercise-list li::before {
  content: "";
  position: absolute;
  left: 0; top: .6em;
  width: .45rem; height: .45rem;
  border-radius: 50%;
  background: var(--primary);
}

.tag-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: var(--gutter-lg);
}
.tag-figure img { max-width: 160px; }
.tag-figure figcaption { font-size: .85rem; color: var(--text-muted); text-align: center; }

/* -------------------------------------------------------------------------
   27. Clases — directorio (grid de clases)
   ------------------------------------------------------------------------- */
.class-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gutter-md);
}

@media (min-width: 640px) {
  .class-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .class-grid { grid-template-columns: repeat(3, 1fr); }
}

.class-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--gutter-sm, .6rem);
  padding: var(--gutter-lg);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.class-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-softer);
}

.class-card__icon {
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-md);
  background: var(--primary-soft-bg);
  color: var(--primary-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .35rem;
}

.class-card__number {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.class-card__title {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.class-card__arrow {
  position: absolute;
  top: var(--gutter-lg);
  right: var(--gutter-lg);
  color: var(--text-muted);
  transition: transform .18s ease, color .18s ease;
}

.class-card:hover .class-card__arrow { color: var(--primary-strong); transform: translateX(3px); }

/* -------------------------------------------------------------------------
   28. Clases — barra fija de navegación entre clases
   ------------------------------------------------------------------------- */
body.has-classbar { padding-bottom: 4.5rem; }

.class-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  background: #1a2033;
  box-shadow: 0 -10px 26px -14px rgba(20, 24, 39, .45);
}

.class-bar__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: .6rem var(--gutter-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gutter-sm);
}

.class-bar__link {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .8rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .85rem;
  color: #d7ddd0;
  white-space: nowrap;
}

.class-bar__link svg { flex-shrink: 0; color: #8fd15f; }

a.class-bar__link:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.class-bar__link.is-disabled { color: #6d7590; opacity: .7; cursor: default; }
.class-bar__link.is-disabled svg { color: #6d7590; }

.class-bar__all {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem 1rem;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--on-primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .82rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.class-bar__all:hover { background: var(--primary-softer); }

@media (max-width: 420px) {
  .class-bar__inner { padding: .5rem .6rem; gap: .35rem; }
  .class-bar__link { padding: .45rem .5rem; font-size: 0; gap: 0; }
  .class-bar__all { padding: .5rem .75rem; font-size: 0; gap: 0; }
  .class-bar__link svg, .class-bar__all svg { width: 18px; height: 18px; }
}

/* -------------------------------------------------------------------------
   29. Clases — mockups visuales (estructura HTML y contenedor genérico)
   ------------------------------------------------------------------------- */
.structure-diagram {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: var(--gutter-lg);
  overflow-x: auto;
}

.sdiag-box {
  position: relative;
  border: 2px solid var(--primary-strong);
  border-radius: var(--radius-md);
  padding: 1.5rem .9rem .9rem;
  min-width: 0;
}

.sdiag-box + .sdiag-box { margin-top: .9rem; }

.sdiag-tag {
  position: absolute;
  top: -.65rem;
  left: .7rem;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: .72rem;
  font-weight: 700;
  padding: .15rem .55rem;
  border-radius: .3rem;
  background: var(--primary-strong);
  color: #fff;
}

.sdiag-box--l2 { border-color: var(--primary); }
.sdiag-box--l2 > .sdiag-tag { background: var(--primary); color: var(--on-primary); }

.sdiag-box--l3 { border-color: var(--border-strong); }
.sdiag-box--l3 > .sdiag-tag { background: var(--border-strong); color: var(--text); }

.sdiag-box--leaf { border-style: dashed; border-color: var(--border-strong); background: var(--surface-alt); }
.sdiag-box--leaf > .sdiag-tag { background: var(--text-muted); color: #fff; }

.sdiag-note { margin: 0; font-size: .85rem; color: var(--text-body); }
.sdiag-note code { font-family: "Cascadia Code", Consolas, monospace; color: var(--primary-strong); }

.sdiag-row { display: flex; gap: .9rem; flex-wrap: wrap; margin-top: .9rem; }
.sdiag-row > .sdiag-box { flex: 1; min-width: 150px; margin-top: 0; }

.container-mockup {
  position: relative;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1.7rem 1.1rem 1.1rem;
  background: var(--surface-alt);
}

.container-mockup__tag {
  position: absolute;
  top: -.7rem;
  left: .9rem;
  font-family: "Cascadia Code", Consolas, monospace;
  font-weight: 700;
  font-size: .72rem;
  padding: .2rem .6rem;
  border-radius: .3rem;
  background: var(--text-muted);
  color: #fff;
}

.container-mockup__content { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }

.container-mockup__block {
  border-radius: .5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.container-mockup__block--img { width: 3rem; height: 3rem; color: var(--primary-strong); flex-shrink: 0; }
.container-mockup__block--line { height: .8rem; border-radius: .4rem; flex: 1; min-width: 60px; }
.container-mockup__block--line.is-lg { max-width: 160px; }
.container-mockup__block--line.is-sm { max-width: 90px; }
.container-mockup__block--btn {
  padding: .4rem .9rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .78rem;
  color: var(--primary-strong);
  border-color: var(--primary-softer);
  background: var(--primary-soft-bg);
  flex-shrink: 0;
}

/* -------------------------------------------------------------------------
   30. Clases — resumen general de etiquetas (grid de columnas)
   ------------------------------------------------------------------------- */
.tag-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  border-radius: var(--radius-md);
  overflow: hidden;
  min-width: 760px;
}

.tag-summary-col {
  padding: var(--gutter-md);
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.tag-summary-col:last-child { border-right: 0; }

.tag-summary-col__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .88rem;
  color: var(--text);
  margin-bottom: .75rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--primary);
}

.tag-summary-item {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: .84rem;
  color: var(--text-body);
  padding: .2rem 0;
}

.tag-summary-item.is-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .78rem;
  color: var(--text);
  margin-top: .5rem;
  padding-top: .3rem;
}

.tag-summary-item.is-muted { color: var(--text-muted); opacity: .55; }

.tag-summary-highlight {
  background: #f7d3d6;
  border-radius: .4rem;
  margin: 0 -.4rem;
  padding: .3rem .4rem;
}
.tag-summary-highlight .tag-summary-item { color: #6b2530; }

@media (max-width: 900px) {
  .tag-summary-wrap { overflow-x: auto; }
}

/* -------------------------------------------------------------------------
   31. Clases — árbol de carpetas y ruta de archivos
   ------------------------------------------------------------------------- */
.file-tree {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--gutter-lg);
  overflow-x: auto;
}

.file-tree__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin-bottom: var(--gutter-md);
  font-size: .82rem;
  color: var(--text-muted);
}

.file-tree__legend-item { display: inline-flex; align-items: center; gap: .45rem; }

.file-tree__dot { width: .6rem; height: .6rem; border-radius: 50%; flex-shrink: 0; }
.file-tree__dot--current { background: var(--primary-strong); }
.file-tree__dot--target { background: #b23a4a; }

.file-tree__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.file-tree__list .file-tree__list {
  padding-left: 1.3rem;
  margin-top: .3rem;
  border-left: 1px dashed var(--border-strong);
}

.file-tree__item { margin-top: .3rem; }
.file-tree__item:first-child { margin-top: 0; }

.file-tree__row {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .6rem;
  border-radius: var(--radius-sm);
  font-size: .92rem;
  color: var(--text-body);
  white-space: nowrap;
}

.file-tree__icon { width: 1.05rem; height: 1.05rem; flex-shrink: 0; }

.file-tree__row--folder { font-family: var(--font-display); font-weight: 600; color: var(--text); }
.file-tree__row--folder .file-tree__icon { color: #d9a53d; }

.file-tree__row--html .file-tree__icon,
.file-tree__row--img .file-tree__icon { color: var(--text-muted); }

.file-tree__row--current {
  background: var(--primary-soft-bg);
  outline: 1.5px dashed var(--primary-strong);
  outline-offset: -1.5px;
}

.file-tree__row--target { background: #f7d3d6; }
.file-tree__row--target .file-tree__icon { color: #b23a4a; }

.file-tree__badge {
  font-family: var(--font-display);
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .15rem .5rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.file-tree__row--current .file-tree__badge { background: var(--primary-strong); color: #fff; }
.file-tree__row--target .file-tree__badge { background: #b23a4a; color: #fff; }

.path-builder {
  display: block;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: .95rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: .8rem 1rem;
  color: var(--text-body);
  word-break: break-all;
}

.path-builder mark {
  background: #f7d3d6;
  color: #6b2530;
  border-radius: .25rem;
  padding: 0 .15rem;
}

.path-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin: 0 0 var(--gutter-lg);
  padding: 0;
}

.path-steps .path-builder { font-size: .88rem; }

/* -------------------------------------------------------------------------
   32. Botón "Ver detalle" + modal con pase de imágenes
   ------------------------------------------------------------------------- */
.detail-btn-wrap {
  display: flex;
  justify-content: center;
  margin-top: var(--gutter-lg);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(20, 26, 12, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter-lg);
}
.modal-overlay[hidden] { display: none; }
body.modal-open { overflow: hidden; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal--lg { max-width: 720px; }
.modal--xl { width: 90vw; max-width: 1400px; }

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gutter-md);
  padding: var(--gutter-lg) var(--gutter-xl);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal__header h2 { font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
.modal__header h2 svg { color: var(--primary-strong); flex-shrink: 0; }

.modal__close {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.modal__close:hover { background: var(--surface-muted); color: var(--text); }

.modal__body {
  padding: var(--gutter-lg) var(--gutter-xl) var(--gutter-xl);
  overflow-y: auto;
}

.modal .slide-image { position: relative; }

.modal .slide-image img {
  max-height: 70vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

img[data-zoom] { cursor: zoom-in; }
.modal .slide-image img[data-zoom], .modal .slide-image img { cursor: default; }
.modal--xl .slide-image { text-align: center; }
.modal--xl .slide-image img { max-width: 100%; width: auto; height: auto; max-height: none; }

.slide-image__download {
  position: absolute;
  top: calc(var(--gutter-lg) + .6rem);
  right: calc(var(--gutter-lg) + .6rem);
  width: 2.4rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary-strong);
  box-shadow: var(--shadow-card);
}
.slide-image__download:hover { background: var(--primary-soft-bg); }
.slide-image__download svg { width: 1.05rem; height: 1.05rem; }

/* -------------------------------------------------------------------------
   33. Clases bloqueadas y panel de administración
   ------------------------------------------------------------------------- */
.class-card--locked {
  position: relative;
  cursor: default;
  user-select: none;
  overflow: hidden;
}
.class-card--locked .class-card__icon,
.class-card--locked .class-card__number,
.class-card--locked .class-card__title {
  filter: blur(4px);
  opacity: .55;
}
.class-card--locked:hover { transform: none; box-shadow: var(--shadow-card); }

.class-card__lock {
  position: absolute;
  top: var(--gutter-lg);
  right: var(--gutter-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.class-card__lock svg { width: 26px; height: 26px; }

.class-card__soon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: .3rem .8rem;
}

.class-card--hidden-admin {
  border-style: dashed;
  border-color: var(--border-strong);
}
.class-card__badge {
  flex-shrink: 0;
  margin-top: .25rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  font-weight: 700;
  color: var(--warning);
  background: #fbf1dc;
  border-radius: var(--radius-full);
  padding: .25rem .65rem;
}

.admin-preview-note {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: .7rem 1rem;
  margin-bottom: var(--gutter-md);
}
.admin-preview-note svg { flex-shrink: 0; color: var(--primary-strong); }

.admin-preview-banner {
  position: sticky;
  top: 0;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  text-align: center;
  font-size: .85rem;
  font-weight: 600;
  color: var(--primary-soft-bg);
  background: var(--on-primary);
  padding: .6rem 1rem;
}
.admin-preview-banner a { color: var(--primary); text-decoration: underline; }

.clase-bloqueada { text-align: center; align-items: center; }
.clase-bloqueada__cta { margin-top: var(--gutter-lg); }

/* Botones de descarga del PDF de la clase (cabecera) */
.hero__downloads { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: var(--gutter-lg); }
.hero__downloads .btn { display: inline-flex; align-items: center; gap: .45rem; }

/* -------------------------------------------------------------------------
   Tests autocorregibles
   ------------------------------------------------------------------------- */
.class-card__meta { font-size: .85rem; color: var(--text-muted); }

.test-back { margin: 0 0 var(--gutter-md); font-size: .9rem; }
.test-back a { display: inline-flex; align-items: center; gap: .35rem; color: var(--text-muted); text-decoration: none; }
.test-back a:hover { color: var(--primary-strong); }

.test-progress {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--gutter-md);
  margin: var(--gutter-lg) 0;
  padding: .6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-card);
}
.test-progress__text { flex-shrink: 0; font-size: .85rem; font-weight: 600; color: var(--text-body); }
.test-progress__bar { flex: 1; height: .5rem; background: var(--surface-muted); border-radius: var(--radius-full); overflow: hidden; }
.test-progress__fill { display: block; height: 100%; width: 0; background: var(--primary); transition: width .25s ease; }

.test-form { display: flex; flex-direction: column; gap: var(--gutter-lg); }

.test-q {
  margin: 0;
  min-width: 0;
  padding: var(--gutter-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.test-q__title { margin: 0; padding: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--text); }
.test-q__options { display: flex; flex-direction: column; gap: .5rem; margin-top: var(--gutter-md); }

.test-opt {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-body);
  transition: border-color .15s ease, background .15s ease;
}
.test-opt:hover { border-color: var(--primary-softer); background: var(--surface-alt); }
.test-opt input { position: absolute; opacity: 0; pointer-events: none; }
.test-opt__letter {
  flex-shrink: 0;
  width: 1.8rem;
  height: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--surface-muted);
  font-size: .8rem;
  font-weight: 700;
}
.test-opt__text { overflow-wrap: anywhere; }
.test-opt:has(input:checked) { border-color: var(--primary-strong); background: var(--primary-soft-bg); }
.test-opt:has(input:checked) .test-opt__letter { background: var(--primary); color: var(--on-primary); }
.test-opt:has(input:focus-visible) { outline: 2px solid var(--primary-strong); outline-offset: 2px; }

.test-q.is-missing { border-color: #d9534f; }
.test-q.is-missing .test-q__title { color: #b83a36; }

.test-q.is-correct, .test-q.is-wrong { box-shadow: none; }
.test-q.is-correct { border-color: var(--success); }
.test-q.is-wrong { border-color: #d9534f; }
.test-q .test-opt { cursor: pointer; }
.test-q:disabled .test-opt, .test-q[disabled] .test-opt { cursor: default; }
.test-q[disabled] .test-opt:hover { background: transparent; border-color: var(--border); }
.test-q[disabled] .test-opt:has(input:checked) { background: transparent; border-color: var(--border); }
.test-q[disabled] .test-opt:has(input:checked) .test-opt__letter { background: var(--surface-muted); color: inherit; }
.test-q[disabled] .test-opt.is-right,
.test-q[disabled] .test-opt.is-right:hover { border-color: var(--success); background: #e8f5e9; }
.test-q[disabled] .test-opt.is-right .test-opt__letter { background: var(--success); color: #fff; }
.test-q[disabled] .test-opt.is-bad,
.test-q[disabled] .test-opt.is-bad:hover { border-color: #d9534f; background: #fdecea; }
.test-q[disabled] .test-opt.is-bad .test-opt__letter { background: #d9534f; color: #fff; }

.test-q__feedback { margin: var(--gutter-md) 0 0; padding: .7rem .9rem; border-radius: var(--radius-md); background: var(--surface-muted); font-size: .92rem; }
.test-q.is-correct .test-q__feedback { background: #e8f5e9; }
.test-q.is-wrong .test-q__feedback { background: #fdecea; }

.test-warning { margin: 0; padding: .8rem 1rem; border-radius: var(--radius-md); background: #fdecea; color: #8c2b27; font-weight: 600; }
.test-actions { display: flex; justify-content: center; }

.test-result {
  margin: var(--gutter-lg) 0;
  padding: var(--gutter-xl) var(--gutter-lg);
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.test-result[hidden] { display: none; }
.test-result--ok { border-color: var(--success); background: #f1f9f1; }
.test-result--ko { border-color: var(--warning); background: #fff8e6; }
.test-result__score { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 3rem; line-height: 1; color: var(--text); }
.test-result__pct { margin: .4rem 0 0; font-weight: 700; color: var(--text-body); }
.test-result__msg { margin: .8rem 0 var(--gutter-lg); }
.test-progress[hidden], .test-actions[hidden], .test-warning[hidden], .test-q__feedback[hidden] { display: none; }
.test-result__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gutter-md); }
.test-result__actions .btn:not(.btn--primary) { background: var(--surface); color: var(--text); border: 1.5px solid var(--border-strong); cursor: pointer; }
.test-result__actions .btn:not(.btn--primary):hover { border-color: var(--primary-strong); }

/* -------------------------------------------------------------------------
   Superindex (temario completo por categorías, sin menú lateral)
   ------------------------------------------------------------------------- */
.content:has(.content__inner--full) { padding: 0 clamp(1rem, 3vw, 3rem); }
.content__inner--full { max-width: none; }

.si-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--gutter-md);
  margin-bottom: var(--gutter-md);
}
.si-search { position: relative; flex: 1 1 320px; max-width: 520px; display: block; }
.si-search svg {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.si-search input {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  padding: .65rem 1rem .65rem 2.6rem;
}
.si-search input:focus-visible { outline: 2px solid var(--primary-strong); outline-offset: 2px; }
.si-count { margin: 0; font-size: .9rem; color: var(--text-muted); }
.si-count strong { color: var(--primary-strong); }

.si-jump { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: var(--gutter-xl); }
.si-jump a {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-body);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: .35rem .9rem;
  transition: border-color .18s ease, color .18s ease;
}
.si-jump a:hover { border-color: var(--primary-softer); color: var(--primary-strong); }

/* Cada bloque tiene su color de acento (cabeceras de las tarjetas). */
.si-bloque { --si-accent: #4f8a1f; --si-accent-bg: var(--primary-soft-bg); margin-bottom: var(--gutter-2xl); scroll-margin-top: calc(var(--topbar-h) + 1rem); }
.si-bloque--html { --si-accent: #c2631a; --si-accent-bg: #fbeedd; }
.si-bloque--efectos { --si-accent: #6a49b8; --si-accent-bg: #efe9fb; }
.si-bloque--maquetacion { --si-accent: #23799e; --si-accent-bg: #e1f1f8; }
.si-bloque[hidden], .si-tema[hidden], .si-list > li[hidden] { display: none; }

.si-bloque__title {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: 1.6rem;
  margin: 0 0 var(--gutter-md);
  color: var(--si-accent);
}
.si-bloque__title::after { content: ""; flex: 1; height: 2px; background: var(--si-accent-bg); border-radius: 2px; }

.si-grid { column-count: 1; column-gap: var(--gutter-lg); }
@media (min-width: 800px)  { .si-grid { column-count: 2; } }
@media (min-width: 1500px) { .si-grid { column-count: 3; } }

.si-tema {
  break-inside: avoid;
  margin-bottom: var(--gutter-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  scroll-margin-top: calc(var(--topbar-h) + 1rem);
}
.si-tema__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gutter-md);
  padding: .85rem var(--gutter-lg);
  background: var(--si-accent);
  color: #fff;
}
.si-tema__title { font-size: 1.15rem; margin: 0; color: inherit; }
.si-tema__glyph {
  flex-shrink: 0;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: .8rem;
  color: var(--si-accent);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: .15rem .55rem;
}
.si-tema--locked { background: var(--surface-muted); box-shadow: none; }
.si-tema--locked .si-tema__head { background: var(--text-muted); }
.si-tema--locked .si-tema__glyph { color: var(--text-muted); }

.si-list {
  list-style: none;
  padding: var(--gutter-md) var(--gutter-lg) var(--gutter-lg);
  columns: 2 200px;
  column-gap: var(--gutter-lg);
}
.si-list > li { break-inside: avoid; }
.si-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .6rem;
  border-left: 3px solid var(--si-accent-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 3px;
  font-size: .92rem;
  line-height: 1.35;
  color: var(--text-body);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
a.si-item:hover, a.si-item:focus-visible {
  background: var(--si-accent-bg);
  border-left-color: var(--si-accent);
  color: var(--text);
}
.si-item__label { min-width: 0; }
.si-item svg { flex-shrink: 0; margin-left: auto; color: var(--text-muted); }
.si-item--hidden-admin { border-left-style: dashed; border-left-color: var(--warning); }
.si-item--locked { cursor: default; color: var(--text-muted); user-select: none; }
.si-item--locked .si-item__label { filter: blur(3px); opacity: .6; }

.si-empty { text-align: center; color: var(--text-muted); padding: var(--gutter-xl) 0; }
