/* =========================================================
   BLOQUES PERSONALIZADOS COMO CARDS
   ========================================================= */

.sidebar_wrapper {
    box-sizing: border-box !important;

    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 1.5rem !important;
    align-items: start !important;

    width: 100% !important;

    /* Aire real entre la franja superior y las cards */
    padding-top: 3.5rem !important;
    padding-bottom: 2.5rem !important;

    margin: 0 !important;
}


/* =========================================================
   CARD BASE
   ========================================================= */

.sidebar_wrapper > .pkp_block.block_custom {
    box-sizing: border-box !important;

    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 330px !important;

    margin: 0 !important;
    padding: 1.25rem 1.4rem !important;

    background: #fbfdff !important;

    border: 1px solid #dfeaf2 !important;
    border-radius: 12px !important;

    box-shadow:
        0 4px 14px rgba(3, 65, 117, 0.06) !important;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        background-color 0.2s ease;
}

.sidebar_wrapper > .pkp_block.block_custom:hover {
    transform: translateY(-3px);

    background: #f8fbfe !important;
    border-color: #cbddea !important;

    box-shadow:
        0 10px 24px rgba(3, 65, 117, 0.10) !important;
}


/* =========================================================
   CONTENIDO INTERIOR
   ========================================================= */

.sidebar_wrapper > .pkp_block.block_custom > .content {
    height: auto;
}

.sidebar_wrapper .block_custom .content h2 {
    margin-top: 0 !important;
    margin-bottom: 1rem !important;

    color: #0054a6 !important;

    font-size: 1.3rem !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
}

.sidebar_wrapper .block_custom .content p {
    color: #33424f;

    font-size: 0.95rem;
    line-height: 1.55;
}


/* Eliminar párrafos vacíos creados desde el editor */
.sidebar_wrapper .block_custom .content > p:empty,
.sidebar_wrapper .block_custom .content > h2:empty {
    display: none;
}


/* =========================================================
   IMÁGENES
   ========================================================= */

.sidebar_wrapper .block_custom img {
    display: block;

    width: auto;
    max-width: 100% !important;
    height: auto !important;

    margin-left: auto;
    margin-right: auto;
}

.sidebar_wrapper .block_custom a img {
    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

.sidebar_wrapper .block_custom a:hover img,
.sidebar_wrapper .block_custom a:focus img {
    transform: scale(1.035);
    opacity: 0.92;
}


/* =========================================================
   PODCAST
   ========================================================= */

#customblock-rrss .content p {
    margin-bottom: 0.6rem !important;
    text-align: center;
}

#customblock-rrss .content h2,
#customblock-rrss .content p:first-of-type {
    text-align: left;
}

#customblock-rrss img {
    width: auto !important;
    max-width: 125px !important;
    max-height: 55px !important;

    object-fit: contain;
}


/* =========================================================
   REDES SOCIALES
   ========================================================= */

#customblock-rrss2 .content p {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 1rem !important;

    margin-top: 0.75rem !important;
}

#customblock-rrss2 img {
    width: auto !important;

    max-width: 46px !important;
    max-height: 46px !important;
}


/* =========================================================
   SCIMAGO / CITESCORE
   ========================================================= */

#customblock-scimago {
    min-height: 330px !important;
}

#customblock-scimago .content {
    text-align: center;
}

#customblock-scimago .content > div {
    margin-left: auto !important;
    margin-right: auto !important;
}

#customblock-scimago img {
    width: auto !important;

    max-width: 180px !important;
    max-height: 200px !important;

    object-fit: contain;
}


/* =========================================================
   INDEXACIONES
   ========================================================= */

#customblock-indexada-en .content {
    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: flex-start;

    gap: 0.45rem;
}

#customblock-indexada-en .content p {
    width: 100%;

    margin: 0.15rem 0 !important;

    text-align: center;
}

#customblock-indexada-en img {
    width: auto !important;

    max-width: 155px !important;
    max-height: 58px !important;

    object-fit: contain;
}

#customblock-indexada-en img[alt="Scielo"] {
    max-height: 65px !important;
}

#customblock-indexada-en img[alt="Google Scholar"] {
    max-height: 55px !important;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1200px) {

    .sidebar_wrapper {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;

        padding-top: 3rem !important;
    }

}

@media (max-width: 700px) {

    .sidebar_wrapper {
        grid-template-columns: 1fr !important;

        gap: 1rem !important;

        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .sidebar_wrapper > .pkp_block.block_custom {
        min-height: 0 !important;
        padding: 1.2rem !important;
    }

}


/* =========================================================
   ACCESIBILIDAD
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .sidebar_wrapper > .pkp_block.block_custom,
    .sidebar_wrapper .block_custom a img {
        transition: none;
    }

    .sidebar_wrapper > .pkp_block.block_custom:hover,
    .sidebar_wrapper .block_custom a:hover img {
        transform: none;
    }

}