/* ===============================
   C.E.S.I - Slider (slide orizzontale)
   =============================== */

.cesi-slider,
.cesi-slider * { box-sizing: border-box; }

.cesi-slider {
    position: relative;
    width: 100%;
    height: 520px;
    overflow: hidden;
    background: #111;
    user-select: none;
    touch-action: pan-y;
    outline: none;
    /* Ombra esterna nera, alta e marcata */
    box-shadow:
        0 22px 50px rgba(0, 0, 0, .35),
        0 10px 24px rgba(0, 0, 0, .22),
        0 4px 10px rgba(0, 0, 0, .12);
    z-index: 1;
}

/* Track: contenitore flessibile che scorre */
.cesi-slider__track {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform .65s cubic-bezier(.4, 0, .2, 1);
    will-change: transform;
}

/* Ogni slide occupa il 100% del contenitore */
.cesi-slider__slide {
    position: relative;
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.cesi-slider__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---------- OVERLAY GRADIENTE ALLA BASE ---------- */
.cesi-slider__overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 45%;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.55) 35%,
        rgba(0, 0, 0, 0.20) 70%,
        rgba(0, 0, 0, 0)   100%
    );
    pointer-events: none;
    z-index: 2;
}

/* ---------- CAPTION CENTRATO ---------- */
.cesi-slider__caption {
    position: absolute;
    inset: 0;
    padding: 50px 70px;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 14px;
    pointer-events: none;
    text-shadow: 0 2px 12px rgba(0,0,0,.75);
    z-index: 3;
}

.cesi-slider__title {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: .5px;
    line-height: 1.15;
    max-width: 700px;
}

.cesi-slider__desc {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.4;
    max-width: 600px;
    opacity: .95;
}

/* ---------- FRECCE ---------- */
.cesi-slider__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.45);
    color: #fff;
    font-size: 1.15rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, transform .2s ease;
    backdrop-filter: blur(4px);
}

.cesi-slider__arrow:hover,
.cesi-slider__arrow:focus-visible {
    background: #3ab2f3;
    outline: none;
    transform: translateY(-50%) scale(1.06);
}

.cesi-slider__arrow--prev { left: 20px; }
.cesi-slider__arrow--next { right: 20px; }

/* ---------- PUNTINI ---------- */
.cesi-slider__dots {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(0,0,0,.35);
    backdrop-filter: blur(4px);
}

.cesi-slider__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.55);
    cursor: pointer;
    padding: 0;
    transition: background .2s ease, transform .2s ease;
}

.cesi-slider__dot:hover,
.cesi-slider__dot:focus-visible {
    background: #fff;
    outline: none;
}

.cesi-slider__dot.is-active {
    background: #3ab2f3;
    transform: scale(1.25);
}

/* =========================================================
   ADMIN SLIDER — thumb quadrata 16:5
   ========================================================= */
.cesi-adm-slide__thumb {
    position: relative;
    aspect-ratio: 16 / 5;
    overflow: hidden;
    background: #eee;
}

.cesi-adm-slide__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =========================================================
   ADMIN SLIDER — bottone elimina (stile gestisci_corsi)
   ========================================================= */
.cesi-adm-slide {
    position: relative;
}

.cesi-adm-slide__delete {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 9999;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f4f6f8;
    color: #4a515b;
    border: 1px solid #e3e6ea;
    border-radius: 8px;
    font-size: .9rem;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
    opacity: 1;
    visibility: visible;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.cesi-adm-slide__delete i {
    color: inherit;
    font-size: .9rem;
    line-height: 1;
}

.cesi-adm-slide__delete:hover,
.cesi-adm-slide__delete:focus-visible {
    background: #e63946;
    color: #ffffff;
    border-color: #e63946;
    transform: translateY(-1px);
    outline: none;
}

.cesi-adm-slide__delete:hover i,
.cesi-adm-slide__delete:focus-visible i {
    color: #ffffff;
}

.cesi-adm-slide__delete:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

/* =========================================================
   ANTEPRIMA CROP SLIDER — 16:5
   ========================================================= */
.cesi-adm-preview--slider {
    aspect-ratio: 16 / 5;
    max-width: 480px;
    background: #f4f6f8;
    border: 1px solid #d6dbe0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}

.cesi-adm-preview--slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .cesi-slider { height: 360px; }
    .cesi-slider__caption { padding: 30px 24px; }
    .cesi-slider__title { font-size: 1.6rem; }
    .cesi-slider__desc { font-size: .95rem; }
    .cesi-slider__arrow { width: 42px; height: 42px; font-size: 1rem; }
    .cesi-slider__arrow--prev { left: 10px; }
    .cesi-slider__arrow--next { right: 10px; }
    .cesi-slider__dots { bottom: 12px; gap: 8px; }
    .cesi-slider__dot { width: 8px; height: 8px; }
    .cesi-slider__overlay { height: 55%; }
}

@media (max-width: 420px) {
    .cesi-slider { height: 260px; }
    .cesi-slider__caption { padding: 20px 16px; }
    .cesi-slider__title { font-size: 1.2rem; }
    .cesi-slider__desc { font-size: .85rem; }
    .cesi-slider__overlay { height: 60%; }
}