/* ============================================================================
 * page-legal.css — Páginas legales (privacidad, términos)
 * ============================================================================ */

/* ── Hero compacto sin imagen ──────────────────────────────────────────── */
/* Specificity boost via body.fw-template-legal para ganar a salient-override
   que define .t-eyebrow y .t-h1 en color ink-dark globalmente. */
body.fw-template-legal .fw-legal__hero {
  position: relative;
  background: linear-gradient(180deg, #0f1c4e 0%, #1B3A6B 60%, #1B3A6B 100%);
  color: #fff;
  padding: clamp(96px, 14vw, 180px) 0 clamp(48px, 7vw, 88px);
  overflow: hidden;
}
body.fw-template-legal .fw-legal__hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at top right, rgba(123, 184, 255, .15), transparent 55%),
    radial-gradient(ellipse at bottom left, rgba(142, 42, 47, .2), transparent 55%);
  pointer-events: none;
}
body.fw-template-legal .fw-legal__hero-inner {
  position: relative;
  max-width: 820px;
}
body.fw-template-legal .fw-legal__hero .t-eyebrow {
  color: rgba(255, 255, 255, .7) !important;
  letter-spacing: .14em;
}
body.fw-template-legal .fw-legal__title,
body.fw-template-legal h1.fw-legal__title {
  margin: .4em 0 .35em;
  color: #fff !important;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .25);
}
body.fw-template-legal .fw-legal__lede {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, .85) !important;
  max-width: 64ch;
  margin: 0 0 1.4em;
}
body.fw-template-legal .fw-legal__lede strong {
  color: #fff !important;
  font-weight: 700;
}
body.fw-template-legal .fw-legal__updated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: rgba(255, 255, 255, .7) !important;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
body.fw-template-legal .fw-legal__updated-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7bf0a0;
  box-shadow: 0 0 10px rgba(123, 240, 160, .6);
}

/* ── Layout principal: TOC sticky + content ────────────────────────────── */
.fw-legal {
  padding: clamp(40px, 6vw, 88px) 0 clamp(60px, 8vw, 120px);
  background: #fafbfc;
}
.fw-legal__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
}
@media (min-width: 960px) {
  .fw-legal__layout {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 64px;
    align-items: start;
  }
}

/* ── TOC ──────────────────────────────────────────────────────────────── */
.fw-legal__toc {
  display: none;
}
@media (min-width: 960px) {
  .fw-legal__toc {
    display: block;
    position: sticky;
    top: 100px;
    align-self: start;
  }
}
.fw-legal__toc-inner {
  border-left: 2px solid #e1e7ef;
  padding-left: 16px;
}
.fw-legal__toc-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: #6b7280;
  margin-bottom: 12px;
}
.fw-legal__toc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fw-legal__toc-link {
  display: block;
  font-size: .85rem;
  line-height: 1.4;
  color: #4a5568;
  text-decoration: none;
  padding: 4px 0;
  border-left: 2px solid transparent;
  margin-left: -18px;
  padding-left: 16px;
  transition: color .15s ease, border-color .15s ease;
}
.fw-legal__toc-link:hover {
  color: #1B3A6B;
}
.fw-legal__toc-link.is-active {
  color: #1B3A6B;
  border-left-color: #1B3A6B;
  font-weight: 600;
}

/* ── Content (the_content) ─────────────────────────────────────────────── */
.fw-legal__content {
  max-width: 720px;
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
  font-size: 1rem;
  line-height: 1.7;
  color: #2c3e50;
}
.fw-legal__content > *:first-child { margin-top: 0; }
.fw-legal__content > *:last-child { margin-bottom: 0; }

.fw-legal__content h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  line-height: 1.2;
  font-weight: 800;
  color: #0f1c4e;
  letter-spacing: -.01em;
  margin: 2.2em 0 .6em;
  padding-top: 1.4em;
  border-top: 1px solid #e1e7ef;
  scroll-margin-top: 120px;
}
.fw-legal__content > h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

.fw-legal__content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1B3A6B;
  margin: 1.6em 0 .4em;
  letter-spacing: -.005em;
  scroll-margin-top: 120px;
}

.fw-legal__content p {
  margin: 0 0 1em;
  color: #2c3e50;
}
.fw-legal__content p:last-child { margin-bottom: 0; }

.fw-legal__content strong {
  color: #0f1c4e;
  font-weight: 700;
}

.fw-legal__content a {
  color: #1B3A6B;
  text-decoration: underline;
  text-decoration-color: rgba(27, 58, 107, .35);
  text-underline-offset: 3px;
  transition: text-decoration-color .15s ease;
}
.fw-legal__content a:hover {
  text-decoration-color: #1B3A6B;
}

.fw-legal__content ul,
.fw-legal__content ol {
  margin: .4em 0 1.4em;
  padding-left: 0;
  list-style: none;
}
.fw-legal__content li {
  position: relative;
  padding-left: 24px;
  margin: .5em 0;
  line-height: 1.6;
}
.fw-legal__content ul > li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: .7em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1B3A6B;
}
.fw-legal__content ol {
  counter-reset: legal-list;
}
.fw-legal__content ol > li {
  counter-increment: legal-list;
}
.fw-legal__content ol > li::before {
  content: counter(legal-list) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
  color: #1B3A6B;
  min-width: 18px;
}

/* Bento-style info card embebida (clase legacy del editor o custom) */
.fw-legal__content .fw-info-card,
.fw-legal__content blockquote {
  margin: 1.4em 0;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f0f7ff 0%, #f6f8fb 100%);
  border-left: 3px solid #1B3A6B;
  border-radius: 10px;
  font-size: .95rem;
  color: #2c3e50;
}
.fw-legal__content blockquote p:last-child { margin-bottom: 0; }

.fw-legal__content code {
  background: #f6f8fb;
  border: 1px solid #e1e7ef;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: .85em;
  font-family: ui-monospace, "SF Mono", monospace;
  color: #8E2A2F;
}

.fw-legal__content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: .9rem;
  border: 1px solid #e1e7ef;
  border-radius: 10px;
  overflow: hidden;
}
.fw-legal__content thead {
  background: #f6f8fb;
}
.fw-legal__content th,
.fw-legal__content td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #e1e7ef;
  vertical-align: top;
}
.fw-legal__content tbody tr:last-child td {
  border-bottom: 0;
}
.fw-legal__content th {
  font-weight: 700;
  color: #0f1c4e;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── CTA final compacto ────────────────────────────────────────────────── */
.cta-final--compact {
  padding: clamp(48px, 7vw, 100px) 0;
  background: linear-gradient(180deg, #fff 0%, #f6f8fb 100%);
  border-top: 1px solid #e1e7ef;
}

/* ── Dark mode (is-dark del theme toggle) ──────────────────────────────── */
body.is-dark .fw-legal { background: #0a0e1a; }
body.is-dark .fw-legal__content {
  background: #131826;
  border-color: rgba(255,255,255,.08);
  color: #c9d1e0;
  box-shadow: none;
}
body.is-dark .fw-legal__content h2 { color: #e8eef9; border-top-color: rgba(255,255,255,.08); }
body.is-dark .fw-legal__content h3 { color: #7ab8ff; }
body.is-dark .fw-legal__content p,
body.is-dark .fw-legal__content li { color: #c9d1e0; }
body.is-dark .fw-legal__content strong { color: #fff; }
body.is-dark .fw-legal__content a { color: #7ab8ff; text-decoration-color: rgba(122,184,255,.4); }
body.is-dark .fw-legal__content a:hover { text-decoration-color: #7ab8ff; }
body.is-dark .fw-legal__content ul > li::before { background: #7ab8ff; }
body.is-dark .fw-legal__content ol > li::before { color: #7ab8ff; }
body.is-dark .fw-legal__content blockquote,
body.is-dark .fw-legal__content .fw-info-card {
  background: rgba(122, 184, 255, .08);
  border-left-color: #7ab8ff;
  color: #c9d1e0;
}
body.is-dark .fw-legal__content code { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1); color: #ffb3b3; }
body.is-dark .fw-legal__content thead { background: rgba(255,255,255,.04); }
body.is-dark .fw-legal__content th,
body.is-dark .fw-legal__content td { border-bottom-color: rgba(255,255,255,.08); }
body.is-dark .fw-legal__content th { color: #e8eef9; }

body.is-dark .fw-legal__toc-inner { border-left-color: rgba(255,255,255,.1); }
body.is-dark .fw-legal__toc-label { color: #94a3b8; }
body.is-dark .fw-legal__toc-link { color: #94a3b8; }
body.is-dark .fw-legal__toc-link:hover,
body.is-dark .fw-legal__toc-link.is-active { color: #7ab8ff; border-left-color: #7ab8ff; }

body.is-dark .cta-final--compact {
  background: linear-gradient(180deg, #0a0e1a 0%, #131826 100%);
  border-top-color: rgba(255,255,255,.06);
}
