/**
 * Estilos para el Blog y Noticias Destacadas
 * Prefijados con .blog para ganar especificidad sobre Elementor
 */

.blog .featured-news-wrapper {
    width: 100%;
}

.blog .featured-news-grid {
    display: grid;
    grid-template-columns: 1.65fr 1fr;
    grid-template-rows: repeat(2, 20em);
    gap: 40px;
}

.blog .featured-card-main {
    grid-row: span 2;
}

.blog .featured-news-card {
    position: relative;
    overflow: hidden;
    background: #111;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.blog .card-overlay-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.blog .card-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.blog .card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.blog .featured-news-card:hover .card-image-wrapper img {
    transform: scale(1.1);
}

.blog .card-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(8, 8, 8, 0.95) 0%, rgba(8, 8, 8, 0.4) 50%, rgba(8, 8, 8, 0) 100%);
    z-index: 1;
}

.blog .card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.blog .featured-card-secondary .card-content {
    padding: 30px;
    gap: 10px;
}

.blog .card-meta {
    display: flex;
    align-items: center;
    gap: 15px;
}

.blog .card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
}

.blog .card-category {
    color: #FDC631;
    font-family: var(--e-global-typography-text-font-family), Sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.blog .meta-dot {
    color: rgba(255, 255, 255, 0.4);
}

.blog .card-date {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.blog .card-title {
    color: #fff;
    font-family: var(--e-global-typography-text-font-family), Sans-serif;
    font-size: 2.2rem;
    line-height: 1.2 !important;
    font-weight: 700;
    letter-spacing: -1px;
    margin: 0;
    text-transform: unset !important;
}

.blog .featured-card-secondary .card-title {
    font-size: 1.5rem;
    line-height: 1.2;
    text-wrap: balance;
}

.blog .card-excerpt {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 10px 0 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 90%;
}

.blog .featured-card-main .card-excerpt {
    -webkit-line-clamp: 3;
    font-size: 1rem;
}

.blog .card-footer {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.blog .featured-news-card:hover .card-footer {
    opacity: 1;
    transform: translateY(0);
}

.blog .read-more {
    color: #FDC631;
    font-family: 'LEMON MILK', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- LISTADO DE POSTS FILTRABLE --- */

.blog .post-filter-section {
    width: 100%;
    margin-top: 80px;
}

.blog .post-filter-container {
    margin-bottom: 50px;
    display: flex;
    justify-content: center;
}

.blog .filter-tabs.checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.blog .tag-button {
    position: relative;
    cursor: pointer;
    font-family: var(--e-global-typography-text-font-family), Sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #000;
    padding: 10px 25px;
    border-radius: 100px;
    border: 1px solid #fff;
    transition: all 0.3s ease;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
    background: #fff;
}

.blog .tag-button input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.blog .tag-button .checked-label {
    position: relative;
    z-index: 2;
}

/* Estado activo cuando el input está checkeado */
.blog .tag-button:has(input:checked) {
    background: #FDC631;
    color: #000;
    border-color: #FDC631;
}

.blog .post-list-flex {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-content: flex-start;
    flex-wrap: wrap;
    gap: 40px;
    width: 100%;
}

.blog .post-item-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: calc(33.333% - 27px);
    min-width: 300px;
    border-radius: 32px;
    overflow: hidden;
    background: #fff;
    transition: background 0.3s ease;
}

.blog .post-card-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
}

.blog .post-thumbnail-wrapper {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.blog .post-thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.blog .post-item-card:hover .post-thumbnail-wrapper img {
    transform: scale(1.05);
}

.blog .post-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 40px 32px;
}

.blog .post-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--e-global-typography-text-font-family), Sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
}

.blog .post-category {
    color: #C5AE79;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.blog .meta-dot {
    color: #99A1AF;
    font-weight: 400;
}

.blog .post-date {
    color: #99A1AF;
    font-weight: 400;
}

.blog .post-title {
    font-family: var(--e-global-typography-text-font-family), Sans-serif;
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -1px;
    text-transform: unset;
    line-height: 1.3;
    color: var(--e-global-color-23aaade);
    margin: 0;
    transition: color 0.3s ease;
}

.blog .post-excerpt {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--e-global-color-23aaade);
    opacity: 0.8;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Paginación */
.blog #post-pagination-container,
.blog-ajax-pagination {
    margin-top: 60px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.blog .page-numbers,
.blog-ajax-pagination .page-numbers {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.blog .page-numbers li a,
.blog .page-numbers li span,
.blog-ajax-pagination .page-numbers li a,
.blog-ajax-pagination .page-numbers li span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    color: #000;
    font-weight: 600;
    transition: all 0.3s ease;
}

.blog .page-numbers li span.current,
.blog-ajax-pagination .page-numbers li span.current {
    background: #FDC631;
    color: #000;
}

.blog .page-numbers li a:hover,
.blog-ajax-pagination .page-numbers li a:hover {
    background: #FDC631;
    color: #000;
}

/* Loading State */
.blog #post-grid-results {
    transition: opacity 0.3s ease;
}

.blog #post-grid-results.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Responsivo */
@media (max-width: 1024px) {
    .blog .featured-news-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .blog .featured-card-main,
    .blog .featured-card-secondary:nth-child(2),
    .blog .featured-card-secondary:nth-child(3) {
        grid-column: auto;
        grid-row: auto;
        height: 400px;
    }

    .blog .post-list-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Estilos para el extracto personalizado en la página de post individual */
.custom-post-excerpt {
    font-size: 24px;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .custom-post-excerpt {
        font-size: 18px;
        padding: 0 20px;
    }
}

@media (max-width: 768px) {
    .blog .post-item-card {
        width: 100% !important;
        min-width: 100% !important;
    }

    .blog .card-content {
        padding: 20px;
    }

    .blog .card-title {
        font-size: 1.8rem;
    }

    .blog .post-list-grid {
        grid-template-columns: 1fr;
    }

    .blog .filter-tabs {
        gap: 15px;
    }

    .blog .post-title {
        font-size: 1.4rem;
    }
}

/* Estilos para el índice (Table of Contents) con estética de course-details-right */
.single-post .indice {
    border-radius: 24px;
    border: 0.909px solid rgba(255, 255, 255, 0.10);
    background: #fff;
    padding: 34px;
    backdrop-filter: blur(10px);
    height: fit-content;

    @media (width>=1024px) {
        position: sticky;
        top: 6em;
    }

    @media (width<1024px) {
        max-width: fit-content !important;
    }

    & .elementor-toc__list-item-text-wrapper {
        align-items: flex-start;
        display: flex;
    }

    & ol.elementor-toc__list-wrapper .elementor-toc__list-item-text-wrapper:before {
        color: #000;
    }
}

.indice .elementor-toc__header {
    border-bottom: 1px solid #000;
    padding-bottom: 20px !important;
    margin-bottom: 20px !important;
    color: #000;
}

.indice .elementor-toc__list-item-text {
    color: #000;
    transition: color 0.3s ease !important;
}

.indice .elementor-toc__list-item-text:hover {
    color: #000 !important;
}

.indice .elementor-toc__list-item-text.elementor-item-active {
    color: #000 !important;
}

.indice .elementor-toc {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Gradiente para el Hero de la entrada individual */
.blog.single .hero {
    position: relative;
    overflow: hidden;
}

.blog.single .hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background-color: transparent;
    background: linear-gradient(190deg, rgba(0, 0, 0, 0.00) 0%, #080808 50.62%);
    background-size: auto, 100% 100%;
    background-position: 0% 0%, 0% 0%;
    background-repeat: repeat, no-repeat;
}

/* Asegurar que el contenido del hero esté por encima del gradiente */
.blog.single .hero .elementor-container,
.blog.single .hero .elementor-widget {
    position: relative;
    z-index: 2;
}

/* Espaciado Jerárquico para el contenido del Post (.text-block) */
.elementor-widget-theme-post-content {
    line-height: 1.8;
}

.text-block {
    margin-bottom: 4em;
    /* Separación entre bloques */
}

.text-block:last-child {
    margin-bottom: 0;
}

/* Títulos principales dentro de bloques */
.text-block h2 {
    margin-top: 0 !important;
    margin-bottom: 0.8em !important;
    font-size: 2rem !important;
    font-weight: 700 !important;
    text-transform: unset !important;
}

/* Subtítulos */
.text-block h3 {
    margin-top: 2em !important;
    margin-bottom: 0.25em !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    text-transform: unset !important;
}

/* Párrafos y Listas */
.text-block p,
.text-block ul,
.text-block ol {
    margin-bottom: 1.5em !important;
}

/* Listas internas */
.text-block ul,
.text-block ol {
    padding-left: 20px;
}

.text-block li {
    margin-bottom: 0.8em;
}

/* Citas */
.text-block blockquote {
    margin: 3em 0 !important;
    padding: 2em !important;
    border-left: 4px solid #FDC631 !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border-radius: 0 24px 24px 0 !important;
    font-style: italic !important;
}

.text-block blockquote p {
    margin-bottom: 0 !important;
    font-size: 1.2rem !important;
}

/* Bloque de imágenes en contenido de post */
.images-block {
    display: flex;
    gap: 2rem;
    margin-top: 3em;
    margin-bottom: 1em;
}

.images-block img {
    width: 50%;
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    object-fit: cover;
}

@media (max-width: 768px) {
    .text-block {
        margin-bottom: 3em;
    }

    .images-block {
        flex-direction: column;
        gap: 1rem;
        margin-top: 2em;
    }

    .images-block img {
        width: 100%;
    }
}

/* Evitar margen superior en el primer bloque del contenido */
.elementor-widget-theme-post-content>.text-block:first-child {
    margin-top: 0 !important;
}

/* --- CARRUSEL DE NOTICIAS (ESTILO MARQUEE) --- */
.blog-carousel-section {
    width: 100%;
    overflow: hidden;
    padding: 100px 0;

    & .carousel-section-title {
        margin-bottom: 1.5rem;
    }
}

.carousel-section-title {
    color: #fff;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -2px;
    margin: 0;
}

.carousel-marquee-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.carousel-marquee-wrapper:active {
    cursor: grabbing;
}

.carousel-marquee-track {
    display: flex;
    gap: 30px;
    width: fit-content;
    will-change: transform;
}

.carousel-card-item {
    position: relative;
    width: 450px;
    flex-shrink: 0;
    aspect-ratio: 16 / 10;
    border-radius: 24px;
    overflow: hidden;
    background: #111;
}

.carousel-card-item .card-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.carousel-card-item .card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-card-item .card-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0) 100%);
    z-index: 1;
}

.carousel-card-item .card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    z-index: 2;
}

.carousel-card-item .card-category {
    color: #FDC631;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: block;
}

.carousel-card-item .card-title {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
}

@media (max-width: 768px) {
    .carousel-card-item {
        width: 320px;
    }

    .carousel-card-item .card-title {
        font-size: 1.3rem;
    }
}