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

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

    width: 100% !important;
}

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

    width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;

    margin: 0 !important;
    padding: 1.4rem 1.5rem !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: 100%;
}

/* Títulos */
.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;
}

/* Texto */
.sidebar_wrapper .block_custom .content p {
    color: #33424f;
    font-size: 0.95rem;
    line-height: 1.55;
}

/* Imágenes */
.sidebar_wrapper .block_custom img {
    display: block;
    max-width: 100% !important;
    height: auto !important;

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

/* Enlaces con imágenes */
.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 {
    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: 150px !important;
}


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

#customblock-rrss2 .content p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
}

#customblock-rrss2 img {
    width: auto !important;
    max-width: 55px !important;
    max-height: 55px !important;
}


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

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

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


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

#customblock-indexada-en .content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#customblock-indexada-en .content p {
    width: 100%;
    margin: 0.4rem 0;
    text-align: center;
}

#customblock-indexada-en img {
    width: auto !important;
    max-width: 210px !important;
    max-height: 100px !important;
    object-fit: contain;
}

/* =========================================================
   AJUSTE FINO BLOQUES PERSONALIZADOS
   ========================================================= */

/* Aire antes de la zona de bloques */
.sidebar_wrapper {
    margin-top: 2.5rem !important;
    margin-bottom: 2.5rem !important;
    align-items: start !important;
}

/* Cards más compactas */
.sidebar_wrapper > .pkp_block.block_custom {
    height: auto !important;
    min-height: 330px !important;

    padding: 1.25rem 1.4rem !important;
}

/* Evitar espacios artificiales demasiado grandes */
.sidebar_wrapper .block_custom .content > p:empty,
.sidebar_wrapper .block_custom .content > h2:empty {
    display: none;
}

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

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

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

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

#customblock-rrss2 .content p {
    margin-top: 0.75rem !important;
    gap: 1rem !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 img {
    width: auto !important;
    max-width: 180px !important;
    max-height: 200px !important;
    object-fit: contain;
}

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

#customblock-indexada-en .content {
    justify-content: flex-start;
    gap: 0.45rem;
}

#customblock-indexada-en .content p {
    margin: 0.15rem 0 !important;
}

/* Logos bastante más pequeños */
#customblock-indexada-en img {
    width: auto !important;
    max-width: 155px !important;
    max-height: 58px !important;
    object-fit: contain;
}

/* Scielo puede necesitar un poco más de altura */
#customblock-indexada-en img[alt="Scielo"] {
    max-height: 65px !important;
}

/* Google Scholar */
#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;
    }

}

@media (max-width: 700px) {

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

    .sidebar_wrapper > .pkp_block.block_custom {
        padding: 1.2rem !important;
    }

}
