/* Accesibilidad — Municipalidad de Las Varillas */

:root {
  --a11y-scale: 1;
}

html {
  font-size: calc(100% * var(--a11y-scale));
}

html.a11y-font-lg { --a11y-scale: 1.125; }
html.a11y-font-xl { --a11y-scale: 1.25; }

/* Fallback flotante (si no hay columna de redes) */
.a11y-widget:not(.a11y-widget--docked) {
  position: fixed;
  left: max(16px, env(safe-area-inset-left, 16px));
  right: auto;
  bottom: max(20px, env(safe-area-inset-bottom, 20px));
  z-index: 3500;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.35;
}

.a11y-widget:not(.a11y-widget--docked) .a11y-widget__toggle {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #0b2a5c;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.a11y-widget__panel {
  position: fixed;
  left: 16px;
  top: 96px;
  right: auto;
  bottom: auto;
  width: min(300px, calc(100vw - 32px));
  max-height: min(72vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  color: #10233f;
  border: 1px solid rgba(11, 42, 92, 0.12);
  box-shadow: 0 16px 40px rgba(11, 42, 92, 0.22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 5000;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.35;
  -webkit-overflow-scrolling: touch;
}

.a11y-widget.is-open .a11y-widget__panel,
.a11y-widget__panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.a11y-widget__title {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #0b2a5c;
}

.a11y-widget__group {
  margin: 0 0 12px;
}

.a11y-widget__label {
  display: block;
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5a6b82;
}

.a11y-widget__row {
  display: flex;
  gap: 8px;
}

.a11y-widget__btn {
  flex: 1;
  min-height: 42px;
  border: 1px solid rgba(11, 42, 92, 0.16);
  border-radius: 10px;
  background: #f4f7fb;
  color: #0b2a5c;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.a11y-widget__btn:hover {
  background: #e8eef8;
  border-color: rgba(11, 42, 92, 0.28);
}

.a11y-widget__btn:focus-visible {
  outline: 3px solid #6bccf9;
  outline-offset: 2px;
}

.a11y-widget__btn.is-active {
  background: #0b2a5c;
  border-color: #0b2a5c;
  color: #fff;
}

.a11y-widget__btn--wide {
  width: 100%;
  text-align: left;
  padding: 0 12px;
  font-size: 0.86rem;
}

.a11y-widget__hint {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: #6a7a90;
}

.a11y-widget__reset {
  width: 100%;
  margin-top: 2px;
  padding: 8px 0 2px;
  border: 0;
  background: transparent;
  color: #1f6fe0;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.a11y-widget__reset:focus-visible {
  outline: 3px solid #6bccf9;
  outline-offset: 2px;
}

/* ===== Espaciado de lectura ===== */
html.a11y-spacing body,
html.a11y-spacing p,
html.a11y-spacing li,
html.a11y-spacing a,
html.a11y-spacing span,
html.a11y-spacing label,
html.a11y-spacing td,
html.a11y-spacing th {
  line-height: 1.8 !important;
  letter-spacing: 0.03em !important;
  word-spacing: 0.08em !important;
}

html.a11y-spacing p,
html.a11y-spacing li,
html.a11y-spacing .muni-section-head__sub,
html.a11y-spacing .lv-map-popup__desc {
  margin-bottom: 0.85em !important;
}

/* ===== Resaltar enlaces ===== */
html.a11y-links a:not(.a11y-widget__reset):not(.social-floating-item) {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important;
  background-color: rgba(255, 236, 61, 0.45) !important;
  color: #0b2a5c !important;
  -webkit-text-fill-color: #0b2a5c !important;
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

html.a11y-links a:not(.a11y-widget__reset):hover {
  background-color: rgba(255, 220, 0, 0.7) !important;
}

/* ===== Pausar animaciones ===== */
html.a11y-reduce-motion *,
html.a11y-reduce-motion *::before,
html.a11y-reduce-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

html.a11y-reduce-motion .eva-mini-eva,
html.a11y-reduce-motion .eva-toggle-avatar {
  animation: none !important;
  transform: none !important;
}

/* ===== Escala de grises ===== */
html.a11y-grayscale body > *:not(.social-floating):not(.a11y-widget) {
  filter: grayscale(1);
}

html.a11y-grayscale .a11y-widget__panel {
  filter: none !important;
}

/* ===== Cursor grande ===== */
html.a11y-big-cursor,
html.a11y-big-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath fill='%230b2a5c' stroke='%23fff' stroke-width='2' d='M10 6v30l8.5-8.5 5.2 12.4 5.2-2.2-5.2-12.4L36 25.2z'/%3E%3C/svg%3E") 6 4, auto !important;
}

html.a11y-big-cursor a,
html.a11y-big-cursor button,
html.a11y-big-cursor [role="button"],
html.a11y-big-cursor input,
html.a11y-big-cursor select,
html.a11y-big-cursor textarea,
html.a11y-big-cursor label {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath fill='%231f6fe0' stroke='%23fff' stroke-width='2' d='M10 6v30l8.5-8.5 5.2 12.4 5.2-2.2-5.2-12.4L36 25.2z'/%3E%3C/svg%3E") 6 4, pointer !important;
}

/* ===== Modo daltonismo (aproximación) ===== */
html.a11y-colorblind body > *:not(.social-floating):not(.a11y-widget) {
  filter: contrast(1.08) saturate(1.35) hue-rotate(18deg);
}

html.a11y-colorblind.a11y-grayscale body > *:not(.social-floating):not(.a11y-widget) {
  filter: grayscale(1) contrast(1.1);
}

html.a11y-colorblind .a11y-widget__panel {
  filter: none !important;
}

/* ===== Alto contraste ===== */
html.a11y-contrast,
html.a11y-contrast body {
  background: #000 !important;
  color: #fff !important;
}

html.a11y-contrast a {
  color: #fff700 !important;
}

html.a11y-contrast header,
html.a11y-contrast footer,
html.a11y-contrast .page-band,
html.a11y-contrast section,
html.a11y-contrast .boton,
html.a11y-contrast .muni-banner-card,
html.a11y-contrast .dir-list,
html.a11y-contrast .cal-week,
html.a11y-contrast .nav-container,
html.a11y-contrast .dropdown-menu,
html.a11y-contrast .a11y-widget__panel {
  background: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html.a11y-contrast body > header,
html.a11y-contrast header.layout-shared-header {
  background: #000 !important;
  border: 2px solid #fff !important;
}

html.a11y-contrast .a11y-widget__toggle,
html.a11y-contrast .social-a11y {
  background: #fff !important;
  color: #000 !important;
  box-shadow: none !important;
  border: 2px solid #fff;
}

html.a11y-contrast .a11y-widget__title,
html.a11y-contrast .a11y-widget__label,
html.a11y-contrast .a11y-widget__hint,
html.a11y-contrast .a11y-widget__reset,
html.a11y-contrast h1,
html.a11y-contrast h2,
html.a11y-contrast h3,
html.a11y-contrast h4,
html.a11y-contrast p,
html.a11y-contrast li,
html.a11y-contrast span,
html.a11y-contrast label {
  color: #fff !important;
  background-image: none !important;
  -webkit-text-fill-color: #fff !important;
}

html.a11y-contrast .a11y-widget__btn {
  background: #111 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
}

html.a11y-contrast .a11y-widget__btn.is-active {
  background: #fff700 !important;
  color: #000 !important;
  border-color: #fff700 !important;
}

html.a11y-contrast img:not(.a11y-keep-color),
html.a11y-contrast video {
  filter: grayscale(1) contrast(1.2);
}

html.a11y-contrast.a11y-links a:not(.a11y-widget__reset):not(.social-floating-item) {
  background-color: #fff700 !important;
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
}

html.a11y-contrast *:focus-visible {
  outline: 3px solid #fff700 !important;
  outline-offset: 3px !important;
}

@media (prefers-reduced-motion: reduce) {
  .a11y-widget__toggle,
  .a11y-widget__panel,
  .a11y-widget__btn {
    transition: none !important;
  }
}
