/* ===== DESIGN TOKENS ===== */
:root {
    --bg: #080c12;
    --surface-1: rgba(255,255,255,0.03);
    --surface-2: rgba(255,255,255,0.06);
    --border: rgba(255,255,255,0.09);
    --border-hover: rgba(6,182,212,0.5);
    --text-1: #f0f4ff;
    --text-2: #8b97b3;
    --text-3: #5a6580;
    --cyan: #06b6d4;
    --blue: #3b82f6;
    --gold: #f59e0b;
    --gold-2: #d97706;
    --gold-glow: rgba(245,158,11,0.25);
    --cyan-glow: rgba(6,182,212,0.15);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-heading: 'Outfit', system-ui, sans-serif;
    --max-w: 1200px;
    --article-w: 780px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { background: var(--bg); color: var(--text-1); font-family: var(--font-sans); line-height: 1.75; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: color 0.2s; }

/* ===== READING PROGRESS BAR ===== */
#reading-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    z-index: 9999;
    transition: width 0.1s;
}

/* ===== HEADER ===== */
header {
    position: sticky;
    top: 0; z-index: 100;
    padding: 1rem 0;
    background: rgba(8,12,18,0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.nav-wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 2rem; display: flex; justify-content: space-between; align-items: center; gap: 2rem; }
.logo { display: flex; align-items: center; text-decoration: none; }
.logo img { display: none; }
.logo span { display: block; font-family: var(--font-heading); font-weight: 800; font-size: 1.25rem; color: #ffffff !important; letter-spacing: -0.02em; }
.nav-links { display: flex; align-items: center; gap: 1rem; }
@media (max-width: 768px) {
    .nav-links { display: none; }
}

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.6rem 1.3rem; border-radius: 50px; font-weight: 600; font-size: 0.9rem; transition: all 0.25s; cursor: pointer; border: none; text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: white !important; text-decoration: none !important; box-shadow: 0 0 24px var(--gold-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 40px var(--gold-glow); color: white !important; }
.btn-ghost { border: 1px solid var(--border); color: var(--text-2); background: transparent; }
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text-1); background: var(--surface-1); }
.btn-sm { padding: 0.45rem 1rem; font-size: 0.82rem; }

/* ===== LAYOUT ===== */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 2rem; }
.article-layout { max-width: var(--article-w); margin: 0 auto; padding: 0 1.5rem; }

/* ===== HERO (index) ===== */
.hero { padding: 9rem 0 5rem; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -100px; left: 50%; transform: translateX(-50%); width: 700px; height: 700px; background: radial-gradient(ellipse, rgba(6,182,212,0.12) 0%, transparent 70%); z-index: 0; pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero-badge { display: inline-block; padding: 0.35rem 1rem; border-radius: 50px; background: var(--cyan-glow); border: 1px solid rgba(6,182,212,0.3); color: var(--cyan); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 1.5rem; }
.hero h1 { font-family: var(--font-heading); font-size: clamp(2.8rem,6vw,5rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 1.5rem; }
.hero h1 em { font-style: normal; background: linear-gradient(135deg, var(--cyan), var(--blue)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-sub { color: var(--text-2); font-size: 1.15rem; max-width: 580px; margin: 0 auto 2.5rem; }

/* ===== STATS ROW ===== */
.stats-row { display: flex; justify-content: center; gap: 3rem; margin: 4rem 0 6rem; flex-wrap: wrap; }
.stat { text-align: center; }
.stat-num { font-family: var(--font-heading); font-size: 2rem; font-weight: 800; background: linear-gradient(135deg, var(--cyan), var(--blue)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-label { font-size: 0.82rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.25rem; }

/* ===== CATEGORY FILTER ===== */
.categories { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 3rem; }
.cat-btn { padding: 0.4rem 1rem; border-radius: 50px; border: 1px solid var(--border); background: transparent; color: var(--text-2); font-size: 0.82rem; font-weight: 500; cursor: pointer; transition: all 0.2s; font-family: var(--font-sans); }
.cat-btn.active, .cat-btn:hover { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-glow); }

/* ===== GRID ===== */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.75rem; }

/* ===== CARD ===== */
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s; display: flex; flex-direction: column; }
.card:hover { border-color: var(--border-hover); transform: translateY(-4px); box-shadow: 0 24px 48px rgba(0,0,0,0.4), 0 0 0 1px rgba(6,182,212,0.1); }
.card-img { width: 100%; height: 200px; object-fit: cover; display: block; }
.card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.card-meta { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.card-tag { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--cyan); }
.card-time { font-size: 0.72rem; color: var(--text-3); }
.card h3 { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; line-height: 1.35; margin-bottom: 0.75rem; color: var(--text-1); }
.card h3 a:hover { color: var(--cyan); }
.card p { font-size: 0.9rem; color: var(--text-2); line-height: 1.6; flex: 1; }
.card-footer { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-author { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; color: var(--text-3); }
.card-author img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.card-read { font-size: 0.78rem; color: var(--cyan); font-weight: 600; }

/* ===== FEATURED CARD ===== */
.card-featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; border-radius: var(--radius-xl); }
.card-featured .card-img { height: 100%; min-height: 300px; border-radius: 0; }
.card-featured .card-body { padding: 2.5rem; }
.card-featured h3 { font-size: 1.75rem; }

/* ===== BREADCRUMB ===== */
.breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--text-3); padding: 1.75rem 0 0; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--cyan); }
.breadcrumb .sep { opacity: 0.4; }
.breadcrumb .current { color: var(--text-2); }

/* ===== ARTICLE HERO ===== */
.art-hero { padding: 3rem 0 2rem; }
.art-hero-meta { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.art-tag { padding: 0.3rem 0.85rem; border-radius: 50px; background: var(--cyan-glow); border: 1px solid rgba(6,182,212,0.3); color: var(--cyan); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.art-date, .art-reading { font-size: 0.8rem; color: var(--text-3); }
.art-hero h1 { font-family: var(--font-heading); font-size: clamp(2rem,4.5vw,3.2rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; margin-bottom: 1.5rem; }
.art-intro { font-size: 1.2rem; color: var(--text-2); line-height: 1.7; margin-bottom: 2rem; border-left: 3px solid var(--cyan); padding-left: 1.25rem; }
.art-cover { width: 100%; height: 420px; object-fit: cover; border-radius: var(--radius-xl); border: 1px solid var(--border); margin-bottom: 3rem; }

/* ===== AUTHOR CARD ===== */
.author-card { display: flex; align-items: center; gap: 1.25rem; padding: 1.25rem 1.5rem; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 2.5rem; }
.author-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid var(--border-hover); }
.author-info { flex: 1; }
.author-name { font-weight: 700; font-size: 0.95rem; }
.author-role { font-size: 0.8rem; color: var(--text-3); margin-top: 0.1rem; }
.art-meta-full { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 1rem; }
.art-author-wrap { display: flex; align-items: center; gap: 1rem; }
.art-author-img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--cyan); }
.art-author-name { font-weight: 700; font-size: 0.95rem; display: block; }
.art-author-date { font-size: 0.8rem; color: var(--text-3); }
.art-share { display: flex; gap: 0.75rem; }
.share-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; transition: all 0.2s; cursor: pointer; color: var(--text-2); }
.share-btn:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-2px); }

/* ===== ARTICLE LEAD ===== */
.art-lead { font-size: 1.25rem; line-height: 1.6; color: var(--text-1); margin-bottom: 2.5rem; font-weight: 500; }

/* ===== INTERNAL LINK BOX ===== */
.inter-link { background: linear-gradient(135deg, rgba(6,182,212,0.1), rgba(59,130,246,0.1)); border: 1px solid rgba(6,182,212,0.2); border-radius: var(--radius-md); padding: 1.5rem; margin: 2.5rem 0; display: flex; align-items: center; gap: 1.25rem; transition: transform 0.2s; }
.inter-link:hover { transform: scale(1.01); border-color: var(--cyan); }
.inter-link-icon { font-size: 1.5rem; }
.inter-link-content { flex: 1; }
.inter-link-label { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; color: var(--cyan); letter-spacing: 0.1em; display: block; margin-bottom: 0.25rem; }
.inter-link-title { font-weight: 700; font-size: 1.05rem; color: var(--text-1); }
.inter-link-title a { text-decoration: none; color: inherit; }

/* ===== TOPICS / TAGS ===== */
.art-topics { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.topics-label { font-size: 0.85rem; font-weight: 700; color: var(--text-3); margin-bottom: 1rem; display: block; }
.topics-list { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.topic-tag { padding: 0.4rem 1rem; border-radius: 50px; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.8rem; color: var(--text-2); transition: all 0.2s; }
.topic-tag:hover { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-glow); box-shadow: 0 0 15px var(--cyan-glow); transform: translateY(-1px); }

/* ===== TOC ===== */
.toc-box { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.5rem; margin: 2rem 0 3rem; }
.toc-title { font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); margin-bottom: 1rem; }
.toc-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.toc-list li { counter-increment: toc; }
.toc-list a { font-size: 0.9rem; color: var(--text-2); display: flex; gap: 0.75rem; align-items: baseline; transition: color 0.2s; }
.toc-list a::before { content: counter(toc, decimal-leading-zero); font-size: 0.72rem; color: var(--text-3); flex-shrink: 0; font-family: var(--font-heading); }
.toc-list a:hover { color: var(--cyan); }
.toc-list { counter-reset: toc; }

/* ===== ARTICLE BODY ===== */
.article-body h2 { font-family: var(--font-heading); font-size: clamp(1.4rem,3vw,1.9rem); font-weight: 800; color: var(--text-1); margin: 3.5rem 0 1.25rem; letter-spacing: -0.02em; padding-top: 1rem; border-top: 1px solid var(--border); }
.article-body h3 { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700; color: var(--text-1); margin: 2rem 0 0.75rem; }
.article-body p { color: var(--text-2); font-size: 1.05rem; line-height: 1.85; margin-bottom: 1.5rem; }
.article-body strong { color: var(--text-1); }
.article-body a { color: var(--cyan); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.article-body ul, .article-body ol { padding-left: 1.5rem; margin-bottom: 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; }
.article-body li { color: var(--text-2); font-size: 1.05rem; line-height: 1.7; }
.article-body li::marker { color: var(--cyan); }

/* ===== CALLOUTS ===== */
.callout { border-radius: var(--radius-md); padding: 1.25rem 1.5rem; margin: 2rem 0; border-left: 4px solid; display: flex; gap: 1rem; align-items: flex-start; }
.callout-icon { font-size: 1.25rem; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.callout-body { flex: 1; }
.callout-body p { margin: 0; font-size: 0.95rem; }
.callout-tip { background: rgba(6,182,212,0.07); border-color: var(--cyan); }
.callout-tip .callout-icon { color: var(--cyan); }
.callout-warn { background: rgba(245,158,11,0.07); border-color: var(--gold); }
.callout-warn .callout-icon { color: var(--gold); }
.callout-info { background: rgba(59,130,246,0.07); border-color: var(--blue); }
.callout-info .callout-icon { color: var(--blue); }

/* ===== FAQ ===== */
.faq-section { margin: 3rem 0; }
.faq-section h2 { margin-top: 1rem; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 0.75rem; transition: border-color 0.2s; }
.faq-item[open], .faq-item:hover { border-color: rgba(6,182,212,0.35); }
.faq-q { cursor: pointer; padding: 1.1rem 1.4rem; font-weight: 700; font-size: 1rem; list-style: none; display: flex; justify-content: space-between; align-items: center; color: var(--text-1); user-select: none; }
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after { content: '+'; font-size: 1.3rem; color: var(--cyan); transition: transform 0.25s; flex-shrink: 0; }
details[open] .faq-q::after { transform: rotate(45deg); }
.faq-a { padding: 0 1.4rem 1.25rem; color: var(--text-2); font-size: 0.95rem; line-height: 1.75; }

/* ===== CTA BAND ===== */
.cta-band { background: linear-gradient(135deg, rgba(6,182,212,0.08) 0%, rgba(59,130,246,0.08) 100%); border: 1px solid rgba(6,182,212,0.2); border-radius: var(--radius-xl); padding: 3.5rem; text-align: center; margin: 4rem 0; position: relative; overflow: hidden; }
.cta-band::before { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 500px; height: 500px; background: radial-gradient(ellipse, rgba(6,182,212,0.07) 0%, transparent 70%); pointer-events: none; }
.cta-band > * { position: relative; }
.cta-band h2 { font-family: var(--font-heading); font-size: clamp(1.5rem,3vw,2rem); margin-bottom: 0.75rem; }
.cta-band p { color: var(--text-2); margin-bottom: 2rem; }

/* ===== KEY TAKEAWAYS ===== */
.takeaways { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.75rem 2rem; margin: 2.5rem 0; }
.takeaways-title { font-weight: 800; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--cyan); margin-bottom: 1rem; }
.takeaways ul { padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; margin: 0; }
.takeaways li { color: var(--text-1); font-size: 0.95rem; font-weight: 500; }
.takeaways li::marker { color: var(--gold); }

/* ===== RELATED ARTICLES ===== */
.related { margin: 4rem 0; }
.related h2 { font-family: var(--font-heading); font-size: 1.5rem; margin-bottom: 1.5rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.related-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.25rem; transition: border-color 0.2s; }
.related-card:hover { border-color: var(--border-hover); }
.related-card .cat { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: var(--cyan); margin-bottom: 0.5rem; letter-spacing: 0.06em; }
.related-card h4 { font-size: 0.95rem; font-weight: 700; color: var(--text-1); line-height: 1.4; }
.related-card h4 a:hover { color: var(--cyan); }

.related-art { margin-top: 4rem; padding: 2rem; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--border); text-align: center; }
.related-art p { margin: 0; font-size: 1.1rem; color: var(--text-2); }
.related-art a { color: var(--gold); font-weight: 600; text-decoration: none; border-bottom: 1px solid transparent; transition: all 0.2s; }
.related-art a:hover { border-bottom-color: var(--gold); }

/* ===== FOOTER ===== */
footer { border-top: 1px solid var(--border); margin-top: 6rem; padding: 4rem 0 2.5rem; color: var(--text-3); text-align: center; background: var(--surface-1); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 2rem; display: flex; justify-content: center; align-items: center; gap: 1rem; font-size: 0.8rem; }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { opacity: 0; animation: fadeUp 0.7s ease forwards; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-links { 
        display: flex; 
        position: fixed; 
        bottom: 0; left: 0; right: 0; 
        background: rgba(8,12,18,0.96); 
        backdrop-filter: blur(15px); 
        padding: 0.85rem 1rem; 
        border-top: 1px solid var(--border); 
        justify-content: center; 
        gap: 0.6rem; 
        z-index: 1000; 
        box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
    }
    .nav-links .btn { 
        flex: 1; 
        font-size: 0.75rem; 
        padding: 0.7rem 0.5rem; 
        justify-content: center;
        white-space: nowrap;
    }
    /* Añadir espacio al final para que nada quede tapado */
    body { padding-bottom: 80px; overflow-x: hidden; width: 100%; }
    .container { padding: 0 1rem; overflow: hidden; }
    .blog-grid { grid-template-columns: 1fr; gap: 1.25rem; }
    .card-featured { grid-template-columns: 1fr; }
    .card-featured .card-img { height: 220px; }
    .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
    .art-cover { height: 220px; border-radius: var(--radius-lg); }
    .hero { padding: 6rem 0 3rem; }
    .hero h1 { font-size: 2.2rem; line-height: 1.2; }
    .cta-band { padding: 2.5rem 1.25rem; }
    .stats-row { gap: 1.5rem; }
}

/* ===== ADVANCED CONTENT COMPONENTS ===== */

/* Diagnostic Checklist */
.check-list { background: var(--surface-2); border-radius: var(--radius-md); padding: 1.5rem; margin: 2rem 0; list-style: none; border: 1px solid var(--border); }
.check-list li { position: relative; padding-left: 2rem; margin-bottom: 0.75rem; font-size: 0.95rem; color: var(--text-2); }
.check-list li::before { content: '✓'; position: absolute; left: 0; color: var(--cyan); font-weight: 800; font-size: 1.1rem; }

/* Comparison Table */
.data-table-wrap { overflow-x: auto; margin: 2.5rem 0; border-radius: var(--radius-md); border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; background: var(--surface-1); font-size: 0.9rem; }
.data-table th { background: var(--surface-2); text-align: left; padding: 1rem; font-weight: 700; color: var(--text-1); border-bottom: 2px solid var(--border); }
.data-table td { padding: 1rem; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: top; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

/* FAQ Accordion (Article version) */
.art-faq { margin: 3rem 0; }
.art-faq-item { border-bottom: 1px solid var(--border); }
.art-faq-q { cursor: pointer; padding: 1.25rem 0; font-weight: 700; color: var(--text-1); display: flex; justify-content: space-between; align-items: center; }
.art-faq-q::after { content: '+'; color: var(--cyan); font-size: 1.2rem; transition: transform 0.2s; }
.art-faq-item[open] .art-faq-q::after { transform: rotate(45deg); }
.art-faq-a { padding-bottom: 1.25rem; color: var(--text-2); line-height: 1.6; }

/* Author Detail */
.art-author-extended { margin-top: 4rem; padding: 2rem; background: var(--surface-2); border-radius: var(--radius-lg); border: 1px solid var(--border); display: flex; gap: 1.5rem; align-items: center; }
@media (max-width: 600px) { .art-author-extended { flex-direction: column; text-align: center; } }
.art-author-extended img { width: 80px; height: 80px; border-radius: 50%; border: 3px solid var(--cyan); }
.art-author-bio h4 { font-family: var(--font-heading); font-size: 1.1rem; margin-bottom: 0.5rem; }
.art-author-bio p { font-size: 0.88rem; color: var(--text-2); line-height: 1.5; margin: 0; }
