/* ============================================================
   Kynex Trade — Blog · estilos (consistentes con el sitio)
   Reusa los design tokens de la web principal (oklch).
   ============================================================ */
:root {
  --bg:           oklch(10% 0.012 235);
  --bg-deep:      oklch(7%  0.010 235);
  --surface:      oklch(14% 0.014 235);
  --surface-2:    oklch(17% 0.014 235);
  --fg:           oklch(96% 0.004 235);
  --fg-dim:       oklch(88% 0.008 235);
  --muted:        oklch(72% 0.012 235);
  --border:       oklch(22% 0.014 235);
  --border-soft:  oklch(18% 0.014 235);
  --accent:       oklch(74% 0.17 145);
  --accent-dim:   oklch(74% 0.17 145 / 0.14);
  --gold:         oklch(80% 0.10 80);
  --font-display: 'Inter Tight','Inter',-apple-system,BlinkMacSystemFont,system-ui,sans-serif;
  --font-body:    'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',system-ui,sans-serif;
  --font-mono:    'JetBrains Mono','IBM Plex Mono',ui-monospace,Menlo,Consolas,monospace;
  --maxw: 1100px;
  --gutter: clamp(20px,4vw,48px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
[data-en] { } /* el JS conmuta el texto via data-es/data-en */

/* ─── NAV ─── */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--gutter);
  background: oklch(8% 0.012 235 / 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-brand img { width: 34px; height: 34px; }
.nav-brand-mark { display: flex; flex-direction: column; line-height: 1; }
.nav-brand-mark b { font-family: var(--font-display); font-weight: 700; letter-spacing: 1px; font-size: 15px; color: var(--fg); }
.nav-brand-mark small { font-family: var(--font-mono); font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--fg-dim); font-size: 14px; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.lang-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.lang-toggle button { background: transparent; color: var(--muted); border: 0; padding: 5px 9px; font-family: var(--font-mono); font-size: 11px; cursor: pointer; }
.lang-toggle button.active { background: var(--accent-dim); color: var(--accent); }
.btn { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; padding: 9px 16px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--accent); color: oklch(14% 0.03 235); }
.btn-primary:hover { text-decoration: none; filter: brightness(1.08); }
.btn-ghost { border-color: var(--border-strong,var(--border)); color: var(--fg); }

/* ─── Blog header ─── */
.blog-head { padding: 64px 0 32px; border-bottom: 1px solid var(--border-soft); }
.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.blog-head h1 { font-family: var(--font-display); font-size: clamp(30px,5vw,46px); font-weight: 700; line-height: 1.1; letter-spacing: -.5px; }
.blog-head p { color: var(--muted); margin-top: 14px; max-width: 60ch; }

/* ─── Post grid (index) ─── */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(320px,1fr)); gap: 22px; padding: 40px 0 72px; }
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; transition: border-color .2s, transform .2s; }
.post-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.post-card .tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.post-card h2 { font-family: var(--font-display); font-size: 21px; line-height: 1.25; margin-bottom: 10px; color: var(--fg); }
.post-card p { color: var(--muted); font-size: 14px; flex: 1; }
.post-card .read { margin-top: 16px; font-size: 13px; color: var(--accent); font-family: var(--font-mono); }

/* ─── Featured post ─── */
.featured { display: grid; grid-template-columns: 1.05fr 1fr; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin: 40px 0 8px; transition: border-color .2s, transform .2s; }
.featured:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.featured-media { background: var(--bg-deep); min-height: 280px; overflow: hidden; }
.featured-media img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; }
.featured-body { padding: clamp(24px,3vw,38px); display: flex; flex-direction: column; justify-content: center; }
.chip { display: inline-block; align-self: flex-start; font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px; margin-bottom: 16px; }
.featured-body h2 { font-family: var(--font-display); font-size: clamp(22px,3vw,31px); line-height: 1.15; color: var(--fg); margin-bottom: 12px; letter-spacing: -.3px; }
.featured-body p { color: var(--muted); font-size: 15px; margin-bottom: 20px; }
.featured-body .read { font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.section-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 48px 0 -8px; }
@media (max-width: 760px) { .featured { grid-template-columns: 1fr; } .featured-media { min-height: 200px; } }

/* ─── Article (prose) ─── */
.article { padding: 56px 0 72px; }
.article-wrap { max-width: 760px; margin: 0 auto; }
.article .meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.article h1 { font-family: var(--font-display); font-size: clamp(28px,4.5vw,42px); line-height: 1.12; letter-spacing: -.5px; margin-bottom: 22px; }
.prose { color: var(--fg-dim); font-size: 17px; }
.prose > * + * { margin-top: 20px; }
.prose h2 { font-family: var(--font-display); color: var(--fg); font-size: 26px; margin-top: 44px; line-height: 1.2; }
.prose h3 { font-family: var(--font-display); color: var(--fg); font-size: 20px; margin-top: 32px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 8px; }
.prose strong { color: var(--fg); }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote { border-left: 3px solid var(--gold); padding: 6px 18px; color: var(--muted); background: var(--surface); border-radius: 0 8px 8px 0; }
.prose code { font-family: var(--font-mono); font-size: .9em; background: var(--surface-2); padding: 2px 6px; border-radius: 4px; color: var(--accent); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; }
.prose th { background: var(--surface); color: var(--accent); font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.prose figure { margin: 30px 0; }
.prose figure img { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.prose img { border-radius: 8px; }
.prose figcaption { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 10px; text-align: center; }
.article-cta { margin-top: 48px; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; }
.article-cta h3 { font-family: var(--font-display); font-size: 20px; margin-bottom: 8px; color: var(--fg); }
.article-cta p { color: var(--muted); font-size: 14px; margin-bottom: 16px; }

/* ─── Footer ─── */
.footer { border-top: 1px solid var(--border-soft); padding: 48px 0 36px; background: var(--bg-deep); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-brand img { width: 40px; margin-bottom: 12px; }
.footer-brand p { color: var(--muted); font-size: 14px; max-width: 36ch; }
.footer-col h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--fg); margin-bottom: 14px; }
.footer-col a, .footer-col span { display: block; color: var(--muted); font-size: 14px; margin-bottom: 9px; }
.footer-col a:hover { color: var(--accent); text-decoration: none; }
.footer-gold { color: var(--gold) !important; }
.footer-legal { border-top: 1px solid var(--border-soft); margin-top: 36px; padding-top: 20px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
}
