/* ============================================================
   SinergIA · subpáginas (Fase 4): Recursos y documentos legales.
   Se carga después de tokens.css y site.css. Reutiliza botones,
   foco, marca, control de efectos y pie del sistema aprobado; solo
   añade el chrome en flujo, el campo discreto y la maqueta de
   lectura de los legales. Sin motor de demostraciones.
   ============================================================ */

/* ---------- Header en flujo ---------- */
.site--sub { position: relative; border-bottom: 1px solid var(--rule); background: var(--ink); }
.site--sub .site__in { min-height: calc(var(--cell) * 8); }
.brand { gap: 0; text-decoration: none; }
.brand__sub {
  display: inline-flex; align-items: center; margin-left: var(--s-2); padding-left: var(--s-2); min-height: 24px;
  border-left: 1px solid var(--rule-strong); font-size: var(--fs-small); font-weight: 600; color: var(--text-muted);
}
.site__back {
  display: inline-flex; align-items: center; gap: var(--s-1); min-height: 44px; padding: 0 4px;
  font-size: var(--fs-small); font-weight: 600; color: var(--text-muted); text-decoration: none;
  transition: color var(--dur-ui) var(--ease-out);
}
.site__back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: square; transition: transform var(--dur-ui) var(--ease-out); }
.site__back:hover { color: var(--text); }
.site__back:hover svg { transform: translateX(-4px); }
@media (max-width: 599px) {
  .site--sub .site__in { gap: var(--s-1); }
  .brand img { height: 24px; }
  .brand__sub { margin-left: var(--s-1); padding-left: var(--s-1); }
}
@media (max-width: 379px) {
  .site--sub .btn--sm { padding: 0 12px; }
  .brand__sub { display: none; }
}

/* ---------- Campo de fondo discreto (solo Recursos) ---------- */
.ambient--sub.is-on { opacity: 0.85; }

/* ---------- Pie compacto ---------- */
.foot--sub { padding: var(--s-4) 0; }
.foot__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); }
.foot--sub .foot__brand { display: inline-flex; align-items: center; min-height: 44px; }
.foot--sub .foot__brand img { height: 24px; }
.foot__copy { color: var(--text-faint); font-size: var(--fs-micro); }
.foot__legal { display: flex; flex-wrap: wrap; gap: 0 var(--s-2); }
.foot__legal a, .foot__legal span { min-height: 44px; display: inline-flex; align-items: center; color: var(--text-muted); text-decoration: none; transition: color var(--dur-ui) var(--ease-out); }
.foot__legal a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.foot__legal [aria-current] { color: var(--text); }
@media (max-width: 899px) { .foot--sub { padding-bottom: var(--s-4); } }
@media (max-width: 599px) {
  .foot__row { flex-direction: column; align-items: flex-start; gap: 0; }
  .foot__copy { margin: var(--s-1) 0; }
  .foot--sub .fx--text { margin-left: 0; margin-top: var(--s-1); }
}

/* ============================================================
   Documentos legales: maqueta de lectura.
   Fondo ESTÁTICO (retícula tenue en una esquina, sin animación,
   sin campo, sin Nivo, sin JS). El texto va sobre tinta lisa.
   ============================================================ */
.sub--legal::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(to right, rgba(248, 246, 244, 0.03) 1px, transparent 1px), linear-gradient(to bottom, rgba(248, 246, 244, 0.03) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  -webkit-mask-image: radial-gradient(ellipse 45% 55% at 100% 0%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse 45% 55% at 100% 0%, #000 0%, transparent 70%);
}
.legal { display: grid; grid-template-columns: minmax(180px, 3fr) minmax(0, 9fr); gap: var(--s-8); padding-top: var(--s-8); padding-bottom: var(--s-12); align-items: start; }
.legal__nav { position: sticky; top: var(--s-3); }
.legal__nav-h { font-size: var(--fs-micro); font-weight: 600; color: var(--text-faint); margin-bottom: var(--s-1); }
.legal__nav ul { list-style: none; padding: 0; display: grid; border-top: 1px solid var(--rule); }
.legal__nav li { border-bottom: 1px solid var(--rule); }
.legal__nav a {
  position: relative; display: flex; align-items: center; min-height: 48px; padding: 0 var(--s-1) 0 var(--s-3);
  font-size: var(--fs-small); font-weight: 500; color: var(--text-muted); text-decoration: none;
  transition: color var(--dur-ui) var(--ease-out), background-color var(--dur-ui) var(--ease-out);
}
.legal__nav a::before { content: ''; position: absolute; left: 0; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; background: var(--ink-4); transition: background-color var(--dur-ui) var(--ease-out); }
.legal__nav a:hover { color: var(--text); background: var(--ink-2); }
.legal__nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
.legal__nav a[aria-current="page"]::before { background: var(--violet); box-shadow: 0 0 0 0 transparent; }

.legal__doc { max-width: 72ch; min-width: 0; }
.legal__doc h1 {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(2.25rem, 1.5rem + 3vw, 3.75rem);
  line-height: var(--lh-head); letter-spacing: var(--track-display); text-wrap: balance;
}
.legal__date { margin-top: var(--s-2); font-size: var(--fs-small); color: var(--text-muted); }
.legal__body { margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--rule); color: #DCD9D6; line-height: 1.7; }
.legal__body > p:first-child { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-h3); line-height: 1.2; color: var(--text); }
.legal__body > p + p { margin-top: var(--s-1); }
.legal__body section { margin-top: var(--s-6); }
.legal__body > :first-child { margin-top: 0; }
.legal__body h2 {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  line-height: 1.2; letter-spacing: -0.015em; color: var(--text); margin-bottom: var(--s-2); text-wrap: balance;
}
.legal__body section > * + * { margin-top: var(--s-1); }
.legal__body ul, .legal__body ol { padding-left: 0; list-style: none; display: grid; gap: 6px; margin-top: var(--s-1); }
.legal__body ul > li { position: relative; padding-left: calc(var(--cell) * 3); }
.legal__body ul > li::before { content: ''; position: absolute; left: 0; top: 0.68em; width: 7px; height: 7px; background: var(--violet-soft); }
.legal__body ol { list-style: decimal; padding-left: 1.5em; }
.legal__body strong { color: var(--text); font-weight: 600; }
.legal__body a { color: var(--text); text-decoration: underline; text-decoration-color: var(--violet-soft); text-underline-offset: 4px; overflow-wrap: anywhere; }
.legal__body a:hover { text-underline-offset: 6px; }
.legal__end { margin-top: var(--s-8); padding-top: var(--s-3); border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); font-size: var(--fs-small); }
.legal__end a { min-height: 44px; display: inline-flex; align-items: center; color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 5px; }
.legal__end a:hover { text-decoration-color: var(--violet-soft); }

@media (max-width: 899px) {
  .legal { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); padding-top: var(--s-4); }
  .legal__nav { position: static; }
  .legal__nav ul { grid-template-columns: 1fr 1fr; border-top: 0; gap: var(--s-1); }
  .legal__nav li { border: 1px solid var(--rule); }
  .legal__nav a { padding-left: calc(var(--s-2) + 9px); font-size: var(--fs-micro); line-height: 1.25; }
  .legal__nav a::before { left: var(--s-1); }
  .legal__nav-h { display: none; }
}
