/* ══════════════════════════════════════════════════════════════════
   PUBLIC.CSS — chrome común de las páginas públicas (sin login):
   /about y el centro de ayuda /help. Mismo lenguaje visual que la
   landing (SIGNAL: navy + azul eléctrico, editorial-financiero).
   Todo con tokens de tokens.css — nada de hex sueltos de marca.
   ══════════════════════════════════════════════════════════════════ */

body.pub {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Enlace de salto para teclado/lector de pantalla */
.pub-skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 1000;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 10px 16px;
  border-radius: var(--r-sm, 6px);
  font-size: 14px;
  font-weight: 600;
}
.pub-skip:focus { left: 8px; }

/* ── NAV ───────────────────────────────────────────────────────── */
.pub-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;          /* mismos números que .lp-nav de la landing */
  padding: 0 40px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
/* Misma marca que la landing (.lp-brand): serif en cursiva + punto que
   late. Si esto se toca, tocar los dos sitios. */
.pub-brand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 21px;
  font-weight: 400;
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: none;
}
.pub-brand-dot {
  width: 6px; height: 6px; border-radius: 50%;
  flex-shrink: 0;
  margin-bottom: 3px;
  background: var(--accent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent);
  animation: pubPulse 2.4s ease-in-out infinite;
}
@keyframes pubPulse {
  0%, 100% { opacity: 1;  transform: scale(1); }
  50%      { opacity: .4; transform: scale(1.5); }
}
@media (prefers-reduced-motion: reduce) {
  .pub-brand-dot { animation: none; }
}
.pub-nav-links { display: flex; align-items: center; gap: 6px; }

.pub-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.pub-nav-link:hover { background: var(--accent-soft); color: var(--ink); }
.pub-nav-link.is-active { color: var(--accent); font-weight: 500; }

/* Mismas medidas que .lp-nav-cta de la landing: sin min-height, que dentro
   de una barra de 60px estiraba el botón de lado a lado. */
.pub-nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px color-mix(in srgb, var(--accent) 35%, transparent);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, box-shadow .15s ease;
}
.pub-nav-cta:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 18px color-mix(in srgb, var(--accent) 40%, transparent);
}
.pub-cta-short { display: none; }

.pub-lang-pill {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  margin-right: 2px;
  background: var(--bg-sunk);
  border: 1px solid var(--border);
  border-radius: 20px;
}
.pub-lang-btn {
  padding: 4px 11px;
  border-radius: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-3);
  text-decoration: none;
}
.pub-lang-btn.active { background: var(--surface); color: var(--ink); }

/* Foco visible SIEMPRE (nunca quitar el anillo) */
.pub-nav a:focus-visible,
.pub-main a:focus-visible,
.pub-foot a:focus-visible,
.pub-skip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── SHELL ─────────────────────────────────────────────────────── */
.pub-main { display: block; }

.pub-wrap {            /* ancho de página */
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
}
.pub-wrap--read {      /* medida cómoda de lectura: ~68 caracteres */
  max-width: 720px;
}

.pub-hero {
  padding: 72px 0 44px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.pub-hero::before {          /* halo azul suave, decorativo */
  content: '';
  position: absolute;
  inset: -120px 0 auto 0;
  height: 340px;
  background: radial-gradient(600px 260px at 22% 0%,
              color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
  pointer-events: none;
}
.pub-hero > * { position: relative; }

.pub-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.pub-eyebrow::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

.pub-h1 {
  margin: 0;
  font-size: clamp(34px, 5.2vw, 54px);
  line-height: 1.06;
  font-weight: 600;
  letter-spacing: -.025em;
}
.pub-h1 em {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.pub-lead {
  margin: 20px 0 0;
  max-width: 62ch;
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.6;
  color: var(--ink-2);
}

/* ── PROSA ─────────────────────────────────────────────────────── */
.pub-prose { padding: 32px 0 24px; }
.pub-prose h2 {
  margin: 44px 0 14px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.015em;
}
.pub-prose h3 {
  margin: 30px 0 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}
.pub-prose p,
.pub-prose li { font-size: 16px; line-height: 1.7; color: var(--ink-2); }
.pub-prose p { margin: 0 0 16px; }
.pub-prose ul { margin: 0 0 18px; padding-left: 20px; }
.pub-prose li { margin-bottom: 8px; }
.pub-prose strong { color: var(--ink); font-weight: 600; }
.pub-prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.pub-prose .pub-card,
.pub-prose .pub-card:hover { text-decoration: none; }
/* `.pub-prose a` (0-1-1) gana a `.pub-nav-cta` (0-1-0): sin esto el botón
   salía con el texto del mismo azul que su fondo — invisible. */
.pub-prose a.pub-nav-cta {
  color: #fff;
  text-decoration: none;
}
.pub-prose a.pub-nav-cta:hover { color: #fff; }
.pub-prose .pub-card .pub-card-title { color: var(--ink); text-decoration: none; }
.pub-prose .pub-card .pub-card-desc { color: var(--ink-3); text-decoration: none; }

.pub-quote {
  margin: 30px 0;
  padding: 20px 24px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--r-md, 10px) var(--r-md, 10px) 0;
}
.pub-quote p { margin: 0; color: var(--ink); font-size: 17px; line-height: 1.6; }

/* ── FIRMA / AUTOR ─────────────────────────────────────────────── */
.pub-author {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 24px 0 8px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg, 14px);
  background: var(--surface);
}
.pub-author img,
.pub-author .pub-avatar-fallback {
  width: 84px; height: 84px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 84px;
  border: 1px solid var(--border);
}
.pub-avatar-fallback {
  display: grid;
  place-items: center;
  background: var(--bg-sunk);
  color: var(--accent);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 26px;
  font-weight: 600;
}
.pub-author-name { font-size: 17px; font-weight: 600; margin: 0 0 3px; }
.pub-author-role {
  margin: 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.pub-author-links { margin: 10px 0 0; display: flex; gap: 14px; font-size: 14px; }

/* ── TARJETAS / GRID ───────────────────────────────────────────── */
.pub-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin: 0 0 40px;
}
.pub-card {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg, 14px);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
.pub-card:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
  .pub-card, .pub-nav-cta { transition: none; }
  .pub-card:hover { transform: none; }
}
.pub-card-title { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
.pub-card-desc { font-size: 14px; line-height: 1.55; color: var(--ink-3); margin: 0; }

/* ── CTA FINAL ─────────────────────────────────────────────────── */
.pub-cta-block {
  margin: 40px 0 64px;
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg, 14px);
  background: linear-gradient(160deg,
              color-mix(in srgb, var(--accent) 10%, var(--surface)) 0%,
              var(--surface) 65%);
  text-align: center;
}
.pub-cta-block h2 { margin: 0 0 10px; font-size: 24px; font-weight: 600; }
.pub-cta-block p { margin: 0 0 22px; color: var(--ink-2); }

/* ── FOOTER ────────────────────────────────────────────────────── */
.pub-foot {
  border-top: 1px solid var(--border);
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-3);
}
.pub-foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.pub-foot a { color: var(--ink-3); text-decoration: none; }
.pub-foot a:hover { color: var(--accent); }

/* ── RESPONSIVE ────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .pub-nav { padding: 0 20px; }
  .pub-wrap { padding: 0 18px; }
  .pub-nav-link--wide { display: none; }   /* "Sobre nosotros" vive en el pie */
  .pub-lang-pill { display: none; }
}
@media (max-width: 520px) {
  /* En móvil el nav se queda con lo imprescindible: Ayuda + el CTA.
     "Iniciar sesión" sigue en el pie y dentro del propio CTA. */
  .pub-nav-links .pub-nav-link[href*="login"] { display: none; }
  .pub-cta-full { display: none; }
  .pub-cta-short { display: inline; }
  .pub-nav-link { padding: 8px 9px; font-size: 13px; }
  .pub-hero { padding: 48px 0 34px; }
  .pub-author { flex-direction: column; text-align: center; }
}

/* ── FOTO EN PROSA ─────────────────────────────────────────────── */
.pub-figure { margin: 26px 0 30px; }
.pub-figure img {
  display: block;
  width: 100%;
  max-width: 460px;
  height: auto;                       /* width/height en el <img> reservan sitio: sin salto */
  border: 1px solid var(--border);
  border-radius: var(--r-lg, 14px);
}
.pub-figure figcaption {
  margin-top: 10px;
  max-width: 460px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
}
