/* ==========================================================================
   OPTILIKIT - ESTILOS DE ARTÍCULOS DE BLOG
   ========================================================================== */

.blog-article-main {
    background-color: #ffffff;
}

/* --- BREADCRUMBS --- */
.breadcrumbs {
    background-color: #f8fafc;
    padding: 1.2rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid #e2e8f0; 
}
.breadcrumbs ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap; 
    align-items: center;
}
.breadcrumbs li {
    display: flex;
    align-items: center;
    color: #64748b; 
}
.breadcrumbs li:not(:last-child)::after {
    content: '/';
    margin: 0 0.6em;
    color: #cbd5e1; 
}
.breadcrumbs a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}
.breadcrumbs a:hover {
    text-decoration: underline;
    color: var(--dark-blue); 
}
.breadcrumbs li[aria-current="page"] {
    color: var(--dark-blue);
    font-weight: 600;
}

/* --- CABECERA DEL ARTÍCULO --- */
.blog-post {
    max-width: 1200px;
    margin: 2.5rem auto 0 auto; /* Separación superior con las migajas de pan */
    text-align: left;
}

.blog-post-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 2.5rem auto;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #64748b;
    flex-wrap: wrap;
}

.blog-tag {
    background: #e0f2fe;
    color: #0284c7;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-post-title {
    font-size: 2.2rem;
    color: var(--dark-blue);
    margin-bottom: 1rem;
    line-height: 1.3;
    font-weight: 800;
}

@media (max-width: 768px) {
    .blog-post-title {
        font-size: 1.8rem;
    }
}

.blog-post-excerpt {
    font-size: 1.05rem;
    color: #475569;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* --- AUTOR --- */
.blog-post-author {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border-top: 1px solid #f1f5f9;
    padding-top: 1.5rem;
    margin-top: 1rem;
}

.author-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f1f5f9;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.author-info {
    text-align: left;
    display: flex;
    flex-direction: column;
}

.author-info strong {
    color: var(--dark-blue);
    font-size: 1.05rem;
}

.author-info span {
    color: #64748b;
    font-size: 0.9rem;
}

/* --- IMAGEN DESTACADA --- */
.blog-post-image {
    width: 100%;
    max-height: 550px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 3rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
}

.blog-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- LAYOUT DEL CONTENIDO --- */
.blog-post-content-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 4rem;
    align-items: start;
}

@media (max-width: 992px) {
    .blog-post-content-wrapper {
        grid-template-columns: 1fr;
    }
    .blog-sidebar {
        display: none; /* Se oculta el TOC en móvil por ahora */
    }
}

/* --- SIDEBAR & TOC --- */
.blog-sidebar {
    position: sticky;
    top: 100px;
}

.table-of-contents {
    background: #f8fafc;
    padding: 1.8rem;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
}

.table-of-contents h3 {
    margin-top: 0;
    margin-bottom: 1.2rem;
    font-size: 1.15rem;
    color: var(--dark-blue);
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.8rem;
}

.table-of-contents nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.table-of-contents nav ul li {
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.table-of-contents nav ul li a {
    color: #64748b;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s, font-weight 0.2s;
    display: block;
}

.table-of-contents nav ul li a:hover,
.table-of-contents nav ul li a.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* --- ESTILOS DEL CONTENIDO (MARKDOWN HTML) --- */
.blog-post-body {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #334155;
    max-width: 850px; /* Para legibilidad óptima */
    text-align: left; /* Forzar siempre a la izquierda para evitar herencia de header */
}

.blog-post-body h2 {
    color: var(--dark-blue);
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    font-weight: 700;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 0.5rem;
}

.blog-post-body h3 {
    color: var(--dark-blue);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.blog-post-body h4 {
    font-size: 1.25rem;
    color: #475569;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.blog-post-body p {
    margin-bottom: 1.5rem;
}

.blog-post-body ul, 
.blog-post-body ol {
    margin-bottom: 2rem;
    padding-left: 1.5rem;
}

.blog-post-body li {
    margin-bottom: 0.8rem;
}

.blog-post-body li::marker {
    color: var(--primary-color);
    font-weight: 700;
}

.blog-post-body a {
    color: var(--primary-color);
    text-decoration: underline;
    text-decoration-color: #bae6fd;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: all 0.2s ease;
}

.blog-post-body a:hover {
    color: #0284c7;
    text-decoration-color: var(--primary-color);
}

.blog-post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2.5rem 0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

.blog-post-body blockquote {
    border-left: 5px solid var(--primary-color);
    background: #f0f9ff;
    padding: 1.5rem 2rem;
    margin: 2.5rem 0;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: #0f172a;
    font-size: 1.2rem;
    line-height: 1.7;
}

/* --- ETIQUETAS SEO INFERIORES --- */
.blog-tags-bottom {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px dashed #cbd5e1;
}

.blog-tags-bottom h4 {
    font-size: 1.1rem;
    color: #475569;
    margin-bottom: 1rem;
    margin-top: 0;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.keyword-tag {
    background: #f1f5f9;
    color: #334155;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
    border: 1px solid #e2e8f0;
}

.keyword-tag:hover {
    background: var(--primary-color);
    color: #ffffff;
    cursor: pointer;
}

/* --- CAJA DE AUTOR (E-E-A-T) --- */
.author-bio-box {
    margin-top: 3rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.author-bio-box img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: 3px solid #ffffff;
}

.author-bio-text h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    color: var(--dark-blue);
}

.author-bio-text p {
    margin-bottom: 0;
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
}

@media (max-width: 600px) {
    .author-bio-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* --- BLOQUES DE CÓDIGO --- */
.blog-post-body pre {
    background: #0f172a;
    color: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 2.5rem 0;
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.blog-post-body code {
    background: #f1f5f9;
    color: #e11d48;
    padding: 3px 6px;
    border-radius: 6px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

.blog-post-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* --- ANUNCIOS --- */
.ad-slot-container {
    width: 100%;
    margin: 3.5rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
    position: relative;
    transition: background 0.3s ease;
}
.ad-slot-container:hover {
    background: #f1f5f9;
}
.ad-slot-container::before {
    content: 'Publicidad';
    position: absolute;
    top: 6px;
    right: 12px;
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* --- FOOTER COMPARTIR --- */
.blog-post-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid #f1f5f9;
}

.share-container {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.share-label {
    font-weight: 600;
    color: #475569;
    font-size: 1.1rem;
    margin-right: 10px;
}

.share-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 1.2rem;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    color: white;
}

.share-tw { background: #1da1f2; }
.share-wa { background: #25d366; }
.share-fb { background: #1877f2; }
.share-cp { background: #64748b; cursor: pointer; border: none; }

/* --- PREGUNTAS FRECUENTES (FAQ) --- */
.faq-section-blog {
    margin-top: 4rem;
    padding: 2.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.faq-section-blog h2 {
    margin-top: 0;
    margin-bottom: 2rem;
    border-bottom: none;
    padding-bottom: 0;
    font-size: 1.8rem;
    text-align: center;
}

.faq-item {
    margin-bottom: 1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.faq-item summary {
    padding: 1.2rem 1.5rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    transition: background 0.3s;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary:after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--primary-color);
    transition: transform 0.3s;
}

.faq-item[open] summary:after {
    transform: rotate(180deg);
}

.faq-item summary:hover {
    background: #f1f5f9;
}

.faq-item summary h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--dark-blue);
    font-weight: 600;
}

.faq-item p {
    padding: 0 1.5rem 1.5rem 1.5rem;
    margin: 0;
    color: #475569;
    font-size: 0.95rem;
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
}

/* --- BARRA DE PROGRESO DE LECTURA --- */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #1de9b6);
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* --- NAVEGACIÓN ANTERIOR / SIGUIENTE --- */
.blog-post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.blog-post-nav a {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.blog-post-nav a:hover {
    background: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    transform: translateY(-3px);
}

.blog-post-nav .nav-prev {
    text-align: left;
    justify-content: flex-start;
}

.blog-post-nav .nav-next {
    text-align: right;
    justify-content: flex-end;
}

.blog-post-nav i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0 15px;
    transition: transform 0.3s ease;
}

.blog-post-nav .nav-prev:hover i {
    transform: translateX(-5px);
}

.blog-post-nav .nav-next:hover i {
    transform: translateX(5px);
}

.nav-content span {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    font-weight: 600;
}

.nav-content h5 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--dark-blue);
    line-height: 1.4;
}

@media (max-width: 768px) {
    .blog-post-nav {
        grid-template-columns: 1fr;
    }
    .blog-post-nav .nav-prev, .blog-post-nav .nav-next {
        justify-content: center;
        text-align: center;
        flex-direction: column;
    }
    .blog-post-nav i {
        margin: 10px 0;
    }
    .blog-post-nav .nav-prev i { order: -1; }
    .blog-post-nav .nav-next i { order: 1; }
}
