/* ============================================================
   La Escuela — Sistema de diseño P2
   Tokens: Rojo SCE · Navy estructural · Navy sutil en bordes
   ============================================================ */

:root {
  /* Colores principales */
  --red:           #9B1C1C;
  --red-light:     #FDECEA;
  --red-dark:      #7a1414;   /* hover / estado pulsado del rojo */

  /* Navy — color estructural principal (navbar, Jack, badges activos) */
  --charcoal:      #1E3A5F;   /* navy profundo — reemplaza el café */
  --charcoal-mid:  #2D4E7A;   /* navy medio — separadores internos */
  --charcoal-soft: #EBF0F8;   /* navy muy claro — fondos alternativos */

  /* Navy en bordes (más claro, nunca como relleno de área grande) */
  --navy:          #1E3A5F;
  --navy-border:   #C8D4E0;   /* borde estándar de tarjeta */
  --navy-line:     #8BA4C0;   /* separadores clave */

  /* Fondos y superficies */
  --bg:            #F5F4F2;
  --surface:       #FFFFFF;

  /* Tipografía */
  --text:          #141C28;   /* navy-oscuro — texto principal */
  --text-muted:    #5C6B80;   /* navy-gris — texto secundario */

  /* Éxito */
  --green:         #166534;
  --green-light:   #DCFCE7;

  /* Acento secundario (badges, contadores, énfasis cálido) */
  --yellow:        #E8A020;
  --warn:          #b58105;   /* texto sobre fondo claro: warning */

  /* Sombras (placeholder; ampliar si se introduce elevación real) */
  --shadow:        transparent;

  /* Radios y líneas */
  --radius:        10px;
  --radius-sm:     6px;
  --border-width:  2px;
}

/* ─── Reset mínimo ──────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Montserrat', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Navbar ─────────────────────────────────────────────────── */

.la-navbar {
  display: flex;
  align-items: center;
  background: var(--charcoal);
  border-bottom: 3px solid var(--red);
  padding: 0 1.5rem;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 200;
  gap: 0;
}

.la-navbar__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  margin-right: 2rem;
  flex-shrink: 0;
}

.la-navbar__logo-img {
  height: 28px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.la-navbar__logo-icon {
  width: 26px;
  height: 26px;
  background: var(--red);
  border-radius: 6px;
  display: inline-block;
  position: relative;
}
.la-navbar__logo-icon::after {
  content: '';
  position: absolute;
  inset: 5px 6px;
  background: rgba(255,255,255,0.9);
  border-radius: 2px;
}

.la-navbar__brand-name {
  color: #fff;
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.la-navbar__links {
  display: flex;
  align-items: stretch;
  flex: 1;
  height: 100%;
  gap: 0;
}

.la-navbar__link {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.la-navbar__link:hover { color: rgba(255,255,255,0.9); text-decoration: none; }
.la-navbar__link.is-active {
  color: #fff;
  font-weight: 700;
  border-bottom-color: var(--red);
}
.la-navbar__link--soon {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.la-navbar__admin-badge {
  display: flex;
  align-items: center;
  margin-left: 0.75rem;
  padding: 0 0.85rem;
  border-left: 1px solid var(--charcoal-mid);
  color: var(--navy-border);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  height: 100%;
}
.la-navbar__admin-badge:hover { color: #fff; text-decoration: none; }
.la-navbar__admin-badge.is-active { color: #fff; }
.la-navbar__admin-badge + .la-navbar__admin-badge {
  margin-left: 0.25rem;
  border-left: none;
}

.la-navbar__user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-left: 1px solid var(--charcoal-mid);
  padding-left: 1rem;
  flex-shrink: 0;
}

.la-navbar__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--navy-border);
}
.la-navbar__avatar-placeholder {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.la-navbar__user-info {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.la-navbar__user-name {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
}
.la-navbar__user-role {
  color: rgba(255,255,255,0.4);
  font-size: 0.68rem;
  line-height: 1;
}

.la-navbar__sep {
  width: 1px;
  height: 18px;
  background: var(--charcoal-mid);
}
.la-navbar__logout {
  color: rgba(255,255,255,0.45);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}
.la-navbar__logout:hover { color: rgba(255,255,255,0.85); text-decoration: none; }

.la-navbar__login-link {
  color: rgba(255,255,255,0.75);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

/* ─── Flash messages ─────────────────────────────────────────── */

.flash-ok    { background: var(--green-light); color: var(--green);
               border: 2px solid #86efac; border-radius: var(--radius-sm);
               padding: 0.7rem 1rem; font-size: 0.88rem; margin-bottom: 1rem; }
.flash-error { background: var(--red-light, #FDECEA); color: var(--red);
               border: 2px solid #fca5a5; border-radius: var(--radius-sm);
               padding: 0.7rem 1rem; font-size: 0.88rem; margin-bottom: 1rem; }

/* ─── Botones ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.88; text-decoration: none; }
.btn-charcoal { background: var(--charcoal); color: #fff; }
.btn-red      { background: var(--red);      color: #fff; }
.btn-outline  { background: transparent; border: 2px solid var(--navy-border); color: var(--text); }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; }
.btn-block { display: flex; width: 100%; justify-content: center; padding: 0.85rem 1.1rem; font-size: 0.92rem; }

/* ─── Formularios ─────────────────────────────────────────────── */

.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.form-input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--navy-border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.form-input:focus {
  outline: none;
  border-color: var(--navy-line);
}
.form-help {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  line-height: 1.5;
}
.form-link { color: var(--red); font-weight: 700; text-decoration: none; }
.form-link:hover { text-decoration: underline; }

/* ─── CMS: barras sticky (editor / trivia editor) ─────────────── */

.cms-sticky-head {
  position: sticky;
  top: 0;
  z-index: 300;
  background: var(--surface);
  border-bottom: 2px solid var(--red);
  box-shadow: 0 6px 20px rgba(20, 28, 40, 0.06);
}

/* ─── Player lección (navbar + barra de progreso) ───────────── */

.player-shell {
  --nav-h: 52px;
  --progress-h: 3px;
}

.player-shell {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Montserrat', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.player-shell .progress {
  top: var(--nav-h);
  height: var(--progress-h);
  background: rgba(155, 28, 28, 0.14);
}

.player-shell .progress-bar {
  background: var(--red);
}

.player-shell .deck {
  height: calc(100vh - var(--nav-h) - var(--progress-h));
  width: 100%;
}

.player-shell .start-overlay,
.player-shell .end-overlay {
  top: var(--nav-h);
  background: var(--bg);
}

/* ─── Trivia interactiva (navbar + contenido) ───────────────── */

.trivia-shell {
  --nav-h: 52px;
  --progress-h: 3px;
  margin: 0;
  min-height: 100vh;
  font-family: 'Montserrat', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.trivia-shell .progress-strip {
  top: var(--nav-h);
  height: var(--progress-h);
  background: rgba(155, 28, 28, 0.14);
}

.trivia-shell .progress-strip > div {
  background: var(--red);
}

.trivia-shell .trivia-page {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.trivia-shell .advance-bar {
  background: var(--bg);
  border-top: 2px solid var(--navy-border);
}

/* ─── Slide / Deck primitives ──────────────────────────────────
   Reglas literalmente compartidas entre master_v2 (export HTML) y
   viewer (player web). El resto de estilos de slide es divergente
   (escalas distintas por superficie) y vive en pages/. Ver
   docs/CSS_ARCHITECTURE.md. */

.slide.is-active { display: block; }
.key-points li::marker { color: var(--yellow); }

/* ─── CMS toolbar / pane primitives ────────────────────────────
   Reglas literalmente compartidas entre editor.html y
   trivia_editor.html. El resto del look-and-feel del editor
   (workspace, panes, helper) sigue en pages/ porque hoy difiere
   entre ambos en detalles. Ver docs/CSS_ARCHITECTURE.md. */

.cms-sticky-head {
  position: sticky;
  top: 52px;                  /* altura del navbar P2 */
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--navy-border);
}
.cms-sticky-head .toolbar { border-bottom: none; }
.toolbar h1 span          { color: var(--red); }
.toolbar .spacer          { flex: 1; }

.toolbar-section-label {
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.25rem 0.65rem;
  border-left: 3px solid var(--red);
  margin-right: 0.5rem;
  white-space: nowrap;
}
.pane:last-child          { border-right: none; }
.status.error             { color: var(--red); }
.issues:empty             { display: none; }
