/* =========================================================================
   Panel de accesibilidad — redacta.me  (autocontenido, sin dependencias)
   -------------------------------------------------------------------------
   Inyecta un botón flotante (FAB) abajo a la derecha y un panel con ajustes
   de lectura. Todas las preferencias se aplican como clases en <html> y se
   recuerdan en localStorage ("rm-a11y"). No requiere WordPress ni plugins.
   Paleta alineada con redacta.me (teal #01aaa7).
   ========================================================================= */
:root{ --rm-a11y-scale: 1; }

/* El tamaño base del documento escala con la preferencia del usuario.
   Se usa "zoom" (no font-size/rem) porque el volcado define sus tamaños de
   letra en píxeles fijos, no en unidades relativas: cambiar el font-size de
   <html> no tiene ningún efecto sobre texto en px. "zoom" sí reescala todo
   el renderizado (texto en px incluido), igual que el zoom nativo del
   navegador. Para que nuestro propio FAB/panel no crezcan también, se les
   aplica el zoom inverso (ver más abajo). */
html{ zoom: var(--rm-a11y-scale); }
.rm-a11y-fab, .rm-a11y-panel, .rm-lang{ zoom: calc(1 / var(--rm-a11y-scale)); }

/* ---- Botón flotante (FAB) ---- */
.rm-a11y-fab{
  position: fixed; right: 20px; bottom: 20px; z-index: 2147483000;
  width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
  background: #01aaa7; color: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  transition: background .2s ease, transform .2s ease;
}
.rm-a11y-fab:hover{ background: #018a88; transform: translateY(-2px); }
.rm-a11y-fab:focus-visible{ outline: 3px solid #13263a; outline-offset: 2px; }
.rm-a11y-fab svg{ width: 30px; height: 30px; }

/* ---- Panel ---- */
.rm-a11y-panel{
  position: fixed; right: 20px; bottom: 84px; z-index: 2147483001;
  width: min(380px, calc(100vw - 40px));
  background: #fff; color: #333;
  border: 1px solid #e3e3e3; border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,.28);
  padding: 18px 18px 20px;
  font-family: 'Montserrat','Comfortaa',Arial,system-ui,sans-serif;
  font-size: 16px; line-height: 1.4;
}
.rm-a11y-panel[hidden]{ display: none; }
.rm-a11y-panel__head{ display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.rm-a11y-panel__title{ font-weight: 700; color: #13263a; font-size: 20px; margin: 0; }
.rm-a11y-close{ border: 0; background: none; cursor: pointer; color: #13263a; font-size: 28px; line-height: 1; padding: 2px 6px; }
.rm-a11y-close:hover{ color: #01aaa7; }
.rm-a11y-group{ margin-bottom: 14px; }
.rm-a11y-group__label{ display: block; font-weight: 600; color: #13263a; font-size: 16px; margin-bottom: 8px; }
.rm-a11y-row{ display: flex; gap: 8px; flex-wrap: wrap; }
.rm-a11y-btn{
  flex: 1 1 auto; min-width: 84px;
  font-family: inherit; font-weight: 600; font-size: 16px;
  padding: 10px 11px; border: 1px solid #d7d7d7; border-radius: 10px;
  background: #fff; color: #13263a; cursor: pointer; line-height: 1.2;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.rm-a11y-btn:hover{ border-color: #01aaa7; }
.rm-a11y-btn:focus-visible{ outline: 3px solid #01aaa7; outline-offset: 1px; }
.rm-a11y-btn[aria-pressed="true"]{ background: #01aaa7; color: #fff; border-color: #01aaa7; }
.rm-a11y-stepper{ display: flex; align-items: center; gap: 8px; }
.rm-a11y-stepper output{ font-size: 16px; font-weight: 700; color: #13263a; min-width: 3.5ch; text-align: center; }
.rm-a11y-reset{
  width: 100%; margin-top: 4px; font-family: inherit; font-weight: 600; font-size: 16px;
  padding: 11px; border-radius: 10px; border: 1px solid #01aaa7;
  background: #fff; color: #01aaa7; cursor: pointer;
}
.rm-a11y-reset:hover{ background: #01aaa7; color: #fff; }
.rm-a11y-note{ font-size: 13px; color: #666; margin: 10px 0 0; line-height: 1.4; }

/* =========================================================================
   Preferencias activables (clases en <html>)
   ========================================================================= */
/* Resaltar enlaces */
html.rm-a11y-underline a{ text-decoration: underline !important; text-underline-offset: 2px; }

/* Legibilidad reforzada */
html.rm-a11y-readable body{ line-height: 1.9 !important; letter-spacing: .02em !important; word-spacing: .08em !important; }

/* Reducir animaciones */
html.rm-a11y-no-anim *,
html.rm-a11y-no-anim *::before,
html.rm-a11y-no-anim *::after{
  animation: none !important; transition: none !important; scroll-behavior: auto !important;
}

/* Alto contraste (no afecta a los controles del propio panel) */
html.rm-a11y-contrast body{ background: #fff !important; color: #000 !important; }
html.rm-a11y-contrast p,
html.rm-a11y-contrast li,
html.rm-a11y-contrast h1,
html.rm-a11y-contrast h2,
html.rm-a11y-contrast h3,
html.rm-a11y-contrast h4,
html.rm-a11y-contrast span,
html.rm-a11y-contrast td,
html.rm-a11y-contrast th{ color: #000 !important; }
html.rm-a11y-contrast a:not(.rm-a11y-btn):not(.rm-a11y-reset):not(.rm-a11y-close){ color: #0a3d62 !important; text-decoration: underline !important; }
/* Los controles del panel conservan su estilo para seguir siendo usables */
html.rm-a11y-contrast .rm-a11y-panel,
html.rm-a11y-contrast .rm-a11y-panel *{ color: inherit; }
html.rm-a11y-contrast .rm-a11y-panel{ border: 2px solid #000; }
