/* GRID / LAYOUT */
.cpg-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.cpg-item {
    box-sizing: border-box;
}

.cpg-inner {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cpg-inner:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.09);
}

/* Imagen dentro de la tarjeta: todas las cajas del mismo tamaño */
.cpg-image-wrapper {
    position: relative;
    height: 220px;      /* alto fijo de las tarjetas (ajústalo a tu gusto) */
    overflow: hidden;
}

/* La imagen se adapta y se recorta para llenar la caja */
.cpg-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;  /* recorta como Instagram */
    display: block;
}

/* Para videos lo dejamos como antes */
.cpg-video-wrapper iframe,
.cpg-video-wrapper video {
    width: 100%;
    height: auto;
    display: block;
}


/* captions tipo Divi */
.cpg-caption {
    padding: 10px 15px 14px;
    font-size: 14px;
    text-align: center;
    color: #444;
}

/* columnas similares a Divi */
.cpg-col-1 { width: 100%; }
.cpg-col-2 { width: calc(50% - 10px); }
.cpg-col-3 { width: calc(33.333% - 13.5px); }
.cpg-col-4 { width: calc(25% - 15px); }

@media (max-width: 980px) {
    .cpg-col-4,
    .cpg-col-3 { width: calc(50% - 10px); }
}

@media (max-width: 600px) {
    .cpg-col-4,
    .cpg-col-3,
    .cpg-col-2,
    .cpg-col-1 { width: 100%; }
}

/* sin imagen */
.cpg-no-image {
    padding: 40px 15px;
    text-align: center;
    font-size: 14px;
    color: #888;
}

/* VIDEO WRAPPER */
.cpg-embed-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}
.cpg-embed-wrapper iframe {
    position: absolute;
    left: 0; top: 0;
    width: 100%;
    height: 100%;
}

/* LIGHTBOX */
#cpg-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

#cpg-lightbox.cpg-lightbox-open {
    display: flex;
}

.cpg-lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.cpg-lightbox-inner img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.cpg-lightbox-close {
    position: absolute;
    right: -10px;
    top: -10px;
    background: #ffffff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* --- FLECHAS DEL LIGHTBOX --- */

/* asegurar que siempre se vean */
#cpg-lightbox .cpg-lightbox-prev,
#cpg-lightbox .cpg-lightbox-next {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* estilo general de las flechas */
.cpg-lightbox-prev,
.cpg-lightbox-next {
    position: absolute;
    top: 50%;
    margin-top: -25px;
    font-size: 50px;                /* tamaño de la flecha */
    font-weight: bold;
    color: #ffffff !important;      /* BLANCAS */
    text-shadow: 0 0 10px rgba(0,0,0,0.8); /* brilla sobre cualquier fondo */
    cursor: pointer;
    z-index: 999999999;             /* por encima de la imagen */
    user-select: none;
    padding: 10px 15px;
}

/* izquierda */
.cpg-lightbox-prev {
    left: 20px;
}

/* derecha */
.cpg-lightbox-next {
    right: 20px;
}

/* hover */
.cpg-lightbox-prev:hover,
.cpg-lightbox-next:hover {
    color: #ffffff !important;
    text-shadow: 0 0 15px rgba(0,0,0,1);
}

@media (max-width: 600px) {
    .cpg-image-wrapper {
        height: 180px;  /* un poco más bajitas en celular */
    }
}
