
/* ==========================================
   GALERÍA CARRUSEL - WORDPRESS
   ========================================== */

/* Contenedor principal */
.gallery.gallery-columns-1.is-carousel {
    position: relative;
    display: block;
    width: 100%;
    max-width: 750px;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    margin: 20px auto;
    padding: 0;
    background-color: #fff;
}

/* ==========================================
   DIAPOSITIVAS
   ========================================== */

.gallery.gallery-columns-1.is-carousel > .gallery-item {
    position: absolute;
    inset: 0;
    display: block;
    float: none !important;
    width: 100% !important;
    height: 100%;
    margin: 0 !important;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .6s ease, visibility .6s ease;
}

/* Diapositiva activa */
.gallery.gallery-columns-1.is-carousel > .gallery-item.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

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

/* Contenedor de cada imagen */
.gallery.gallery-columns-1.is-carousel .gallery-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: #fff;
}

/* Enlace de la imagen */
.gallery.gallery-columns-1.is-carousel .gallery-icon a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Imagen completa, sin recortes */
.gallery.gallery-columns-1.is-carousel .gallery-icon img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    border: 0;
    box-shadow: none;
}

/* ==========================================
   FLECHAS DE NAVEGACIÓN
   ========================================== */

.gallery-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;

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

    width: 40px;
    height: 40px;
    padding: 0;

    border: 0;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, .4);
    color: #fff;

    font-size: 28px;
    line-height: 1;
    cursor: pointer;

    transition: background-color .2s ease;
}

/* Flecha anterior */
.gallery-carousel-prev {
    left: 10px;
}

/* Flecha siguiente */
.gallery-carousel-next {
    right: 10px;
}

/* Hover */
.gallery-carousel-arrow:hover {
    background-color: rgba(0, 0, 0, .7);
}

/* ==========================================
   PAGINACIÓN
   ========================================== */

.gallery-carousel-pagination {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    z-index: 10;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Puntos */
.gallery-carousel-pagination button {
    display: block;
    width: 10px;
    height: 10px;
    min-width: 10px;
    padding: 0;

    border: 1px solid #555;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, .2);

    cursor: pointer;
    transition: background-color .2s ease;
}

/* Punto activo */
.gallery-carousel-pagination button.is-active {
    background-color: #333;
    border-color: #333;
}

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

@media (max-width: 768px) {

    .gallery.gallery-columns-1.is-carousel {
        aspect-ratio: 4 / 3;
    }

    .gallery-carousel-arrow {
        width: 32px;
        height: 32px;
        font-size: 24px;
    }

    .gallery-carousel-prev {
        left: 5px;
    }

    .gallery-carousel-next {
        right: 5px;
    }

    .gallery-carousel-pagination {
        bottom: 8px;
    }
}

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

/* Navegación mediante teclado */
.gallery-carousel-arrow:focus-visible,
.gallery-carousel-pagination button:focus-visible {
    outline: 2px solid #333;
    outline-offset: 3px;
}

/* Reducir animaciones según preferencias */
@media (prefers-reduced-motion: reduce) {

    .gallery.gallery-columns-1.is-carousel > .gallery-item,
    .gallery-carousel-arrow,
    .gallery-carousel-pagination button {
        transition: none;
    }
}
