/*
 * Centrado de imágenes y videos sin modificar archivos del tema.
 * Las reglas se limitan a elementos normalizados por VSP Photo Engine.
 */
img.aligncenter,
.wp-caption.aligncenter,
p.vsp-photo-engine-row img {
    display: block !important;
    float: none !important;
    max-width: 100% !important;
    height: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 0 !important;
    margin-bottom: 26px !important;
}

p.vsp-photo-engine-row {
    clear: both;
    text-align: center !important;
}

.vsp-video-editor-row,
.vsp-video-center {
    clear: both;
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 1.25em auto;
    text-align: center;
}

.vsp-video-responsive.vsp-video-native,
.vsp-video-responsive.vsp-video-block {
    width: 100%;
}

.vsp-video-responsive .wp-video,
.vsp-video-responsive .mejs-container,
.vsp-video-responsive video,
.vsp-video-responsive .wp-video-shortcode {
    display: block !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
    margin-left: auto !important;
    margin-right: auto !important;
}

.vsp-video-responsive.is-iframe {
    position: relative;
    width: 100%;
    aspect-ratio: var(--vsp-video-aspect, 1.777778);
    overflow: hidden;
}

.vsp-video-responsive.is-iframe iframe,
.vsp-video-responsive.is-iframe object,
.vsp-video-responsive.is-iframe embed {
    display: block !important;
    position: absolute;
    inset: 0;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    border: 0;
}

/* Los bloques de WordPress pueden agregar figure y otros contenedores. */
.vsp-video-responsive.is-iframe > figure,
.vsp-video-responsive.is-iframe .wp-block-embed__wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    margin: 0 !important;
}


/* Separación editorial uniforme entre fotografías consecutivas. */
.wp-caption.aligncenter {
    margin-top: 0 !important;
    margin-bottom: 26px !important;
}

.wp-caption.aligncenter img,
p.vsp-photo-engine-row img {
    margin-bottom: 0 !important;
}

p.vsp-photo-engine-row {
    margin-top: 0 !important;
    margin-bottom: 26px !important;
}

@media (max-width: 767px) {
    img.aligncenter,
    .wp-caption.aligncenter,
    p.vsp-photo-engine-row {
        margin-bottom: 20px !important;
    }

    .wp-caption.aligncenter img,
    p.vsp-photo-engine-row img {
        margin-bottom: 0 !important;
    }
}
