/* Kit de accesibilidad — Radio Ilumán 106.7 FM
   Referencia: NTE INEN-ISO/IEC 40500 (WCAG 2.0 AA) */

/* ---------- Siempre activo ---------- */

/* Foco visible con teclado en todo el sitio */
:focus-visible {
  outline: 3px solid #A04F00 !important;
  outline-offset: 2px !important;
  /* halo blanco: el foco también se ve sobre los fondos oscuros del sitio */
  box-shadow: 0 0 0 5px #fff !important;
}

/* Enlace "Saltar al contenido": oculto hasta recibir foco */
.a11y-skip {
  position: absolute; left: 8px; top: -60px; z-index: 2147483647;
  background: #1a1a1a; color: #fff !important; padding: 12px 18px;
  font: 600 16px/1.2 system-ui, Arial, sans-serif; border-radius: 6px; text-decoration: none;
}
.a11y-skip:focus { top: 8px; }

/* Respeta la preferencia del sistema de reducir movimiento */
@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;
  }
}

/* ---------- Opciones del usuario ---------- */

/* Tamaño del texto (amplía todo el contenido, no el panel) */
html.a11y-zoom body > *:not(#a11y-root):not(.a11y-skip) { zoom: var(--a11y-zoom, 1); }

/* Alto contraste */
html.a11y-contrast body,
html.a11y-contrast body *:not(#a11y-root):not(#a11y-root *) {
  background-color: #000 !important; background-image: none !important;
  color: #fff !important; border-color: #fff !important;
  text-shadow: none !important; box-shadow: none !important;
}
html.a11y-contrast body a:not(#a11y-root *),
html.a11y-contrast body a:not(#a11y-root *) * { color: #ff0 !important; }
html.a11y-contrast body button:not(#a11y-root *),
html.a11y-contrast body [role="button"]:not(#a11y-root *) { outline: 2px solid #ff0 !important; }
html.a11y-contrast img:not(#a11y-root *) { filter: none !important; opacity: 1 !important; }

/* Escala de grises */
html.a11y-gray body > *:not(#a11y-root):not(.a11y-skip) { filter: grayscale(1); }

/* Resaltar enlaces */
html.a11y-links body a:not(#a11y-root *) {
  text-decoration: underline !important; text-underline-offset: 3px !important;
  text-decoration-thickness: 2px !important;
  outline: 1px dashed currentColor !important; outline-offset: 2px !important;
}

/* Letra legible */
html.a11y-font body *:not(#a11y-root *):not(svg):not(svg *):not(i):not([class*="icon"]):not([class*="fa-"]) {
  font-family: Verdana, Tahoma, "Segoe UI", Arial, sans-serif !important;
  font-style: normal !important;
}

/* Más espaciado (WCAG 1.4.12) */
html.a11y-spacing body *:not(#a11y-root *) {
  line-height: 1.6 !important; letter-spacing: 0.08em !important; word-spacing: 0.16em !important;
}
html.a11y-spacing body p:not(#a11y-root *) { margin-bottom: 1.2em !important; }

/* Detener animaciones (cintillo de programación, contadores, carruseles) */
html.a11y-pause *, html.a11y-pause *::before, html.a11y-pause *::after {
  animation-play-state: paused !important; transition: none !important; scroll-behavior: auto !important;
}

/* Resaltar foco */
html.a11y-focus body *:focus:not(#a11y-root *) {
  outline: 4px solid #ff0 !important; outline-offset: 3px !important;
  box-shadow: 0 0 0 7px #000 !important;
}

/* Cursor grande */
html.a11y-cursor, html.a11y-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l16 10-7 1.5L16 21l-3 1.5-3.2-7.5L4 19z' fill='%23000' stroke='%23fff' stroke-width='1.2'/%3E%3C/svg%3E") 4 2, auto !important;
}

/* ---------- Panel de accesibilidad ---------- */
#a11y-root, #a11y-root * { box-sizing: border-box; font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif; letter-spacing: normal; line-height: 1.3; }

#a11y-toggle {
  /* bottom: 86px deja libre la barra fija del reproductor (70px) */
  position: fixed; left: 16px; bottom: 86px; z-index: 2147483646;
  width: 56px; height: 56px; border-radius: 50%; border: 3px solid #fff;
  background: #A04F00; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
#a11y-toggle:hover { background: #7a3c00; }
#a11y-toggle:focus-visible { outline: 3px solid #000 !important; outline-offset: 3px !important; }

#a11y-panel {
  position: fixed; left: 16px; bottom: 154px; z-index: 2147483647;
  width: min(340px, calc(100vw - 32px)); max-height: calc(100vh - 170px); overflow-y: auto;
  background: #fff; color: #1a1a1a; border: 2px solid #1a1a1a; border-radius: 12px;
  padding: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); font-size: 15px;
}
#a11y-panel[hidden] { display: none; }

#a11y-root .a11y-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
#a11y-root h2 { margin: 0; font-size: 18px; font-weight: 700; color: #1a1a1a; }
#a11y-root .a11y-close {
  width: 36px; height: 36px; border: 1px solid #595959; border-radius: 8px;
  background: #fff; color: #1a1a1a; font-size: 18px; cursor: pointer;
}

#a11y-root .a11y-zoombox {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #f2f2f2; border-radius: 8px; padding: 6px; margin-bottom: 10px;
}
#a11y-root .a11y-zbtn {
  min-width: 64px; height: 40px; border: 1px solid #1a1a1a; border-radius: 8px;
  background: #fff; color: #1a1a1a; font-size: 17px; font-weight: 700; cursor: pointer;
}
#a11y-zoom-level { font-weight: 700; font-size: 16px; color: #1a1a1a; }

#a11y-root .a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#a11y-root .a11y-opt {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 72px; padding: 8px 6px; border: 1px solid #595959; border-radius: 8px;
  background: #fff; color: #1a1a1a; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: center;
}
#a11y-root .a11y-opt:hover { border-color: #A04F00; }
#a11y-root .a11y-opt[aria-pressed="true"] { background: #A04F00; border-color: #A04F00; color: #fff; }
#a11y-root .a11y-ico { font-size: 20px; line-height: 1; }
#a11y-root #a11y-tts { grid-column: 1 / -1; flex-direction: row; gap: 10px; min-height: 52px; }

#a11y-root .a11y-reset {
  width: 100%; margin-top: 10px; height: 42px; border: 0; border-radius: 8px;
  background: #1a1a1a; color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
}
#a11y-root .a11y-foot { margin: 10px 0 0; font-size: 13px; color: #404040; }
#a11y-root .a11y-foot a { color: #7a3c00; font-weight: 700; text-decoration: underline; }
#a11y-root button:focus-visible, #a11y-root a:focus-visible { outline: 3px solid #000 !important; outline-offset: 2px !important; }

@media print { #a11y-root, .a11y-skip { display: none !important; } }
