/* =========================================================
   HSDD Events — Frontend Styles
   ========================================================= */

/* Reset base */
.hsdd-events-list,
.hsdd-events-grid,
.hsdd-events-timetable { margin: 0; padding: 0; list-style: none; }

/* -------- Layout List -------- */
/* Design "riga di lista": nessun box/border/shadow, solo un separatore
   orizzontale leggero tra un evento e l'altro. Il trattamento "a card"
   (box-shadow, sfondo bianco) esiste solo nella variante mobile "card"
   sotto i 480px — vedi sezione Responsive più in basso. */
.hsdd-events-list {
    display: flex; flex-direction: column; gap: 0;
    border-top: 1px solid #e5e5e5;
}

.hsdd-event-card--list {
    position: relative;
    display: flex; align-items: flex-start; gap: 1.25rem;
    margin: 0 !important;
    padding: var( --hsdd-row-padding, 16px 0 ) !important;
    border-bottom: 1px solid var( --hsdd-divider-color, #e5e5e5 );
}

/* Permalink che copre l'intera riga: tutta la card è cliccabile */
.hsdd-event-card__permalink {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
}

.hsdd-event-card--list .hsdd-event-card__image-wrap {
    position: relative; flex: 0 0 140px; width: 140px; height: 140px; overflow: hidden;
}
.hsdd-event-card--list .hsdd-event-card__image-wrap--rounded { border-radius: 12px; }
.hsdd-event-card--list .hsdd-event-card__image-wrap--circle { border-radius: 50%; }
.hsdd-event-card--list .hsdd-event-card__image-wrap a { display: block; width: 100%; height: 100%; position: relative; }
.hsdd-event-card--list .hsdd-event-card__image-wrap img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    animation: hsdd-img-fade-in 0.5s ease;
}
@keyframes hsdd-img-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
.hsdd-event-card--list .hsdd-event-card__overlay {
    position: absolute; inset: 0;
    background: var( --hsdd-overlay-color, rgba(0,0,0,.5) );
}

.hsdd-event-card--list .hsdd-event-card__body {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 0.45rem;
}
.hsdd-event-card--list .hsdd-event-card__body > * { margin: 0; }

.hsdd-event-card--list .hsdd-event-card__title,
.hsdd-event-card--list .hsdd-event-card__title a {
    font-size: 23px !important; line-height: 1.06em; font-weight: 700;
    color: var( --hsdd-title-color, inherit ); text-decoration: none;
}
.hsdd-event-card--list .hsdd-event-card__title--large,
.hsdd-event-card--list .hsdd-event-card__title--large a {
    font-size: 28px !important;
}
.hsdd-event-card--list .hsdd-event-card__title a:hover { text-decoration: underline; }

.hsdd-event-card--list .hsdd-event-card__subtitle {
    font-size: 17px; line-height: 1.36em; color: var( --hsdd-subtitle-color, #555 );
}

.hsdd-event-card--list .hsdd-event-card__excerpt {
    font-size: 0.9rem; color: #555;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: ellipsis;
}

/* Tag in fondo alla card (tags_position="bottom"): icona + nomi separati
   da pallini, più piccoli e discreti rispetto ai talloncini in alto. */
.hsdd-event-card--list .hsdd-event-card__tags-bottom {
    display: flex; flex-wrap: wrap; align-items: center;
    margin-top: 0.4rem; font-size: 0.7rem; color: #777;
}
.hsdd-event-card--list .hsdd-event-card__tags-bottom svg { margin-right: 0.35rem; }
.hsdd-event-card--list .hsdd-event-card__tag-dot {
    display: inline-block; width: 2px; height: 2px; border-radius: 50%;
    background: currentColor; margin: 0 4px;
}

/* Organizzatore in fondo alla card, prima dei tag */
.hsdd-event-card--list .hsdd-event-card__organizer {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 !important;
    line-height: 1.26em;
}
.hsdd-event-card--list .hsdd-event-card__organizer svg { flex: none; }
.hsdd-event-card--list .hsdd-event-card__organizer-prefix {
    font-size: 0.9rem; font-weight: 400; opacity: 0.5;
}
.hsdd-event-card--list .hsdd-event-card__organizer-value {
    font-size: calc(0.9rem + 2px); font-weight: 700;
}

.hsdd-event-card--list .hsdd-event-card__badges {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.5rem;
}
.hsdd-event-card--list .hsdd-event-card__cat {
    line-height: 1em; padding: 0.3em 0.6em; font-size: 0.75rem; margin-top: 0;
    border: 1px solid transparent;
}
.hsdd-event-card--list .hsdd-event-card__tag {
    display: inline-block; line-height: 1em; padding: 0.3em 0.6em;
    font-size: 0.75rem; border-radius: 3px; margin-top: 0;
    background: none; border: 1px solid #ccc; color: #555;
}

.hsdd-event-card--list .hsdd-event-card__action {
    position: relative; z-index: 2; align-self: stretch; flex: 0 0 auto;
    display: flex;
}
.hsdd-event-card--list .hsdd-event-card__image-wrap,
.hsdd-event-card--list .hsdd-event-card__title a { position: relative; z-index: 2; }

/* Desktop (≥960px): bottoni "+"/calendario impilati, ancorati in basso
   (align bottom) alla riga — non in cima. */
@media (min-width: 960px) {
    .hsdd-event-card--list .hsdd-event-card__action {
        flex-direction: column; justify-content: flex-end; align-items: center; gap: 0.5rem;
        opacity: 0; transition: opacity 0.2s;
    }
    .hsdd-event-card--list:hover .hsdd-event-card__action {
        opacity: 1;
    }
}

/* Sotto i 960px: i bottoni diventano un footer a piena larghezza sotto
   il contenuto (la riga va a capo), con divisore superiore. Calendario a
   sx, dettaglio a dx — row-reverse perché nel markup "dettaglio" precede
   "calendario" (per lo stack desktop sopra). */
@media (max-width: 959px) {
    .hsdd-event-card--list {
        flex-wrap: wrap;
        padding: var( --hsdd-row-padding-mobile, 16px 0 ) !important;
    }
    .hsdd-event-card--list .hsdd-event-card__image-wrap {
        margin-top: 7px;
    }
    .hsdd-event-card--list .hsdd-event-card__action {
        flex: 1 0 100%; order: 99;
        flex-direction: row-reverse; justify-content: space-between; align-items: center;
        margin-top: -0.50em; padding-top: 0.75rem; border-top: 1px solid #e1e1e1;
    }
}
.hsdd-event-card--list .hsdd-event-card__action-btn {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border: 1px solid #ddd; border-radius: 4px;
    background: transparent;
    color: #1a1a1a; text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}
.hsdd-event-card--list .hsdd-event-card__action-btn:hover { border-color: #1a1a1a; background: #f7f7f7; }
.hsdd-event-card--list .hsdd-event-card__action-btn svg { width: 16px; height: 16px; }
button.hsdd-event-card__action-btn { font: inherit; cursor: pointer; }
.hsdd-event-card--list .hsdd-event-card__action-btn--ticket {
    background: #f0f0f0; border-color: #d0d0d0;
}
.hsdd-event-card--list .hsdd-event-card__action-btn--ticket svg { width: 18px; height: 18px; }
.hsdd-event-card--list .hsdd-event-card__action-btn--ticket:hover { background: #e4e4e4; border-color: #aaa; }

/* Tooltip di conferma "Aggiungi al calendario?" */
.hsdd-event-card__calendar-wrap { position: relative; z-index: 2; display: flex; }
.hsdd-event-card__calendar-tooltip {
    position: absolute; bottom: calc(100% + 8px); right: 0;
    display: flex; align-items: center; gap: 0.6rem;
    background: #1a1a1a; color: #fff; border-radius: 6px;
    padding: 0.5rem 0.75rem; white-space: nowrap;
    font-size: 0.8rem; box-shadow: 0 4px 12px rgba(0,0,0,.2);
    z-index: 5;
}
.hsdd-event-card__calendar-tooltip[hidden] { display: none; }
.hsdd-event-card__calendar-tooltip::after {
    content: ''; position: absolute; top: 100%; right: 14px;
    border: 6px solid transparent; border-top-color: #1a1a1a;
}
.hsdd-event-card__calendar-confirm {
    background: #3dbfa5; color: #fff; text-decoration: none;
    border-radius: 4px; padding: 0.2rem 0.6rem; font-weight: 600;
    flex: none;
}
.hsdd-event-card__calendar-confirm:hover { background: #1a8570; }

/* Badge data sull'immagine (list) — nessun background proprio: la resa
   scura è già data dal layer .hsdd-event-card__overlay (36% di default). */
.hsdd-event-card--list .hsdd-event-card__date-badge {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    z-index: 1; color: var( --hsdd-date-color, #fff ); text-align: center; background: none;
    display: flex; flex-direction: column; align-items: center;
}
.hsdd-event-card--list .hsdd-event-card__date-day,
.hsdd-event-card--list .hsdd-event-card__date-month,
.hsdd-event-card--list .hsdd-event-card__date-year {
    line-height: 1.06em;
}
.hsdd-event-card--list .hsdd-event-card__date-day { font-size: 1.8rem; font-weight: 700; }
.hsdd-event-card--list .hsdd-event-card__date-month { font-size: 0.9rem; letter-spacing: 0.05em; text-transform: uppercase; }
.hsdd-event-card--list .hsdd-event-card__date-year { font-size: 0.8rem; opacity: 0.85; }
.hsdd-event-card--list .hsdd-event-card__date-time { display: block; margin-top: 1em; font-size: 0.85rem; }

/* Variante "large": +26% su tutte le righe del badge data */
.hsdd-event-card--list .hsdd-event-card__date-badge--large .hsdd-event-card__date-day { font-size: 2.27rem; }
.hsdd-event-card--list .hsdd-event-card__date-badge--large .hsdd-event-card__date-month { font-size: 1.13rem; }
.hsdd-event-card--list .hsdd-event-card__date-badge--large .hsdd-event-card__date-year { font-size: 1.01rem; }
.hsdd-event-card--list .hsdd-event-card__date-badge--large .hsdd-event-card__date-time { font-size: 1.07rem; }

/* Variante "senza immagine in evidenza": resta solo il badge data, colonna
   dimezzata, sfondo scuro pieno al posto della foto, badge in alto a sx. */
.hsdd-event-card--list .hsdd-event-card__image-wrap--no-image {
    flex-basis: 70px; width: 70px; height: 70px;
    background: #1a1a1a;
}
.hsdd-event-card--list .hsdd-event-card__image-wrap--no-image .hsdd-event-card__date-badge {
    top: 0.5rem; left: 0.5rem; transform: none; align-items: flex-start; text-align: left;
}
.hsdd-event-card--list .hsdd-event-card__image-wrap--no-image .hsdd-event-card__date-day { font-size: 1.1rem; }
.hsdd-event-card--list .hsdd-event-card__image-wrap--no-image .hsdd-event-card__date-month { font-size: 0.6rem; }
.hsdd-event-card--list .hsdd-event-card__image-wrap--no-image .hsdd-event-card__date-year,
.hsdd-event-card--list .hsdd-event-card__image-wrap--no-image .hsdd-event-card__date-time { display: none; }

/* Talloncino categoria + tag in overlay sull'immagine — esiste nel markup
   solo quando mobile_layout="card", ma resta nascosto finché non si è
   sotto i 480px (vedi Responsive): sopra i 480px vince sempre la versione
   nel corpo, sopra il titolo, come nella lista tradizionale. */
.hsdd-event-card--list .hsdd-event-card__badges--overlay {
    display: none;
    position: absolute; top: 0.6rem; right: 0.6rem; z-index: 1;
    flex-wrap: wrap; justify-content: flex-end; gap: 0.35rem; max-width: calc(100% - 1.2rem);
}
.hsdd-event-card__cat--overlay { background: #fff; color: #1a1a1a; }
.hsdd-event-card__tag--overlay { background: rgba(255,255,255,0.15); border-color: #fff; color: #fff; }

/* -------- Layout Grid -------- */
.hsdd-events-grid {
    display: grid;
    grid-template-columns: repeat(var(--hsdd-cols, 3), 1fr);
    gap: 1.5rem;
}
.hsdd-events-grid--cols-2 { --hsdd-cols: 2; }
.hsdd-events-grid--cols-3 { --hsdd-cols: 3; }
.hsdd-events-grid--cols-4 { --hsdd-cols: 4; }

.hsdd-event-card--grid .hsdd-event-card__link {
    display: flex; flex-direction: column; text-decoration: none; color: inherit;
    border: 1px solid #e5e5e5; border-radius: 6px; overflow: hidden;
    height: 100%; transition: box-shadow 0.2s;
}
.hsdd-event-card--grid .hsdd-event-card__link:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.hsdd-event-card--grid .hsdd-event-card__image-wrap {
    position: relative; aspect-ratio: 16/9; overflow: hidden;
}
.hsdd-event-card--grid .hsdd-event-card__image-wrap img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.hsdd-event-card--grid .hsdd-event-card__body { padding: 1rem; flex: 1; }
.hsdd-event-card--grid .hsdd-event-card__title { margin: 0 0 0.5rem; font-size: 1rem; }

/* Date badge (list + grid) */
.hsdd-event-card__date-badge {
    position: absolute; top: 0.5rem; left: 0.5rem;
    background: rgba(0,0,0,0.72); color: #fff;
    display: flex; flex-direction: column; align-items: center;
    padding: 0.3rem 0.5rem; border-radius: 4px; line-height: 1.1;
    font-size: 0.8rem; text-transform: uppercase;
}
.hsdd-event-card__date-badge .day   { font-size: 1.4rem; font-weight: 700; line-height: 1; }
.hsdd-event-card__date-badge .month { font-size: 0.7rem; letter-spacing: 0.05em; }

/* Category badge */
.hsdd-event-card__cat {
    display: inline-block; font-size: 0.75rem; padding: 0.15rem 0.5rem;
    background: #f0f0f0; border-radius: 3px; margin-top: 0.5rem;
}

/* -------- Intestazioni di gruppo (group_by day/week/month) -------- */
.hsdd-events-group-header {
    list-style: none;
    padding: 0.5rem 0 0.5rem !important;
    margin: 50px 0 0 !important;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-top: 1px solid #e5e5e5;
    border-bottom: 1px dashed #1a1a1a;
}
.hsdd-events-list > .hsdd-events-group-header:first-child { padding-top: 0.5rem; border-top: none; margin-top: 25px !important; }

/* -------- Event Meta -------- */
.hsdd-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.9rem;
    line-height: 1.66em;
    color: #555;
    margin: 0.5rem 0;
    align-items: center;
}
.hsdd-event-card--list .hsdd-event-meta { color: var( --hsdd-meta-color, #555 ); }
.hsdd-event-meta span { display: inline-flex; align-items: center; gap: 0.3em; }
.hsdd-icon { flex: none; vertical-align: -2px; }
.hsdd-event-ticket {
    display: inline-block; padding: 0.2rem 0.75rem;
    background: #1a1a1a; color: #fff; border-radius: 4px;
    text-decoration: none; font-size: 0.85rem;
}
.hsdd-event-ticket:hover { background: #333; }

/* -------- Layout Timetable -------- */
.hsdd-events-timetable { width: 100%; border-collapse: collapse; }
.hsdd-events-timetable th,
.hsdd-events-timetable td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid #e5e5e5; font-size: 0.9rem; }
.hsdd-events-timetable th { background: #f7f7f7; font-weight: 600; }
.hsdd-events-timetable tbody tr:nth-child(even) td { background: #f5f5f5; }
.hsdd-events-timetable tr:hover td { background: #fafafa; }
.hsdd-tt-date { white-space: nowrap; font-weight: 600; }
.hsdd-tt-time { white-space: nowrap; color: #555; }
.hsdd-tt-title a { text-decoration: none; color: inherit; }
.hsdd-tt-title a:hover { text-decoration: underline; }

/* -------- Recurrences Modal -------- */
.hsdd-recurrences-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; padding: 1rem;
}
.hsdd-recurrences-modal[hidden] { display: none; }
.hsdd-recurrences-modal__content {
    background: #fff; border-radius: 10px; overflow: hidden;
    max-width: 768px; width: 100%; max-height: 90vh;
    position: relative; display: flex; flex-direction: column;
}
.hsdd-recurrences-modal__close {
    position: absolute; top: 0.75rem; right: 0.75rem; z-index: 2;
    background: rgba(255,255,255,.9); border: none; border-radius: 50%;
    width: 28px; height: 28px; font-size: 1.3rem; line-height: 1; cursor: pointer;
}

/* Header: featured image stile mobile-card compact, con badge data e categoria */
.hsdd-recurrences-modal__header {
    position: relative; flex: none;
    aspect-ratio: 21 / 9; overflow: hidden; background: #eee;
}
.hsdd-recurrences-modal__header img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Stesso overlay (colore piatto, variabile --hsdd-overlay-color) usato
   dalla card lista, invece del gradiente proprio del modale: restano
   visivamente sincronizzati. */
.hsdd-recurrences-modal__overlay {
    position: absolute; inset: 0;
    background: var( --hsdd-overlay-color, rgba(0,0,0,.5) );
}
.hsdd-recurrences-modal__header .hsdd-event-card__date-badge {
    position: absolute; top: 0.75rem; left: 0.75rem;
    flex-direction: column; align-items: flex-start; text-align: left;
    padding: 0.6rem 0.8rem;
}
.hsdd-recurrences-modal__header .hsdd-event-card__date-day { font-size: 1.6rem; font-weight: 700; line-height: 1.06em; }
.hsdd-recurrences-modal__header .hsdd-event-card__date-month { font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase; line-height: 1.06em; }
.hsdd-recurrences-modal__header .hsdd-event-card__date-year { font-size: 0.75rem; opacity: 0.85; line-height: 1.06em; }
.hsdd-recurrences-modal__badges {
    position: absolute; bottom: 0.75rem; left: 0.75rem; right: 0.75rem;
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
}
.hsdd-recurrences-modal__cat,
.hsdd-recurrences-modal__tag,
.hsdd-recurrences-modal__badges .hsdd-event-card__recurrence-badge {
    margin-top: 0 !important;
}
.hsdd-recurrences-modal__tag {
    display: inline-block; line-height: 1em; padding: 0.3em 0.6em;
    font-size: 0.75rem; border-radius: 3px;
}

.hsdd-recurrences-modal__body { padding: 1.25rem 1.5rem 1.5rem; overflow-y: auto; }
.hsdd-recurrences-modal__title { margin: 0 0 0.4rem; font-size: 1.15rem; line-height: 1.3; }
.hsdd-recurrences-modal__body .hsdd-event-card__organizer {
    display: flex; align-items: center; gap: 0.35rem; margin: 0 0 0.4rem;
}
.hsdd-recurrences-modal__body .hsdd-event-card__organizer svg { flex: none; }
.hsdd-recurrences-modal__body .hsdd-event-card__organizer-prefix { font-size: 0.9rem; font-weight: 400; opacity: 0.5; }
.hsdd-recurrences-modal__body .hsdd-event-card__organizer-value { font-size: calc(0.9rem + 2px); font-weight: 700; }
.hsdd-recurrences-modal__meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; font-size: 0.85rem; color: #555; }
.hsdd-recurrences-modal__meta span { display: inline-flex; align-items: center; gap: 0.3em; }
.hsdd-recurrences-modal__subtitle { margin: 0 0 0.5rem; color: #555; font-size: 0.9rem; }
.hsdd-recurrences-modal__meta { margin: 0 0 0.75rem; }

.hsdd-recurrences-modal__divider {
    border: none; border-top: 1px solid var( --hsdd-divider-color, #e5e5e5 );
    margin: 0 -1.5rem 0.5rem;
}

/* margin:0 !important su ul/li: il tema Enfold applica margini propri a
   liste generiche che altrimenti "sfondano" nel modale. */
.hsdd-recurrences-modal__list {
    list-style: none; margin: 0 !important; padding: 0; max-height: 40vh; overflow-y: auto;
}
.hsdd-recurrences-modal__item {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    margin: 0 !important;
    padding: 0.7rem 0.1rem; border-bottom: 1px solid var( --hsdd-divider-color, #eee );
    font-size: 0.9rem; color: #333;
}
.hsdd-recurrences-modal__item:last-child { border-bottom: none; }
.hsdd-recurrences-modal__item-date { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.hsdd-recurrences-modal__item-time { display: inline-flex; align-items: center; gap: 0.3em; color: #777; }
.hsdd-recurrences-modal__item .hsdd-icon { flex: none; vertical-align: -2px; }
.hsdd-recurrences-modal__item--primary { font-weight: 700; color: #146b5a; }
.hsdd-recurrences-modal__item-action {
    display: inline-flex; align-items: center; justify-content: center;
    flex: none; width: 34px; height: 34px; border-radius: 50%;
    background: #eef7f5; color: #146b5a; text-decoration: none;
    transition: background .15s ease;
}
.hsdd-recurrences-modal__item-action:hover { background: #d7efe9; }

/* -------- Bottone apertura modale ricorrenze (accanto a data/ora) -------- */
.hsdd-event-meta__recurrences-toggle {
    position: relative; z-index: 2;
    display: inline-flex; align-items: center; justify-content: center;
    background: none; border: 1px solid currentColor; border-radius: 50%;
    width: 1.6em; height: 1.6em; padding: 0; cursor: pointer;
    color: inherit; opacity: 0.75; transition: opacity .15s ease, transform .15s ease;
}
.hsdd-event-meta__recurrences-toggle:hover { opacity: 1; transform: scale(1.08); }
.hsdd-event-meta__recurrences-toggle svg { width: 0.9em; height: 0.9em; }

/* -------- Badge "ricorrenza" (modalità duplicate + header modale) --------
   Sfondo gradiente diagonale grigio chiaro/bianco, animato lentamente,
   testo rosso: un'etichetta volutamente "speciale", distinta dalle badge
   categoria/tag. */
.hsdd-event-card__recurrence-badge {
    display: inline-flex; align-items: center; gap: 0.3em;
    background: linear-gradient( 135deg, #f2f2f2 0%, #ffffff 50%, #e8e8e8 100% );
    background-size: 220% 220%;
    color: #c0392b; border: 1px solid #e0e0e0;
    animation: hsdd-recurrence-badge-shift 6s ease-in-out infinite;
}
.hsdd-event-card__recurrence-badge svg { flex: none; }
.hsdd-event-card__recurrence-badge--overlay { border-color: rgba(255,255,255,.6); }
@keyframes hsdd-recurrence-badge-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@media (prefers-reduced-motion: reduce) {
    .hsdd-event-card__recurrence-badge { animation: none; }
}

/* Icona repliche fra i pulsanti azione (stessa UI di dettaglio/calendario),
   spostata a destra insieme alle altre azioni sulle card di occorrenza. */
.hsdd-event-card__action-btn--recurrence {
    color: #c0392b; cursor: default;
}

/* Bottone biglietteria: sempre visibile a riposo su desktop.
   Poiché opacity sul padre non è ereditabile in senso inverso, la colonna
   --has-ticket resta opacity:1 e gli altri button vengono nascosti
   individualmente, rientrando su hover della riga. */
@media (min-width: 960px) {
    .hsdd-event-card--list .hsdd-event-card__action--has-ticket {
        opacity: 1;
    }
    .hsdd-event-card--list .hsdd-event-card__action--has-ticket .hsdd-event-card__action-btn:not(.hsdd-event-card__action-btn--ticket) {
        opacity: 0;
        transition: opacity 0.2s;
    }
    .hsdd-event-card--list:hover .hsdd-event-card__action--has-ticket .hsdd-event-card__action-btn:not(.hsdd-event-card__action-btn--ticket) {
        opacity: 1;
    }
}

/* -------- Tag urgenza dinamici (in base alla data evento) --------
   Stile outline (nessun riempimento), colore per livello di urgenza. */
.hsdd-event-card__urgency-tag {
    display: inline-block; line-height: 1em; padding: 0.3em 0.6em;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.03em; border-radius: 3px; background: none;
    border: 1px solid currentColor; margin-top: 0;
}
.hsdd-event-card__urgency-tag--in-corso  { color: #e74c3c; animation: hsdd-urgency-pulse 2.4s ease-in-out infinite; }
.hsdd-event-card__urgency-tag--oggi      { color: #e74c3c; }
.hsdd-event-card__urgency-tag--domani    { color: #e67e22; }
.hsdd-event-card__urgency-tag--entro-7   { color: #d4a017; }
.hsdd-event-card__urgency-tag--entro-30  { color: #2980b9; }
.hsdd-event-card__urgency-tag--entro-60  { color: #7f8c8d; }
/* Su overlay (sfondo immagine scuro): outline chiaro, sempre leggibile. */
.hsdd-event-card__urgency-tag--overlay {
    color: #fff; border-color: rgba(255,255,255,.8);
}
@keyframes hsdd-urgency-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}
@media (prefers-reduced-motion: reduce) {
    .hsdd-event-card__urgency-tag--in-corso { animation: none; }
}

/* -------- Venue Map -------- */
.hsdd-venue-map { border-radius: 6px; overflow: hidden; }

/* -------- Single Event -------- */
.hsdd-single-event { max-width: 820px; margin: 0 auto; padding: 2rem 1rem; }
.hsdd-event-thumbnail { margin: 1.5rem 0; }
.hsdd-event-thumbnail img { width: 100%; height: auto; border-radius: 6px; }

/* -------- Responsive -------- */
@media (max-width: 768px) {
    .hsdd-events-grid { grid-template-columns: repeat(2, 1fr); }
    .hsdd-event-card--list .hsdd-event-card__image-wrap { flex: 0 0 120px; max-width: 120px; }
}
@media (max-width: 959px) {
    .hsdd-events-grid { grid-template-columns: 1fr; }

    /* Variante "compact" (default): 2 colonne, 1/3 immagine senza overlay/data,
       2/3 testo (categoria sopra il titolo, niente excerpt). Resta stile
       "riga di lista", nessun box/shadow. */
    .hsdd-event-card--mobile-compact.hsdd-event-card--list {
        align-items: flex-start;
    }
    .hsdd-event-card--mobile-compact .hsdd-event-card__image-wrap {
        flex: 0 0 16%;
        width: 24%;
        max-width: none;
        height: auto;
        aspect-ratio: 1 / 1;
    }
    /* Overlay/badge data ora visibili anche in "compact", ridimensionati
       per stare nella colonna immagine più stretta (28%). */
    .hsdd-event-card--mobile-compact .hsdd-event-card__date-day { font-size: 1.1rem; }
    .hsdd-event-card--mobile-compact .hsdd-event-card__date-month { font-size: 0.65rem; }
    .hsdd-event-card--mobile-compact .hsdd-event-card__date-year { font-size: 0.6rem; }
    .hsdd-event-card--mobile-compact .hsdd-event-card__date-time { font-size: 0.6rem; }
    .hsdd-event-card--mobile-compact .hsdd-event-card__excerpt { display: none; }

    /* Meta più compatto su mobile: righe più vicine, testo un filo più stretto */
    .hsdd-event-card--list .hsdd-event-meta {
        margin: 0.25rem 0; gap: 0.3rem 0.6rem;
    }
    .hsdd-event-card--list .hsdd-event-meta span { line-height: 1.16em; }

    /* Titolo ridotto su mobile (default e large avevano dimensioni pensate
       per la colonna larga del desktop) */
    .hsdd-event-card--list .hsdd-event-card__title,
    .hsdd-event-card--list .hsdd-event-card__title a {
        font-size: 19px !important;
    }
    .hsdd-event-card--list .hsdd-event-card__title--large,
    .hsdd-event-card--list .hsdd-event-card__title--large a {
        font-size: 22px !important;
    }

    /* Variante "card": unica con trattamento visivo a card (box-shadow,
       sfondo bianco). 1 colonna, immagine edge-to-edge sopra con overlay
       data + talloncino categoria sovrapposti, corpo bianco sotto. */
    .hsdd-event-card--mobile-card.hsdd-event-card--list {
        flex-direction: column; align-items: stretch; gap: 0;
        background: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        border-bottom: none; padding: 0 !important; overflow: hidden;
    }
    .hsdd-event-card--mobile-card.hsdd-event-card--list + .hsdd-event-card--mobile-card.hsdd-event-card--list {
        margin-top: 1.25rem !important;
    }
    .hsdd-event-card--mobile-card .hsdd-event-card__image-wrap {
        flex: none; width: 100%; max-width: none; height: auto; margin-top: 0;
        aspect-ratio: var( --hsdd-mobile-card-ratio, 3 / 2 );
        border-radius: 0;
    }
    /* Badge data in alto a sinistra (non centrato come su desktop), largo
       quanto l'immagine (non solo il contenuto testo) */
    .hsdd-event-card--mobile-card .hsdd-event-card__date-badge {
        top: 0.75rem; left: 0.75rem; right: 0.75rem; width: auto;
        transform: none; align-items: flex-start; text-align: left;
    }
    /* Sotto i 960px in variante "card": cat/tag passano in overlay
       sull'immagine, sparisce la versione nel corpo sopra il titolo. */
    .hsdd-event-card--mobile-card .hsdd-event-card__badges--overlay { display: flex; }
    .hsdd-event-card--mobile-card .hsdd-event-card__body > .hsdd-event-card__badges { display: none; }
    .hsdd-event-card--mobile-card .hsdd-event-card__body { padding: 1rem; }
    .hsdd-event-card--mobile-card .hsdd-event-card__action { flex: none; width: 100%; padding: 0.75rem 1rem 1rem; }
}

/* -------- Load more / Infinite scroll -------- */
.hsdd-events__loadmore-wrap {
    text-align: center;
    margin-top: 1.5rem;
}

.hsdd-events__loadmore-btn {
    display: inline-block;
    padding: 0.6rem 1.75rem;
    border: 2px solid #1a1a1a;
    border-radius: 4px;
    background: transparent;
    color: #1a1a1a;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.hsdd-events__loadmore-btn:hover { background: #1a1a1a; color: #fff; }
.hsdd-events__loadmore-btn[disabled] { opacity: 0.4; cursor: default; }

.hsdd-events__sentinel { height: 1px; }

.hsdd-events__spinner {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem 0;
    color: #555;
    font-size: 0.85rem;
}
.hsdd-events__spinner.is-active {
    display: flex;
    animation: hsdd-events-pulse 1.8s ease-in-out infinite;
}
.hsdd-events__spinner svg { width: 22px; height: 22px; flex: none; }
@keyframes hsdd-events-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* Fade-in for newly loaded items. Opacity only (no translateY): the
   timetable layout appends <tr> elements, and transform on table rows
   is inconsistently supported across browsers. */
.hsdd-event-card--entering { opacity: 0; transition: opacity 0.4s ease; }

/* Fade-in con lieve sfalsamento per tutti gli item del loop (render iniziale) */
.hsdd-event-card { animation: hsdd-card-fadein 0.5s ease both; }
@keyframes hsdd-card-fadein { from { opacity: 0; } to { opacity: 1; } }
.hsdd-event-card:nth-child(1)  { animation-delay: 0ms; }
.hsdd-event-card:nth-child(2)  { animation-delay: 60ms; }
.hsdd-event-card:nth-child(3)  { animation-delay: 120ms; }
.hsdd-event-card:nth-child(4)  { animation-delay: 180ms; }
.hsdd-event-card:nth-child(5)  { animation-delay: 240ms; }
.hsdd-event-card:nth-child(6)  { animation-delay: 300ms; }
.hsdd-event-card:nth-child(7)  { animation-delay: 360ms; }
.hsdd-event-card:nth-child(8)  { animation-delay: 420ms; }
.hsdd-event-card:nth-child(9)  { animation-delay: 480ms; }
.hsdd-event-card:nth-child(10) { animation-delay: 540ms; }
.hsdd-event-card:nth-child(n+11) { animation-delay: 600ms; }
