/* ============================================================
   Synerxgy — hoja de estilos de las páginas estáticas
   (blog/, glosario/, buscar/)

   Estas páginas no pasan por React, pero tienen que verse igual que las
   públicas de la SPA (/about, /producto/*, /legal/*):
   - tokens = los de client/src/index.css (claro y oscuro, mismos valores);
   - cabecera y pie = copia de PublicLayout.tsx y GlobalFooter.tsx;
   - artículo = tipografía de MarketingPageShell.tsx;
   - hero y CTA = los de la landing (hero-bg, hero-gradient, btn-glow).

   Si cambian los tokens o la cabecera/pie de la app, cambia esto también.
   Tema: oscuro por defecto (igual que la app). /seo-assets/theme.js pone
   class="light" en <html> si el usuario eligió claro en la app.
   ============================================================ */

/* ---------- Tokens (copiados de index.css) ---------- */
:root {
  /* Oscuro (por defecto, = .dark en index.css) */
  --background: 218 32% 5%;
  --foreground: 0 0% 93%;
  --card: 218 30% 8%;
  --card-foreground: 0 0% 93%;
  --primary: 218 88% 62%;
  --primary-foreground: 0 0% 100%;
  --primary-hover: 218 90% 54%;
  --secondary: 218 30% 14%;
  --secondary-foreground: 0 0% 93%;
  --muted: 218 30% 14%;
  --muted-foreground: 0 0% 55%;
  --accent: 218 35% 13%;
  --accent-foreground: 218 90% 78%;
  --border: 218 22% 16%;
  --surface: 218 28% 7%;
  --surface-elevated: 218 30% 11%;
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.35);
  --gradient-surface: linear-gradient(180deg, hsl(218 30% 11%), hsl(218 28% 7%));
  --text-gradient: linear-gradient(135deg, hsl(218 88% 65%) 0%, hsl(218 90% 55%) 35%, hsl(22 96% 58%) 100%);
  --hero-glow:
    radial-gradient(ellipse 80% 50% at 50% -10%, hsl(218 88% 30% / 0.45), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 30%, hsl(22 92% 35% / 0.25), transparent 70%),
    radial-gradient(ellipse 50% 40% at 10% 70%, hsl(218 80% 25% / 0.2), transparent 70%);

  /* Marca (iguales en los dos temas) */
  --brand-blue: 218 88% 52%;
  --brand-orange: 22 96% 54%;

  --radius: 0.75rem;
  color-scheme: dark;
}

html.light {
  /* Claro (= :root en index.css) */
  --background: 218 20% 93%;
  --foreground: 218 40% 8%;
  --card: 40 3% 98%;
  --card-foreground: 218 40% 8%;
  --primary: 218 88% 52%;
  --primary-foreground: 0 0% 100%;
  --primary-hover: 218 90% 44%;
  --secondary: 218 25% 90%;
  --secondary-foreground: 218 30% 10%;
  --muted: 218 20% 90%;
  --muted-foreground: 218 15% 35%;
  --accent: 218 25% 93%;
  --accent-foreground: 218 40% 8%;
  --border: 218 20% 78%;
  --surface: 218 20% 97%;
  --surface-elevated: 218 20% 94%;
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.1);
  --gradient-surface: linear-gradient(180deg, hsl(218 20% 97%), hsl(218 20% 94%));
  --text-gradient: linear-gradient(135deg, hsl(218 88% 45%), hsl(22 96% 45%));
  --hero-glow:
    radial-gradient(ellipse 80% 50% at 50% -10%, hsl(218 88% 60% / 0.18), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 30%, hsl(22 92% 60% / 0.12), transparent 70%);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-feature-settings: "ss01", "cv11";
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; width: 100%; }

a { color: hsl(var(--primary)); text-decoration: none; transition: color .15s; }
a:hover { color: hsl(var(--primary-hover)); text-decoration: underline; text-underline-offset: 3px; }

strong { color: hsl(var(--foreground)); font-weight: 600; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: absolute; z-index: 50; width: auto; height: auto; clip: auto; margin: 0;
  padding: 1rem; background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
}

/* ---------- Botones (= Button de la app) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 2.5rem; padding: 0 1rem; border-radius: calc(var(--radius) - 2px);
  font-size: .875rem; font-weight: 600; white-space: nowrap;
  transition: background-color .15s, color .15s, box-shadow .25s, transform .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-primary:hover { background: hsl(var(--primary) / 0.8); color: hsl(var(--primary-foreground)); }
.btn-ghost { color: hsl(var(--foreground)); font-weight: 500; }
.btn-ghost:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
.btn-lg { height: 3rem; padding: 0 2rem; font-size: 1rem; }
.btn-glow {
  box-shadow: 0 1px 0 hsl(218 88% 66% / 0.15), 0 8px 16px -4px hsl(218 88% 50% / 0);
}
.btn-glow:hover {
  box-shadow: 0 1px 0 hsl(218 88% 70% / 0.25), 0 12px 28px -6px hsl(218 88% 50% / 0.45);
  transform: translateY(-1px);
}

/* ---------- Cabecera (= PublicLayout.tsx) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--background) / 0.8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.site-nav {
  max-width: 80rem; margin: 0 auto; height: 4rem; padding: 0 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.site-logo { display: flex; align-items: center; color: hsl(var(--foreground)); }
.site-logo svg { height: 1.75rem; width: auto; }
.site-links { display: none; align-items: center; gap: 1.5rem; font-size: .875rem; }
.site-links a { color: hsl(var(--muted-foreground)); }
.site-links a:hover { color: hsl(var(--foreground)); text-decoration: none; }
.site-actions { display: flex; align-items: center; gap: .5rem; }
.site-actions .btn-ghost { display: none; }

@media (min-width: 640px) { .site-actions .btn-ghost { display: inline-flex; } }
@media (min-width: 768px) {
  .site-nav { padding: 0 1.5rem; }
  .site-logo svg { height: 2rem; }
  .site-links { display: flex; }
}

/* ---------- Pie (= GlobalFooter.tsx) ---------- */
.site-footer { border-top: 1px solid hsl(var(--border)); background: hsl(var(--card) / 0.5); margin-top: 2rem; }
.site-footer-in { max-width: 80rem; margin: 0 auto; padding: 2.5rem 1rem; }
.site-footer-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; margin-bottom: 2rem; }
.site-footer h4 {
  font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: hsl(var(--foreground)); margin-bottom: .75rem;
}
.site-footer ul { list-style: none; margin: 0; font-size: .75rem; line-height: 1rem; }
.site-footer li { margin: 0; padding: 0; }
.site-footer li + li { margin-top: .5rem; }
.site-footer li a { color: hsl(var(--muted-foreground)); }
.site-footer li a:hover { color: hsl(var(--foreground)); text-decoration: none; }
.site-footer .muted, .site-footer .muted em { color: hsl(var(--muted-foreground) / 0.5); }
.site-footer-legal em { color: inherit; }
.site-footer-bar {
  padding-top: 1.5rem; border-top: 1px solid hsl(var(--border));
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 1rem;
  font-size: .75rem; color: hsl(var(--muted-foreground));
}
.site-footer-legal { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.site-footer-legal img { height: 1.5rem; opacity: .8; }
.site-footer-legal em { opacity: .8; }
.site-footer-social { display: flex; align-items: center; gap: .75rem; }
.site-footer-social a { color: hsl(var(--muted-foreground)); display: inline-flex; }
.site-footer-social a:hover { color: hsl(var(--foreground)); }
.site-footer-social svg { width: 1rem; height: 1rem; }

@media (min-width: 768px) {
  .site-footer-in { padding: 2.5rem 1.5rem; }
  .site-footer-cols { grid-template-columns: repeat(4, 1fr); }
  .site-footer-bar { flex-direction: row; align-items: center; }
}

/* ---------- Artículo (= MarketingPageShell.tsx + prose) ---------- */
article { max-width: 48rem; margin: 0 auto; padding: 3rem 1rem; }

.breadcrumb { font-size: .875rem; color: hsl(var(--muted-foreground)); margin-bottom: 1.5rem; }
.breadcrumb a { color: hsl(var(--muted-foreground)); }
.breadcrumb a:hover { color: hsl(var(--foreground)); }

h1, h2, h3, h4 { color: hsl(var(--foreground)); line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 1.875rem; font-weight: 700; margin-bottom: .75rem; }
h2 { font-size: 1.25rem; font-weight: 700; margin: 2.5rem 0 1rem; scroll-margin-top: 5rem; }
h3 { font-size: 1.125rem; font-weight: 600; margin: 1.75rem 0 .5rem; }

p { margin-bottom: 1.25rem; color: hsl(var(--foreground) / 0.9); }
ul, ol { margin: 0 0 1.25rem 1.5rem; color: hsl(var(--foreground) / 0.9); }
li { margin-bottom: .5rem; padding-left: .25rem; }
li::marker { color: hsl(var(--muted-foreground)); }
em { color: hsl(var(--foreground)); }

.meta {
  display: flex; flex-wrap: wrap; gap: 1rem;
  font-size: .875rem; color: hsl(var(--muted-foreground)); margin-bottom: 2rem;
}

@media (min-width: 768px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.5rem; }
  body { font-size: 1.0625rem; }
}

/* Tablas */
table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin: 1.5rem 0;
  font-size: .9375rem; line-height: 1.5;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius); overflow: hidden;
}
th, td { padding: .75rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid hsl(var(--border)); }
tr:last-child td { border-bottom: none; }
th {
  background: hsl(var(--muted)); color: hsl(var(--foreground));
  font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
}

/* ---------- Bloques de contenido ---------- */
.tldr, .checklist, .related, .role-block, .cta-inline, .glosario-nav {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Resumen */
.tldr { border-left: 4px solid hsl(var(--primary)); padding: 1.25rem 1.5rem; margin-bottom: 2rem; }
.tldr strong { color: hsl(var(--primary)); }

/* Checklist / aviso */
.checklist { border-left: 4px solid hsl(var(--brand-orange)); padding: 1.25rem 1.5rem; margin: 1.75rem 0; }
.checklist strong { display: block; margin-bottom: .5rem; }
.checklist ul { margin-bottom: 0; }

/* Bloque por rol */
.role-block { padding: 1.5rem; margin: 1.5rem 0; transition: border-color .25s; }
.role-block:hover { border-color: hsl(var(--primary) / 0.5); }
.role-block h3 { margin-top: 0; color: hsl(var(--primary)); }

/* Sigue leyendo */
.related { padding: 1.5rem; margin-top: 3rem; }
.related h3 { margin: 0 0 .75rem; }
.related ul { list-style: none; margin: 0; }
.related li { padding: .625rem 0; margin: 0; border-bottom: 1px solid hsl(var(--border)); }
.related li:last-child { border-bottom: none; }
.related a { font-weight: 500; }

/* CTA compacto */
.cta-inline {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  padding: 1.25rem 1.5rem; margin: 1.75rem 0;
}
.cta-inline p { margin: 0; font-size: .9375rem; }
.cta-inline a {
  display: inline-flex; align-items: center; height: 2.5rem; padding: 0 1rem;
  border-radius: calc(var(--radius) - 2px); background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  font-size: .875rem; font-weight: 600; white-space: nowrap;
}
.cta-inline a:hover { background: hsl(var(--primary) / 0.8); color: hsl(var(--primary-foreground)); text-decoration: none; }

/* CTA grande (= CTA final de la landing) */
.cta-box, .cta-strip, .gate {
  position: relative; overflow: hidden; text-align: center;
  background-color: hsl(var(--surface));
  background-image: var(--hero-glow);
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  padding: 2.5rem 1.5rem; margin: 2.75rem 0;
}
.cta-box h3, .cta-strip h3, .gate h2 { margin: 0 0 .75rem; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.cta-box p, .cta-strip p, .gate p { color: hsl(var(--muted-foreground)); margin: 0 auto 1.5rem; max-width: 36rem; }
.cta-box a, .cta-strip a, .gate a {
  display: inline-flex; align-items: center; justify-content: center;
  height: 3rem; padding: 0 2rem; border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  font-size: 1rem; font-weight: 600;
  box-shadow: 0 1px 0 hsl(218 88% 66% / 0.15), 0 8px 16px -4px hsl(218 88% 50% / 0);
  transition: background-color .15s, box-shadow .25s, transform .15s;
}
.cta-box a:hover, .cta-strip a:hover, .gate a:hover {
  background: hsl(var(--primary) / 0.9); color: hsl(var(--primary-foreground)); text-decoration: none;
  box-shadow: 0 1px 0 hsl(218 88% 70% / 0.25), 0 12px 28px -6px hsl(218 88% 50% / 0.45);
  transform: translateY(-1px);
}
.cta-strip { margin-top: 3.5rem; }
.gate small { display: block; margin-top: 1rem; font-size: .75rem; color: hsl(var(--muted-foreground)); }

/* ---------- Índices: hero + rejilla de tarjetas (= landing) ---------- */
.hero {
  text-align: center; padding: 4.5rem 1.5rem 3.5rem;
  background-image: var(--hero-glow);
  border-bottom: 1px solid hsl(var(--border));
}
.hero h1 { font-size: 2.25rem; font-weight: 900; letter-spacing: -0.03em; margin-bottom: 1rem; }
.hero p { font-size: 1.125rem; color: hsl(var(--muted-foreground)); max-width: 42rem; margin: 0 auto; }
@media (min-width: 768px) { .hero h1 { font-size: 3rem; } }

.text-gradient {
  background: var(--text-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.wrap { max-width: 80rem; margin: 0 auto; padding: 3.5rem 1rem; }
@media (min-width: 768px) { .wrap { padding: 3.5rem 1.5rem; } }
.wrap > h2:first-child { margin-top: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 1.5rem; }

.card {
  display: flex; flex-direction: column;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: 1rem; padding: 1.75rem;
  transition: border-color .25s ease, transform .25s ease;
}
html:not(.light) .card { background: linear-gradient(180deg, hsl(218 28% 9%), hsl(218 28% 6%)); }
.card:hover { border-color: hsl(var(--primary)); transform: translateY(-3px); }
.card-tag {
  display: inline-flex; width: fit-content; align-items: center;
  border-radius: 9999px; padding: .125rem .625rem; margin-bottom: .875rem;
  background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
  font-size: .75rem; font-weight: 600; line-height: 1.25rem;
}
.card h2, .card h3 { font-size: 1.125rem; font-weight: 700; margin: 0 0 .5rem; line-height: 1.35; }
.card h2 a, .card h3 a { color: hsl(var(--foreground)); }
.card h2 a:hover, .card h3 a:hover { color: hsl(var(--primary)); text-decoration: none; }
.card p { color: hsl(var(--muted-foreground)); font-size: .875rem; line-height: 1.55; margin-bottom: 1rem; flex-grow: 1; }
.card-meta { display: flex; flex-wrap: wrap; gap: .875rem; font-size: .75rem; color: hsl(var(--muted-foreground)); margin-bottom: .875rem; }
.card-cta { margin-top: auto; font-size: .875rem; font-weight: 600; color: hsl(var(--primary)); }

/* ---------- Glosario ---------- */
.glosario-nav { padding: 1.25rem 1.5rem; margin: 1.5rem 0; }
.glosario-nav strong { display: block; margin-bottom: .75rem; font-size: .9375rem; }
.glosario-nav .letras { display: flex; flex-wrap: wrap; gap: .5rem; }
.glosario-nav .letras a {
  display: inline-flex; justify-content: center; min-width: 2.25rem; padding: .25rem .75rem;
  border-radius: calc(var(--radius) - 4px); border: 1px solid hsl(var(--border));
  background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
  font-size: .875rem; font-weight: 600;
}
.glosario-nav .letras a:hover { border-color: hsl(var(--primary) / 0.5); color: hsl(var(--primary)); text-decoration: none; }

.termino { padding: 1.25rem 0; border-bottom: 1px solid hsl(var(--border)); scroll-margin-top: 5rem; }
.termino:last-child { border-bottom: none; }
.termino h3 { margin-top: 0; }

/* ---------- Perfiles públicos (plantillas p/, aún sin publicar) ---------- */
.perfil-wrap { max-width: 54rem; margin: 0 auto; padding: 2.5rem 1rem 3.5rem; }
.perfil-card { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 1rem; overflow: hidden; box-shadow: var(--shadow-md); }
.banner { height: 8.75rem; background: linear-gradient(135deg, hsl(218 60% 20%) 0%, hsl(220 88% 32%) 60%, hsl(22 90% 42%) 100%); }
.avatar-row { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 1.375rem; padding: 0 2rem; margin-top: -3.375rem; position: relative; }
.avatar {
  position: relative; flex-shrink: 0; width: 7rem; height: 7rem; border-radius: 50%;
  display: grid; place-items: center; font-size: 2.5rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, hsl(218 88% 62%), hsl(218 88% 45%));
  border: 4px solid hsl(var(--card)); filter: blur(6px);
}
.avatar-lock {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); filter: none;
  width: 3.375rem; height: 3.375rem; border-radius: 50%; display: grid; place-items: center;
  background: hsl(0 0% 0% / 0.6); font-size: 1.625rem;
}
.head-info { flex: 1; min-width: 13.75rem; padding-bottom: .5rem; }
.alias { font-size: 1.625rem; font-weight: 800; letter-spacing: -0.02em; }
.alias-badge {
  display: inline-block; margin-left: .5rem; padding: .125rem .625rem; vertical-align: middle;
  border-radius: 9999px; background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
  font-size: .75rem; font-weight: 600;
}
.subline { color: hsl(var(--muted-foreground)); font-size: .9375rem; margin-top: .25rem; }
.body { padding: 1.625rem 2rem 2rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0 1.625rem; }
.chip {
  padding: .5rem .875rem; border-radius: 9999px; font-size: .8125rem; font-weight: 500;
  background: hsl(var(--secondary)); border: 1px solid hsl(var(--border)); color: hsl(var(--secondary-foreground));
}
.chip.verified::before { content: "✓ "; font-weight: 800; color: hsl(var(--primary)); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .875rem; margin-bottom: 1.75rem; }
.stat { padding: 1rem; border-radius: calc(var(--radius) - 2px); background: hsl(var(--surface-elevated)); border: 1px solid hsl(var(--border)); }
.stat-label { font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: hsl(var(--muted-foreground)); margin-bottom: .5rem; }
.stat-value { font-size: 1.125rem; font-weight: 800; }
.stat-value.blurred { filter: blur(6px); user-select: none; }
.trust { margin-top: 1.75rem; padding: 1.375rem 1.625rem; border-radius: var(--radius); background: hsl(var(--surface-elevated)); border: 1px solid hsl(var(--border)); }
.trust h3 { margin: 0 0 .75rem; font-size: 1rem; }
.trust ul { list-style: none; margin: 0; }
.trust li { display: flex; align-items: center; gap: .5rem; padding: .375rem 0; margin: 0; font-size: .875rem; }

/* ---------- Móvil ---------- */
@media (max-width: 720px) {
  article { padding: 2rem 1rem 2.75rem; }
  .hero { padding: 3.25rem 1.25rem 2.75rem; }
  .hero p { font-size: 1rem; }
  .cta-box, .cta-strip, .gate { padding: 1.75rem 1.25rem; }
  .cta-box h3, .cta-strip h3 { font-size: 1.3125rem; }
  .avatar-row { padding: 0 1.25rem; }
  .body { padding: 1.375rem 1.25rem; }
}
