/* =========================
   Escalado global de fuente
   ========================= */
html {
  font-size: calc(16px * var(--acc-font-scale, 1));
}

/* =========================
   Skip Link ("Saltar al contenido")
   ========================= */
.skip-link {
  position: fixed;
  top: -4rem;
  left: 1rem;
  background-color: #005c99;
  color: #ffffff;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 0.5rem;

  opacity: 0;
  pointer-events: none;
  box-shadow: none;
  transition:
    top 0.25s ease,
    opacity 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.skip-link:focus {
  top: 1rem;
  opacity: 1;
  pointer-events: auto;
  outline: none;
  box-shadow: 0 8px 22px rgba(0, 92, 153, 0.4);
  transform: translateY(-2px);
}

/* =========================
   Toolbar flotante
   ========================= */
#acc-toolbar {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  font-size: 14px;
}

/* Icono de accesibilidad */
#acc-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-color: #005c99;
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 14px rgba(0, 92, 153, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  padding: 0;
  outline: none;
}
#acc-icon:hover {
  transform: scale(1.08);
  background-color: #004573;
  box-shadow: 0 6px 18px rgba(0, 92, 153, 0.5);
}
#acc-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Panel principal */
#acc-panel {
  margin-top: 0.5rem;
  padding: 0.75rem 0.9rem 0.9rem;
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  width: 280px;
  max-width: 90vw;
  font-size: 13px;
}

/* Header del panel */
.acc-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.acc-panel-title {
  font-weight: 600;
  color: #005c99;
  font-size: 0.95rem;
}
.acc-panel-close {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}

/* Secciones */
.acc-section {
  margin-bottom: 0.7rem;
}
.acc-section-title {
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  color: #1f2933;
}

/* Botones tipo "pill" (perfiles rápidos) */
.acc-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.acc-pill {
  border-radius: 999px;
  border: 1px solid #d0d7e2;
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  background: #f7f9fc;
  cursor: pointer;
}
.acc-pill[aria-pressed="true"] {
  background: #005c99;
  color: #ffffff;
  border-color: #005c99;
}

/* Botones de ajustes individuales */
.acc-toggle-btn {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 0.25rem;
  padding: 0.25rem 0.45rem;
  border-radius: 0.35rem;
  border: 1px solid #e2e8f0;
  background: #f9fafb;
  cursor: pointer;
  font-size: 0.8rem;
}
.acc-toggle-btn[aria-pressed="true"] {
  background: #e0f2ff;
  border-color: #005c99;
  color: #003a63;
}

/* Footer del panel */
.acc-panel-footer {
  margin-top: 0.5rem;
  border-top: 1px solid #e5e7eb;
  padding-top: 0.45rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
}
.acc-footer-link {
  font-size: 0.75rem;
  text-decoration: underline;
  color: #4b5563;
}
.acc-reset-btn {
  border: none;
  background: #f3f4f6;
  padding: 0.25rem 0.5rem;
  border-radius: 0.35rem;
  font-size: 0.75rem;
  cursor: pointer;
}

/* =========================
   MODOS ACTIVABLES
   ========================= */

/* Alto contraste / modo oscuro global */
body.acc-contrast {
  background-color: #020617 !important; /* fondo global oscuro */
  color: #f9fafb !important;            /* texto claro global */
}

/* Fondos claros a oscuro */
body.acc-contrast .bg-white,
body.acc-contrast .bg-bocana-blue,
body.acc-contrast .bg-bocana-blue-dark,
body.acc-contrast .glass-card,
body.acc-contrast header,
body.acc-contrast main,
body.acc-contrast footer {
  background-color: #020617 !important;
  background-image: none !important;
}

/* Textos a color claro */
body.acc-contrast .text-bocana-blue,
body.acc-contrast .text-gray-800,
body.acc-contrast .text-gray-700,
body.acc-contrast .text-gray-600,
body.acc-contrast .text-gray-400,
body.acc-contrast .text-gray-300,
body.acc-contrast p,
body.acc-contrast h1,
body.acc-contrast h2,
body.acc-contrast h3,
body.acc-contrast h4,
body.acc-contrast h5,
body.acc-contrast h6,
body.acc-contrast a {
  color: #e5e7eb !important;
}

/* Enlaces bien marcados en contraste */
body.acc-contrast a {
  text-decoration: underline;
}

/* Bordes a gris intermedio */
body.acc-contrast .border-bocana-blue,
body.acc-contrast .border-gray-700,
body.acc-contrast .border-gray-600,
body.acc-contrast .border-gray-300 {
  border-color: #4b5563 !important;
}

/* Inputs en modo oscuro también */
body.acc-contrast input,
body.acc-contrast textarea {
  background-color: #020617 !important;
  color: #f9fafb !important;
  border-color: #4b5563 !important;
}

/* ===== Alto contraste específico del panel de accesibilidad ===== */

body.acc-contrast #acc-panel {
  background-color: #020617 !important;
  color: #f9fafb !important;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

body.acc-contrast .acc-panel-title,
body.acc-contrast .acc-section-title {
  color: #f9fafb !important;
}

body.acc-contrast .acc-footer-link {
  color: #e5e7eb !important;
}

body.acc-contrast .acc-toggle-btn,
body.acc-contrast .acc-pill,
body.acc-contrast .acc-reset-btn {
  background-color: #111827 !important;
  color: #f9fafb !important;
  border-color: #e5e7eb !important;
}

body.acc-contrast .acc-toggle-btn[aria-pressed="true"],
body.acc-contrast .acc-pill[aria-pressed="true"] {
  background-color: #f9fafb !important;
  color: #020617 !important;
  border-color: #f9fafb !important;
}

/* Fuente legible */
body.acc-readable-font {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Enlaces destacados */
body.acc-links a {
  text-decoration: underline;
  font-weight: 600;
}

/* Reducir animaciones (CSS) */
body.acc-reduce-motion *,
body.acc-reduce-motion *::before,
body.acc-reduce-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* Cursor grande (usa el icono, con !important para pisar cursor:pointer) */
/* Cursor grande accesible (círculo blanco con borde oscuro) */
body.acc-big-cursor,
body.acc-big-cursor * {
  cursor: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAu0lEQVR4nO2XQQ7AIAgEtS9sX9r+0B5MY1RArFBJ6l4VdrIcFOf+Lv+ubA/42dXVs+MyZYqpDcMEyM1DOPGG/uiCaAAkY8qUBwODbFrmdR08QgRg3JwLQSQwbs7pAwBESinzGiJPoQDQMacgyBF8IUsAuvE/KsdgKYEFsACmA8Tnsn7PZZX6Rz9LCZgA0B1DGT8AoAcBmSMAUJGUeS0EIFGOQrQ+pkQC4xCcX7H1vQCH4ElsMyoltxtO1w3jA080fJ/CDAAAAABJRU5ErkJggg==") 16 16, auto !important;
}


/* Modo lectura fuerte: más interlineado/espaciado en texto */
body.acc-reading-strong p,
body.acc-reading-strong li {
  line-height: 1.7;
  letter-spacing: 0.03em;
  word-spacing: 0.08em;
  max-width: 70ch;
}

/* Foco visible global (teclado) */
a:focus,
button:focus,
input:focus,
#acc-icon:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}