/* Oli · legal.css — envoltorio de privacy.html y terms.html (el texto legal no se toca) */

/* Barra de progreso: un hilo de 2 px al pie de la cabecera */
.progreso { display: none; }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .progreso {
      display: block; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
      background: var(--hilo); transform-origin: 0 50%; scale: 0 1;
      animation: progreso linear both; animation-timeline: scroll(root);
    }
  }
}
@keyframes progreso { to { scale: 1 1; } }

/* Retícula: índice a la izquierda en escritorio, documento en una columna legible */
.legal { padding-block: clamp(32px, 6vw, 96px) var(--s-9); }
.indice { display: none; }
@media (min-width: 1024px) {
  .legal { display: grid; grid-template-columns: minmax(200px, 3fr) minmax(0, 9fr); column-gap: var(--s-8); align-items: start; }
  .legal__doc { grid-column: 2; grid-row: 1; }
  .indice { grid-column: 1; grid-row: 1; }
  .indice { display: block; position: sticky; top: 104px; max-height: calc(100vh - 128px); overflow-y: auto; padding: 4px 8px 16px 4px; }
  .indice-movil { display: none; }
}
.indice__lista { display: grid; gap: 2px; counter-reset: none; }
.indice__lista a {
  position: relative; display: block; padding: 6px 0 6px 18px; min-height: 32px;
  font-size: 14px; line-height: 1.35; color: var(--graphite); text-decoration: none;
}
.indice__lista a::before { content: ""; position: absolute; left: 0; top: 50%; width: 10px; height: 3px; border-radius: 2px; background: var(--hilo); scale: 0 1; transform-origin: 0 50%; translate: 0 -50%; }
.indice__lista a[aria-current="true"] { color: var(--ink); font-weight: 600; }
.indice__lista a[aria-current="true"]::before { scale: 1 1; }
@media (hover: hover) { .indice__lista a:hover { color: var(--terracota-deep); } }
@media (prefers-reduced-motion: no-preference) { .indice__lista a::before { transition: scale 260ms var(--ease-suave); } }

/* El índice que trae el documento: compacto y con subrayado recto (el ondulado queda para el texto) */
.doc .toc a { background-image: none; padding-bottom: 0; font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--rosa); }
@media (min-width: 1024px) {
  .doc .toc { columns: 2; column-gap: var(--s-7); font-size: 15px; }
  .doc .toc li { break-inside: avoid; }
}

/* Índice en móvil */
.indice-movil { margin-bottom: var(--s-6); border-block: 1px solid var(--sand); }
.indice-movil summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; font-size: 15px; cursor: pointer; color: var(--ink); }
.indice-movil .indice__lista { padding-bottom: var(--s-4); }

/* Lectura */
.legal__doc { max-width: var(--medida-legal); min-width: 0; }
.doc { font-size: 17px; line-height: 1.7; color: var(--ink); }
.doc h1 { font-family: var(--f-display); font-weight: 600; font-size: var(--t-h1-int); line-height: 1; letter-spacing: -.02em; color: var(--ink); margin-bottom: var(--s-4); }
.doc .folio { margin-bottom: var(--s-4); }
.doc .updated { font-size: var(--t-caption); color: var(--slate); margin-bottom: var(--s-7); }
.doc h2 { font-family: var(--f-texto); font-weight: 500; font-size: var(--t-h3); line-height: 1.2; color: var(--ink); margin: var(--s-8) 0 var(--s-4); scroll-margin-top: 104px; }
.doc h3 { font-size: 1.1875rem; margin: var(--s-6) 0 var(--s-3); }
.doc p, .doc ul, .doc ol { margin: 0 0 var(--s-4); }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li + li { margin-top: 6px; }
.doc li::marker { color: var(--terracota-deep); }
.doc strong { font-weight: 600; }
.doc a { color: var(--enlace); font-weight: 600; text-decoration: none; background-image: var(--subrayado); background-repeat: no-repeat; background-size: 100% 6px; background-position: 0 100%; padding-bottom: 3px; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: no-preference) { .doc a:hover, .doc a:focus-visible { animation: liga-redibuja 220ms var(--ease-suave); } }
.doc .resumen { background: var(--off-white); border-radius: var(--r-panel); box-shadow: var(--sombra-papel); padding: var(--s-5) var(--s-5) var(--s-2); margin-bottom: var(--s-7); }
.doc .resumen h2 { margin-top: 0; }
.doc .nota { background: var(--cream-deep); border-left: 3px solid var(--hilo); padding: var(--s-4) var(--s-5); margin: 0 0 var(--s-5); border-radius: 0 var(--r-input) var(--r-input) 0; }
.doc .nota > :last-child { margin-bottom: 0; }

/* Tablas: completas en escritorio, apiladas por fila en móvil */
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; margin: 0 0 var(--s-5); background: var(--cream-deep); }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--bone); }
.doc thead th { font-weight: 600; color: var(--ink); border-bottom-color: var(--ink); }
/* El encabezado de fila se ve como antes (una celda más); solo cambia lo que anuncia un lector de pantalla */
.doc tbody th { font-weight: 400; color: inherit; }
.doc .tabla { position: relative; overflow-x: auto; }
@media (max-width: 767px) {
  .js .doc table[data-apilada] thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .js .doc table[data-apilada], .js .doc table[data-apilada] tbody, .js .doc table[data-apilada] tr, .js .doc table[data-apilada] :is(td, th) { display: block; }
  .js .doc table[data-apilada] tr { padding: var(--s-3) 0; border-bottom: 1px solid var(--bone); }
  .js .doc table[data-apilada] :is(td, th) { border: 0; padding: 4px 12px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--s-3); }
  .js .doc table[data-apilada] :is(td, th)::before { content: attr(data-label); font-weight: 600; color: var(--slate); }
  .js .doc table[data-apilada] :is(td, th)[data-label=""] { display: block; font-weight: 600; font-family: var(--f-texto); font-size: 1.0625rem; }
  .js .doc table[data-apilada] :is(td, th)[data-label=""]::before { content: none; }
}
.legal__arriba { margin-top: var(--s-8); }

@media print {
  .cabecera, .pie, .indice, .indice-movil, .progreso, .legal__arriba, .salto { display: none !important; }
  body { background: #fff !important; color: #000; }
  .doc, .doc h1, .doc h2, .doc h3, .doc th, .doc td { color: #000; }
  .doc a { color: #000; background: none; padding: 0; }
  .doc a[href^="http"]::after { content: " (" attr(href) ")"; font-weight: 400; }
  .doc .resumen, .doc .nota, .doc table { background: none; box-shadow: none; }
  .legal { display: block; padding: 0; }
}
.indice-movil summary { list-style: none; gap: var(--s-3); }
.indice-movil summary::-webkit-details-marker { display: none; }
.indice-movil summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--terracota-deep); border-bottom: 2px solid var(--terracota-deep); rotate: 45deg; translate: 0 -3px; }
.indice-movil[open] summary::after { rotate: -135deg; translate: 0 2px; }
