/* ============================================================
   MANUAL DE ACCESIBILIDAD WEB — UNIVERSIDAD DEL VALLE
   styles.css | Versión 3.0 | Febrero 2026
   Compartido por todos los archivos HTML del manual.
   ============================================================ */


/* ─── 1. VARIABLES — Modo claro ─────────────────────────── */
:root {
  --rojo:         #95042d;
  --rojo-hover:   #7a0325;
  --rojo-pale:    #fdf0f3;
  --rojo-border:  rgba(149,4,45,0.18);

  --bg:           #ffffff;
  --bg-sidebar:   #f8f9fb;
  --bg-surface:   #ffffff;
  --bg-code:      #f3f4f6;
  --bg-th:        #f0f2f5;

  --text-primary: #1a1a2e;
  --text-body:    #333333;
  --text-muted:   #555566;
  --text-subtle:  #6b7280;
  --text-link:    #95042d;
  --text-code:    #9b1c1c;

  --border:       #e2e6ec;

  /* Callouts */
  --ci-bg:  #eff6ff; --ci-bd: #93c5fd; --ci-tx: #1e3a8a;
  --cw-bg:  #fffbeb; --cw-bd: #fcd34d; --cw-tx: #78350f;
  --cd-bg:  #fef2f2; --cd-bd: #fca5a5; --cd-tx: #7f1d1d;
  --ct-bg:  #f0fdf4; --ct-bd: #86efac; --ct-tx: #14532d;

  /* Sintaxis código — todos ≥ 4.5:1 sobre #f3f4f6 */
  --syn-kw: #6d28d9; --syn-fn: #0369a1; --syn-str: #15803d;
  --syn-cm: #6b7280; --syn-num: #c2410c; --syn-at: #92400e;
  --syn-tg: #7c3aed; --syn-vl: #065f46;

  --nav-h:      60px;
  --sidebar-w:  265px;
  --font:       system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono:  ui-monospace, 'Cascadia Code', 'Consolas', monospace;
  --radius:     8px;
  --radius-lg:  12px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.07);
  --shadow-md:  0 4px 14px rgba(0,0,0,0.09);
  --font-size-base: 16px;
}

/* ─── 2. MODO OSCURO ─────────────────────────────────────── */
html.dark {
  --bg:           #111118;
  --bg-sidebar:   #0d0d14;
  --bg-surface:   #1a1a24;
  --bg-code:      #0f0f18;
  --bg-th:        #1e1e2a;

  --text-primary: #f0f0f8;
  --text-body:    #d8d8e8;
  --text-muted:   #a8a8bc;
  --text-subtle:  #8888a0;
  --text-link:    #f4758f;
  --text-code:    #f87171;
  --border:       #2a2a3c;
  --rojo-pale:    #1e0a10;
  --rojo-border:  rgba(244,117,143,0.2);

  --ci-bg: #0f172a; --ci-bd: #1d4ed8; --ci-tx: #93c5fd;
  --cw-bg: #1c1200; --cw-bd: #d97706; --cw-tx: #fcd34d;
  --cd-bg: #1a0505; --cd-bd: #dc2626; --cd-tx: #fca5a5;
  --ct-bg: #052010; --ct-bd: #16a34a; --ct-tx: #86efac;

  --syn-kw: #c4b5fd; --syn-fn: #7dd3fc; --syn-str: #86efac;
  --syn-cm: #6b7280; --syn-num: #fb923c; --syn-at: #fcd34d;
  --syn-tg: #a78bfa; --syn-vl: #6ee7b7;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.5);
}

/* ─── 3. RESET Y BASE ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-body);
  background: var(--bg);
  transition: background-color 0.25s, color 0.25s;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--text-link); text-decoration: underline; text-underline-offset: 3px; transition: color 0.15s; }
a:hover { color: var(--rojo-hover); }
ul, ol { padding-left: 1.5em; }
li { margin-bottom: 4px; }
strong { color: var(--text-primary); }

/* ─── 4. ACCESIBILIDAD ───────────────────────────────────── */
.skip-link {
  position: fixed; top: -120px; left: 16px; z-index: 9999;
  background: var(--rojo); color: #fff;
  padding: 10px 18px; border-radius: var(--radius);
  font-weight: 600; font-size: 0.9rem;
  text-decoration: none; transition: top 0.2s;
  box-shadow: var(--shadow-md);
}
.skip-link:focus { top: 80px; outline: 3px solid #ffdd00; outline-offset: 2px; }

:focus-visible {
  outline: 3px solid var(--rojo);
  outline-offset: 3px;
  border-radius: 4px;
}
html.dark :focus-visible { outline-color: #f4758f; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ─── 5. NAVEGACIÓN SUPERIOR ─────────────────────────────── */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center;
  padding: 0 20px;
  transition: background-color 0.25s, border-color 0.25s;
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0; margin-right: 20px;
}
.nav-logo-img {
  background: #fff; border-radius: 5px;
  padding: 4px 6px; height: 40px; width: auto;
  border: 1px solid var(--border);
}
.nav-logo-text {
  font-size: 0.75rem; font-weight: 600; line-height: 1.3;
  color: var(--text-muted); max-width: 140px;
}

.nav-sep { width: 1px; height: 26px; background: var(--border); margin: 0 14px; flex-shrink: 0; }

/* Links de sección — usan <a> reales para navegar entre archivos HTML */
.nav-sections {
  display: flex; align-items: center; gap: 2px; flex: 1;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.nav-sections::-webkit-scrollbar { display: none; }

.nav-link {
  display: inline-block;
  font-family: var(--font); font-size: 0.81rem; font-weight: 600;
  color: var(--text-muted);
  padding: 6px 11px; border-radius: 6px;
  white-space: nowrap; text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--rojo-pale); color: var(--rojo); }
.nav-link.active { background: var(--rojo); color: #fff; }
html.dark .nav-link.active { background: var(--rojo); color: #fff; }

.nav-controls { display: flex; align-items: center; gap: 7px; margin-left: auto; flex-shrink: 0; }

.nav-icon-btn {
  background: none; border: 1px solid var(--border);
  border-radius: 6px; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.nav-icon-btn:hover { background: var(--rojo-pale); border-color: var(--rojo); color: var(--rojo); }

.nav-version {
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500;
  background: var(--rojo-pale); color: var(--rojo);
  border: 1px solid var(--rojo-border);
  border-radius: 5px; padding: 3px 8px; white-space: nowrap;
}

/* Hamburguesa móvil */
.nav-hamburger {
  display: none; background: none; border: none;
  width: 36px; height: 36px; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
  cursor: pointer; padding: 4px; margin-right: 6px;
}
.nav-hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--text-body); border-radius: 99px; transition: all 0.2s;
}

/* ─── 6. SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  position: fixed; top: var(--nav-h); left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto; padding: 20px 0 60px; z-index: 100;
  transition: background-color 0.25s, border-color 0.25s, transform 0.28s;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.sb-title {
  font-size: 0.67rem; font-weight: 700; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--text-subtle);
  padding: 10px 20px 6px;
}

/* Los ítems del sidebar son <a> reales con anclas (#id) dentro de la misma página */
.sb-item {
  display: block; padding: 7px 20px;
  font-size: 0.84rem; font-weight: 500;
  color: var(--text-muted); text-decoration: none;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0; margin: 1px 8px 1px 0;
  transition: background-color 0.12s, color 0.12s, border-color 0.12s;
  line-height: 1.4;
}
.sb-item:hover { background: var(--rojo-pale); color: var(--rojo); border-left-color: rgba(149,4,45,0.25); }
.sb-item.active { background: var(--rojo-pale); color: var(--rojo); border-left-color: var(--rojo); font-weight: 600; }
html.dark .sb-item:hover,
html.dark .sb-item.active { background: #1e0a10; color: #f4758f; }
html.dark .sb-item.active { border-left-color: #f4758f; }

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 90;
}
.sidebar-overlay.visible { display: block; }

/* ─── 7. LAYOUT ──────────────────────────────────────────── */
.main-wrapper { margin-left: var(--sidebar-w); padding-top: var(--nav-h); min-height: 100vh; }

.page-content {
  max-width: 820px;
  padding: 48px 60px 80px;
  margin: 0 auto;
}

/* Secciones con scroll-margin para anclas */
section[id] { scroll-margin-top: calc(var(--nav-h) + 20px); }

/* ─── 8. HERO — Portada ──────────────────────────────────── */
.hero {
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-md); margin-bottom: 52px;
}
.hero-img { position: relative; min-height: 320px; overflow: hidden; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

.hero-panel {
  background: var(--bg-surface);
  border-left: 4px solid var(--rojo);
  padding: 48px 36px;
  display: flex; flex-direction: column; justify-content: center; gap: 18px;
}
.hero-eyebrow {
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--rojo);
}
.hero-title {
  font-size: 1.75rem; font-weight: 800; line-height: 1.2;
  color: var(--text-primary); letter-spacing: -0.02em;
}
.hero-sub { font-size: 0.9rem; line-height: 1.65; color: var(--text-muted); }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.badge {
  background: var(--rojo-pale); color: var(--rojo);
  border: 1px solid var(--rojo-border);
  border-radius: 999px; padding: 4px 14px;
  font-size: 0.73rem; font-weight: 700; letter-spacing: 0.04em;
}
.badge.destacado { background: var(--rojo); color: #fff; }

/* Cards de navegación rápida — íconos SVG monocromáticos en rojo */
.quick-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px,1fr));
  gap: 14px; margin: 24px 0 40px;
}
.quick-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 20px;
  text-decoration: none; color: inherit; display: block;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.quick-card:hover { box-shadow: var(--shadow-md); border-color: var(--rojo); transform: translateY(-2px); }

/* Ícono SVG dentro de la card */
.quick-card-icon {
  width: 36px; height: 36px; margin-bottom: 12px;
  color: var(--rojo);   /* Los SVG heredan este color via currentColor */
}
.quick-card-icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.quick-card h3 { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); margin-bottom: 5px; }
.quick-card p  { font-size: 0.79rem; color: var(--text-muted); line-height: 1.5; margin: 0; }

/* ─── 9. TIPOGRAFÍA ──────────────────────────────────────── */
.page-eyebrow {
  display: block; font-family: var(--font-mono); font-size: 0.69rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--rojo); margin-bottom: 12px;
}

h1 { font-size: 2rem; font-weight: 800; line-height: 1.2; color: var(--text-primary); margin-bottom: 16px; letter-spacing: -0.02em; }
h2 { font-size: 1.35rem; font-weight: 700; color: var(--text-primary); margin-top: 48px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--rojo-pale); }
html.dark h2 { border-bottom-color: #2a0a10; }
h3 { font-size: 1.08rem; font-weight: 700; color: var(--text-primary); margin-top: 30px; margin-bottom: 10px; }
h4 { font-size: 0.93rem; font-weight: 700; color: var(--rojo); margin-top: 22px; margin-bottom: 8px; }
html.dark h4 { color: #f4758f; }

p { color: var(--text-body); margin-bottom: 15px; max-width: 72ch; }
.lead { font-size: 1.04rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 30px; padding-left: 14px; border-left: 3px solid var(--border); }
ul, ol { color: var(--text-body); margin-bottom: 15px; }
code:not(pre code) { font-family: var(--font-mono); font-size: 0.83em; background: var(--bg-code); color: var(--text-code); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border); }

/* ─── 10. CÓDIGO ─────────────────────────────────────────── */
.code-block { position: relative; margin: 22px 0; }
.code-header {
  display: flex; align-items: center; justify-content: space-between;
  background: #1e1e2e; color: #a0a0c0;
  padding: 8px 16px; border-radius: var(--radius) var(--radius) 0 0;
  font-family: var(--font-mono); font-size: 0.71rem;
}
.copy-btn {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  color: #c0c0d8; font-family: var(--font); font-size: 0.71rem; font-weight: 600;
  padding: 3px 10px; border-radius: 4px; cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  transition: background-color 0.15s, color 0.15s;
}
.copy-btn:hover  { background: rgba(255,255,255,0.16); color: #fff; }
.copy-btn.copied { background: rgba(50,200,100,0.2); border-color: rgba(50,200,100,0.35); color: #6ee7b7; }

pre {
  background: var(--bg-code); border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 20px 22px; overflow-x: auto; margin: 0;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
pre code { font-family: var(--font-mono); font-size: 0.83rem; line-height: 1.7; color: var(--text-body); background: none; border: none; padding: 0; }

.kw { color: var(--syn-kw); font-weight: 600; }
.fn { color: var(--syn-fn); }
.str{ color: var(--syn-str); }
.cm { color: var(--syn-cm); font-style: italic; }
.num{ color: var(--syn-num); }
.at { color: var(--syn-at);  }
.tg { color: var(--syn-tg);  }
.vl { color: var(--syn-vl);  }

/* ─── 11. CALLOUTS ───────────────────────────────────────── */
.callout {
  display: flex; gap: 13px; padding: 15px 17px;
  border-radius: var(--radius); margin: 22px 0; border: 1px solid;
  align-items: flex-start;
}
.callout-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.callout-body { flex: 1; }
.callout-body p { margin: 0; font-size: 0.875rem; }
.callout-body ul { margin: 6px 0 0; padding-left: 1.2em; font-size: 0.875rem; }
.callout strong { display: block; margin-bottom: 4px; font-size: 0.875rem; }
.callout.info   { background: var(--ci-bg); border-color: var(--ci-bd); }
.callout.warn   { background: var(--cw-bg); border-color: var(--cw-bd); }
.callout.danger { background: var(--cd-bg); border-color: var(--cd-bd); }
.callout.tip    { background: var(--ct-bg); border-color: var(--ct-bd); }
.callout.info   * { color: var(--ci-tx); }
.callout.warn   * { color: var(--cw-tx); }
.callout.danger * { color: var(--cd-tx); }
.callout.tip    * { color: var(--ct-tx); }

/* ─── 12. TABLAS ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 22px 0; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead { background: var(--bg-th); }
th { padding: 10px 15px; text-align: left; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-subtle); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 15px; color: var(--text-body); border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--rojo-pale); }
html.dark tbody tr:hover td { background: #1e0a10; }

/* ─── 13. NAVEGACIÓN ENTRE SECCIONES (pie) ───────────────── */
.page-nav { display: flex; justify-content: space-between; gap: 14px; margin-top: 68px; padding-top: 26px; border-top: 1px solid var(--border); }
.page-nav-btn { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 18px; text-decoration: none; color: inherit; display: block; flex: 1; max-width: 275px; transition: border-color 0.15s, box-shadow 0.15s; }
.page-nav-btn:hover { border-color: var(--rojo); box-shadow: var(--shadow-sm); }
.page-nav-btn.next { text-align: right; margin-left: auto; }
.page-nav-label { font-family: var(--font-mono); font-size: 0.69rem; color: var(--text-subtle); letter-spacing: 0.06em; margin-bottom: 3px; }
.page-nav-title { font-size: 0.86rem; font-weight: 600; color: var(--rojo); }
html.dark .page-nav-title { color: #f4758f; }

/* ─── 14. FAB ────────────────────────────────────────────── */
.fab-group { position: fixed; bottom: 26px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 300; }
.fab-btn { width: 42px; height: 42px; border-radius: 50%; border: none; background: var(--rojo); color: #fff; font-weight: 700; cursor: pointer; box-shadow: 0 4px 12px rgba(149,4,45,0.35); transition: transform 0.15s, box-shadow 0.15s; display: flex; align-items: center; justify-content: center; }
.fab-btn:hover { transform: scale(1.08); background: var(--rojo-hover); }

/* ─── 15. FOOTER ─────────────────────────────────────────── */
.doc-footer { margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--border); font-size: 0.78rem; color: var(--text-subtle); text-align: center; line-height: 1.8; }

/* ─── 16. TAGS ───────────────────────────────────────────── */
.tag { display: inline-block; font-family: var(--font-mono); font-size: 0.69rem; font-weight: 600; padding: 2px 7px; border-radius: 999px; vertical-align: middle; margin-left: 5px; }
.tag-rojo  { background: var(--rojo-pale); color: var(--rojo); border: 1px solid var(--rojo-border); }
.tag-verde { background: #dcfce7; color: #14532d; border: 1px solid #86efac; }
.tag-azul  { background: #dbeafe; color: #1e3a8a; border: 1px solid #93c5fd; }
html.dark .tag-rojo  { background: #1e0a10; color: #f4758f; border-color: rgba(244,117,143,0.25); }
html.dark .tag-verde { background: #052010; color: #86efac; border-color: #16a34a; }
html.dark .tag-azul  { background: #0f172a; color: #93c5fd; border-color: #1d4ed8; }

/* ─── 17. RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sidebar-w: 280px; }
  .nav-hamburger { display: flex; }
  .nav-sep, .nav-logo-text { display: none; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-md); }
  .main-wrapper { margin-left: 0; }
  .page-content { padding: 30px 18px 60px; }
  .hero { grid-template-columns: 1fr; }
  .hero-img { min-height: 200px; max-height: 260px; }
  .hero-panel { border-left: none; border-top: 4px solid var(--rojo); padding: 28px 22px; }
  .hero-title { font-size: 1.4rem; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.18rem; }
  .page-nav { flex-direction: column; }
  .page-nav-btn { max-width: 100%; }
  .page-nav-btn.next { margin-left: 0; }
  .quick-cards { grid-template-columns: 1fr 1fr; }
  .fab-group { bottom: 14px; right: 14px; }
}
@media (max-width: 480px) {
  .quick-cards { grid-template-columns: 1fr; }
  .nav-version { display: none; }
}

/* ─── 18. MOVIMIENTO REDUCIDO ────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
