/*
Theme Name: New-IA Dark
Template: astra
Version: 1.0
*/

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:         #030712;
    --bg-card:    rgba(255,255,255,0.02);
    --border:     rgba(255,255,255,0.06);
    --brand:      #4f46e5;
    --brand-hover:#4338ca;
    --brand-light:#818cf8;
    --text:       #f9fafb;
    --muted:      #9ca3af;
    --muted2:     #6b7280;
    --font:       'Inter', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg) !important;
    color: var(--text) !important;
    font-family: var(--font) !important;
    font-size: 16px !important;
    line-height: 1.7;
}

/* ── Hide Astra elements we replace ── */
.site-header,
.ast-masthead-custom-menu-items,
#ast-mobile-header,
.site-footer,
.ast-footer-overlay { display: none !important; }

/* ── Navbar ── */
#newia-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(3,7,18,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
#newia-nav .nav-inner {
    max-width: 1152px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
#newia-nav .nav-logo {
    display: flex; align-items: center; gap: 0.5rem;
    text-decoration: none;
}
#newia-nav .nav-logo .logo-icon {
    width: 2rem; height: 2rem;
    background: var(--brand);
    border-radius: 0.5rem;
    display: flex; align-items: center; justify-content: center;
}
#newia-nav .nav-logo span {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}
#newia-nav .nav-logo span em { color: var(--brand-light); font-style: normal; }
#newia-nav .nav-links {
    display: flex; gap: 2rem;
    list-style: none;
    align-items: center;
}
#newia-nav .nav-links a {
    color: var(--muted); font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s;
    line-height: 1;
}
#newia-nav .nav-links a:hover,
#newia-nav .nav-links a.active { color: var(--text); }
#newia-nav .nav-cta {
    display: inline-flex; align-items: center; gap: 0.4rem;
    line-height: 1;
    background: var(--brand);
    color: #fff !important;
    font-size: 0.875rem; font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: background 0.2s;
}
#newia-nav .nav-cta:hover { background: var(--brand-hover); }

/* ── Layout principal ── */
.site-content,
#content.site-content {
    padding-top: 5rem !important;
    background: var(--bg) !important;
}
.ast-container,
.container,
.entry-content-wrap,
#primary { max-width: 1152px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Hero del blog ── */
#newia-blog-hero {
    background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.1) 0%, transparent 70%);
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.1) 0%, transparent 70%),
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: auto, 60px 60px, 60px 60px;
    padding: 5rem 1.5rem 4rem;
    text-align: center;
}
#newia-blog-hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem) !important;
    font-weight: 800 !important;
    color: var(--text) !important;
    letter-spacing: -0.03em;
    line-height: 1.15 !important;
    margin-bottom: 1rem !important;
}
#newia-blog-hero h1 .gt {
    background: linear-gradient(135deg, #818cf8, #a78bfa, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
#newia-blog-hero p {
    color: var(--muted) !important;
    font-size: 1.125rem !important;
    max-width: 36rem; margin: 0 auto;
}

/* ── Post cards ── */
.ast-archive-post,
.ast-article-post,
article.post,
.blog article {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: 1rem !important;
    overflow: hidden;
    transition: box-shadow 0.3s, border-color 0.3s !important;
    margin-bottom: 1.5rem !important;
}
.ast-archive-post:hover,
article.post:hover {
    border-color: rgba(99,102,241,0.25) !important;
    box-shadow: 0 0 30px rgba(99,102,241,0.1) !important;
}

/* Thumbnail */
.ast-archive-post .post-thumb img,
article .post-thumb img,
.ast-archive-post .wp-post-image,
.entry-content img.wp-post-image {
    width: 100%; aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 0 !important;
}

/* Post meta & title */
.ast-archive-post .ast-blog-featured-section { padding: 1.5rem !important; }
.entry-header, .ast-archive-post .entry-header { padding: 1.5rem 1.5rem 0 !important; }

.entry-title a,
.ast-archive-post .entry-title a {
    color: var(--text) !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    line-height: 1.35 !important;
    transition: color 0.2s !important;
}
.entry-title a:hover,
.ast-archive-post .entry-title a:hover { color: var(--brand-light) !important; }

.entry-meta,
.ast-blog-single-element.ast-meta { color: var(--muted2) !important; font-size: 0.8rem !important; }
.entry-meta a { color: var(--muted2) !important; }

.entry-summary p,
.ast-excerpt { color: var(--muted) !important; font-size: 0.9375rem !important; line-height: 1.65 !important; }

/* Read more */
.ast-archive-post .ast-read-more,
.more-link,
a.read-more {
    display: inline-flex; align-items: center; gap: 0.35rem;
    background: transparent !important;
    color: var(--brand-light) !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    padding: 0 !important;
    margin-top: 0.75rem;
    transition: gap 0.2s !important;
}
.ast-archive-post .ast-read-more:hover,
a.read-more:hover { gap: 0.6rem !important; }

/* Categories badge */
.ast-archive-post .ast-terms-badges a,
.cat-links a {
    background: rgba(99,102,241,0.12) !important;
    color: var(--brand-light) !important;
    border: 1px solid rgba(99,102,241,0.2) !important;
    border-radius: 9999px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    padding: 0.2rem 0.65rem !important;
    text-decoration: none !important;
    letter-spacing: 0.02em !important;
}

/* ── Post individual ── */
.single .entry-content {
    color: var(--text) !important;
    font-size: 1.0625rem !important;
    line-height: 1.8 !important;
    max-width: 42rem;
    margin: 2rem auto !important;
}
.single .entry-title {
    color: var(--text) !important;
    font-size: clamp(1.75rem, 4vw, 2.75rem) !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em;
    line-height: 1.2 !important;
    max-width: 42rem;
    margin: 2rem auto 1rem !important;
}
.single .entry-content h2 {
    color: var(--text) !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    margin: 2.5rem 0 1rem !important;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.single .entry-content h3 {
    color: var(--text) !important;
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    margin: 2rem 0 0.75rem !important;
}
.single .entry-content p { color: #d1d5db !important; }
.single .entry-content a { color: var(--brand-light) !important; }
.single .entry-content a:hover { color: #fff !important; }
.single .entry-content ul,
.single .entry-content ol { color: #d1d5db !important; padding-left: 1.5rem !important; }
.single .entry-content blockquote {
    border-left: 3px solid var(--brand) !important;
    background: rgba(99,102,241,0.06) !important;
    border-radius: 0 0.5rem 0.5rem 0 !important;
    padding: 1rem 1.5rem !important;
    margin: 1.5rem 0 !important;
    color: #d1d5db !important;
}
.single .entry-content code {
    background: rgba(255,255,255,0.08) !important;
    color: #c4b5fd !important;
    font-size: 0.875em !important;
    padding: 0.15em 0.4em !important;
    border-radius: 0.25rem !important;
}
.single .entry-content pre {
    background: rgba(255,255,255,0.04) !important;
    border: 1px solid var(--border) !important;
    border-radius: 0.75rem !important;
    padding: 1.5rem !important;
    overflow-x: auto;
    margin: 1.5rem 0 !important;
}

/* Featured image post individual */
.single .ast-single-post-featured {
    max-width: 860px;
    margin: 2rem auto !important;
    border-radius: 1rem !important;
    overflow: hidden;
}
.single .ast-single-post-featured img {
    width: 100%; border-radius: 1rem !important;
}

/* ── Sidebar ── */
#secondary, .widget-area {
    background: transparent !important;
}
.widget {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: 1rem !important;
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}
.widget-title {
    color: var(--text) !important;
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem !important;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.widget a { color: var(--muted) !important; }
.widget a:hover { color: var(--text) !important; }
.widget li { border-bottom: 1px solid var(--border) !important; padding: 0.4rem 0 !important; }

/* ── Paginación ── */
ul.page-numbers {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    justify-content: center !important;
    align-items: center !important;
}
ul.page-numbers li {
    padding: 0 !important;
    border: none !important;
}
.page-numbers {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    color: var(--muted) !important;
    border-radius: 0.5rem !important;
    padding: 0.4rem 0.75rem !important;
    text-decoration: none !important;
}
.page-numbers.current,
.page-numbers:hover {
    background: var(--brand) !important;
    color: #fff !important;
    border-color: var(--brand) !important;
}

/* ── Comments ── */
#comments { background: transparent !important; }
.comment-list .comment-body {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: 0.75rem !important;
    padding: 1.25rem !important;
    margin-bottom: 1rem !important;
}
.comment-author .fn { color: var(--text) !important; }
.comment-meta a,
.comment-metadata a { color: var(--muted2) !important; font-size: 0.8rem !important; }
.comment-content p { color: #d1d5db !important; }

/* ── Footer del blog ── */
#newia-footer {
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    margin-top: 4rem;
    background: var(--bg);
}
#newia-footer .footer-inner {
    max-width: 1152px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}
#newia-footer .footer-brand span { font-weight: 700; font-size: 1.125rem; color: var(--text); }
#newia-footer .footer-brand span em { color: var(--brand-light); font-style: normal; }
#newia-footer .footer-brand p { color: var(--muted2); font-size: 0.875rem; margin-top: 0.25rem; }
#newia-footer .footer-brand p a { color: var(--muted2); text-decoration: none; }
#newia-footer .footer-brand p a:hover { color: var(--text); }
#newia-footer .footer-links { display: flex; gap: 1.5rem; }
#newia-footer .footer-links a { color: var(--muted2); font-size: 0.875rem; text-decoration: none; }
#newia-footer .footer-links a:hover { color: var(--text); }
#newia-footer .footer-copy { color: #374151; font-size: 0.8rem; }

/* ── Inputs / forms ── */
input, textarea, select {
    background: rgba(255,255,255,0.04) !important;
    border: 1px solid var(--border) !important;
    border-radius: 0.75rem !important;
    color: var(--text) !important;
    padding: 0.75rem 1rem !important;
    font-size: 1rem !important;
    font-family: var(--font) !important;
    transition: border-color 0.2s !important;
    width: 100%;
}
input:focus, textarea:focus {
    border-color: var(--brand) !important;
    outline: none !important;
}
input::placeholder, textarea::placeholder { color: #4b5563 !important; }
input[type="submit"],
button[type="submit"],
.wp-block-button__link {
    background: var(--brand) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.2s, transform 0.15s !important;
    width: auto !important;
}
input[type="submit"]:hover,
button[type="submit"]:hover { background: var(--brand-hover) !important; transform: scale(1.02) !important; }

/* ── Tablas ── */
table {
    width: 100% !important;
    border-collapse: collapse !important;
    border-radius: 0.75rem !important;
    overflow: hidden;
    margin: 1.5rem 0 !important;
}
thead th {
    background: #111827 !important;
    color: #fff !important;
    font-weight: 700 !important;
    padding: 0.75rem 1rem !important;
    text-align: left !important;
}
tbody tr:nth-child(odd)  td { background: rgba(255,255,255,0.02) !important; }
tbody tr:nth-child(even) td { background: rgba(255,255,255,0.05) !important; }
td { padding: 0.65rem 1rem !important; color: #d1d5db !important; border-bottom: 1px solid var(--border) !important; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4b5563; }

/* ── Responsive ── */


@media (max-width: 768px) {
    #newia-nav .nav-links,
    #newia-nav .nav-cta { display: none; }
    #newia-blog-hero { padding: 4rem 1.25rem 2.5rem; }
}


/* ================================================================
   DARK MODE OVERRIDES — contenido generado por API (estilos inline)
   Los articulos vienen con colores para fondo blanco; los invertimos
   ================================================================ */

/* Respuesta Rapida: background:#f0f4ff -> azul oscuro */
.single .entry-content div[style*="background:#f0f4ff"] {
    background: rgba(79,70,229,0.12) !important;
    border-color: #4f46e5 !important;
}
.single .entry-content div[style*="background:#f0f4ff"] > div:first-child {
    color: #818cf8 !important;
}
.single .entry-content div[style*="background:#f0f4ff"] p {
    color: #e2e8f0 !important;
}

/* TOC y Definition box: background:#f8f9fa -> oscuro */
.single .entry-content div[style*="background:#f8f9fa"],
.single .entry-content .toc-box {
    background: rgba(255,255,255,0.05) !important;
    border-color: rgba(255,255,255,0.1) !important;
}
.single .entry-content div[style*="background:#f8f9fa"] div,
.single .entry-content div[style*="background:#f8f9fa"] p,
.single .entry-content .toc-box > div {
    color: #d1d5db !important;
}
.single .entry-content div[style*="background:#f8f9fa"] a,
.single .entry-content .toc-box a {
    color: #818cf8 !important;
}

/* TL;DR: background:#eff6ff -> azul muy oscuro */
.single .entry-content div[style*="background:#eff6ff"] {
    background: rgba(37,99,235,0.10) !important;
    border-color: #4f46e5 !important;
    color: #d1d5db !important;
}
.single .entry-content div[style*="background:#eff6ff"] strong {
    color: #e2e8f0 !important;
}

/* Pro Tip: background:#f0fdf4 (verde claro) -> verde oscuro */
.single .entry-content div[style*="background:#f0fdf4"] {
    background: rgba(22,163,74,0.10) !important;
    border-color: #16a34a !important;
    color: #d1d5db !important;
}
.single .entry-content div[style*="background:#f0fdf4"] strong {
    color: #e2e8f0 !important;
}

/* Takeaways: background:#f8fafc -> oscuro */
.single .entry-content ul[style*="background:#f8fafc"] {
    background: rgba(255,255,255,0.04) !important;
    border-color: #4f46e5 !important;
}
.single .entry-content ul[style*="background:#f8fafc"] li {
    color: #d1d5db !important;
    border-bottom: none !important;
}

/* Textos con color:#374151 o #111827 dentro del contenido */
.single .entry-content ul[style*="color:#374151"] > li,
.single .entry-content p[style*="color:#374151"],
.single .entry-content div[style*="color:#374151"] {
    color: #d1d5db !important;
}
.single .entry-content p[style*="color:#111827"] {
    color: #e2e8f0 !important;
}

/* Barra de lectura (tiempo + palabras) */
.single .entry-content div[style*="color:#6b7280"] {
    color: #9ca3af !important;
    border-color: rgba(255,255,255,0.08) !important;
}

/* FAQ items */
.single .entry-content .ar-faq-item {
    background: rgba(255,255,255,0.03) !important;
    border-color: rgba(255,255,255,0.08) !important;
}
.single .entry-content .ar-faq-item h3 {
    color: #f9fafb !important;
}
.single .entry-content .ar-faq-item p {
    color: #d1d5db !important;
}

/* Links azules inline dentro del contenido */
.single .entry-content a[style*="color:#2563eb"] {
    color: #818cf8 !important;
}

/* Puntos Clave: background:#fefce8 (amarillo claro) -> amarillo oscuro */
.single .entry-content div[style*="background:#fefce8"] {
    background: rgba(234,179,8,0.08) !important;
    border-color: rgba(234,179,8,0.25) !important;
}
.single .entry-content div[style*="background:#fefce8"] > div:first-child {
    color: #fbbf24 !important;
}
.single .entry-content div[style*="background:#fefce8"] ul,
.single .entry-content div[style*="background:#fefce8"] li {
    color: #d1d5db !important;
}

/* Recursos Relacionados: background:#f0f9ff (celeste claro) -> azul oscuro */
.single .entry-content div[style*="background:#f0f9ff"] {
    background: rgba(3,105,161,0.10) !important;
    border-color: rgba(99,102,241,0.25) !important;
}
.single .entry-content div[style*="background:#f0f9ff"] > div:first-child {
    color: #818cf8 !important;
}
.single .entry-content div[style*="background:#f0f9ff"] a {
    color: #818cf8 !important;
}
.single .entry-content div[style*="background:#f0f9ff"] li {
    color: #d1d5db !important;
    border-bottom: none !important;
}

/* Sobre el Autor: background:#f9fafb (casi blanco) -> oscuro */
.single .entry-content div[style*="background:#f9fafb"] {
    background: rgba(255,255,255,0.04) !important;
    border-color: rgba(255,255,255,0.08) !important;
}
.single .entry-content div[style*="background:#f9fafb"] span[style*="color:#111827"] {
    color: #f9fafb !important;
}
.single .entry-content div[style*="background:#f9fafb"] div[style*="color:#6b7280"] {
    color: #9ca3af !important;
}
.single .entry-content div[style*="background:#f9fafb"] p[style*="color:#374151"] {
    color: #d1d5db !important;
}

/* Tabla: celdas con color:#111827 y borde #e2e8f0 */
.single .entry-content td[style*="color:#111827"] {
    color: #d1d5db !important;
}
.single .entry-content td[style*="border:1px solid #e2e8f0"] {
    border-color: rgba(255,255,255,0.08) !important;
}

/* Tabla generada por API — filas con fondo blanco/gris claro */
.single .entry-content tr[style*="background:#f8fafc"],
.single .entry-content tr[style*="background:#ffffff"] {
    background: transparent !important;
}
.single .entry-content tr[style*="background:#f8fafc"] td,
.single .entry-content tr[style*="background:#ffffff"] td {
    background: rgba(255,255,255,0.03) !important;
    color: #d1d5db !important;
    border-color: rgba(255,255,255,0.07) !important;
}
.single .entry-content tr[style*="background:#f8fafc"]:nth-child(even) td,
.single .entry-content tr[style*="background:#ffffff"]:nth-child(even) td {
    background: rgba(255,255,255,0.06) !important;
}
