/* Compacto en el celular (oct-2026): dos patrones para acortar páginas largas
   SIN sacar contenido. Todo el texto sigue en el HTML (lo lee Google y lo lee
   un lector de pantalla); en el celular solo cambia cómo se recorre.

   1. [data-riel-movil]: bajo 640 px, sus hijos pasan a un riel horizontal con
      encaje (scroll-snap) y puntos que dicen en cuál vas. En pantallas más
      anchas el contenedor es `display: contents`, así que sus hijos siguen
      siendo celdas de la grilla del padre como si el contenedor no existiera.

   2. details[data-plegable-movil]: bajo 640 px es un plegable (el título a la
      vista, el texto al tocar). En pantallas más anchas siempre está abierto
      y el summary no se ve como botón. La apertura la decide un script en
      línea justo después del bloque, antes de pintar, para no mover la página. */

/* ── 1. Riel ──────────────────────────────────────────────────────────── */
[data-riel-movil] { display: contents; }
.riel-movil__puntos { display: none; }

@media (max-width: 639px) {
  [data-riel-movil] {
    display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: 2px;
    margin-inline: -4px; padding: 4px 4px 10px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    grid-column: 1 / -1;
  }
  [data-riel-movil]::-webkit-scrollbar { display: none; }
  [data-riel-movil] > * { flex: 0 0 84%; scroll-snap-align: start; min-width: 0; }
  [data-riel-movil]:focus-visible { outline: 2px solid var(--navy, #132075); outline-offset: 4px; }

  .riel-movil__puntos {
    display: flex; justify-content: center; align-items: center; gap: 7px;
    margin-top: 4px; grid-column: 1 / -1;
  }
  .riel-movil__puntos button {
    width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%;
    background: rgba(19, 32, 117, 0.22); cursor: pointer;
    transition: width 0.25s ease, background 0.25s ease, border-radius 0.25s ease;
  }
  /* El punto activo se estira: dice «estás acá» sin depender solo del color. */
  .riel-movil__puntos button[aria-current="true"] { width: 22px; border-radius: 4px; background: var(--magenta, #9d0067); }
  .riel-movil__pista { font-size: 12.5px; color: var(--texto-suave, #5b6478); margin-left: 6px; font-variant-numeric: tabular-nums; }
}

/* ── 2. Plegable ──────────────────────────────────────────────────────── */
details[data-plegable-movil] > summary { list-style: none; }
details[data-plegable-movil] > summary::-webkit-details-marker { display: none; }

@media (min-width: 640px) {
  /* En escritorio no es un control: no se ve ni se comporta como botón. */
  details[data-plegable-movil] > summary { cursor: default; pointer-events: none; }
  details[data-plegable-movil] .plegable__flecha { display: none; }
}

@media (max-width: 639px) {
  details[data-plegable-movil] > summary { cursor: pointer; -webkit-tap-highlight-color: transparent; }
  details[data-plegable-movil] > summary:focus-visible { outline: 2px solid var(--navy, #132075); outline-offset: 3px; }
  .plegable__flecha {
    flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    color: var(--navy, #132075); background: rgba(19, 32, 117, 0.07); transition: transform 0.25s ease;
  }
  .plegable__flecha svg { width: 16px; height: 16px; }
  details[data-plegable-movil][open] .plegable__flecha { transform: rotate(180deg); }
  details[data-plegable-movil][open] > :not(summary) { animation: plegableAbre 0.3s ease both; }
  @keyframes plegableAbre { from { opacity: 0; transform: translateY(-4px); } }
}

@media (prefers-reduced-motion: reduce) {
  .riel-movil__puntos button, .plegable__flecha { transition: none; }
  details[data-plegable-movil][open] > :not(summary) { animation: none; }
}
