/* ==============================
 * ACCESIBILIDAD CSS - BOTÓN + PANEL + MODOS
 * ============================== */

#accesibilidad-btn {
  position: fixed;
  bottom: 1.8rem;
  right: 5.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #3366CC;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  z-index: 1050;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#accesibilidad-btn.show {
  opacity: 1;
  transform: translateY(0);
}
#accesibilidad-btn:hover,
#accesibilidad-btn:focus {
  background-color: #254a99;
  outline: none;
}
#accesibilidad-btn svg {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px;
  min-height: 24px;
  display: block;
  pointer-events: none;
}
/* Mantener tamaño fijo en modo fuente grande */
body.modo-fuente #accesibilidad-btn,
body.modo-fuente #accesibilidad-btn svg,
#accesibilidad-btn,
#accesibilidad-btn svg {
  font-size: 1.5rem !important;
  width: 48px !important;
  height: 48px !important;
}

/* -------- PANEL -------- */
#accesibilidad-panel {
  position: fixed;
  bottom: 5.2rem;
  right: 5.6rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.13);
  padding: 0.75em 1.2em;
  min-width: 180px;
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 1060;
}
#accesibilidad-panel.active {
  display: flex;
}
.accesibilidad-opcion {
  background: #f4f4f4;
  border: none;
  color: #3366CC;
  border-radius: 7px;
  padding: 0.38em 0.65em;
  font-size: 0.98rem;
  cursor: pointer;
  margin-bottom: 7px;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.accesibilidad-opcion:focus {
  outline: 2px solid #208ea3;
}
.accesibilidad-opcion:last-child {
  margin-bottom: 0;
}

/* -------- MODOS DE ACCESIBILIDAD -------- */
body.modo-contraste,
body.modo-contraste .fondo-blanco,
body.modo-contraste .fondo-gris,
body.modo-contraste .footer-creditos,
body.modo-contraste .footer-contacto,
body.modo-contraste .footer-gov,
body.modo-contraste .navbar,
body.modo-contraste .container,
body.modo-contraste main,
body.modo-contraste section,
body.modo-contraste .creditos-columna,
body.modo-contraste .footer-wrapper {
  background: #111 !important;
  color: #fff !important;
}

body.modo-contraste a,
body.modo-contraste h1,
body.modo-contraste h2,
body.modo-contraste h3,
body.modo-contraste h4,
body.modo-contraste h5,
body.modo-contraste h6,
body.modo-contraste p,
body.modo-contraste ul,
body.modo-contraste ol,
body.modo-contraste li,
body.modo-contraste table,
body.modo-contraste th,
body.modo-contraste td,
body.modo-contraste .list-group-item,
body.modo-contraste .articulo-indice-contenido,
body.modo-contraste .creditos-columna li,
body.modo-contraste .footer-creditos li {
  color: #fff !important;
  background: transparent !important;
}

body.modo-contraste a {
  color: #90cafc !important;
  text-decoration: underline !important;
}

body.modo-fuente,
body.modo-fuente * {
  font-size: 120% !important;
  overflow-wrap: break-word;
  word-break: break-word;
  box-sizing: border-box;
  max-width: 100vw;
}

body.modo-fuente .contenedor,
body.modo-fuente .creditos-columna,
body.modo-fuente .footer-creditos,
body.modo-fuente .footer-contacto {
  width: 100%;
  max-width: 98vw;
  padding-left: 1vw;
  padding-right: 1vw;
  box-sizing: border-box;
}

body.modo-enlaces a {
  text-decoration: underline !important;
}
body.modo-dislexia,
body.modo-dislexia * {
  font-family: 'OpenDyslexic', Arial, sans-serif !important;
}

/* Fuente dislexia vía CDN */
@import url('https://fonts.cdnfonts.com/css/opendyslexic');

/* -------- RESPONSIVE -------- */
@media (max-width: 768px) {
  #accesibilidad-btn {
    bottom: 1rem;
    right: 4.9rem;
    width: 44px !important; height: 44px !important; font-size: 1.2rem !important;
  }
  #accesibilidad-btn svg {
    width: 22px !important; height: 22px !important;
  }
  #accesibilidad-panel {
    bottom: 4.4rem; right: 5rem;
    min-width: 160px;
    padding: 0.7em 1em;
  }
  body.modo-fuente #accesibilidad-btn,
  body.modo-fuente #accesibilidad-btn svg {
    width: 44px !important; height: 44px !important; font-size: 1.2rem !important;
  }
}
