/* ═══════════════════════════════════════════════
   InnovaVeo — Estilos del Blog
   Compartido por /blog/ y por cada artículo.
   Mismos colores, tipografías y estilo que la landing.
   ═══════════════════════════════════════════════ */

:root {
  --accent:      #3666F1;
  --accent-lt:   #7294F5;
  --accent-dk:   #294DB5;
  --accent-rgb:  54,102,241;
  --lime:        #06B6D4;
  --lime-rgb:    6,182,212;
  --bg:          #080809;
  --bg2:         #0E0E10;
  --card:        #101013;
  --text:        #F2F2F0;
  --text-dim:    #D4D4E0;
  --text-muted:  #A8A8BC;
  --border:      rgba(255,255,255,0.055);
  --border-md:   rgba(255,255,255,0.10);
  --font-head: 'Bricolage Grotesque', sans-serif;
  --font-body: 'Geist', -apple-system, sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; max-width: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ''; position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.038'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 1; opacity: .55;
}
.grid-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(54,102,241,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(54,102,241,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
}

h1, h2 { font-family: var(--font-head); font-weight: 700; line-height: 1.08; letter-spacing: -0.03em; }
h3 { font-family: var(--font-body); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
p  { color: #D0D0DC; line-height: 1.8; font-size: 1.02rem; }
a  { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 28px; }
.text-accent { color: var(--accent-lt); }
.text-gradient {
  background: linear-gradient(125deg, var(--accent-lt) 0%, #DCE6FF 60%, var(--lime) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* BOTONES */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px; border-radius: 60px;
  font-family: var(--font-body); font-size: .9rem; font-weight: 500;
  cursor: pointer; border: none; transition: all .3s var(--ease);
  white-space: nowrap; letter-spacing: -0.01em;
}
.btn-lime { background: var(--lime); color: #0a0a0c; font-weight: 600; }
.btn-lime:hover { transform: translateY(-3px); box-shadow: 0 10px 40px rgba(var(--lime-rgb),.25); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border-md); }
.btn-ghost:hover { border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.04); transform: translateY(-3px); }

.section-label {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .8rem; font-weight: 500; letter-spacing: .16em;
  text-transform: uppercase; color: #C0C0D0; margin-bottom: 20px;
}
.section-label::before { content: ''; width: 28px; height: 1px; background: linear-gradient(90deg, var(--accent-lt), transparent); }

/* NAV (igual que la landing) */
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 14px 0; background: rgba(8,8,9,.9); backdrop-filter: blur(24px) saturate(200%); -webkit-backdrop-filter: blur(24px) saturate(200%); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; }
.nav-logo img { height: 60px; width: auto; max-width: 260px; }
.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-link { font-size: .88rem; color: #C8C8D8; transition: color .22s; letter-spacing: -.01em; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--text); }
.nav-cta { margin-left: 20px; }
.nav-cta .btn { padding: 10px 22px; font-size: .84rem; }

main { position: relative; z-index: 2; padding-top: 88px; }

/* CABECERA DEL BLOG */
.blog-hero { padding: 100px 0 64px; position: relative; overflow: hidden; }
.blog-hero::before {
  content: ''; position: absolute; width: 640px; height: 520px; border-radius: 50%;
  background: rgba(var(--accent-rgb),.09); filter: blur(120px);
  top: -30%; right: -10%; pointer-events: none;
}
.blog-hero .container { position: relative; }
.blog-hero h1 { font-size: clamp(2.6rem, 5.5vw, 4.4rem); margin-bottom: 24px; max-width: 820px; }
.blog-hero .intro { font-size: 1.08rem; max-width: 620px; font-weight: 300; color: #CECEDA; }

/* LISTADO DE ARTÍCULOS */
.blog-list { padding: 0 0 120px; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
/* Sin artículos: se oculta la rejilla. Con al menos uno: se oculta el mensaje vacío. */
.post-grid:not(:has(.post-card)) { display: none; }
.post-grid:has(.post-card) + .blog-empty { display: none; }

.post-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  overflow: hidden; transition: all .3s var(--ease); display: flex; flex-direction: column;
}
.post-card:hover { border-color: rgba(var(--accent-rgb),.3); transform: translateY(-4px); }
.post-card img { aspect-ratio: 16/9; object-fit: cover; width: 100%; background: var(--bg2); }
.post-card-body { padding: 24px 24px 28px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-cat { font-size: .74rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--lime); }
.post-card h2 { font-family: var(--font-body); font-size: 1.12rem; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; }
.post-card p { font-size: .9rem; line-height: 1.7; color: #C8C8D8; }
.post-meta { font-size: .8rem; color: var(--text-muted); margin-top: auto; }

/* ESTADO VACÍO */
.blog-empty {
  position: relative; border: 1px solid var(--border-md); border-radius: 22px;
  background: linear-gradient(160deg, rgba(var(--accent-rgb),.07) 0%, var(--card) 55%);
  padding: 64px 40px; text-align: center; overflow: hidden;
}
.blog-empty-icon {
  width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 26px;
  background: rgba(var(--lime-rgb),.1); border: 1px solid rgba(var(--lime-rgb),.25);
  display: flex; align-items: center; justify-content: center;
}
.blog-empty-icon svg { width: 28px; height: 28px; stroke: var(--lime); fill: none; stroke-width: 1.6; }
.blog-empty h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); max-width: 640px; margin: 0 auto 16px; }
.blog-empty p { max-width: 520px; margin: 0 auto 34px; }
.blog-empty-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.dots { display: inline-flex; gap: 6px; margin-bottom: 22px; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-lt); animation: pulse 1.6s ease-in-out infinite; }
.dots span:nth-child(2) { animation-delay: .2s; background: #9DB5F8; }
.dots span:nth-child(3) { animation-delay: .4s; background: var(--lime); }
@keyframes pulse { 0%,100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* ARTÍCULO */
.breadcrumb { font-size: .84rem; color: var(--text-muted); margin-bottom: 26px; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.breadcrumb li + li::before { content: '›'; margin-right: 8px; opacity: .6; }
.breadcrumb a:hover { color: var(--text); }
.article { padding: 80px 0 100px; }
.article-wrap { max-width: 760px; margin: 0 auto; }
.article-header h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); margin: 10px 0 20px; }
.article-meta { font-size: .86rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.article-cover { margin: 40px 0; border-radius: 18px; overflow: hidden; border: 1px solid var(--border); }
.article-cover img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.article-cover figcaption { font-size: .8rem; color: var(--text-muted); padding: 10px 14px; }
.article-body h2 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); margin: 48px 0 16px; }
.article-body h3 { font-size: 1.15rem; margin: 32px 0 12px; }
.article-body p { margin-bottom: 20px; font-size: 1.06rem; }
.article-body ul, .article-body ol { margin: 0 0 22px 22px; color: #D0D0DC; line-height: 1.8; }
.article-body a { color: var(--accent-lt); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { color: var(--lime); }
.article-body img { border-radius: 14px; margin: 28px 0; }
.related { margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--border); }
.related h2 { font-size: 1.4rem; margin-bottom: 18px; }
.related ul { list-style: none; display: grid; gap: 10px; }
.related a { color: var(--accent-lt); }
.related a:hover { color: var(--lime); }
.article-cta { margin-top: 56px; padding: 40px; border-radius: 20px; border: 1px solid var(--border-md); background: linear-gradient(160deg, rgba(var(--accent-rgb),.08), var(--card) 60%); text-align: center; }
.article-cta h2 { font-size: 1.6rem; margin-bottom: 12px; }
.article-cta p { margin-bottom: 26px; }

/* FOOTER */
footer { padding: 44px 0; border-top: 1px solid var(--border); position: relative; z-index: 2; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.footer-logo img { height: 26px; width: auto; }
.footer-links { display: flex; gap: 28px; flex-wrap: wrap; }
.footer-links a { font-size: .88rem; color: #C8C8D8; transition: color .2s; }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: .82rem; color: #888898; }

/* ENTRADA SUAVE (solo CSS, sin JavaScript) */
.fade { animation: fadeUp .8s var(--ease) both; }
.fade.d1 { animation-delay: .08s; } .fade.d2 { animation-delay: .16s; } .fade.d3 { animation-delay: .24s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade, .dots span { animation: none; } }

/* RESPONSIVE */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-logo img { height: 50px; max-width: 220px; }
  main { padding-top: 78px; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .nav-logo img { height: 44px; max-width: 190px; }
  .nav-cta { margin-left: 12px; }
  main { padding-top: 72px; }
  .blog-hero { padding: 64px 0 44px; }
  .blog-list { padding-bottom: 80px; }
  .post-grid { grid-template-columns: 1fr; }
  .blog-empty { padding: 48px 22px; }
  .article { padding: 56px 0 72px; }
  .article-cta { padding: 30px 20px; }
}
