/* ============================================================
   Accesibilidad · WCAG 2.2 AA (EN 301 549)
   Se carga después de styles.css y docs.css. Informe y motivos:
   marketing/turito/accesibilidad.md
   ============================================================ */

/* 1.4.3 · Contraste del texto. El azul de marca #0877f9 da 4,19:1 sobre
   blanco; #005de9 da 5,61:1 y sigue siendo el mismo azul de Turito. */
:root {
  --blue: #005de9;
  --muted: #5b6880;
  --violet: #6244e0;
}

/* Pastilla «Cómo funciona» sobre el fondo oscuro del recorrido (antes 1,88:1) */
.story .story-eyebrow {
  background: rgba(255, 255, 255, .08);
  color: #b9d7ff;
}

/* 1.3.1 · Recorrido por capítulos: el título de cada paso estaba oculto
   (display: none) y la palabra gigante es decorativa y queda tapada por el
   móvil. Se muestra el título junto al número, para quien mira y para el
   lector de pantalla. */
.story.is-live .story-chapter h3 {
  display: block;
  margin: 2px 0 0;
  color: #fff;
  font-size: clamp(26px, 3vw, 34px);
}

/* Las letras gigantes ya no se cortan por abajo: la máscara deja margen
   vertical para los trazos que se salen de la línea. */
.story-word {
  line-height: .9;
  clip-path: inset(-.1em -6% -.12em -6%);
}

/* Las palabras que esperan o ya han pasado se alejan más, para que no
   asomen por el margen nuevo de la máscara. */
.story-letter {
  transform: translateY(135%);
}

.story-word.is-active .story-letter {
  transform: translateY(0);
}

.story-word.is-past .story-letter {
  transform: translateY(-135%);
}

/* 2.1.1 · El recorrido se puede seguir con teclado: los segmentos de
   progreso son botones (la raya visible sigue igual, la zona pulsable es
   de 32 px de alto). */
.story-progress button {
  display: flex;
  align-items: center;
  width: 42px;
  min-height: 32px;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
}

.story-progress button i {
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background:
    linear-gradient(#fff, #fff) left / calc(var(--fill, 0) * 100%) 100% no-repeat,
    rgba(255, 255, 255, .18);
  transform: none;
}

.story-progress button:hover i {
  background-color: rgba(255, 255, 255, .4);
}

.story-progress button:focus-visible {
  outline-offset: 2px;
  border-radius: 4px;
}

@media (max-width: 640px) {
  .story-progress button {
    width: 28px;
  }
}

.demo-steps li:nth-child(2) > span { color: #007a57; }
.demo-steps li:nth-child(4) > span { color: #9a5400; }
.footer-bottom,
.social-links a { color: #5b6880; }

/* Guía (docs.css) */
.tag-green { color: #007a57; }
.tag-blue { color: #005de9; }
.tag-violet { color: #6244e0; }
.tips-grid p { color: #5b6880; }
.docs-footer p,
.docs-footer > span { color: #5b6880; }

/* 2.4.7 y 1.4.11 · Foco visible: anillo opaco con halo para que se vea
   en cualquier fondo (el anterior, azul al 32 %, daba 1,5:1). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #005de9;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px #fff;
}

.story a:focus-visible,
.story button:focus-visible,
.cta-panel a:focus-visible,
.button.primary:focus-visible {
  outline-color: #fff;
  box-shadow: 0 0 0 6px #071432;
}

/* 2.4.1 · Saltar al contenido */
.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 12px 18px;
  border-radius: 10px;
  background: #101b3b;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
}

/* 2.4.11 · La cabecera fija (70 px) no tapa lo que recibe el foco */
html {
  scroll-padding-top: 96px;
}

/* 2.5.8 · Objetivos de al menos 24 px (aquí 32 px) en el pie */
.footer-column a,
.footer-column button,
.docs-footer nav a,
.footer-contact-link,
.newsletter-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

.footer-column {
  gap: 0;
}

/* 1.4.12 · Con el espaciado de texto ampliado el botón crece en vez de cortar */
.cta-panel .button.light {
  max-width: 100%;
  min-height: 52px;
  height: auto;
  padding-block: 12px;
  flex-wrap: wrap;
  text-align: center;
}

/* Botón «Reducir animaciones» */
.motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border: 1px solid #c9d6e8;
  border-radius: 999px;
  padding: 4px 14px;
  background: #fff;
  color: #10172d;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.motion-toggle::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.motion-toggle[aria-pressed="true"]::before {
  background: currentColor;
  box-shadow: inset 0 0 0 2px #fff;
}

.footer-bottom {
  flex-wrap: wrap;
  gap: 10px 20px;
}

.footer-bottom nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 18px;
}

.footer-bottom a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: #5b6880;
}

/* 2.2.2 · Con «Reducir animaciones» activado, lo mismo que hace
   prefers-reduced-motion en styles.css y docs.css */
html.reduce-motion {
  scroll-behavior: auto !important;
}

html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
  scroll-behavior: auto !important;
  transition-duration: .01ms !important;
  animation: none !important;
}

html.reduce-motion.js [data-reveal] {
  opacity: 1;
  transform: none;
}

html.reduce-motion .rv-unit {
  opacity: 1 !important;
  transform: none !important;
}

html.reduce-motion .phone-front { transform: rotate(-2deg); }
html.reduce-motion .phone-back { transform: rotate(2deg); }
html.reduce-motion .tutorial-item:hover,
html.reduce-motion .guide-card:hover { transform: none; }

/* El destino del enlace de salto no es un control: sin anillo al recibir el foco */
main[tabindex="-1"]:focus {
  outline: none;
  box-shadow: none;
}
