.equipo-hype {
    --equipo-hype-gap: 1rem;
    --equipo-hype-cols: 3;
    --equipo-hype-item-width: calc((100% - (var(--equipo-hype-cols) - 1) * var(--equipo-hype-gap)) / var(--equipo-hype-cols));
    display: grid;
    grid-template-columns: repeat(var(--equipo-hype-cols), minmax(0, 1fr));
    row-gap: 0.35rem;
    column-gap: var(--equipo-hype-gap);
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.equipo-hype-wrap .entry-header {
    margin-bottom: 0.25rem !important;
}

.equipo-hype-wrap .entry-header .entry-title {
    margin-top: 0.25rem !important;
    margin-bottom: 0.35rem !important;
}

.equipo-hype-wrap .entry-header .read-details {
    margin-bottom: 0 !important;
}

.equipo-hype-wrap .entry-header .read-details {
    margin-bottom: 0 !important;
}

.equipo-hype.entry-content > :is(h1, h2, h3, h4, h5, h6, .wp-block-heading),
.equipo-hype.entry-content :is(h1, h2, h3, h4, h5, h6).wp-block-heading {
    margin: 0.25rem 0 !important;
    margin-block: 0.25rem !important;
}

.equipo-hype.entry-content > :is(p, .wp-block-paragraph),
.equipo-hype.entry-content p.wp-block-paragraph {
    margin: 0.15rem 0 !important;
    margin-block: 0.15rem !important;
}

.equipo-hype.entry-content > :first-child {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
}

/* Encabezados, párrafos y galerías ocupan toda la fila */
.equipo-hype > :not(figure.wp-block-image) {
    grid-column: 1 / -1;
}

/* Bloques de imagen sueltos: una celda del grid cada uno */
.equipo-hype > figure.wp-block-image {
    float: none !important;
    margin: 0 !important;
    width: 100%;
    max-width: 100%;
    justify-self: center;
}

/* Galerías: fila completa, imágenes en flex dentro */
.equipo-hype figure.wp-block-gallery,
.equipo-hype .gallery {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: flex-start !important;
    gap: var(--equipo-hype-gap) !important;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
}

.equipo-hype figure.wp-block-gallery > figure,
.equipo-hype .gallery .gallery-item,
.equipo-hype .gallery figure {
    flex: 0 0 var(--equipo-hype-item-width) !important;
    max-width: var(--equipo-hype-item-width) !important;
    width: var(--equipo-hype-item-width) !important;
    float: none !important;
    margin: 0 !important;
    flex-grow: 0 !important;
}

/* Anular reglas de WordPress que agrandan imágenes sueltas en galería */
.equipo-hype .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image),
.equipo-hype .wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image):first-child:nth-last-child(1),
.equipo-hype .wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image):first-child:nth-last-child(2),
.equipo-hype .wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image):first-child:nth-last-child(2) ~ figure.wp-block-image:not(#individual-image),
.equipo-hype .wp-block-gallery.has-nested-images.columns-1 figure.wp-block-image:not(#individual-image) {
    width: var(--equipo-hype-item-width) !important;
    max-width: var(--equipo-hype-item-width) !important;
    flex: 0 0 var(--equipo-hype-item-width) !important;
    flex-grow: 0 !important;
}

.equipo-hype .wp-block-group:has(> figure.wp-block-image) {
    display: grid !important;
    grid-template-columns: repeat(var(--equipo-hype-cols), minmax(0, 1fr));
    gap: var(--equipo-hype-gap);
}

.equipo-hype .wp-block-group:has(> figure.wp-block-image) > :not(figure.wp-block-image) {
    grid-column: 1 / -1;
}

.equipo-hype .wp-block-group > figure.wp-block-image {
    float: none !important;
    margin: 0 !important;
    width: 100%;
    max-width: 100%;
    justify-self: center;
}

.equipo-hype .wp-block-gallery.is-cropped figure.wp-block-image img {
    object-fit: contain !important;
    height: auto !important;
}

.equipo-hype img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.equipo-hype figcaption,
.equipo-hype .gallery-caption,
.equipo-hype .wp-element-caption {
    display: none !important;
}

@media (max-width: 991px) {
    .equipo-hype {
        --equipo-hype-cols: 2;
    }
}

@media (max-width: 479px) {
    .equipo-hype {
        --equipo-hype-cols: 1;
    }
}
