/* ══════════════════════════════════════════════════════════════════
   AlgoritmoIADigital Pro 4 — global.css
   Base del tema: fondo, tipografía, páginas genéricas, blog, 404,
   shortcodes [aid_btn] [aid_pill] [aid_stat] y clases de WordPress.
══════════════════════════════════════════════════════════════════ */
html { scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
body.aid-site {
  margin: 0; background: #060c18; color: #f0f4ff;
  font-family: 'Manrope', system-ui, sans-serif; font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
body.aid-site ::selection { background: rgba(0,212,200,.3); color: #fff; }
body.aid-site img { max-width: 100%; height: auto; }
body.aid-site { scrollbar-color: rgba(0,212,200,.35) #060c18; }
body.aid-site::-webkit-scrollbar { width: 10px; }
body.aid-site::-webkit-scrollbar-track { background: #060c18; }
body.aid-site::-webkit-scrollbar-thumb { background: linear-gradient(#1a8cff, #00d4c8); border-radius: 10px; border: 3px solid #060c18; }

/* Fondo de rejilla y halos para las plantillas genéricas */
.aidx-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.aidx-bg::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(0,212,200,.022) 1px, transparent 1px), linear-gradient(90deg, rgba(0,212,200,.022) 1px, transparent 1px);
  background-size: 44px 44px;
}
.aidx-bg::after {
  content: ''; position: absolute; top: -20%; left: -10%; width: 60%; height: 70%;
  background: radial-gradient(ellipse, rgba(26,140,255,.08), transparent 65%);
}

/* ── Contenedores ── */
.aidx-wrap { position: relative; z-index: 1; max-width: 1160px; margin: 0 auto; padding: 0 28px; }
.aidx-narrow { max-width: 820px; }

/* ── Cabecera de página genérica ── */
.aidx-page-hero { position: relative; z-index: 1; padding: 56px 0 40px; }
.aidx-kicker {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; margin-bottom: 20px; border-radius: 999px;
  border: 1px solid rgba(0,212,200,.2); background: rgba(0,212,200,.07);
  font: 600 .64rem 'JetBrains Mono', monospace; letter-spacing: .14em; text-transform: uppercase; color: #00d4c8;
}
.aidx-kicker i { width: 7px; height: 7px; border-radius: 50%; background: #00d4c8; box-shadow: 0 0 8px #00d4c8; }
.aidx-page-title {
  margin: 0 0 14px; font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 900; line-height: 1.08; letter-spacing: -.035em; color: #f0f4ff;
}
.aidx-grad { background: linear-gradient(90deg, #00d4c8, #1a8cff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.aidx-page-sub { margin: 0; font-size: 1.05rem; color: #6a7d9e; max-width: 640px; }
.aidx-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; font: 600 .64rem 'JetBrains Mono', monospace; letter-spacing: .08em; color: #6a7d9e; text-transform: uppercase; }
.aidx-divider { height: 1px; margin: 0; background: linear-gradient(90deg, transparent, rgba(0,212,200,.25), transparent); }

/* ── Contenido (editor de WordPress) ── */
.aidx-prose { position: relative; z-index: 1; padding: 40px 0 96px; color: #a9b7d0; font-size: 1.02rem; line-height: 1.85; }
.aidx-prose > * { margin-top: 0; margin-bottom: 1.2em; }
.aidx-prose h2, .aidx-prose h3, .aidx-prose h4 { color: #f0f4ff; font-weight: 900; letter-spacing: -.02em; line-height: 1.2; margin-top: 1.8em; margin-bottom: .6em; }
.aidx-prose h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.aidx-prose h3 { font-size: 1.3rem; }
.aidx-prose strong { color: #f0f4ff; }
.aidx-prose a { color: #00d4c8; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(0,212,200,.4); transition: color .2s, text-decoration-color .2s; }
.aidx-prose a:hover { color: #f0f4ff; text-decoration-color: #00d4c8; }
.aidx-prose ul, .aidx-prose ol { padding-left: 1.3em; }
.aidx-prose li { margin-bottom: .4em; }
.aidx-prose li::marker { color: #00d4c8; }
.aidx-prose blockquote {
  margin: 1.6em 0; padding: 18px 22px; border-left: 3px solid #00d4c8; border-radius: 0 12px 12px 0;
  background: rgba(0,212,200,.05); color: #c8d4e8; font-style: italic;
}
.aidx-prose code { font-family: 'JetBrains Mono', monospace; font-size: .88em; padding: 2px 7px; border-radius: 6px; background: rgba(0,212,200,.08); color: #00d4c8; }
.aidx-prose pre { padding: 18px; border-radius: 12px; background: #0b1526; border: 1px solid rgba(255,255,255,.07); overflow-x: auto; }
.aidx-prose pre code { background: none; padding: 0; color: #c8d4e8; }
.aidx-prose img, .aidx-prose figure img { border-radius: 14px; }
.aidx-prose table { width: 100%; border-collapse: collapse; border: 1px solid rgba(255,255,255,.07); border-radius: 12px; overflow: hidden; }
.aidx-prose th { background: rgba(0,212,200,.07); color: #00d4c8; font: 600 .68rem 'JetBrains Mono', monospace; letter-spacing: .1em; text-transform: uppercase; text-align: left; }
.aidx-prose th, .aidx-prose td { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.05); }
.aidx-prose hr { border: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(0,212,200,.3), transparent); margin: 2.4em 0; }

/* Páginas hechas con Elementor: ancho completo, sin cabecera de página */
.aidx-builder { position: relative; z-index: 1; }

/* ── Blog: tarjetas ── */
.aidx-posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 16px 0 96px; position: relative; z-index: 1; }
.aidx-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: 18px;
  background: linear-gradient(180deg, rgba(15,29,53,.78), rgba(11,21,38,.92));
  border: 1px solid rgba(255,255,255,.07); box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 12px 32px rgba(0,0,0,.28);
  transition: transform .4s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .3s;
  color: inherit; text-decoration: none;
}
.aidx-card:hover { transform: translateY(-5px); border-color: rgba(0,212,200,.3); box-shadow: 0 24px 60px rgba(0,0,0,.45), 0 0 0 1px rgba(0,212,200,.1); }
.aidx-card-img { aspect-ratio: 16 / 9; overflow: hidden; background: radial-gradient(120% 120% at 30% 0%, rgba(0,212,200,.18), transparent 55%), linear-gradient(160deg, #0f1d35, #060c18); }
.aidx-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.aidx-card:hover .aidx-card-img img { transform: scale(1.05); }
.aidx-card-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.aidx-card-date { font: 600 .6rem 'JetBrains Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: #00d4c8; }
.aidx-card-title { margin: 0; font-size: 1.08rem; font-weight: 800; line-height: 1.3; color: #f0f4ff; }
.aidx-card-ex { margin: 0; font-size: .86rem; color: #6a7d9e; line-height: 1.7; }
.aidx-card-more { margin-top: auto; font-size: .8rem; font-weight: 800; color: #00d4c8; }
.aidx-pagination { display: flex; justify-content: center; gap: 8px; padding-bottom: 96px; position: relative; z-index: 1; }
.aidx-pagination .page-numbers {
  min-width: 42px; height: 42px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 11px;
  border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); color: #b0bdd8; font-weight: 700; text-decoration: none;
}
.aidx-pagination .page-numbers.current, .aidx-pagination a.page-numbers:hover { border-color: rgba(0,212,200,.45); color: #fff; background: rgba(0,212,200,.1); }
.aidx-empty { padding: 40px 0 96px; color: #6a7d9e; position: relative; z-index: 1; }

/* ── 404 ── */
.aidx-404 { position: relative; z-index: 1; min-height: 70vh; display: flex; align-items: center; text-align: center; }
.aidx-404-code {
  font-size: clamp(7rem, 24vw, 15rem); font-weight: 900; line-height: .9; letter-spacing: -.06em; margin: 0 0 8px;
  background: linear-gradient(90deg, #00d4c8, #1a8cff, #00d4c8); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: aidx-g404 5s linear infinite; filter: drop-shadow(0 0 40px rgba(0,212,200,.25));
}
@keyframes aidx-g404 { to { background-position: 200% 50%; } }
.aidx-404 h1 { margin: 0 0 12px; font-size: clamp(1.5rem, 3.5vw, 2.2rem); font-weight: 900; letter-spacing: -.02em; }
.aidx-404 p { margin: 0 auto 32px; max-width: 480px; color: #6a7d9e; }
.aidx-btns { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ── Shortcodes [aid_btn] [aid_pill] [aid_stat] ── */
.aid-btn, .aid-btn-ghost {
  display: inline-flex; align-items: center; gap: 9px; padding: 13px 28px; border-radius: 12px;
  font-family: 'Manrope', sans-serif; font-size: .86rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; text-decoration: none;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s, filter .25s, border-color .25s, color .25s, background .25s;
}
.aid-btn { background: linear-gradient(135deg, #1a8cff, #00d4c8); color: #fff !important; box-shadow: 0 8px 28px rgba(0,180,220,.4); }
.aid-btn:hover { transform: translateY(-2px); filter: brightness(1.1); box-shadow: 0 12px 40px rgba(0,180,220,.55); }
.aid-btn-ghost { border: 1px solid rgba(0,212,200,.3); color: #b0bdd8 !important; text-transform: none; letter-spacing: 0; font-weight: 700; }
.aid-btn-ghost:hover { border-color: rgba(0,212,200,.6); color: #fff !important; background: rgba(0,212,200,.07); }
.aid-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(0,212,200,.2); background: rgba(0,212,200,.07); }
.aid-pill-dot { width: 7px; height: 7px; border-radius: 50%; background: #00d4c8; box-shadow: 0 0 8px #00d4c8; }
.aid-pill span:last-child { font: 600 .64rem 'JetBrains Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: #00d4c8; }
.aid-stat { display: inline-block; padding: 20px 24px; border-radius: 16px; background: #0b1526; border: 1px solid rgba(0,212,200,.15); text-align: center; }
.aid-stat-val { font-size: 2.2rem; font-weight: 900; letter-spacing: -.04em; line-height: 1; background: linear-gradient(90deg, #00d4c8, #1a8cff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.aid-stat-lbl { margin-top: 6px; font-size: .8rem; color: #6a7d9e; }

/* ── Clases de WordPress ── */
.alignleft { float: left; margin: .3em 1.4em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.4em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption-text, figcaption { font-size: .8rem; color: #6a7d9e; text-align: center; margin-top: 8px; }

/* ── Aparición suave (plantillas genéricas) ── */
.aidx-js .aidx-reveal { opacity: 0; transform: translateY(24px); filter: blur(6px); transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .8s cubic-bezier(.2,.8,.2,1), filter .8s; transition-delay: var(--d, 0s); }
.aidx-js .aidx-reveal.is-in { opacity: 1; transform: none; filter: none; }

@media (max-width: 980px) { .aidx-posts { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) {
  .aidx-wrap { padding: 0 20px; }
  .aidx-posts { grid-template-columns: 1fr; }
  .aidx-page-hero { padding: 36px 0 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .aidx-js .aidx-reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .aidx-404-code { animation: none; }
}
