/* ==========================================================================
   INTIA — legal.css
   privacidad.html and terminos.html, in the home page's language:
   night hero with the same sunrise, then an ivory "day" reading surface.
   Loaded after propuesta.css and reuses its tokens, nav, hero type, sun and footer.
   ========================================================================== */

/* ---------- Reading progress (gold hairline under the nav) ---------- */
.read-progress {
  position: fixed;
  inset: 0 0 auto;
  height: 2px;
  z-index: 55;
  pointer-events: none;
}
.read-progress__bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--sun) 60%, var(--white-sun));
  transform: scaleX(var(--read, 0));
  transform-origin: left center;
}

/* ---------- Hero ---------- */
.lhero { padding-top: clamp(8rem, 18vh, 10.5rem); }
.lhero__copy { position: relative; z-index: 3; max-width: 52rem; margin-inline: auto; padding-inline: var(--gutter); text-align: center; }

.lhero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font: 500 0.78rem/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-text);
}
.lhero__eyebrow::before {
  content: "";
  width: 0.4rem; height: 0.4rem;
  border-radius: 50%;
  background: var(--sun);
}
.lhero__title { font-size: clamp(2.6rem, 6vw, 5.25rem); }
.lhero__title span { display: block; }
.lhero__lead { max-width: 42rem; }
.lhero__updated {
  margin-top: 1.5rem;
  font: 400 0.82rem/1.4 var(--font-mono);
  color: var(--gold-text);
}

/* The home page's sun, as a crest rising at the foot of the hero */
.lhero__dawn {
  --dawn-h: 30rem;
  position: relative;
  height: clamp(11rem, 20vw, 15rem);
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  /* clip only the bottom: the halo and side light must spill upward into the sky */
  clip-path: inset(-40rem -50vw 0 -50vw);
}
.lhero__dawn .sun {
  top: 2.5rem;
  --sun-w: clamp(40rem, 100vw, 84rem);
  transform: translateX(-50%);
}
.lhero__dawn::before {
  content: "";
  position: absolute;
  inset: 30% -10% -20%;
  background:
    radial-gradient(40% 60% at 0% 80%, rgba(160, 138, 240, 0.35), transparent 70%),
    radial-gradient(40% 60% at 100% 80%, rgba(217, 119, 154, 0.32), transparent 70%);
  filter: blur(30px);
  z-index: -1;
}
/* the crest dissolves into the ivory page below */
.lhero__dawn::after {
  content: "";
  position: absolute;
  inset: auto 0 -2px;
  height: 55%;
  background: linear-gradient(to bottom, rgba(250, 246, 239, 0), rgba(250, 246, 239, 0.55) 55%, var(--ivory) 100%);
  z-index: 2;
}

/* ---------- Document on ivory ---------- */
.ldoc { position: relative; padding-block: clamp(2.5rem, 5vw, 4rem) clamp(5rem, 9vw, 7.5rem); }
/* the sun is a composited layer whose clip at the hero's fractional bottom edge rounds out by a
   pixel; lay an opaque ivory sill over that row (same fix as the home page's night sill) */
.lhero + .ldoc::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: -3px;
  height: 4px;
  background: var(--ivory);
  pointer-events: none;
}
.ldoc__grid {
  display: grid;
  grid-template-columns: minmax(14rem, 17rem) minmax(0, 46rem);
  justify-content: center;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}

/* Contents: pinned while reading */
.ldoc__aside { position: sticky; top: 6.5rem; }
.ldoc__toc p {
  margin-bottom: 1rem;
  font: 500 0.78rem/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bronze);
}
.ldoc__toc ol {
  counter-reset: toc;
  border-left: 1px solid rgba(10, 37, 64, 0.14);
}
.ldoc__toc li { counter-increment: toc; }
.ldoc__toc a {
  position: relative;
  display: flex;
  gap: 0.75rem;
  padding: 0.42rem 0 0.42rem 1.1rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.ldoc__toc a::before {
  content: counter(toc, decimal-leading-zero);
  flex: none;
  font: 400 0.78rem/1.6 var(--font-mono);
  color: var(--bronze);
  opacity: 0.75;
}
.ldoc__toc a:hover { color: var(--ink); }
.ldoc__toc a.is-current {
  color: var(--ink);
  font-weight: 600;
  border-left-color: var(--gold);
}
.ldoc__toc a.is-current::before { opacity: 1; }
.day .ldoc__toc a:focus-visible { outline-color: var(--bronze); }

/* Body copy */
.legal { color: var(--ink-soft); font-size: 1.0625rem; line-height: 1.7; }
.legal > h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.legal h2 {
  margin: 3.75rem 0 1.1rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(10, 37, 64, 0.12);
  font-size: clamp(1.5rem, 2.6vw, 1.9rem);
  font-weight: 600;
  color: var(--ink);
  scroll-margin-top: 6rem;
}
.legal h3 {
  margin: 2rem 0 0.6rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink);
}
.legal p, .legal li { color: var(--ink-soft); }
.legal strong { color: var(--ink); font-weight: 600; }
.legal em { color: var(--ink); }
.legal ul { list-style: none; margin: 0 0 1.1em; }
.legal ul li { position: relative; padding-left: 1.4rem; margin-bottom: 0.55rem; }
.legal ul li::before {
  content: "";
  position: absolute;
  left: 0.15rem; top: 0.72em;
  width: 0.45rem; height: 0.45rem;
  border-radius: 50%;
  background: var(--gold);
}
.legal a:not(.btn) {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}
.legal a:not(.btn):hover { color: var(--bronze); text-decoration-color: var(--bronze); }
.day .legal :focus-visible { outline-color: var(--bronze); }

/* Tables: white cards on ivory, as the home page's pills */
.table-wrap {
  overflow-x: auto;
  margin: 0.75rem 0 1.5rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 1px 0 rgba(10, 37, 64, 0.06), 0 16px 32px -24px rgba(10, 37, 64, 0.35);
}
.legal table { width: 100%; min-width: 32rem; border-collapse: collapse; font-size: 0.95rem; }
.legal th, .legal td {
  text-align: left;
  vertical-align: top;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid rgba(10, 37, 64, 0.08);
}
.legal tr:last-child td { border-bottom: 0; }
.legal th {
  font: 600 0.85rem/1.3 var(--font-display);
  color: var(--ivory);
  background: var(--ink);
}
.legal td { color: var(--ink-soft); }

/* Data still to fill in: impossible to miss before publishing */
.todo {
  padding: 0.05em 0.35em;
  border: 1px dashed #C4553E;
  border-radius: 4px;
  background: rgba(229, 115, 92, 0.14);
  color: #9A3A26;
  font: 500 0.88em/1.4 var(--font-mono);
}

/* Closing card: a piece of night on the day page */
.legal__contact {
  position: relative;
  overflow: hidden;
  margin-top: 4rem;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border-radius: var(--r-slab);
  background: var(--midnight);
  isolation: isolate;
}
.legal__contact::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 22rem; height: 22rem;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(233, 167, 126, 0.35), rgba(108, 85, 214, 0.18) 60%, transparent);
  z-index: -1;
}
.legal__contact p { margin-bottom: 0.4rem; color: var(--text-muted); }
.legal__contact p:last-child { margin-bottom: 0; }
.legal__contact strong { color: var(--sun); font: 600 1.15rem/1.3 var(--font-display); }
.legal__contact a:not(.btn) { color: var(--text); text-decoration-color: var(--sun); }
.legal__contact a:not(.btn):hover { color: var(--sun); text-decoration-color: var(--sun); }
.legal__contact :focus-visible { outline-color: var(--sun); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .ldoc__grid { grid-template-columns: minmax(0, 46rem); gap: 2.5rem; }
  .ldoc__aside {
    position: static;
    padding: 1.5rem;
    border-radius: 1.25rem;
    background: #fff;
    box-shadow: 0 16px 32px -24px rgba(10, 37, 64, 0.35);
  }
  .ldoc__toc ol { columns: 2 14rem; column-gap: 2rem; border-left: 0; }
  .ldoc__toc li { break-inside: avoid; }
  .ldoc__toc a { padding-left: 0; border-left: 0; }
}
@media (max-width: 640px) {
  .lhero__dawn { height: 9rem; }
  .lhero__dawn .sun { --sun-w: 46rem; top: 2rem; }
  .legal h2 { margin-top: 3rem; }
}
