/* =========================================================
 * MemoTV - Frontend
 * Stili generali dell'interfaccia
 * ========================================================= */


/* =========================================================
 * WRAPPER PRINCIPALE
 * ========================================================= */

.memotv-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

@media (min-width: 1200px) {
    .is-layout-constrained > .memotv-wrapper {
        width: calc(100% - 10vw);
        max-width: 1290px;
        margin-left: auto;
        margin-right: auto;
    }
}


/* =========================================================
 * SEZIONI
 * ========================================================= */

.memotv-section {
    width: 100%;

    margin: 0 0 30px;
}

.memotv-section:last-child {
    margin-bottom: 0;
}


/* Titolo sezione */

.memotv-section-title {
    margin: 0 0 14px;
}


/* Titolo fascia palinsesto */

.memotv-slot-title {
    text-align: center;
}


/* =========================================================
 * CATEGORIE PALINSESTI
 * ========================================================= */

.memotv-category-title {
    grid-column: 1 / -1;
    width: 100%;
    text-align: center;
    margin: 24px 0 0px;
}


/* =========================================================
 * ORDINE / SWITCH PROGRAMMI-CANALI
 * ========================================================= */

.memotv-order {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    margin-bottom: 50px !important;
}

.memotv-order-label {
    margin-right: 4px;
    font-size: 17px;
}

.memotv-order-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: var(--theme-palette-color-1);
    color: var(--theme-palette-color-2);

    cursor: pointer;

    transition:
        transform 0.18s ease,
        background-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease;
}

.memotv-order-btn.active {
    box-shadow:
        0 0 20px 5px var(--theme-palette-color-3);
}

.memotv-order-btn:not(.active):hover {
    background-color: var(--theme-palette-color-6);
    color: var(--theme-palette-color-2);
}

.memotv-order-btn .dashicons {
    width: 32px;
    height: 32px;

    font-size: 32px;
    line-height: 32px;
}


@media (max-width: 600px) {

    .memotv-order {
        margin-bottom: 50px;
    }

    .memotv-order-btn {
        width: 38px;
        height: 38px;
    }

    .memotv-order-btn .dashicons {
        width: 28px;
        height: 28px;

        font-size: 28px;
        line-height: 28px;
    }
}



/* =========================================================
 * MemoTV - FILTRO CATEGORIE PALINSESTI
 * ========================================================= */

/* ===============================
   CONTENITORE
================================= */

.memotv-category-filter {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 20px;

    width: 100%;
    max-width: 1290px;
    margin-bottom: 70px !important;
    padding: 0;

    box-sizing: border-box;
}

/* ===============================
   VOCI DEL FILTRO
================================= */

.memotv-category-filter-btn {
    flex: 0 0 auto;

    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;

    background: transparent;
    color: inherit;

    font: inherit;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;

    text-decoration: none;
    cursor: pointer;

    transition: color 0.2s ease;
}

.memotv-category-empty-message {
    text-align: center;
}

/* ===============================
   VOCE ATTIVA
================================= */

.memotv-category-filter-btn.active {
    text-decoration: underline;
    text-decoration-color: var(--theme-palette-color-1);
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
}

/* ===============================
   HOVER
================================= */

.memotv-category-filter-btn:hover {
    color: var(--theme-palette-color-6);
}

/* ===============================
   TABLET
================================= */

@media (max-width: 1024px) {
    .memotv-category-filter {
        gap: 16px;
        max-width: 100%;
    }

    .memotv-category-filter-btn {
        font-size: 15px;
    }
}

/* ===============================
   MOBILE
================================= */

@media (max-width: 600px) {
    .memotv-category-filter {
        justify-content: space-between;
        gap: 0;
        width: 100%;
        max-width: 100%;
        margin-bottom: 20px;
        padding: 0;
    }

    .memotv-category-filter-btn {
        font-size: clamp(14px, 4.2vw, 17px);
        letter-spacing: -0.02em;
    }
}

/* Nasconde le card escluse dal filtro categorie */
.memotv-category-filter-hidden {
    display: none !important;
}

/* Nasconde i titoli delle categorie senza card corrispondenti */
.memotv-category-filter-title-hidden {
    display: none !important;
}



/* =========================================================
 * MOSTRA PROGRAMMI CONCLUSI
 * ========================================================= */

/*
 * Un solo pulsante globale sopra i risultati.
 *
 * Non viene inserito nelle singole card.
 */
.memotv-show-concluded {
    display: flex;
    justify-content: center;

    width: 100%;

    margin: 0 0 35px;
}

.memotv-show-concluded-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    min-height: 38px;

    padding: 8px 16px;

    border-radius: 999px;

    background: var(--theme-palette-color-7);
    color: var(--theme-palette-color-3);

    cursor: pointer;


    line-height: 1.2;

    transition:
        background-color 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}


/*
 * Hover
 */
.memotv-show-concluded-btn:hover {
    background-color: var(--theme-palette-color-1);
    border-color: var(--theme-palette-color-1);
    color: var(--theme-palette-color-2);

    transform: translateY(-1px);
}


/*
 * Freccia
 */
.memotv-show-concluded-btn .dashicons {
    flex: 0 0 auto;

    width: 17px;
    height: 17px;

    font-size: 17px;
    line-height: 17px;
}


/*
 * Stato nascosto utilizzabile dal JS.
 */
.memotv-concluded-hidden {
    display: none;
}


/* =========================================================
 * PROGRAMMI IN ONDA TRA POCO
 * ========================================================= */

.memotv-now-upcoming {
    width: 100%;
    margin: 0 0 30px;
}

.memotv-now-upcoming-title {
    display: flex;
    align-items: center;
    justify-content: center;

    width: fit-content;
    min-height: 38px;

    margin: 70px auto 24px;

    padding: 8px 16px;

    border-radius: 999px;

    background: var(--theme-palette-color-7);
    border: 2px solid var(--theme-palette-color-1);
    color: var(--theme-palette-color-3);

    cursor: pointer;
    
    font-size: 25px;
    font-weight: 700;

    line-height: 1.2;

    list-style: none;

    transition:
        background-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

.memotv-now-upcoming-description {
    width: 100%;
    margin: 0 0 24px;

    text-align: center;

    font-size: 15px;
    line-height: 1.4;
}


/*
 * Rimuove il triangolino nativo di <summary>.
 */
.memotv-now-upcoming-title::-webkit-details-marker {
    display: none;
}

.memotv-now-upcoming-title::marker {
    display: none;
}


/*
 * Hover
 */
.memotv-now-upcoming-title:hover {
    background-color: var(--theme-palette-color-1);
    color: var(--theme-palette-color-2);

    transform: translateY(-1px);
}


/*
 * Contenuto della fisarmonica.
 */
.memotv-now-upcoming-content {
    width: 100%;
}


/*
 * Spaziatura mobile.
 */
@media (max-width: 600px) {

    .memotv-now-upcoming {
        margin-bottom: 24px;
    }

    .memotv-now-upcoming-title {
        min-height: 36px;

        padding: 7px 14px;
        
        font-size: 20px;
    }

}


/* =========================================================
 * CONTENITORE RISULTATI
 * ========================================================= */

.memotv-results {
    width: 100%;
}


/* =========================================================
 * MESSAGGI
 * ========================================================= */

.memotv-message {
    width: 100%;

    padding: 18px;

    border-radius: 12px;

    line-height: 1.5;
}

.memotv-message-empty {
    text-align: center;

}


/* =========================================================
 * LOADING
 * ========================================================= */

.memotv-loading {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 80px;

    font-size: 14px;

    opacity: 0.7;
}


/* =========================================================
 * ACCESSIBILITÀ
 * ========================================================= */

.memotv-visually-hidden {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;

    padding: 0 !important;
    margin: -1px !important;

    overflow: hidden !important;

    clip: rect(0, 0, 0, 0) !important;

    white-space: nowrap !important;

    border: 0 !important;
}


/* =========================================================
 * FOCUS
 * ========================================================= */

.memotv-order-btn:focus-visible,
.memotv-show-concluded-btn:focus-visible,
.memotv-btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}


/* =========================================================
 * MOBILE
 * ========================================================= */

@media (max-width: 600px) {

    .memotv-section {
        margin-bottom: 24px;
    }

    .memotv-show-concluded {
        margin-bottom: 30px;
    }

    .memotv-show-concluded-btn {
        min-height: 36px;

        padding: 7px 14px;

    }

}


/* =========================================================
 * REDUCED MOTION
 * ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .memotv-order-btn,
    .memotv-show-concluded-btn {
        transition: none;
    }

}
/* =========================================================
 * IMPOSTA ORARIO
 * ========================================================= */
.memotv-imposta-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 0 auto 18px;
}
.memotv-imposta-time > label {
    font-weight: 600;
    text-align: center;
}
.memotv-imposta-time-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    flex-wrap: nowrap;
}

.memotv-imposta-time-controls input[type="time"] {
    flex: 0 1 160px;
    width: 160px;
    min-width: 0;
    height: 48px;
    box-sizing: border-box;
    padding: 8px;
    border: 2px solid var(--theme-palette-color-4);
    border-radius: 8px;
    color: var(--theme-palette-color-4);
    color-scheme: dark;
}

.memotv-imposta-time-controls button {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
}

.memotv-imposta-time [data-memotv-time-submit] {
    height: 48px;
    min-height: 48px;
    box-sizing: border-box;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    background: var(--theme-palette-color-1, #222);
    color: var(--theme-palette-color-2, #fff);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.memotv-imposta-time [data-memotv-time-submit]:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.memotv-imposta-days .giorni-top {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 0;
    margin: 0 0 25px;
    list-style: none;
    box-sizing: border-box;
}
.memotv-imposta-days .giorno-top button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    box-sizing: border-box;
    border: 0;
    border-radius: 50%;
    background: var(--theme-palette-color-1);
    color: var(--theme-palette-color-2);
    font-weight: 600;
    font-size: 17px;
    letter-spacing: .02em;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.memotv-imposta-days .giorno-top:not(.is-active) button:hover {
    background-color: var(--theme-palette-color-6);
    color: var(--theme-palette-color-8);
}
.memotv-imposta-days .giorno-top.is-active button {
    box-shadow: 0 0 20px 5px var(--theme-palette-color-3);
}
.memotv-imposta-results .data-giorno {
    text-align: center;
    margin: 0 0 40px;
}
.memotv-imposta-loading {
    text-align: center;
}
.memotv-imposta-days[hidden],
.memotv-imposta-results[hidden] {
    display: none !important;
}
@media (max-width: 768px) {
    .memotv-imposta-days .giorni-top {
        justify-content: space-between;
        gap: 0;
        padding: 0 1vw;
        box-sizing: border-box;
    }

    .memotv-imposta-days .giorno-top button {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }
}
