/* Visualizzazione calendario archivio eventi */

.eventi-view-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 35px 0 20px;
}

.eventi-view-switch {
    display: inline-flex;
    padding: 4px;
    background: #fff;
    border: 1px solid rgba(19, 53, 78, 0.12);
    border-radius: 8px;
}

.eventi-view-switch__button {
    border: 0;
    padding: 11px 20px;
    background: transparent;
    color: #1d5578;
    font-weight: 700;
    cursor: pointer;
    border-radius: 6px;
}

.eventi-view-switch__button.is-active {
    background: #1d5578;
    color: #fff;
}

.eventi-calendar-view {
    margin-top: 15px;
}

.eventi-calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px;
    background: #fff;
    border: 1px solid rgba(19, 53, 78, 0.12);
    border-bottom: 0;
}

.eventi-calendar-toolbar__navigation {
    display: flex;
    align-items: center;
    gap: 8px;
}

.eventi-calendar-title {
    margin: 0;
    color: #25395f;
    font-size: 28px;
    text-transform: capitalize;
}

.eventi-calendar-nav,
.eventi-calendar-today {
    min-height: 42px;
    border: 1px solid rgba(29, 85, 120, 0.22);
    background: #fff;
    color: #1d5578;
    cursor: pointer;
    border-radius: 5px;
    font-weight: 700;
}

.eventi-calendar-nav {
    width: 42px;
    font-size: 28px;
    line-height: 1;
}

.eventi-calendar-today {
    padding: 0 15px;
}

.eventi-calendar-nav:hover,
.eventi-calendar-today:hover {
    background: #edf8f9;
}

.eventi-calendar-weekdays,
.eventi-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.eventi-calendar-weekdays {
    background: #1d5578;
    color: #fff;
    font-weight: 700;
    text-align: center;
}

.eventi-calendar-weekdays span {
    padding: 12px 8px;
}

.eventi-calendar-grid {
    background: #fff;
    border-left: 1px solid rgba(19, 53, 78, 0.12);
    border-top: 1px solid rgba(19, 53, 78, 0.12);
}

.eventi-calendar-day {
    min-height: 165px;
    padding: 10px;
    border-right: 1px solid rgba(19, 53, 78, 0.12);
    border-bottom: 1px solid rgba(19, 53, 78, 0.12);
    background: #fff;
}

.eventi-calendar-day.is-outside-month {
    background: #f7f8f9;
}

.eventi-calendar-day.is-outside-month .eventi-calendar-day__number {
    opacity: 0.35;
}

.eventi-calendar-day.is-today {
    box-shadow: inset 0 0 0 2px #5bc3b5;
}

.eventi-calendar-day.is-selected {
    background: #eef9f8;
}

.eventi-calendar-day__number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 31px;
    height: 31px;
    margin: 0 0 8px auto;
    color: #25395f;
    font-weight: 700;
    border-radius: 50%;
}

.eventi-calendar-day.is-today .eventi-calendar-day__number {
    background: #5bc3b5;
    color: #fff;
}

.eventi-calendar-day__events {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.eventi-calendar-event {
    display: block;
    padding: 8px 9px;
    background: #edf8f9;
    border-left: 3px solid #5bc3b5;
    color: #1b3652;
    text-decoration: none;
    border-radius: 10px;
    overflow: hidden;
}



.eventi-calendar-event:hover {
    background: #5bc3b5;
    color: #1b3652;
}

.eventi-calendar-event__time,
.eventi-calendar-event__title,
.eventi-calendar-event__organizer {
    display: block;
}

.eventi-calendar-event__time {
    margin-bottom: 2px;
    font-size: 12px;
    font-weight: 700;
}

.eventi-calendar-event__title {
    font-size: 13px;
    line-height: 1.25;
}

.eventi-calendar-event__organizer {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.25;
    opacity: 0.78;
}

.eventi-calendar-source {
    display: none !important;
}

.eventi-list-view[hidden],
.eventi-calendar-view[hidden] {
    display: none !important;
}

@media (max-width: 991px) {
    .eventi-calendar-toolbar {
        align-items: flex-start;
        flex-direction: column-reverse;
    }

    .eventi-calendar-title {
        font-size: 24px;
    }

    .eventi-calendar-grid,
    .eventi-calendar-weekdays {
        min-width: 900px;
    }

    .eventi-calendar-view {
        overflow-x: auto;
        padding-bottom: 8px;
    }
}

@media (max-width: 767px) {
    .eventi-view-toolbar {
        justify-content: stretch;
    }

    .eventi-view-switch {
        width: 100%;
    }

    .eventi-view-switch__button {
        flex: 1;
    }

    .eventi-calendar-view {
        overflow: visible;
    }

    .eventi-calendar-weekdays {
        display: none;
    }

    .eventi-calendar-grid {
        display: block;
        min-width: 0;
        border: 0;
        background: transparent;
    }

    .eventi-calendar-day {
        display: none;
        min-height: 0;
        margin-bottom: 12px;
        padding: 14px;
        border: 1px solid rgba(19, 53, 78, 0.12);
        border-radius: 6px;
    }

    .eventi-calendar-day:has(.eventi-calendar-event) {
        display: block;
    }

    .eventi-calendar-day.is-outside-month {
        display: none;
    }

    .eventi-calendar-day__number {
        margin: 0 0 10px;
    }

    .eventi-calendar-event {
        padding: 12px;
    }

    .eventi-calendar-event__title {
        font-size: 15px;
    }

    .eventi-calendar-event__organizer {
        font-size: 13px;
    }
}

/* Fallback mobile per browser che non supportano :has() */
@supports not selector(:has(*)) {
    @media (max-width: 767px) {
        .eventi-calendar-day {
            display: block;
        }

        .eventi-calendar-day__events:empty {
            display: none;
        }
    }
}

/* Pulsante calendario al posto del filtro data */
.eventi-calendar-filter-button-wrap {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.eventi-calendar-filter-label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
}

.eventi-calendar-toggle {
    width: 100%;
    min-height: 50px;
    padding-top: 0;
    padding-bottom: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Spaziatura dei pulsanti filtro */
.eventi-filters__actions {
    margin-top: 35px;
    margin-bottom: 35px;
}

.eventi-filters__actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Elenco visibile di default */
.eventi-list-view {
    margin-top: 35px;
}

/* Calendario */
.eventi-calendar-view {
    margin-top: 35px;
    background: #fff;
    padding: 10px 14px 20px;
}

.eventi-calendar-toolbar {
    border: 0;
    border-bottom: 1px solid #777;
    padding: 12px 0 14px;
}

.eventi-calendar-toolbar__navigation {
    order: 2;
}

.eventi-calendar-title {
    order: 1;
    font-size: 24px;
    font-weight: 700;
}

.eventi-calendar-weekdays {
    background: #fff;
    color: #444;
    text-align: left;
    border-bottom: 1px solid rgba(19, 53, 78, 0.18);
}

.eventi-calendar-weekdays span {
    padding: 12px 8px;
}

.eventi-calendar-grid {
    border-top: 0;
}

.eventi-calendar-day {
    min-height: 145px;
    padding: 7px;
}


.eventi-calendar-event__time,
.eventi-calendar-event__title,
.eventi-calendar-event__organizer {
    color: inherit;
}

.eventi-calendar-event__organizer {
    opacity: 1;
}

.eventi-calendar-nav,
.eventi-calendar-today {
    min-height: 36px;
}

.eventi-list-view[hidden],
.eventi-calendar-view[hidden] {
    display: none !important;
}

@media (max-width: 767px) {
    .eventi-calendar-filter-button-wrap {
        margin-top: 20px;
    }

    .eventi-calendar-toggle {
        min-height: 50px;
    }

    .eventi-calendar-view {
        padding: 0;
        background: transparent;
    }
}
