/* ==========================================================
   blog-post.css
   CSS compartido para todas las vistas de post del blog ISOptimo.
   Usar: <link rel="stylesheet" href="../css/blog-post.css" />
========================================================== */

/* ── RESET & BASE ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --navy:       #1E293B;
    --lime:       #BACA00;
    --lime-dark:  #495004ff;
    --blue-deep:  rgb(12, 47, 107);
    --gray-text:  #4b5563;
    --gray-light: #f8fafc;
    --gray-border:#e5e7eb;
    --white:      #ffffff;
}

html, body {
    font-family: 'Inter', sans-serif;
    background: #fff;
    color: var(--navy);
}

html { scroll-behavior: smooth; }


/* ==========================================================
   NAVBAR
========================================================== */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 1400px;
    background: var(--navy);
    padding: 18px 40px;
    border-radius: 20px;
    z-index: 1000;
    box-shadow: 0 12px 40px rgba(0,0,0,.52), 0 6px 20px rgba(0,0,0,.13);
}

.navbar-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.navbar-left {
    display: flex;
    gap: 35px;
    justify-content: flex-start;
}

.navbar-left a {
    position: relative;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: .7px;
    padding-bottom: 4px;
    transition: color .25s ease;
}

.navbar-left a::after {
    content: '';
    position: absolute;
    bottom: -3px; left: 0;
    height: 3px; width: 0;
    background: var(--lime);
    border-radius: 2px;
    transition: width .3s ease;
}

.navbar-left a:hover { color: var(--lime); }
.navbar-left a:hover::after { width: 100%; }

.navbar-logo { display: flex; justify-content: center; }
.navbar-logo img { height: 40px; }
.navbar-right { display: flex; justify-content: flex-end; }

.btn-demo {
    background: var(--lime);
    color: #fff;
    padding: 10px 28px;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 0 6px rgba(186,202,0,.4);
    transition: transform .2s, box-shadow .2s, opacity .2s;
}

.btn-demo:hover {
    transform: scale(1.06);
    opacity: .95;
    box-shadow: 0 0 10px rgba(186,202,0,.55);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
}

.mobile-menu { display: none; }


/* ==========================================================
   HERO DEL POST
========================================================== */
.post-hero {
    position: relative;
    width: 100%;
    padding: 140px 5% 80px;
    background: var(--navy);
    color: #fff;
    overflow: hidden;
}

.post-hero-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}

#heroBgCanvas {
    width: 100%; height: 100%; display: block;
}

.post-hero-content {
    position: relative;
    z-index: 2;
    max-width: 860px;
    margin: 0 auto;
    text-align: center;
}

.post-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}

.post-breadcrumb a {
    color: var(--lime);
    text-decoration: none;
    font-weight: 600;
    transition: opacity .2s;
}

.post-breadcrumb a:hover { opacity: 0.8; }
.post-breadcrumb span { color: rgba(255,255,255,0.4); }

.post-category-badge {
    display: inline-block;
    background: var(--lime);
    color: var(--navy);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 6px 18px;
    border-radius: 30px;
    margin-bottom: 24px;
}

.post-hero-title {
    font-size: clamp(1.8rem, 4.5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.post-hero-title .highlight { color: var(--lime); }

.post-hero-subtitle {
    font-size: 1.05rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.75);
    max-width: 680px;
    margin: 0 auto 32px;
}

.post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.55);
    flex-wrap: wrap;
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 7px;
}

.post-meta-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}


/* ==========================================================
   LAYOUT PRINCIPAL (artículo + sidebar)
========================================================== */
.post-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 72px 5%;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 64px;
    align-items: start;
}


/* ==========================================================
   IMAGEN DESTACADA
========================================================== */
.post-featured-img {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 52px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.post-featured-img-inner {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--blue-deep) 55%, #0f4c81 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.post-featured-img-inner::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(186,202,0,0.12) 0%, transparent 70%);
    top: -150px; right: -80px;
}

.post-featured-img-inner::after {
    content: '';
    position: absolute;
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(12,47,107,0.35) 0%, transparent 70%);
    bottom: -80px; left: -60px;
}

.featured-img-graphic {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

/* Icono genérico principal */
.featured-main-icon {
    width: 96px;
    height: 96px;
    background: rgba(255,255,255,0.07);
    border: 2px solid rgba(186,202,0,0.35);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.featured-main-icon svg {
    width: 58px;
    height: 58px;
}

/* Icono específico Power BI (compatibilidad con el primer post) */
.featured-powerbi-icon {
    width: 96px;
    height: 96px;
    background: rgba(255,255,255,0.07);
    border: 2px solid rgba(186,202,0,0.35);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.featured-powerbi-icon svg { width: 58px; height: 58px; }

.featured-img-label {
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Pills decorativas */
.featured-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
}

.featured-pill {
    background: rgba(186,202,0,0.15);
    border: 1px solid rgba(186,202,0,0.4);
    color: var(--lime);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 30px;
    letter-spacing: 0.5px;
}

/* Barras animadas BI (compatibilidad primer post) */
.bi-bars {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.bi-bar {
    width: 26px;
    border-radius: 4px 4px 0 0;
    animation: barPulse 2s ease-in-out infinite alternate;
}

.bi-bar:nth-child(1) { height: 56px;  background: var(--lime);              animation-delay: 0s;   }
.bi-bar:nth-child(2) { height: 96px;  background: rgba(186,202,0,0.6);      animation-delay: .2s;  }
.bi-bar:nth-child(3) { height: 72px;  background: var(--lime);              animation-delay: .4s;  }
.bi-bar:nth-child(4) { height: 116px; background: rgba(186,202,0,0.6);      animation-delay: .6s;  }
.bi-bar:nth-child(5) { height: 82px;  background: var(--lime);              animation-delay: .8s;  }

@keyframes barPulse {
    from { opacity: 0.6; transform: scaleY(0.92); }
    to   { opacity: 1;   transform: scaleY(1);    }
}


/* ==========================================================
   ARTÍCULO — TIPOGRAFÍA Y COMPONENTES
========================================================== */
.post-article h2 {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--navy);
    margin: 52px 0 18px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    position: relative;
    padding-left: 20px;
}

.post-article h2::before {
    content: '';
    position: absolute;
    left: 0; top: 4px;
    width: 5px; height: 80%;
    background: var(--lime);
    border-radius: 3px;
}

.post-article h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--navy);
    margin: 32px 0 14px;
}

.post-article p {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--gray-text);
    margin-bottom: 20px;
}

/* Lista estilizada */
.post-article ul {
    margin: 18px 0 28px 0;
    padding-left: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.post-article ul li {
    position: relative;
    padding: 12px 18px 12px 44px;
    font-size: 0.96rem;
    line-height: 1.65;
    color: var(--gray-text);
    background: var(--gray-light);
    border-radius: 10px;
    border-left: 4px solid var(--lime);
}

.post-article ul li::before {
    content: '→';
    position: absolute;
    left: 16px;
    color: var(--lime);
    font-weight: 700;
}

/* Cita destacada */
.post-quote {
    margin: 44px 0;
    padding: 32px 40px;
    background: var(--navy);
    border-radius: 16px;
    border-left: 6px solid var(--lime);
    position: relative;
    overflow: hidden;
}

.post-quote::after {
    content: '"';
    position: absolute;
    right: 20px; top: -10px;
    font-size: 110px;
    color: rgba(186,202,0,0.1);
    font-family: Georgia, serif;
    line-height: 1;
    pointer-events: none;
}

.post-quote p {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    font-style: italic;
    line-height: 1.65;
    margin-bottom: 0;
}

/* Info box / tip */
.info-box {
    padding: 26px 30px;
    border-radius: 14px;
    margin: 32px 0;
}

.info-box.tip {
    background: linear-gradient(135deg, rgba(186,202,0,0.07) 0%, rgba(186,202,0,0.02) 100%);
    border: 1.5px solid rgba(186,202,0,0.28);
}

.info-box.tip .info-title {
    color: var(--lime-dark);
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-box.tip p {
    margin-bottom: 0;
    font-size: 0.94rem;
}

/* Tabla */
.post-table-wrap {
    overflow-x: auto;
    margin: 32px 0;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}

.post-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.post-table thead tr { background: var(--navy); color: #fff; }

.post-table thead th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.post-table thead th:first-child { border-radius: 12px 0 0 0; }
.post-table thead th:last-child  { border-radius: 0 12px 0 0; }

.post-table tbody tr:nth-child(even) { background: var(--gray-light); }
.post-table tbody tr:hover { background: rgba(186,202,0,0.05); transition: background .15s; }

.post-table tbody td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-border);
    color: var(--gray-text);
    line-height: 1.5;
}

.post-table .check {
    color: var(--lime-dark);
    font-weight: 700;
    font-size: 1.05rem;
}

/* Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 52px;
    padding-top: 32px;
    border-top: 2px solid var(--gray-border);
}

.post-tag {
    background: var(--gray-light);
    color: var(--navy);
    border: 1.5px solid var(--gray-border);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all .2s;
    cursor: default;
}

.post-tag:hover {
    background: var(--lime);
    color: var(--navy);
    border-color: var(--lime);
}

/* Bloque de autor */
.post-author {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 48px;
    padding: 26px 30px;
    background: var(--gray-light);
    border-radius: 16px;
    border: 1.5px solid var(--gray-border);
}

.author-avatar {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--lime);
    flex-shrink: 0;
}

.author-info h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.author-info p {
    font-size: 0.88rem;
    color: var(--gray-text);
    margin: 0;
    line-height: 1.55;
}


/* ==========================================================
   SIDEBAR
========================================================== */
.post-sidebar {
    position: sticky;
    top: 110px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-card {
    background: #fff;
    border: 1.5px solid var(--gray-border);
    border-radius: 16px;
    padding: 26px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

.sidebar-card h4 {
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--navy);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--lime);
}

/* TOC */
.toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toc-list li a {
    display: block;
    color: var(--gray-text);
    text-decoration: none;
    font-size: 0.86rem;
    line-height: 1.5;
    padding: 7px 12px;
    border-radius: 8px;
    transition: all .2s;
    border-left: 3px solid transparent;
}

.toc-list li a:hover {
    background: rgba(186,202,0,0.08);
    color: var(--lime-dark);
    border-left-color: var(--lime);
}

.toc-list li.active a {
    background: rgba(186,202,0,0.1);
    color: var(--lime-dark);
    border-left-color: var(--lime);
    font-weight: 600;
}

/* Posts relacionados */
.related-post {
    display: flex;
    gap: 13px;
    padding: 13px 0;
    border-bottom: 1px solid var(--gray-border);
    text-decoration: none;
    transition: all .2s;
}

.related-post:last-child { border-bottom: none; padding-bottom: 0; }
.related-post:first-of-type { padding-top: 0; }

.related-post-img {
    width: 54px;
    height: 54px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.related-post-title {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--navy);
    line-height: 1.4;
    margin-bottom: 5px;
    transition: color .2s;
}

.related-post:hover .related-post-title { color: var(--lime-dark); }

.related-post-date {
    font-size: 0.76rem;
    color: var(--gray-text);
}

/* CTA card */
.sidebar-cta {
    background: var(--navy);
    border-color: transparent;
}

.sidebar-cta h4 {
    color: #fff;
    border-bottom-color: rgba(186,202,0,0.45);
}

.sidebar-cta p {
    font-size: 0.88rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.68);
    margin-bottom: 18px;
}

.sidebar-cta .btn-demo {
    display: block;
    text-align: center;
    width: 100%;
}


/* ==========================================================
   FOOTER
========================================================== */
.footer {
    background: #ffffff;
    color: var(--navy);
    padding-top: 80px;
    font-family: 'Inter', sans-serif;
}

.footer-container {
    max-width: 1200px;
    margin: auto;
    padding: 0 5% 60px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 60px;
}

.footer-logo { height: 44px; margin-bottom: 20px; }

.footer-description {
    font-size: .95rem;
    line-height: 1.6;
    color: #4b5563;
    max-width: 360px;
}

.footer-cert {
    margin-top: 32px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.footer-cert img { height: 68px; object-fit: contain; }

.footer-links h4, .footer-contact h4 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--navy);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: #4b5563;
    text-decoration: none;
    font-size: .95rem;
    transition: color .25s ease;
}

.footer-links a:hover { color: var(--lime); }

.footer-contact p {
    font-size: .95rem;
    margin-bottom: 12px;
    color: #4b5563;
}

.footer-bottom {
    border-top: 1px solid #e5e7eb;
    padding: 20px 5%;
    text-align: center;
    font-size: .85rem;
    color: #6b7280;
}


/* ==========================================================
   RESPONSIVE
========================================================== */
@media (max-width: 1024px) {
    .post-layout {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .post-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .sidebar-cta { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    /* Navbar mobile */
    .navbar-left, .navbar-right { display: none; }
    .menu-toggle { display: block; }

    .navbar-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .mobile-menu {
        display: none;
        flex-direction: column;
        align-items: center;
        gap: 22px;
        margin-top: 18px;
        padding-top: 18px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .mobile-menu.active { display: flex; }

    .mobile-menu a:not(.btn-demo) {
        color: #fff;
        font-size: 1rem;
        font-weight: 700;
        text-decoration: none;
        letter-spacing: .6px;
    }

    .mobile-menu .btn-demo {
        margin-top: 12px;
        text-align: center;
        padding: 12px 30px;
        width: 200px;
    }

    /* Hero */
    .post-hero { padding: 120px 5% 60px; }

    /* Imagen destacada */
    .post-featured-img-inner { height: 260px; }

    /* Sidebar en columna única */
    .post-sidebar { grid-template-columns: 1fr; }

    /* Footer */
    .footer-container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .footer-description { margin: auto; }
    .footer-cert { justify-content: center; }
}