/* =========================================================
   PentaVida Blog Shortcodes
   Estilos base. Puedes sobrescribirlos desde Divi si lo deseas.
   ========================================================= */

:root {
    --pv-navy: #343e4a;
    --pv-orange: #ff6b00;
    --pv-light: #f3f3f3;
    --pv-white: #ffffff;
    --pv-line: #c9c9c9;
    --pv-font-title: 'Montserrat', Arial, sans-serif;
    --pv-font-text: 'Nunito Sans', Arial, sans-serif;
}

/* TIPOGRAFÍA GLOBAL DEL SISTEMA BLOG */
.pv-blog-grid,
.pv-categories-box,
.pv-blog-pagination,
.pv-single-header-content,
.pv-single-hero,
.pv-related-box,
.pv-latest-carousel {
    font-family: var(--pv-font-text);
}

.pv-blog-title,
.pv-blog-title a,
.pv-categories-box h3,
.pv-category-dynamic-title,
.pv-single-title,
.pv-single-hero-title,
.pv-related-box > h3,
.pv-related-content h4,
.pv-related-content h4 a,
.pv-carousel-title,
.pv-carousel-title a {
    font-family: var(--pv-font-title);
}

.pv-blog-meta,
.pv-blog-excerpt,
.pv-blog-readmore,
.pv-categories-list a,
.pv-blog-pagination .page-numbers,
.pv-single-meta,
.pv-single-hero-meta,
.pv-related-content p,
.pv-carousel-meta,
.pv-carousel-excerpt,
.pv-carousel-button {
    font-family: var(--pv-font-text);
}

/* Título dinámico usado en las páginas de categoría */
.pv-category-dynamic-title {
    font-weight: 700;
}

/* Contenido individual de la entrada (Divi Post Content) */
.single-post .et_pb_post_content,
.single-post .et_pb_post_content p,
.single-post .et_pb_post_content li,
.single-post .et_pb_post_content blockquote,
.pv-post-content,
.pv-post-content p,
.pv-post-content li,
.pv-post-content blockquote {
    font-family: var(--pv-font-text) !important;
    font-size: 18px;
    line-height: 1.75;
}

.single-post .et_pb_post_content h1,
.single-post .et_pb_post_content h2,
.single-post .et_pb_post_content h3,
.single-post .et_pb_post_content h4,
.single-post .et_pb_post_content h5,
.single-post .et_pb_post_content h6,
.pv-post-content h1,
.pv-post-content h2,
.pv-post-content h3,
.pv-post-content h4,
.pv-post-content h5,
.pv-post-content h6 {
    font-family: var(--pv-font-title) !important;
}

/* LISTADO DEL BLOG */
.pv-blog-grid {
    --pv-blog-cols: 2;
    display: grid;
    grid-template-columns: repeat(var(--pv-blog-cols), minmax(0, 1fr));
    gap: 32px;
}

.pv-blog-grid-cols-1 { --pv-blog-cols: 1; }
.pv-blog-grid-cols-2 { --pv-blog-cols: 2; }
.pv-blog-grid-cols-3 { --pv-blog-cols: 3; }
.pv-blog-grid-cols-4 { --pv-blog-cols: 4; }

.pv-blog-card {
    background: var(--pv-light);
    border-radius: 26px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pv-blog-image {
    display: block;
    width: 100%;
    aspect-ratio: 1.18 / 1;
    overflow: hidden;
}

.pv-blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.pv-blog-card:hover .pv-blog-image img {
    transform: scale(1.025);
}

.pv-blog-card-content {
    padding: 34px 30px 30px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.pv-blog-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    margin-bottom: 20px;
}

.pv-blog-category {
    color: var(--pv-orange) !important;
    font-weight: 700;
}

.pv-blog-date,
.pv-blog-separator {
    color: var(--pv-navy);
}

.pv-blog-title {
    font-size: 29px;
    line-height: 1.28;
    font-weight: 700;
    padding: 0;
    margin: 0 0 18px;
}

.pv-blog-title a {
    color: var(--pv-navy);
}

.pv-blog-excerpt {
    font-size: 18px;
    line-height: 1.8;
    color: var(--pv-navy);
    margin-bottom: 25px;
}

.pv-blog-readmore {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--pv-navy) !important;
    font-size: 19px;
    font-weight: 700;
}

.pv-blog-readmore span {
    font-size: 27px;
    line-height: 1;
}

/* CATEGORÍAS */
.pv-categories-box {
    background: #fff;
    border-radius: 26px;
    padding: 40px 34px;
}

.pv-categories-box h3 {
    font-size: 20px;
    color: var(--pv-navy);
    font-weight: 700;
    padding-bottom: 28px;
    margin: 0;
    border-bottom: 1px solid var(--pv-line);
}

.pv-categories-list a {
    display: block;
    padding: 29px 0;
    border-bottom: 1px solid var(--pv-line);
    font-size: 18px;
    line-height: 1.4;
    color: #222 !important;
    transition: color .2s ease;
}

.pv-categories-list a:hover,
.pv-categories-list a.active {
    color: var(--pv-orange) !important;
}

/* PAGINACIÓN */
.pv-blog-pagination {
    background: #eef0f1;
    border-radius: 25px;
    padding: 26px 20px;
    margin-top: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pv-blog-pagination .page-numbers {
    width: 55px;
    height: 55px;
    border: 2px solid var(--pv-navy);
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: #111 !important;
    font-size: 18px;
    font-weight: 700;
    transition: all .2s ease;
    box-sizing: border-box;
}

.pv-blog-pagination .page-numbers.current,
.pv-blog-pagination a:hover {
    background: var(--pv-navy);
    color: white !important;
}

.pv-blog-pagination .prev,
.pv-blog-pagination .next {
    font-size: 26px;
}

/* CABECERA DEL ARTÍCULO */
.pv-single-header-content {
    max-width: 650px;
}

.pv-single-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 48px;
    font-size: 14px;
    flex-wrap: wrap;
}

.pv-single-meta a {
    color: var(--pv-orange) !important;
}

.pv-single-title {
    color: var(--pv-navy);
    font-family: var(--pv-font-title);
    font-size: 36px;
    line-height: 1.15;
    font-weight: 700;
    padding: 0;
}

/* HERO COMPLETO DEL ARTÍCULO - [pv_post_hero] */
.pv-single-hero {
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 560px;
    max-height: 600px;
    background: #fff0e5;
    overflow: hidden;
}

.pv-single-hero-copy {
    background: #fff0e5;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.pv-single-hero-copy-inner {
    width: 100%;
    max-width: 680px;
    padding: 72px clamp(48px, 6vw, 120px);
    box-sizing: border-box;
}

.pv-single-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-bottom: 52px;
    color: var(--pv-navy);
    font-size: 14px;
    line-height: 1.4;
}

.pv-single-hero-meta a {
    color: var(--pv-orange) !important;
}

.pv-single-hero-title {
    max-width: 660px;
    margin: 0;
    padding: 0;
    color: var(--pv-navy);
    font-family: var(--pv-font-title);
    font-size: 36px;
    line-height: 1.15;
    font-weight: 700;
}

.pv-single-hero-media {
    min-width: 0;
    min-height: 560px;
    max-height: 600px;
    overflow: hidden;
    background: #e8e8e8;
}

.pv-single-hero-image {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 560px;
    max-height: 600px;
    object-fit: cover;
}

.pv-single-hero-no-image {
    background: #e8e8e8;
}

/* Hero sin imagen destacada: ocupa todo el ancho y centra la información. */
.pv-single-hero--no-image {
    grid-template-columns: 1fr;
}

.pv-single-hero--no-image .pv-single-hero-copy {
    width: 100%;
    min-height: 560px;
    justify-content: center;
    text-align: center;
}

.pv-single-hero--no-image .pv-single-hero-copy-inner {
    max-width: 980px;
    margin: 0 auto;
    padding-left: clamp(28px, 8vw, 150px);
    padding-right: clamp(28px, 8vw, 150px);
}

.pv-single-hero--no-image .pv-single-hero-meta {
    justify-content: center;
    margin-bottom: 34px;
}

.pv-single-hero--no-image .pv-single-hero-title {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* ARTÍCULO RELACIONADO */
.pv-related-box {
    background: #fff;
    border-radius: 25px;
    padding: 35px 25px 25px;
}

.pv-related-box > h3 {
    color: var(--pv-navy);
    font-size: 20px;
    font-weight: 700;
    padding: 0;
    margin: 0 0 28px;
}

.pv-related-divider {
    height: 1px;
    background: var(--pv-line);
    margin-bottom: 28px;
}

.pv-related-card {
    overflow: hidden;
    border-radius: 22px;
    background: var(--pv-light);
}

.pv-related-image {
    display: block;
    aspect-ratio: 1.45 / 1;
    overflow: hidden;
}

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

.pv-related-content {
    padding: 27px 25px;
}

.pv-related-content h4 {
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
    padding: 0;
    margin: 0 0 15px;
}

.pv-related-content h4 a {
    color: var(--pv-navy);
}

.pv-related-content p {
    font-size: 17px;
    line-height: 1.7;
    color: var(--pv-navy);
    margin-bottom: 25px;
}


/* TABLET */
@media (max-width: 980px) and (min-width: 768px) {
    .pv-blog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* RESPONSIVE */
@media (max-width: 767px) {
    .pv-blog-grid {
        grid-template-columns: 1fr;
    }

    /* Categorías en formato chips, como el diseño móvil */
    .pv-categories-box {
        padding: 32px 24px;
        border-radius: 25px;
    }

    .pv-categories-box h3 {
        font-size: 20px;
        padding-bottom: 24px;
        margin-bottom: 18px;
    }

    .pv-categories-list {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px 12px;
    }

    .pv-categories-list a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: auto;
        padding: 10px 14px;
        margin: 0;
        border: 0;
        border-radius: 999px;
        background: #eef0f2;
        color: #243342 !important;
        font-size: 16px;
        line-height: 1.2;
        white-space: normal;
    }

    .pv-categories-list a:hover {
        background: #e3e6e9;
        color: #243342 !important;
    }

    .pv-categories-list a.active {
        background: var(--pv-orange);
        color: #fff !important;
    }

    .pv-categories-list .pv-category-view-all {
        background: #eef0f2;
        color: #243342 !important;
    }

    .pv-blog-card-content {
        padding: 25px 22px;
    }

    .pv-blog-title {
        font-size: 25px;
    }

    .pv-blog-excerpt {
        font-size: 16px;
    }

    .pv-blog-pagination {
        gap: 6px;
        padding: 20px 10px;
    }

    .pv-blog-pagination .page-numbers {
        width: 43px;
        height: 43px;
        font-size: 16px;
    }

    .pv-single-meta {
        margin-bottom: 25px;
    }

    .pv-single-title {
        font-size: 18px;
        line-height: 1.35;
    }

    .single-post .et_pb_post_content,
    .single-post .et_pb_post_content p,
    .single-post .et_pb_post_content li,
    .single-post .et_pb_post_content blockquote,
    .pv-post-content,
    .pv-post-content p,
    .pv-post-content li,
    .pv-post-content blockquote {
        font-size: 16px;
        line-height: 1.7;
    }
}


/* =========================================================
   CARRUSEL DE ÚLTIMAS ENTRADAS
   Shortcode: [pv_blog_carrusel cantidad="5"]
   ========================================================= */

.pv-latest-carousel {
    --pv-carousel-arrow-top: 50%;
    position: relative;
    width: 100%;
    max-width: none;
    overflow: hidden;
    background: #fff0e5;
}

.pv-carousel-viewport {
    width: 100%;
    overflow: hidden;
}

.pv-carousel-track {
    display: flex;
    width: 100%;
    transition: transform .65s cubic-bezier(.22, .61, .36, 1);
    will-change: transform;
}

.pv-carousel-slide {
    flex: 0 0 100%;
    min-width: 100%;
    display: grid;
    max-height: 600px;
    grid-template-columns: 1fr 1fr;
    background: #fff0e5;
}

.pv-carousel-content {
    min-height: 540px;
    padding: clamp(58px, 6.6vw, 120px) clamp(58px, 6vw, 115px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

.pv-carousel-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 44px;
    font-size: 14px;
    line-height: 1.4;
}

.pv-carousel-category {
    color: var(--pv-orange) !important;
}

.pv-carousel-date,
.pv-carousel-separator {
    color: var(--pv-navy);
}

.pv-carousel-title {
    max-width: 620px;
    margin: 0 0 38px;
    padding: 0;
    font-size: clamp(34px, 2.5vw, 48px);
    line-height: 1.08;
    font-weight: 700;
}

.pv-carousel-title a {
    color: var(--pv-navy) !important;
}

.pv-carousel-excerpt {
    max-width: 590px;
    margin-bottom: 30px;
    color: var(--pv-navy);
    font-size: 18px;
    line-height: 1.75;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.pv-carousel-button {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 178px;
    min-height: 48px;
    padding: 11px 28px;
    border: 1.5px solid var(--pv-orange);
    border-radius: 999px;
    color: var(--pv-orange) !important;
    background: transparent;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 700;
    transition: background-color .2s ease, color .2s ease;
}

.pv-carousel-button:hover {
    background: var(--pv-orange);
    color: #fff !important;
}

.pv-carousel-media {
    display: block;
    min-height: 540px;
    height: 100%;
    overflow: hidden;
    background: #e8e8e8;
}

.pv-carousel-image,
.pv-carousel-no-image {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 540px;
    object-fit: cover;
}

.pv-carousel-no-image {
    background: #e8e8e8;
}

.pv-carousel-arrow {
    position: absolute;
    top: var(--pv-carousel-arrow-top);
    z-index: 5;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1.5px solid var(--pv-navy);
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    color: var(--pv-navy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 23px;
    line-height: 1;
    transition: background-color .2s ease, color .2s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.pv-carousel-arrow:hover,
.pv-carousel-arrow:focus-visible {
    background: var(--pv-navy);
    color: #fff;
    outline: none;
}

.pv-carousel-prev {
    left: 18px;
}

.pv-carousel-next {
    right: 18px;
}

@media (max-width: 980px) {
    .pv-single-hero {
        min-height: 500px;
    }

    .pv-single-hero-copy-inner {
        padding: 54px 48px;
    }

    .pv-single-hero-meta {
        margin-bottom: 34px;
    }

    .pv-single-hero-title {
        font-size: 36px;
    }

    .pv-single-hero-media,
    .pv-single-hero-image {
        min-height: 500px;
    }

    .pv-single-hero--no-image .pv-single-hero-copy {
        min-height: 500px;
    }

    .pv-carousel-content {
        min-height: 470px;
        padding: 54px 58px;
    }

    .pv-carousel-media,
    .pv-carousel-image,
    .pv-carousel-no-image {
        min-height: 470px;
    }

    .pv-carousel-meta {
        margin-bottom: 28px;
    }

    .pv-carousel-title {
        font-size: 34px;
        margin-bottom: 25px;
    }

    .pv-carousel-excerpt {
        font-size: 17px;
    }
}

@media (max-width: 767px) {
    .pv-single-hero {
        width: 100vw;
        margin-left: calc(50% - 50vw);
        grid-template-columns: 1fr;
        min-height: 0;
        max-height: none;
    }

    .pv-single-hero-media {
        grid-row: 1;
        width: 100%;
        min-width: 100%;
        min-height: 0;
        max-height: none;
        aspect-ratio: 1.45 / 1;
    }

    .pv-single-hero-image {
        min-height: 0;
        max-height: none;
        height: 100%;
    }

    .pv-single-hero-copy {
        grid-row: 2;
        width: 100%;
        font-family: var(--pv-font-text);
    }

    .pv-single-hero--no-image .pv-single-hero-copy {
        grid-row: 1;
        min-height: 300px;
        justify-content: center;
        text-align: center;
    }

    .pv-single-hero--no-image .pv-single-hero-copy-inner {
        padding: 48px 28px;
    }

    .pv-single-hero--no-image .pv-single-hero-meta {
        justify-content: center;
        margin-bottom: 22px;
    }

    .pv-single-hero-copy-inner {
        max-width: none;
        padding: 34px 28px 42px;
    }

    .pv-single-hero-meta {
        margin-bottom: 26px;
        font-size: 13px;
    }

    .pv-single-hero-title {
        max-width: none;
        font-family: var(--pv-font-title);
        font-size: 18px;
        line-height: 1.35;
    }

    .pv-latest-carousel {
        --pv-carousel-arrow-top: 32vw;
    }

    .pv-carousel-slide {
        grid-template-columns: 1fr;
        max-height: none;
    }

    .pv-carousel-media {
        grid-row: 1;
        min-height: 0;
        height: auto;
        aspect-ratio: 1.55 / 1;
    }

    .pv-carousel-image,
    .pv-carousel-no-image {
        min-height: 0;
        height: 100%;
    }

    .pv-carousel-content {
        grid-row: 2;
        min-height: 0;
        padding: 30px 30px 38px;
        justify-content: flex-start;
    }

    .pv-carousel-meta {
        margin-bottom: 28px;
        font-size: 13px;
        gap: 10px;
    }

    .pv-carousel-title {
        max-width: none;
        margin-bottom: 26px;
        font-size: clamp(25px, 7vw, 31px);
        line-height: 1.15;
    }

    .pv-carousel-excerpt {
        max-width: none;
        margin-bottom: 25px;
        font-size: 16px;
        line-height: 1.7;
        -webkit-line-clamp: 3;
    }

    .pv-carousel-button {
        min-width: 160px;
        min-height: 44px;
        font-size: 16px;
        padding: 10px 24px;
    }

    .pv-carousel-arrow {
        width: 42px;
        height: 42px;
        font-size: 20px;
        background: rgba(255, 255, 255, .2);
    }

    .pv-carousel-prev {
        left: 26px;
    }

    .pv-carousel-next {
        right: 26px;
    }
}

@media (max-width: 480px) {
    .pv-carousel-content {
        padding-left: 26px;
        padding-right: 26px;
    }

    .pv-carousel-prev {
        left: 24px;
    }

    .pv-carousel-next {
        right: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pv-carousel-track {
        transition: none;
    }
}
