/* ════════════════════════════════════════════════════════════
   INCLUY — Menú de Accesibilidad
   Sin dependencias externas · Vanilla CSS
   ════════════════════════════════════════════════════════════ */

/* ── Variables del sistema ──────────────────────────────── */
:root {
  --acc-navy:   #1a2e4a;
  --acc-blue:   #2563eb;
  --acc-active: #3b82f6;
  --acc-white:  #ffffff;
  --acc-gray:   #e5e7eb;
  --acc-panel-w: 320px;
}

/* ══════════════════════════════════════════════════════════
   1. BARRA DE ACCESIBILIDAD (debajo del nav)
   ══════════════════════════════════════════════════════════ */
.acc-bar {
  background: var(--acc-navy);
  padding: 0.45rem 5vw;
  position: sticky;
  top: 130px; /* altura nav con logo imagen (100px) + padding (2×16px) */
  z-index: 900;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.acc-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}
.acc-bar-label {
  color: rgba(255,255,255,0.5);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-right: 0.75rem;
}
.acc-bar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  min-width: 36px;
  height: 32px;
}
.acc-bar-btn svg { width: 15px; height: 15px; fill: currentColor; flex-shrink: 0; }
.acc-bar-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.35); color: #fff; }
.acc-bar-btn.active { background: var(--acc-active); border-color: var(--acc-active); color: #fff; }
.acc-bar-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.acc-bar-sep { width: 1px; height: 20px; background: rgba(255,255,255,0.15); margin: 0 0.5rem; }

/* ══════════════════════════════════════════════════════════
   2. GRUPO DE FABs FLOTANTES (centrado inferior)
   ══════════════════════════════════════════════════════════ */

.fab-group {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

/* Botón de acción genérico (contacto y wsp) */
.fab-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  width: 56px;
  border-radius: 16px;
  padding: 0.65rem 0.4rem 0.5rem;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
}
.fab-action svg { width: 24px; height: 24px; fill: currentColor; flex-shrink: 0; }
.fab-action-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  font-family: 'Lexend', sans-serif;
}
.fab-action:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(0,0,0,0.35); }
.fab-action:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.fab-action--contact { background: #004494; }
.fab-action--contact:hover { background: #00306e; }

.fab-action--wsp { background: #25D366; }
.fab-action--wsp:hover { background: #1aaf54; }

/* FAB principal — Accesibilidad (color tercero: dorado) */
.acc-fab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  width: 68px;
  border-radius: 20px;
  padding: 0.75rem 0.4rem 0.55rem;
  background: #B38F23;
  border: 3px solid rgba(255,255,255,0.25);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(179,143,35,0.5);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.acc-fab svg { width: 32px; height: 32px; fill: currentColor; }
.acc-fab .fab-action-label { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.3px; white-space: nowrap; font-family: 'Lexend', sans-serif; }
.acc-fab:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(179,143,35,0.6); background: #9a7a1d; }
.acc-fab:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* ══════════════════════════════════════════════════════════
   3. PANEL LATERAL
   ══════════════════════════════════════════════════════════ */

/* Overlay */
.acc-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.acc-overlay.visible { opacity: 1; pointer-events: all; }

/* Drawer */
.acc-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: var(--acc-panel-w);
  background: #fff;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,0.2);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.acc-drawer.open { transform: translateX(0); }

/* Panel header */
.acc-panel-header {
  background: var(--acc-navy);
  color: #fff;
  padding: 1.1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
}
.acc-panel-header-title {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
}
.acc-panel-header-title kbd {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.72rem;
  font-family: monospace;
}
.acc-close {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 6px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1rem; flex-shrink: 0;
  transition: background 0.15s;
}
.acc-close:hover { background: rgba(255,255,255,0.2); }
.acc-close:focus-visible { outline: 2px solid #fff; }

/* Panel body */
.acc-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.acc-panel-body::-webkit-scrollbar { width: 4px; }
.acc-panel-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* Toggle gran tamaño */
.acc-size-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.acc-size-label { font-size: 0.82rem; font-weight: 600; color: #374151; }

/* Switch toggle */
.acc-switch { position: relative; display: inline-flex; width: 44px; height: 24px; flex-shrink: 0; }
.acc-switch input { opacity: 0; width: 0; height: 0; }
.acc-switch-slider {
  position: absolute; inset: 0;
  background: #d1d5db;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}
.acc-switch-slider::before {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.acc-switch input:checked + .acc-switch-slider { background: var(--acc-blue); }
.acc-switch input:checked + .acc-switch-slider::before { transform: translateX(20px); }
.acc-switch input:focus-visible + .acc-switch-slider { outline: 2px solid var(--acc-blue); outline-offset: 2px; }

/* Grid de opciones */
.acc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

/* Opción ancho completo (lector) */
.acc-option--full {
  grid-column: 1 / -1;
  flex-direction: row;
  justify-content: flex-start;
  gap: 0.8rem;
  padding: 0.85rem 1.1rem;
  min-height: auto;
}
.acc-option--full svg { width: 22px; height: 22px; }

/* Lector activo */
.acc-option--reader[aria-pressed="true"] {
  background: #fff0f6;
  border-color: #e91e8c;
  color: #e91e8c;
  animation: acc-reader-pulse 1.8s ease-in-out infinite;
}
.acc-option--reader[aria-pressed="true"] svg { fill: #e91e8c; }

@keyframes acc-reader-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(233,30,140,0.3); }
  50%       { box-shadow: 0 0 0 6px rgba(233,30,140,0); }
}

/* Controles del lector */
.acc-reader-controls {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.acc-reader-status {
  font-size: 0.75rem;
  color: #6B7C93;
  font-weight: 600;
  text-align: center;
  min-height: 1.1em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acc-reader-btns {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}
.acc-reader-ctrl {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 2px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  color: #1a2e4a;
}
.acc-reader-ctrl svg { width: 18px; height: 18px; }
.acc-reader-ctrl:hover { background: #eff6ff; border-color: #93c5fd; }
.acc-reader-ctrl:focus-visible { outline: 2px solid var(--acc-blue); }

.acc-reader-speed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.acc-reader-speed-sel {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  font-family: inherit;
  color: #374151;
  background: #fff;
  cursor: pointer;
}

/* Párrafo activo siendo leído */
.acc-reading-active {
  background: rgba(233,30,140,0.08) !important;
  outline: 2px solid rgba(233,30,140,0.3);
  outline-offset: 2px;
  border-radius: 4px;
  transition: background 0.3s;
}

.acc-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.9rem 0.5rem;
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 600;
  color: #374151;
  font-family: inherit;
  text-align: center;
  line-height: 1.3;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  min-height: 80px;
}
.acc-option svg { width: 26px; height: 26px; fill: #1f2937; flex-shrink: 0; transition: fill 0.15s; }
.acc-option:hover { border-color: #93c5fd; box-shadow: 0 2px 8px rgba(37,99,235,0.12); }
.acc-option:focus-visible { outline: 2px solid var(--acc-blue); outline-offset: 2px; }
.acc-option[aria-pressed="true"] {
  border-color: var(--acc-blue);
  background: #eff6ff;
  color: var(--acc-blue);
}
.acc-option[aria-pressed="true"] svg { fill: var(--acc-blue); }

/* Font size buttons (full width) */
.acc-font-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.acc-font-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.6rem; background: #fff;
  border: 2px solid #e5e7eb; border-radius: 8px;
  cursor: pointer; font-family: inherit;
  font-weight: 700; color: #374151;
  transition: border-color 0.15s, background 0.15s;
}
.acc-font-btn:hover { border-color: #93c5fd; background: #eff6ff; }
.acc-font-btn:focus-visible { outline: 2px solid var(--acc-blue); }
.acc-font-btn span.acc-font-label { font-size: 0.72rem; font-weight: 600; }
.acc-font-btn span.acc-font-size  { font-size: 1.1rem; font-weight: 800; }

/* Panel footer */
.acc-panel-footer {
  padding: 1rem 1.2rem;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  flex-shrink: 0;
}
.acc-reset-all {
  width: 100%;
  background: var(--acc-navy);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.7rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 0.6rem;
}
.acc-reset-all:hover { background: #243d5f; }
.acc-reset-all:focus-visible { outline: 2px solid var(--acc-navy); outline-offset: 2px; }
.acc-footer-credit {
  text-align: center;
  font-size: 0.7rem;
  color: #9ca3af;
}

/* ── Modo gran tamaño ───────────────────────────────────── */
.acc-drawer.acc-large {
  --acc-panel-w: 420px;
  width: 420px;
}
.acc-drawer.acc-large .acc-option { min-height: 100px; font-size: 0.85rem; padding: 1.1rem 0.6rem; }
.acc-drawer.acc-large .acc-option svg { width: 34px; height: 34px; }
.acc-drawer.acc-large .acc-panel-header-title { font-size: 0.92rem; }

/* ══════════════════════════════════════════════════════════
   4. MODIFICADORES DEL BODY (clases de accesibilidad)
   ══════════════════════════════════════════════════════════ */

/* 4.1 Alto contraste */
body.acc-contrast {
  filter: contrast(1.6) brightness(0.95);
}
body.acc-contrast .acc-bar,
body.acc-contrast .acc-drawer,
body.acc-contrast .acc-fab,
body.acc-contrast .fab-action { filter: none; }

/* 4.2 Resaltar enlaces */
body.acc-links a {
  outline: 2px solid #facc15 !important;
  outline-offset: 2px !important;
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
}

/* 4.3 Espaciado de texto */
body.acc-spacing p,
body.acc-spacing li,
body.acc-spacing span,
body.acc-spacing div,
body.acc-spacing h1, body.acc-spacing h2,
body.acc-spacing h3, body.acc-spacing h4 {
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
}

/* 4.4 Detener animaciones */
body.acc-no-anim *,
body.acc-no-anim *::before,
body.acc-no-anim *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* 4.5 Ocultar imágenes */
body.acc-no-images img,
body.acc-no-images picture,
body.acc-no-images figure,
body.acc-no-images svg:not(.acc-svg) {
  visibility: hidden !important;
}

/* 4.6 Fuente para dislexia */
body.acc-dyslexia,
body.acc-dyslexia * {
  font-family: 'OpenDyslexic', 'Comic Sans MS', cursive !important;
}

/* 4.7 Cursor grande */
body.acc-cursor,
body.acc-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M8 4 L8 36 L16 28 L22 40 L26 38 L20 26 L32 26 Z' fill='%23000000' stroke='%23ffffff' stroke-width='2.5'/%3E%3C/svg%3E") 8 4, auto !important;
}

/* 4.8 Altura de línea */
body.acc-line-height p,
body.acc-line-height li,
body.acc-line-height span,
body.acc-line-height div:not(.acc-panel-body) {
  line-height: 2 !important;
}

/* 4.9 Tooltips visibles */
body.acc-tooltips [title]::after {
  content: " [" attr(title) "]";
  font-size: 0.75em;
  color: #374151;
  background: #fef9c3;
  border: 1px solid #fde047;
  border-radius: 4px;
  padding: 0 0.4em;
  margin-left: 0.3em;
  vertical-align: middle;
  white-space: nowrap;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════
   5. RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .acc-bar-label { display: none; }
  .acc-drawer, .acc-drawer.acc-large { width: 100vw; }
  .fab-group { bottom: 1rem; right: 1rem; gap: 0.5rem; }
  .fab-action { width: 48px; border-radius: 14px; padding: 0.55rem 0.3rem 0.4rem; }
  .fab-action svg { width: 20px; height: 20px; }
  .acc-fab { width: 58px; border-radius: 16px; padding: 0.6rem 0.3rem 0.45rem; }
  .acc-fab svg { width: 26px; height: 26px; }
}

/* ══════════════════════════════════════════════════════════
   6. SKIP LINK (accesibilidad básica)
   ══════════════════════════════════════════════════════════ */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--acc-navy);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 0 0 8px 8px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }
