/* ============================================================
   CALENDARIO – LISTA SEMPLICE
   ============================================================ */

.cg-calendario-lista {
    max-width: 800px;
    margin: 0 auto 30px;
}
.cg-calendario-data {
    margin-top: 20px;
    font-size: 1.3rem;
    color: #1d323cff;
}
.cg-calendario-giorno {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cg-calendario-voce {
    padding: 6px 0;
    border-bottom: 1px solid #1d323cff;
    color: #1d323cff;
}

/* ============================================================
   CALENDARIO – TABELLA PUBBLICA
   ============================================================ */

.cg-calendario-pubblico {
    max-width: 1000px;
    margin: 0 auto 30px;
}
.cg-calendario-tabella th,
.cg-calendario-tabella td {
    padding: 8px 10px;
    color: #1d323cff;
    border-color: #1d323cff;
}

/* ============================================================
   CALENDARIO – MENSILE GRAFICO COMPLETO
   ============================================================ */

.cg-month-calendar-php {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto 30px;
    padding: 0 20px;
    border: none;
    border-radius: 0;
    background: #fadac1ff;
    box-shadow: none;
    font-size: 0.9em;
    overflow-x: auto;
    color: #1d323cff;
}

/* TITOLI GENERICI (es. "Note:") */
.cg-bold-title {
    font-weight: 700;
    color: #1d323cff;
}

/* HEADER MESE */
.cg-month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    width: 100%;
}

.cg-month-header-title {
    font-size: 1.6em;
    font-weight: 600;
    color: #1d323cff;
}

/* BOTTONI NAVIGAZIONE */
.cg-month-header-nav a {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid #1d323cff;
    background: #1d323cff;
    color: #fadac1ff;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.cg-month-header-nav a:hover {
    background: #264250;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.25);
}

.cg-month-header-nav a:active {
    transform: translateY(0);
    box-shadow: none;
}

/* TABELLA CALENDARIO */
.cg-grid-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    color: #1d323cff;
}

/* INTESTAZIONI (Lunedì, Martedì…) */
.cg-grid-table th {
    text-align: center;
    padding: 6px 4px;
    font-weight: 600;
    color: #1d323cff;
    border-bottom: 1px solid rgba(29,50,60,0.35);
}

/* CELLE GIORNI */
.cg-grid-table td {
    border: 1px solid rgba(29,50,60,0.35);
    vertical-align: top;
    height: 110px;
    padding: 4px;
    overflow: hidden;
    color: #1d323cff;
    background: transparent;
}

/* NUMERI DEI GIORNI */
.cg-day-number {
    font-weight: 600;
    margin-bottom: 4px;
    color: #1d323cff;
}

/* OGGI */
.cg-today-cell {
    background: #efefef;
    border: 2px solid rgba(29,50,60,0.85) !important;
}
.cg-today-cell .cg-day-number {
    color: #1d323cff;
}

/* ============================================================
   PILL EVENTI
   ============================================================ */

.cg-event-pill {
    display: block;
    margin-bottom: 3px;
    padding: 3px 4px;
    border-radius: 4px;
    font-size: 0.8em;
    background: #f5f5f5;
    color: #1d323cff;
    font-weight: 400; /* base: NON grassetto */
}

/* Blu – turno coperto NON montato */
.cg-event-normal {
    background: #e3f2fd;
    border-left: 3px solid #1565c0;
}

/* Verde – film montato */
.cg-event-ready {
    background: #e8f5e9;
    border-left: 3px solid #2e7d32;
}

/* Rosso – turno scoperto */
.cg-event-uncovered {
    background: #ffebee;
    border-left: 3px solid #c62828;
}

/* Arancione – evento montaggio */
.cg-event-montaggio {
    background: #fff3e0;
    border-left: 3px solid #fb8c00;
}

/* ORARIO */
.cg-event-time {
    font-weight: 600;
    margin-right: 4px;
    color: #1d323cff;
}

/* TITOLO FILM – unico testo del contenuto evento sempre in grassetto */
.cg-event-title {
    display: block;
    margin-bottom: 4px;
    font-size: 1.05em;
    font-weight: 700;          /* TITOLO FILM in grassetto */
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* STAFF (nome + label P:/C:/Montatore:) */
.cg-event-staff {
    display: block;
    margin-top: 4px;
    font-size: 0.9em;
    font-weight: 400;          /* nomi NON in grassetto */
    color: #1d323cff;
    line-height: 1.3;
}
/* Le etichette P:, C:, Montatore: sono in <strong>, quindi restano in grassetto */

/* STATO FILM ("Film pronto", "Montabile dal ...") */
.cg-event-montabile {
    display: block;
    margin-top: 4px;
    font-size: 0.9em;
    font-weight: 400;          /* testo NON grassetto di base */
    color: #00c853;            /* verde semaforo */
}
/* Anche se nel PHP c'è <strong>Film pronto</strong>, lo forziamo non-bold */
.cg-event-montabile strong {
    font-weight: 400;
}

/* NOTE */
.cg-event-notes {
    margin-top: 4px;
    font-size: 0.8em;
    line-height: 1.3;
    font-weight: 400;          /* testo nota NON in grassetto */
    color: #1d323cff;
}
/* L’etichetta "Note:" usa .cg-bold-title ed è l’unica in grassetto qui */

/* ============================================================
   ELENCO PROIEZIONISTI
   ============================================================ */

.cg-elenco-proiezionisti {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto 30px;
    color: #1d323cff;
}
.cg-elenco-proiezionisti table {
    width: 100%;
    font-size: 0.95rem;
}
.cg-elenco-proiezionisti th,
.cg-elenco-proiezionisti td {
    padding: 8px 10px;
    color: #1d323cff;
    border-color: #1d323cff;
}

/* ============================================================
   BADGE EVENTO (lista e calendario)
   ============================================================ */

.cg-evento-badge {
    display: inline-block;
    background: #6a1b9a;
    color: #fff;
    font-size: 0.75em;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
    letter-spacing: 0.05em;
    vertical-align: middle;
    margin-right: 4px;
}

.cg-calendario-voce-evento {
    border-left: 3px solid #6a1b9a;
    padding-left: 8px;
}

/* Pill viola — evento speciale */
.cg-event-evento {
    background: #ede7f6;
    border-left: 3px solid #6a1b9a;
}

/* ============================================================
   FULLCALENDAR — wrapper e override colori
   ============================================================ */

.cg-fc-wrap {
    max-width: 1200px;
    margin: 0 auto 30px;
    position: relative;
}

.cg-fc-wrap .fc .fc-toolbar-title {
    font-size: 1.3em;
    color: #1d323c;
}

.cg-fc-wrap .fc .fc-button-primary {
    background-color: #1d323c;
    border-color:     #1d323c;
}
.cg-fc-wrap .fc .fc-button-primary:hover,
.cg-fc-wrap .fc .fc-button-primary:not(:disabled):active {
    background-color: #264250;
    border-color:     #264250;
}
.cg-fc-wrap .fc .fc-button-primary:not(:disabled).fc-button-active {
    background-color: #264250;
    border-color:     #264250;
}

/* Righe giorno (agenda/list view) → colore brand */
.cg-fc-wrap .fc .fc-list-day td,
.cg-fc-wrap .fc .fc-list-day-cushion {
    background-color: #1D323C !important;
}
.cg-fc-wrap .fc .fc-list-day-text,
.cg-fc-wrap .fc .fc-list-day-side-text {
    color: #fff !important;
}

/* Intestazione colonne giorni (Lun, Mar, ...) */
.cg-fc-wrap .fc .fc-col-header-cell {
    background-color: #1D323C;
}
.cg-fc-wrap .fc .fc-col-header-cell-cushion {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

/* Celle giorni: altezza automatica per contenere tutti i dati */
.cg-fc-wrap .fc .fc-daygrid-day-frame {
    min-height: 100px;
}

/* Pill evento */
.cg-fc-wrap .fc .fc-daygrid-event {
    white-space: normal;
    margin-bottom: 3px;
    opacity: 1;
    background: transparent !important;
    border: none !important;
}
.cg-fc-wrap .fc .fc-event-main {
    padding: 0;
    height: 100%;
}
.cg-fc-wrap .fc .fc-event {
    cursor: pointer;
    background: transparent !important;
    border: none !important;
}

/* ============================================================
   FULLCALENDAR — contenuto custom della pill (cg-ev-*)
   ============================================================ */

.cg-ev-inner {
    padding: 3px 5px;
    line-height: 1.3;
}

.cg-ev-time {
    font-size: 0.78em;
    font-weight: 700;
    color: #1d323c;
    opacity: 0.75;
}

.cg-ev-film {
    font-size: 0.88em;
    font-weight: 700;
    color: #1d323c;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin: 1px 0;
    word-break: break-word;
}

.cg-ev-staff {
    font-size: 0.75em;
    color: #333;
    margin-top: 2px;
}

.cg-ev-stato {
    font-size: 0.72em;
    font-weight: 600;
    margin-top: 2px;
}

/* ============================================================
   FULLCALENDAR — vista Agenda (mobile): pill compatta
   ============================================================ */

/* Agenda (list view): layout orizzontale compatto, mostra TUTTO */
/* Nessun hover nelle righe agenda */
.cg-fc-wrap .fc .fc-list-event:hover td,
.cg-fc-wrap .fc .fc-list-event:hover .fc-list-event-dot,
.cg-fc-wrap .fc .fc-list-event-graphic,
.cg-fc-wrap .fc .fc-list-event-title:hover {
    background-color: inherit !important;
    background: inherit !important;
}

.cg-fc-wrap .fc .fc-list-event .cg-ev-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 12px;
    align-items: baseline;
    padding: 4px 2px;
}
.cg-fc-wrap .fc .fc-list-event .cg-ev-time  { font-size: 0.85em; font-weight:700; }
.cg-fc-wrap .fc .fc-list-event .cg-ev-film  { font-size: 0.9em; font-weight:600; text-transform: none; flex-basis: 100%; }
.cg-fc-wrap .fc .fc-list-event .cg-ev-staff { font-size: 0.82em; color:#444; }
.cg-fc-wrap .fc .fc-list-event .cg-ev-stato { font-size: 0.8em; font-weight:600; }

/* ============================================================
   FULLCALENDAR — modale dettaglio evento (popup click)
   ============================================================ */

.cg-fc-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.45);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cg-fc-modal-inner {
    background: #fff;
    border-radius: 10px;
    padding: 26px 22px 20px;
    max-width: 360px;
    width: 92%;
    position: relative;
    box-shadow: 0 8px 28px rgba(0,0,0,0.28);
    color: #1d323c;
}

.cg-fc-modal-close {
    position: absolute;
    top: 10px; right: 14px;
    background: none;
    border: none;
    font-size: 1.3em;
    cursor: pointer;
    color: #888;
    line-height: 1;
    padding: 0;
}
.cg-fc-modal-close:hover { color: #1d323c; }

/* Stili interni popup */
.cg-popup-title {
    font-size: 1.05em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}
.cg-popup-time {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 4px;
}
.cg-popup-hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 8px 0;
}
.cg-popup-row {
    font-size: 0.9em;
    margin: 3px 0;
    line-height: 1.4;
}
.cg-popup-row span {
    font-weight: 600;
}
.cg-popup-stato {
    font-size: 0.9em;
    font-weight: 700;
    margin-top: 4px;
}
.cg-popup-note {
    font-size: 0.85em;
    color: #555;
    font-style: italic;
    line-height: 1.4;
}
.cg-sala-popup-trailer {
    margin-top: 10px;
}
.cg-trailer-thumb {
    display: block;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
}
.cg-trailer-thumb img {
    width: 100%;
    display: block;
    border-radius: 6px;
}
.cg-trailer-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(0,0,0,0.65);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6em;
    color: #fff;
    pointer-events: none;
}
/* Orari con link prenotazione nel popup sala pubblica */
.cg-popup-orari-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
}
.cg-orario-btn {
    font-size: 0.85em !important;
    padding: 6px 12px !important;
}
.cg-orario-plain {
    display: inline-block;
    background: #f0f0f0;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 0.85em;
    font-weight: 700;
    color: #333;
}

.cg-popup-buttons {
    display: flex;
    gap: 8px;
    margin: 10px 0;
    flex-wrap: wrap;
}
.cg-btn-prenota,
.cg-btn-trailer,
.cg-trailer-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
}
.cg-btn-prenota {
    background: #1d323c;
    color: #fff;
}
.cg-btn-trailer,
.cg-trailer-btn {
    background: #c62828;
    color: #fff;
}

/* ============================================================
   LISTA FILM (shortcode cinema_sala_lista)
   ============================================================ */

/* ============================================================
   LISTA FILM — stile cinema premium
   ============================================================ */

.cg-lista-wrap {
    max-width: 960px;
    margin: 0 auto 40px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Card principale: sfondo scuro stile cinema */
.cg-lista-item {
    display: flex;
    background: #0f1f28;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 240px;
}
.cg-lista-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 40px rgba(0,0,0,0.6);
}

/* Poster */
.cg-lista-poster {
    flex: 0 0 170px;
    position: relative;
}
.cg-lista-poster img {
    width: 170px;
    height: 100%;
    min-height: 240px;
    object-fit: cover;
    display: block;
}
.cg-lista-nocover {
    width: 170px;
    height: 100%;
    min-height: 240px;
    background: linear-gradient(160deg, #1d323c 0%, #0f1f28 100%);
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    text-align: center;
    padding: 12px;
    box-sizing: border-box;
    font-style: italic;
}

/* Gradiente laterale sul bordo del poster */
.cg-lista-poster::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 40px;
    background: linear-gradient(to right, transparent, #0f1f28);
    pointer-events: none;
}

/* Corpo info */
.cg-lista-body {
    flex: 1;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: #e8e8e8;
}

.cg-lista-title {
    margin: 0;
    font-size: 1.5em;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

/* Badge meta: genere, durata, regia */
.cg-lista-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.cg-lista-tag {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.75em;
    color: #ccc;
    white-space: nowrap;
}
.cg-lista-tag-genre {
    background: rgba(29,200,150,0.15);
    border-color: rgba(29,200,150,0.3);
    color: #5de8b8;
}

/* Divisore */
.cg-lista-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 2px 0;
}

/* Label "Prossime proiezioni" */
.cg-lista-schedule-label {
    font-size: 0.68em;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #888;
    font-weight: 700;
}

/* Giorni di programmazione */
.cg-lista-days {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cg-lista-day {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cg-lista-date {
    font-size: 0.8em;
    font-weight: 700;
    color: #aaa;
    min-width: 90px;
    white-space: nowrap;
}

/* Bottoni orario: stile "biglietto" */
.cg-lista-time {
    background: linear-gradient(135deg, #e8a020, #f5c842);
    color: #0f1f28;
    border: none;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 0.88em;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    box-shadow: 0 2px 8px rgba(232,160,32,0.35);
    letter-spacing: 0.3px;
}
.cg-lista-time:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(232,160,32,0.55);
}

/* Bottoni azione card (prenota/trailer) */
.cg-lista-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 4px;
    flex-wrap: wrap;
}
.cg-lista-actions .cg-btn-prenota {
    background: linear-gradient(135deg, #1d323c, #264250);
    border: 1px solid rgba(255,255,255,0.15);
    font-size: 0.82em;
    padding: 7px 14px;
}
.cg-lista-actions .cg-btn-prenota:hover { background: #264250; }
.cg-lista-actions .cg-btn-trailer {
    background: linear-gradient(135deg, #c62828, #e53935);
    font-size: 0.82em;
    padding: 7px 14px;
}
.cg-lista-actions .cg-btn-trailer:hover { background: #e53935; }

/* Mobile */
@media (max-width: 640px) {
    .cg-lista-item { flex-direction: column; min-height: unset; }
    .cg-lista-poster { flex: none; width: 100%; }
    .cg-lista-poster img { width: 100%; height: 220px; min-height: unset; }
    .cg-lista-nocover { width: 100%; min-height: 140px; height: auto; }
    .cg-lista-poster::after { display: none; }
    .cg-lista-body { padding: 16px; }
    .cg-lista-title { font-size: 1.2em; }
}

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

@media (max-width: 768px) {
    .cg-fc-wrap .fc .fc-toolbar {
        flex-wrap: wrap;
        gap: 6px;
    }
    .cg-fc-wrap .fc .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
    }
    .cg-fc-wrap .fc .fc-daygrid-day-frame {
        min-height: 60px;
    }
    /* Su mobile nella GRIGLIA nascondi staff/stato (troppo piccolo), ma in Agenda (list) mostra tutto */
    .cg-fc-wrap .fc-daygrid-view .cg-ev-film  { font-size: 0.75em; }
    .cg-fc-wrap .fc-daygrid-view .cg-ev-staff,
    .cg-fc-wrap .fc-daygrid-view .cg-ev-stato { display: none; }
}

/* ============================================================
   SALA PUBBLICA — calendario con copertine
   ============================================================ */

.cg-sala-wrap .fc .fc-daygrid-day-frame {
    min-height: 150px;
}
.cg-sala-wrap .fc .fc-daygrid-event {
    background: none !important;
    border: none !important;
}
.cg-sala-wrap .fc .fc-event-main {
    padding: 0;
}

.cg-sala-pill {
    text-align: center;
    padding: 2px;
}

.cg-sala-cover {
    width: 100%;
    max-width: 110px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    margin: 0 auto 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.15s ease;
}
.cg-sala-cover:hover { transform: scale(1.05); }

.cg-sala-nocover {
    width: 100%;
    max-width: 110px;
    aspect-ratio: 2 / 3;
    background: #1d323c;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    color: #fff;
    margin: 0 auto 4px;
    padding: 4px;
    text-align: center;
    box-sizing: border-box;
}

.cg-sala-pill-orari {
    font-size: 0.72em;
    font-weight: 700;
    color: #1d323c;
    margin-top: 2px;
}

/* Modale SALA: più grande per contenere cover + trama */
.cg-sala-modal-inner {
    max-width: 480px !important;
    max-height: 85vh;
    overflow-y: auto;
}

.cg-sala-popup-cover {
    width: 100%;
    max-width: 220px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    margin: 0 auto 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
