/* === Mejoras de diseño para artículos del blog === */

/* --- Tipografía y legibilidad --- */
.elementor-widget-text-editor .elementor-widget-container p,
.elementor-widget-text-editor .elementor-widget-container li {
    line-height: 1.85;
    margin-bottom: 1.2em;
    color: #333;
    font-size: 15.5px;
}
.elementor-widget-text-editor .elementor-widget-container ul,
.elementor-widget-text-editor .elementor-widget-container ol {
    padding-left: 1.5em;
    margin-bottom: 1.2em;
}
.elementor-widget-text-editor .elementor-widget-container li {
    margin-bottom: 0.8em;
    padding-left: 0.3em;
}

/* Subtítulos dentro de artículos: quitar subrayado, usar estilo moderno */
.elementor-widget-text-editor .elementor-widget-container p u {
    text-decoration: none;
    font-weight: 700;
    color: #426e86;
    font-size: 17px;
    display: inline-block;
    margin-top: 0.5em;
    padding-bottom: 3px;
    border-bottom: 2px solid #90AFC5;
}

/* Títulos h2 de artículos Elementor */
.elementor-heading-title.elementor-size-default {
    color: #2c5364;
    letter-spacing: 0.3px;
}

/* --- Contenido entry-content (páginas clásicas como cardiovascular) --- */
.entry-content {
    line-height: 1.85;
    color: #333;
    font-size: 15.5px;
}
.entry-content p {
    margin-bottom: 1.2em;
}
.entry-content h3 {
    color: #426e86;
    font-size: 20px;
    font-weight: 700;
    margin-top: 1.8em;
    margin-bottom: 0.6em;
    padding-bottom: 5px;
    border-bottom: 2px solid #90AFC5;
}
.entry-content h6 {
    color: #2c5364;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 0.3em;
}
.entry-content img.aligncenter {
    display: block;
    margin: 1.5em auto;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* --- Sección de Referencias --- */
.elementor-widget-text-editor .elementor-widget-container p:first-child strong:only-child {
    font-size: 16px;
    color: #426e86;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Estilo para el bloque de referencias (último widget de texto) */
.elementor-element:last-child > .elementor-widget-container {
    position: relative;
}

/* --- Imágenes dentro de artículos Elementor --- */
.elementor-widget-image .elementor-widget-container img {
    border-radius: 6px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s ease;
}
.elementor-widget-image .elementor-widget-container img:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* --- Separación entre secciones Elementor --- */
.elementor-top-section + .elementor-top-section {
    margin-top: 10px;
}

/* --- Sección "Te pueden interesar" y "Más historias" --- */
.af-main-banner-latest-posts .widget-title .header-after,
.em-reated-posts .related-title {
    color: #426e86;
    font-size: 18px;
    font-weight: 700;
}

/* Quitar altura fija del contenedor de imagen → elimina fondo gris */
.af-main-banner-latest-posts .data-bg-categorised,
.em-reated-posts .data-bg-categorised {
    height: auto !important;
    background: none !important;
}
.af-main-banner-latest-posts .data-bg-categorised img,
.em-reated-posts .data-bg-categorised img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px 6px 0 0;
    object-fit: cover;
}

/* Separación entre artículos */
.af-main-banner-latest-posts .col-sm-15,
.em-reated-posts .col-sm-15 {
    margin-bottom: 20px;
    padding: 0 10px;
}

/* Tarjeta de artículo */
.af-main-banner-latest-posts .spotlight-post,
.em-reated-posts .spotlight-post {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}
.af-main-banner-latest-posts .spotlight-post:hover,
.em-reated-posts .spotlight-post:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

/* Título del artículo */
.af-main-banner-latest-posts .article-title a,
.em-reated-posts .article-title a {
    color: #2c5364;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.4;
    transition: color 0.2s ease;
}
.af-main-banner-latest-posts .article-title a:hover,
.em-reated-posts .article-title a:hover {
    color: #426e86;
}

/* Figcaption con padding */
.af-main-banner-latest-posts figcaption,
.em-reated-posts figcaption {
    padding: 12px 14px;
}

/* Etiquetas de categoría sobre la imagen */
.af-main-banner-latest-posts .figure-categories.figure-categories-bg,
.em-reated-posts .figure-categories.figure-categories-bg {
    padding: 6px 10px;
    line-height: 1.2;
}
.af-main-banner-latest-posts .figure-categories .cat-links a.covernews-categories,
.em-reated-posts .figure-categories .cat-links a.covernews-categories {
    font-size: 10px;
    padding: 2px 6px;
}

/* Extracto de texto en artículos relacionados */
.related-excerpt {
    font-size: 13px !important;
    color: #666 !important;
    line-height: 1.5 !important;
    margin-top: 6px !important;
    margin-bottom: 0 !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Ocultar artículos vacíos en "Te pueden interesar" */
.af-main-banner-latest-posts .col-sm-15 .article-title:empty,
.af-main-banner-latest-posts .col-sm-15 .article-title a:empty {
    display: none;
}
.af-main-banner-latest-posts .spotlight-post:has(.article-title:empty) {
    display: none;
}

/* --- Créditos de imágenes más discretos --- */
.elementor-widget-text-editor .elementor-widget-container p:last-child:not(:first-child) {
    font-size: 12px;
    color: #999;
    font-style: italic;
    margin-top: 0.5em;
}

/* === Clases inyectadas por article-enhance.js === */

/* Subtítulos detectados automáticamente */
.visual-heading {
    font-size: 19px !important;
    font-weight: 700 !important;
    color: #426e86 !important;
    margin-top: 1.8em !important;
    margin-bottom: 0.6em !important;
    padding-bottom: 5px;
    border-bottom: 2px solid #90AFC5;
    text-decoration: none !important;
    line-height: 1.3 !important;
}
.visual-heading u {
    text-decoration: none !important;
}
.visual-heading strong {
    font-weight: 700;
}

/* Bloque de referencias */
.references-block {
    margin-top: 2em !important;
    padding-top: 1.5em;
    border-top: 2px solid #e0e0e0;
    position: relative;
}
.references-block p {
    font-size: 13.5px !important;
    line-height: 1.7 !important;
    color: #555 !important;
}
.references-block p:first-child {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #426e86 !important;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 0.8em !important;
}

/* Créditos de imágenes */
.image-credit {
    font-size: 11px !important;
    color: #aaa !important;
    font-style: italic !important;
    margin-top: 0.3em !important;
}

/* Primera letra capital */
.drop-cap::first-letter {
    float: left;
    font-size: 3.2em;
    line-height: 0.8;
    padding-right: 8px;
    padding-top: 4px;
    color: #426e86;
    font-weight: 700;
    font-family: 'Georgia', serif;
}

/* --- Tags en artículos clásicos --- */
.entry-meta .tags-links {
    margin-top: 1.5em;
    padding-top: 1em;
    border-top: 1px solid #e8e8e8;
    font-size: 13px;
    color: #888;
}
.entry-meta .tags-links a {
    background: #f0f6f9;
    color: #426e86;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin: 0 3px;
    transition: all 0.2s ease;
    text-decoration: none;
}
.entry-meta .tags-links a:hover {
    background: #426e86;
    color: #fff;
}

/* --- Navegación Previous/Next en artículos clásicos --- */
.post-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 2em;
    padding-top: 1.5em;
    border-top: 1px solid #e8e8e8;
}
.post-navigation .nav-links a {
    color: #426e86;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}
.post-navigation .nav-links a:hover {
    color: #2c5364;
}
.post-navigation .em-post-navigation {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    margin-bottom: 4px;
}
