
/* =====================================================
   SPS MODERN 2027 MOBILE
   calendar.css
   FullCalendar / Dashboard
   ===================================================== */

@media screen and (max-width: 767px) {

    /* Contenitore calendario */

    .fc {
        width: 100%;
        max-width: 100%;
        min-width: 0;

        font-size: 12px;
    }

    .fc-view-container {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    /* Toolbar FullCalendar v3 */

    .fc-toolbar {
        display: flex;
        flex-direction: column;
        align-items: stretch;

        gap: 10px;
        margin-bottom: 14px !important;
    }

    .fc-toolbar .fc-left,
    .fc-toolbar .fc-center,
    .fc-toolbar .fc-right {
        float: none !important;
        clear: both;

        display: flex;
        align-items: center;
        justify-content: center;

        width: 100%;
        min-width: 0;
    }

    .fc-toolbar .fc-center {
        order: -1;
    }

    .fc-toolbar .fc-center h2,
    .fc-toolbar h2 {
        float: none !important;

        max-width: 100%;

        margin: 0 !important;

        font-size: 17px !important;
        line-height: 1.4;

        text-align: center;
        white-space: normal;
    }

    /* Gruppi pulsanti */

    .fc-toolbar .fc-button-group {
        display: inline-flex;
        float: none !important;

        max-width: 100%;
    }

    .fc-toolbar .fc-button {
        float: none !important;

        display: inline-flex;
        align-items: center;
        justify-content: center;

        min-width: 39px;
        min-height: 38px;
        height: auto;

        padding: 8px 10px;

        font-size: 12px;
        line-height: 1.25;

        white-space: nowrap;
        word-break: normal;
        overflow-wrap: normal;
    }

    .fc-toolbar .fc-button-group .fc-button {
        flex: 0 0 auto;
    }

    .fc-toolbar .fc-button .fc-icon {
        margin: 0;
    }

    .fc-toolbar .fc-today-button {
        min-width: 65px;
    }

    /* Titoli e intestazioni */

    .fc th,
    .fc td {
        box-sizing: border-box;
    }

    .fc th {
        font-size: 11px;
    }

    .fc-day-header {
        padding: 7px 3px !important;
        font-weight: 600;
    }

    .fc-axis {
        font-size: 11px;
    }

    /* Eventi */

    .fc-event {
        border-radius: 5px;
    }

    .fc-event .fc-title,
    .fc-event .fc-time {
        font-size: 11px;
        line-height: 1.35;
    }

    /* Vista giornaliera: spazio leggibile */

    .fc-agendaDay-view .fc-event,
    .fc-timeGridDay-view .fc-event {
        min-width: 0;
    }

    .fc-agendaDay-view .fc-title,
    .fc-timeGridDay-view .fc-event-title {
        white-space: normal;
        overflow-wrap: break-word;
    }

    /* Evita il testo verticale nei pulsanti */

    .fc-toolbar .fc-button,
    .fc-toolbar .fc-button span {
        writing-mode: horizontal-tb !important;
        text-orientation: mixed !important;
    }

    /* FullCalendar v5/v6 */

    .fc .fc-header-toolbar {
        display: flex;
        flex-direction: column;
        align-items: stretch;

        gap: 10px;
    }

    .fc .fc-toolbar-chunk {
        display: flex;
        align-items: center;
        justify-content: center;

        max-width: 100%;
        min-width: 0;
    }

    .fc .fc-toolbar-title {
        font-size: 17px !important;
        text-align: center;
    }

    .fc .fc-button {
        white-space: nowrap;
        word-break: normal;
    }

    .fc .fc-col-header-cell-cushion {
        font-size: 11px;
    }

    /* Piccoli schermi */

    @media (max-width: 390px) {

        .fc-toolbar .fc-button {
            padding: 7px 8px;
            font-size: 11px;
        }

        .fc-toolbar .fc-center h2,
        .fc .fc-toolbar-title {
            font-size: 15px !important;
        }
    }
}
