/* Nasconde il carosello fino a quando Slick non è pronto */
.block-carousel-posts .posts-carousel {
    visibility: hidden;            /* evita il flash a schermo intero */
}

/* Mostra solo quando Slick ha inizializzato correttamente */
.block-carousel-posts .posts-carousel.slick-initialized {
    visibility: visible;
}

/* — Pulsanti freccia personalizzati con SVG come background — */
.block-carousel-posts .posts-carousel > button.slick-arrow {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    width: 40px;
    height: 40px;
    background: transparent; /* nessuno sfondo, useremo SVG */
    border: none;
    cursor: pointer;
    padding: 0;
}

/* Rimuovi qualsiasi contenuto generato */
.block-carousel-posts .posts-carousel > button.slick-arrow::before,
.block-carousel-posts .posts-carousel > button.slick-arrow::after {
    content: "" !important;
    display: none !important;
}

/* Aggiungi icona via ::before o via background-image */
.block-carousel-posts .posts-carousel > button.slick-prev {
    left: 8px;
    background-image:  url(/wp-content/themes/infn/images/svg/arrow-left.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 32px 32px;
}

.block-carousel-posts .posts-carousel > button.slick-next {
    right: 8px;
    background-image:  url(/wp-content/themes/infn/images/svg/arrow-right.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 32px 32px;
}

/* Disabilitato (freccia non attiva) */
.block-carousel-posts .posts-carousel > button.slick-arrow.slick-disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* === Dots personalizzati === */
.block-carousel-posts .posts-carousel .slick-dots {
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 12px; /* distanza tra i pallini */
    position: relative;
    bottom: -40px; /* spaziatura dal carosello */
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
}

/* Ogni pallino come bottone rotondo */
.block-carousel-posts .posts-carousel .slick-dots li {
    width: 24px;
    height: 24px;
    margin: 0; /* gap gestito da gap sopra */
    padding: 0;
}

/* Rimuovi gli stili inline di slick */
.block-carousel-posts .posts-carousel .slick-dots li button {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #dcdcdc; /* colore base */
    border: 2px solid #dcdcdc;
    cursor: pointer;
    font-size: 0; /* nasconde il numero */
    transition: all 0.3s ease;
}

/* Hover */
.block-carousel-posts .posts-carousel .slick-dots li button:hover {
    background-color: #999;
    border-color: #999;
}

/* Attivo */
.block-carousel-posts .posts-carousel .slick-dots li.slick-active button {
    background-color: #000; /* colore attivo */
    border-color: #000;
    transform: scale(1.1);
}

/* Accessibilità e focus */
.block-carousel-posts .posts-carousel .slick-dots li button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
}