/* ============================================================
   NSC EVENTI SLIDER
   Stessi nomi di classe del tema: questo file basta da solo,
   il blocco "SEZIONE EVENTI HOME" in style.css si puo' rimuovere.
   Le regole delle card sono sotto .nsc-slider per vincere
   su quelle del tema finche' restano entrambe.
   ============================================================ */

.nsc-eventi-home {
    background: #f7f4ef;
    padding: 70px 0;
    color: #111;
}

.nsc-eventi-heading {
    text-align: center;
    margin-bottom: 42px;
}

.nsc-small-title {
    color: #fe8902;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 10px;
}

.nsc-eventi-heading h2 {
    color: #111;
    font-size: 42px;
    font-size: clamp(26px, 5vw, 42px);
    line-height: 1.05;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0 0 12px;
    overflow-wrap: break-word;
}

.nsc-eventi-subtitle {
    color: #555;
    font-size: 17px;
    margin: 0;
}

.nsc-eventi-vuoto {
    text-align: center;
    color: #555;
    font-size: 17px;
    margin: 0;
}

/* ============================================================
   SLIDER
   ============================================================ */

.nsc-slider {
    --nsc-gap: 26px;
    --nsc-pv: var(--nsc-pv-d, 3);
    --nsc-arrow: 46px;
    position: relative;
}

.nsc-slider *,
.nsc-slider *::before,
.nsc-slider *::after {
    box-sizing: border-box;
}

.nsc-slider-viewport {
    display: flex;
    gap: var(--nsc-gap);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* spazio per ombra e sollevamento della card in hover */
    padding: 12px 0 46px;
    margin: -12px 0 -46px;
}

.nsc-slider-viewport::-webkit-scrollbar {
    display: none;
}

/* durante lo scorrimento animato dal JS lo snap va sospeso */
.nsc-slider.is-animating .nsc-slider-viewport {
    scroll-snap-type: none;
}

.nsc-slider.is-static .nsc-slider-viewport {
    justify-content: center;
}

.nsc-slide {
    flex: 0 0 calc((100% - (var(--nsc-pv) - 1) * var(--nsc-gap)) / var(--nsc-pv));
    min-width: 0;
    scroll-snap-align: start;
    /* testi e bottoni si adattano alla larghezza reale della card */
    container-type: inline-size;
}

/* Frecce */
.nsc-slider .nsc-slider-arrow {
    position: absolute;
    top: 38%;
    z-index: 5;
    width: var(--nsc-arrow);
    height: var(--nsc-arrow);
    min-width: 0;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #111;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    overflow: visible;
    box-shadow: 0 6px 18px rgba(0,0,0,.22);
    transform: translateY(-50%);
    transition: background .2s ease, color .2s ease, opacity .2s ease;
    -webkit-appearance: none;
    appearance: none;
}

/* freccia disegnata in CSS: non dipende dal font e resta centrata */
.nsc-slider .nsc-slider-arrow span {
    display: block;
    width: 26%;
    height: 26%;
    font-size: 0;
    border: solid currentColor;
    border-width: 0 0 3px 3px;
    transform: translateX(18%) rotate(45deg);
}

.nsc-slider .nsc-slider-next span {
    transform: translateX(-18%) rotate(225deg);
}

.nsc-slider .nsc-slider-arrow:hover,
.nsc-slider .nsc-slider-arrow:focus-visible {
    background: #fe8902;
    color: #111;
    outline: none;
}

.nsc-slider .nsc-slider-prev {
    left: calc(var(--nsc-arrow) / -2);
}

.nsc-slider .nsc-slider-next {
    right: calc(var(--nsc-arrow) / -2);
}

.nsc-slider .nsc-slider-arrow[disabled] {
    opacity: 0;
    pointer-events: none;
}

.nsc-slider.is-static .nsc-slider-arrow,
.nsc-slider.is-static .nsc-slider-dots {
    display: none;
}

/* Puntini */
.nsc-slider-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
    margin-top: 30px;
}

.nsc-slider-dots:empty {
    display: none;
}

.nsc-slider .nsc-slider-dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    min-width: 0;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 999px;
    background: rgba(17,17,17,.22);
    cursor: pointer;
    transition: background .2s ease, width .2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.nsc-slider .nsc-slider-dot.is-active {
    width: 26px;
    background: #fe8902;
}

/* ============================================================
   CARD EVENTO
   ============================================================ */

.nsc-slider .nsc-evento-card {
    position: relative;
    height: 100%;
    max-width: none;
    margin: 0;
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 35px rgba(0,0,0,.08);
    transition: box-shadow .3s ease, border-color .3s ease, opacity .4s ease, filter .4s ease;
}

.nsc-slider .nsc-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: #111;
}

.nsc-slider .nsc-evento-img {
    position: relative;
    flex: 0 0 auto;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #f2f2f2;
}

.nsc-slider .nsc-evento-img img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain;
    display: block;
    transition: transform .35s ease, filter .35s ease;
}

.nsc-slider .nsc-evento-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 22px 26px;
    padding: clamp(18px, 7cqi, 24px) clamp(14px, 6.5cqi, 22px) clamp(20px, 7.5cqi, 26px);
    text-align: center;
}

.nsc-slider .nsc-date {
    display: inline-block;
    color: #fe8902;
    font-size: 13px;
    font-size: clamp(11px, 4cqi, 13px);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .8px;
    margin-bottom: 12px;
}

.nsc-slider .nsc-evento-content h3 {
    color: #111;
    font-size: 26px;
    font-size: clamp(19px, 8cqi, 26px);
    line-height: 1.08;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0 0 8px;
    max-width: 100%;
    overflow-wrap: break-word;
    hyphens: auto;
}

.nsc-slider .nsc-evento-content p {
    color: #666;
    font-size: 16px;
    font-size: clamp(14px, 5cqi, 16px);
    font-weight: 400;
    margin: 0 0 10px;
    max-width: 100%;
    overflow-wrap: break-word;
}

.nsc-slider .nsc-evento-content strong {
    display: block;
    color: #333;
    font-size: 14px;
    font-size: clamp(12.5px, 4.4cqi, 14px);
    margin: 0 0 20px;
    max-width: 100%;
    overflow-wrap: break-word;
}

/* Bottoni: sempre in fondo alla card, anche con testi di altezza diversa */
.nsc-slider .nsc-evento-azioni {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: auto;
}

.nsc-slider .nsc-btn-ticket,
.nsc-slider .nsc-btn-mappa,
.nsc-slider .nsc-btn-ticket:hover,
.nsc-slider .nsc-btn-mappa:hover {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 auto;
    width: auto;
    height: auto;
    min-height: 44px;
    max-width: 100%;
    margin: 0;
    padding: 10px 20px;
    border: 2px solid #fe8902;
    border-radius: 999px;
    background: #fe8902;
    color: #111;
    font-size: 13px;
    font-size: clamp(11.5px, 4.2cqi, 13px);
    font-weight: 900;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .7px;
    white-space: normal;
    overflow-wrap: break-word;
    transition: background .25s ease, color .25s ease, border-color .25s ease;
}

.nsc-slider .nsc-btn-mappa,
.nsc-slider .nsc-btn-mappa:hover {
    position: relative;
    z-index: 2;
    background: transparent;
    border-color: #111;
    color: #111;
}

.nsc-slider .nsc-btn-mappa::before {
    content: "";
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    margin-right: 7px;
    border: 3px solid currentColor;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg) translate(1px, -1px);
}

.nsc-slider .nsc-btn-mappa:hover,
.nsc-slider .nsc-btn-mappa:focus-visible {
    background: #111;
    color: #fff;
}

/* due bottoni: affiancati se c'e' spazio, altrimenti impilati a tutta larghezza */
.nsc-slider .nsc-evento-azioni.has-due > a,
.nsc-slider .nsc-evento-azioni.has-due > a:hover {
    flex: 1 1 auto;
}

/* Il link biglietti copre tutta la card: la card resta cliccabile per intero
   e il tasto mappa, che sta sopra, apre invece Google Maps. */
.nsc-slider .nsc-card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.nsc-slider .nsc-card-link:focus-visible {
    outline: 3px solid #111;
    outline-offset: 2px;
}

/* card strette (molti eventi per riga o smartphone): bottoni a tutta larghezza */
@container (max-width: 330px) {
    .nsc-slider .nsc-btn-ticket,
    .nsc-slider .nsc-btn-mappa,
    .nsc-slider .nsc-btn-ticket:hover,
    .nsc-slider .nsc-btn-mappa:hover {
        flex: 1 1 100%;
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* In hover nulla si sposta o cambia dimensione: cambiano solo ombra, bordo
   e colore del bottone. Annulla anche sollevamento e zoom previsti dal
   vecchio CSS del tema. */
.nsc-slider .nsc-evento-card,
.nsc-slider .nsc-evento-card:hover,
.nsc-slider .nsc-evento-card .nsc-evento-img img,
.nsc-slider .nsc-evento-card:hover .nsc-evento-img img,
.nsc-slider .nsc-evento-card .nsc-btn-ticket,
.nsc-slider .nsc-evento-card:hover .nsc-btn-ticket {
    transform: none;
}

@media (hover: hover) {
    .nsc-slider .nsc-evento-card:hover {
        border-color: rgba(254,137,2,.65);
        box-shadow: 0 22px 55px rgba(0,0,0,.13);
    }

    .nsc-slider .nsc-evento-card:hover .nsc-btn-ticket {
        background: #111;
        border-color: #111;
        color: #fff;
    }
}

/* ============================================================
   EVENTO CONCLUSO / SPENTO
   ============================================================ */

.nsc-slider .nsc-evento-card.is-past {
    opacity: .58;
    filter: grayscale(1);
    pointer-events: auto;
    cursor: not-allowed;
    box-shadow: none;
    -webkit-user-select: none;
    user-select: none;
}

.nsc-slider .nsc-evento-card.is-past .nsc-btn-ticket {
    background: #d6d6d6;
    border-color: #d6d6d6;
    color: #555;
}

/* Al passaggio del mouse la card conclusa riprende colore in dissolvenza
   e torna grigia quando il mouse esce. Resta non cliccabile. */
@media (hover: hover) {
    .nsc-slider .nsc-evento-card.is-past:hover {
        opacity: 1;
        filter: grayscale(0);
        border-color: rgba(0,0,0,.14);
        box-shadow: 0 12px 35px rgba(0,0,0,.08);
    }

    .nsc-slider .nsc-evento-card.is-past:hover .nsc-btn-ticket {
        background: #d6d6d6;
        border-color: #d6d6d6;
        color: #555;
    }
}

.nsc-slider .nsc-evento-status {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    max-width: calc(100% - 28px);
    background: rgba(17,17,17,.85);
    color: #fff;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-size: clamp(10.5px, 3.8cqi, 12px);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
}

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

/* sotto questa larghezza non c'e' margine fuori dal contenitore:
   le frecce restano dentro lo schermo, a cavallo del bordo delle card */
@media (max-width: 1240px) {
    .nsc-slider {
        --nsc-arrow: 42px;
    }

    .nsc-slider .nsc-slider-prev {
        left: -10px;
    }

    .nsc-slider .nsc-slider-next {
        right: -10px;
    }
}

@media (max-width: 991px) {
    .nsc-slider {
        --nsc-pv: var(--nsc-pv-t, 2);
        --nsc-gap: 20px;
    }

    .nsc-eventi-home {
        padding: 45px 0;
    }

    .nsc-eventi-heading {
        margin-bottom: 32px;
    }
}

@media (max-width: 575px) {
    .nsc-slider {
        --nsc-pv: var(--nsc-pv-m, 1);
        --nsc-gap: 14px;
        --nsc-arrow: 38px;
    }

    .nsc-eventi-home {
        padding: 35px 0;
    }

    .nsc-eventi-heading {
        margin-bottom: 26px;
    }

    .nsc-eventi-subtitle {
        font-size: 15px;
    }

    .nsc-slider-dots {
        margin-top: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nsc-slider .nsc-evento-card,
    .nsc-slider .nsc-evento-img img,
    .nsc-slider .nsc-btn-ticket,
    .nsc-slider .nsc-btn-mappa {
        transition: none;
    }
}
