/* Centro de accesibilidad (js/accesibilidad.js), con la marca de la Psic. Maity Rincon.
   Funciona igual en el inicio estatico, en las paginas React y en la entrada al panel: usa
   sus propias variables y los efectos van sobre el documento entero. Claro y oscuro: el sitio
   marca html.dark y el panel html[data-tema="oscuro"]. */

@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 400; font-display: swap; src: url(/fonts/atkinson-400.woff2) format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 700; font-display: swap; src: url(/fonts/atkinson-700.woff2) format('woff2'); }

:root {
  --pmr-a11y-fondo: #FFFFFF;
  --pmr-a11y-suave: #F7F0E9;
  --pmr-a11y-linea: rgba(95, 10, 60, .16);
  --pmr-a11y-tinta: #3B2A31;
  --pmr-a11y-titulo: #5F0A3C;
  --pmr-a11y-apagado: #6B5E5E;
  --pmr-a11y-acento: #C23B3B;
  --pmr-a11y-uva: #5F0A3C;
  --pmr-a11y-crema: #F2E7DD;
}
html.dark, html[data-tema="oscuro"] {
  --pmr-a11y-fondo: #241820;
  --pmr-a11y-suave: #1D1318;
  --pmr-a11y-linea: rgba(242, 231, 221, .16);
  --pmr-a11y-tinta: #EFE3D9;
  --pmr-a11y-titulo: #F2E7DD;
  --pmr-a11y-apagado: #C4B4AD;
  --pmr-a11y-acento: #EC6A6A;
}

/* ---------- Tamano del texto: todo lo que usa rem crece con esta variable ---------- */
html { font-size: calc(100% * var(--a11y-fs, 1)); }

/* ---------- Boton flotante (abajo a la izquierda; el WhatsApp y la flor van a la derecha) ---------- */
.pmr-a11y-fab {
  position: fixed; left: 16px; bottom: 20px; z-index: 56;
  display: grid; place-items: center; width: 50px; height: 50px; padding: 0;
  border-radius: 50%; border: 2px solid var(--pmr-a11y-crema);
  background: var(--pmr-a11y-uva); color: var(--pmr-a11y-crema); cursor: pointer;
  box-shadow: 0 10px 24px -10px rgba(62, 6, 39, .7);
  transition: transform .2s;
}
.pmr-a11y-fab:hover { transform: translateY(-2px); }
.pmr-a11y-fab[hidden] { display: none; }
.pmr-a11y-fab svg { width: 26px; height: 26px; }
.pmr-a11y-fab:focus-visible { outline: 3px solid var(--pmr-a11y-acento); outline-offset: 3px; }
@media (max-width: 859px) {
  /* El inicio lo sube por encima de su barra inferior tipo app (inicio.css) */
  .pmr-a11y-fab { left: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); width: 46px; height: 46px; }
}
/* Paginas React: por encima de su barra inferior del celular (NavbarMobile, 92 px de alto) */
@media (max-width: 767px) {
  body:has([data-barra-inferior]) .pmr-a11y-fab { bottom: calc(104px + env(safe-area-inset-bottom)); }
}

/* ---------- Panel lateral ---------- */
.pmr-a11y-panel { position: fixed; inset: 0; z-index: 130; display: flex; justify-content: flex-end; background: rgba(30, 8, 20, .45); opacity: 0; transition: opacity .2s; font-family: 'Lato', system-ui, sans-serif; }
.pmr-a11y-panel[hidden] { display: none; }
.pmr-a11y-panel.ver { opacity: 1; }
.pmr-a11y-card { width: min(380px, 100%); height: 100%; overflow-y: auto; overscroll-behavior: contain; background: var(--pmr-a11y-fondo); color: var(--pmr-a11y-tinta); border-left: 1px solid var(--pmr-a11y-linea); box-shadow: -30px 0 60px -30px rgba(0, 0, 0, .5); transform: translateX(24px); transition: transform .25s; padding-bottom: env(safe-area-inset-bottom); }
.pmr-a11y-panel.ver .pmr-a11y-card { transform: none; }
.pmr-a11y-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: calc(16px + env(safe-area-inset-top)) 18px 14px; background: var(--pmr-a11y-fondo); border-bottom: 1px solid var(--pmr-a11y-linea); }
.pmr-a11y-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.3rem; font-weight: 700; color: var(--pmr-a11y-titulo); }
.pmr-a11y-head h2 svg { width: 26px; height: 26px; color: var(--pmr-a11y-acento); }
.pmr-a11y-x { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--pmr-a11y-linea); background: var(--pmr-a11y-suave); color: var(--pmr-a11y-tinta); cursor: pointer; }
.pmr-a11y-x svg { width: 18px; height: 18px; }
.pmr-a11y-body { display: grid; gap: 8px; padding: 14px 18px 24px; }
.pmr-a11y-row, .pmr-a11y-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 12px; border-radius: 14px; background: var(--pmr-a11y-suave); border: 1px solid var(--pmr-a11y-linea); font-size: .98rem; font-weight: 700; color: var(--pmr-a11y-tinta); cursor: pointer; }
.pmr-a11y-steps { display: flex; align-items: center; gap: 6px; }
.pmr-a11y-steps button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--pmr-a11y-linea); background: var(--pmr-a11y-fondo); color: var(--pmr-a11y-titulo); cursor: pointer; }
.pmr-a11y-steps svg { width: 18px; height: 18px; }
.pmr-a11y-steps output { min-width: 52px; text-align: center; font-weight: 900; color: var(--pmr-a11y-titulo); }
.pmr-a11y-switch { position: relative; }
.pmr-a11y-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pmr-a11y-switch i { position: relative; flex: none; width: 46px; height: 26px; border-radius: 999px; background: rgba(112, 99, 99, .45); transition: background .2s; }
.pmr-a11y-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .2s; }
.pmr-a11y-switch input:checked + i { background: var(--pmr-a11y-acento); }
.pmr-a11y-switch input:checked + i::after { transform: translateX(20px); }
.pmr-a11y-switch input:focus-visible + i { outline: 3px solid var(--pmr-a11y-acento); outline-offset: 3px; }
.pmr-a11y-colores { flex-direction: column; align-items: stretch; gap: 10px; padding-top: 12px; padding-bottom: 12px; cursor: default; }
.pmr-a11y-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.pmr-a11y-chip { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 6px 10px; border-radius: 12px; border: 1.5px solid var(--pmr-a11y-linea); background: var(--pmr-a11y-fondo); color: var(--pmr-a11y-tinta); font: inherit; font-size: .84rem; font-weight: 700; text-align: left; cursor: pointer; }
.pmr-a11y-chip[aria-checked="true"] { border-color: var(--pmr-a11y-acento); box-shadow: 0 0 0 3px rgba(194, 59, 59, .18); }
.pmr-a11y-chip span { line-height: 1.2; }
.pmr-a11y-muestra { position: relative; flex: none; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7), 0 1px 3px rgba(0, 0, 0, .2); }
.pmr-a11y-chip[aria-checked="true"] .pmr-a11y-muestra::after { content: ""; position: absolute; left: 7px; top: 4px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.m-ninguno { background: linear-gradient(135deg, #C23B3B, #5F0A3C); }
.m-protan { background: linear-gradient(135deg, #0072B2, #E69F00); }
.m-deutan { background: linear-gradient(135deg, #56B4E9, #D55E00); }
.m-tritan { background: linear-gradient(135deg, #CC3311, #007A70); }
.m-gris { background: linear-gradient(135deg, #D4D4D8, #3F3F46); }
.pmr-a11y-read { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 4px; }
.pmr-a11y-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--pmr-a11y-acento); color: #fff; font: 700 .95rem 'Lato', system-ui, sans-serif; cursor: pointer; }
html.dark .pmr-a11y-btn, html[data-tema="oscuro"] .pmr-a11y-btn { color: #1A1016; }
.pmr-a11y-btn-suave { width: 48px; padding: 0; background: var(--pmr-a11y-suave); color: var(--pmr-a11y-tinta) !important; border: 1px solid var(--pmr-a11y-linea); }
.pmr-a11y-btn[hidden] { display: none; }
.pmr-a11y-btn svg { width: 18px; height: 18px; }
.pmr-a11y-reset { min-height: 44px; border-radius: 14px; border: 1px dashed var(--pmr-a11y-linea); background: transparent; color: var(--pmr-a11y-tinta); font: 700 .92rem 'Lato', system-ui, sans-serif; cursor: pointer; }
.pmr-a11y-nota { margin: 6px 0 0; font-size: .82rem; color: var(--pmr-a11y-apagado); }
.pmr-a11y-panel button:focus-visible { outline: 3px solid var(--pmr-a11y-acento); outline-offset: 2px; }

/* ---------- Efectos en la pagina ---------- */

/* Espaciado del texto (WCAG 1.4.12) */
html[data-a11y-espaciado] body :is(p, li, span, a, label, summary, td, th, h1, h2, h3, blockquote) { line-height: 1.9 !important; letter-spacing: .06em !important; word-spacing: .12em !important; }

/* Fuente de lectura facil */
html[data-a11y-fuente] body, html[data-a11y-fuente] body :is(input, select, textarea, button, .btn, h1, h2, h3) { font-family: 'Atkinson Hyperlegible', 'Lato', system-ui, sans-serif !important; }

/* Enlaces y botones resaltados (el boton flotante y el panel quedan fuera) */
html[data-a11y-enlaces] a { text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px !important; }
html[data-a11y-enlaces] :is(a, button):not(.pmr-a11y-fab):not(.pmr-a11y-panel *) { outline: 2px dashed #B35C00 !important; outline-offset: 2px; }

/* Cursor grande */
html[data-a11y-cursor], html[data-a11y-cursor] * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 11-6.5 1 3.5 7-2.8 1.3-3.4-7L4 20z' fill='%23000' stroke='%23fff' stroke-width='1.3'/%3E%3C/svg%3E") 4 2, auto !important; }

/* Pausar animaciones (y mostrar de una vez lo que aparecia al bajar) */
html[data-a11y-animaciones] *, html[data-a11y-animaciones] *::before, html[data-a11y-animaciones] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html[data-a11y-animaciones].js .aparecer { opacity: 1 !important; transform: none !important; }

/* Guia de foco del teclado */
html[data-a11y-foco] :focus { outline: 4px solid #B35C00 !important; outline-offset: 4px !important; box-shadow: 0 0 0 8px rgba(0, 0, 0, .55) !important; }

/* Alto contraste y vision de color: filtros sobre el documento entero. En el elemento raiz
   el filtro no rompe las cabeceras ni las barras fijas. */
html[data-a11y-contraste] { filter: contrast(1.35); }
html[data-a11y-color="gris"] { filter: grayscale(1); }
html[data-a11y-color="protan"] { filter: url(#pmr-protan); }
html[data-a11y-color="deutan"] { filter: url(#pmr-deutan); }
html[data-a11y-color="tritan"] { filter: url(#pmr-tritan); }
html[data-a11y-contraste][data-a11y-color="gris"] { filter: contrast(1.35) grayscale(1); }
html[data-a11y-contraste][data-a11y-color="protan"] { filter: contrast(1.35) url(#pmr-protan); }
html[data-a11y-contraste][data-a11y-color="deutan"] { filter: contrast(1.35) url(#pmr-deutan); }
html[data-a11y-contraste][data-a11y-color="tritan"] { filter: contrast(1.35) url(#pmr-tritan); }
/* Con alto contraste los textos secundarios del inicio van casi negros (o casi blancos en oscuro) */
html[data-a11y-contraste] { --suave: #1F1418; --tinta: #140A0F; --verde-texto: #2F4A40; --linea: rgba(20, 10, 15, .45); }
html.dark[data-a11y-contraste] { --suave: #FFFFFF; --tinta: #FFFFFF; --verde-texto: #DDEBE4; --linea: rgba(255, 255, 255, .5); }
