/* =============================================================================
   LISTA EVENTI  —  assets/css/lista-eventi.css
   TUTTI i selettori sono scopati dentro .ge-plugin per non collidere col tema.
   I colori dinamici arrivano come CSS custom properties da PHP:
     --ge-date-color   (colore sfondo data / loader)
     --ge-badge-color  (colore badge "New!")
   ============================================================================= */

/* ── Loader ────────────────────────────────────────────────────────────────── */
.ge-plugin .loader-wrapper {
    position: fixed;
    inset: 0;
    background: rgba(169, 169, 169, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.ge-plugin .loader {
    border: 8px solid var(--ge-date-color, #F7810C);
    border-top-color: #fff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: ge-spin 1s linear infinite;
}

@keyframes ge-spin {
    to { transform: rotate(360deg); }
}

/* ── Reset difensivo: neutralizza margini/padding che i temi toccano ─────── */
/* Scopato dentro .ge-plugin così non tocca nulla fuori dal plugin */
.ge-plugin p,
.ge-plugin h3,
.ge-plugin h4,
.ge-plugin ul,
.ge-plugin ol,
.ge-plugin li {
    margin: 0;
    padding: 0;
    line-height: normal;
    font-size: inherit;
}

.ge-plugin a,
.ge-plugin a:hover,
.ge-plugin a:visited,
.ge-plugin a:focus {
    text-decoration: none;
    color: inherit;
    box-shadow: none;
    outline: none;
}

.ge-plugin select {
    appearance: auto;
    -webkit-appearance: auto;
    font-family: inherit;
    font-size: 14px;
    line-height: normal;
    padding: 6px 10px;
    margin: 0;
    box-sizing: border-box;
}

/* ── Filtri ────────────────────────────────────────────────────────────────── */
.ge-plugin .eventFilters {
    width: 70%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.ge-plugin .eventFilters select {
    width: 32%;
    background-color: black !important;
    color: white !important;
    border-radius: 10px;
}

/* ── Griglia card ──────────────────────────────────────────────────────────── */
.ge-plugin .card-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    justify-content: space-between;
    margin-bottom: 20px;
}

.ge-plugin .acard {
    width: 48% !important;
    position: relative;
    display: block;
}

.ge-plugin .card {
    position: relative;
    width: 100%;
    height: 250px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-top: 20px;
    opacity: 0.7;
    transition: opacity 0.5s ease;
    /* reset box-model difensivo */
    box-sizing: border-box;
    padding: 0;
}

.ge-plugin .card:hover { opacity: 1; cursor: pointer; }

.ge-plugin .card::after {
    content: "";
    position: absolute;
    bottom: 0; left: 0; right: 0;
    border-bottom: 2px solid transparent;
    transition: opacity 0.5s ease;
}
.ge-plugin .card:hover::after { opacity: 1; }

.ge-plugin .card-image {
    width: 100%;
    height: 100%;
    background: center / cover no-repeat;
}

/* ── Etichetta data ────────────────────────────────────────────────────────── */
.ge-plugin .card-label-container {
    position: absolute;
    top: 10%;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-around;
}

.ge-plugin .card-label {
    margin-left: 30px;
    width: 65px;
    background: var(--ge-date-color, #F7810C);
    z-index: 1;
    color: #fff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    line-height: 30px;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: center;
    /* reset difensivo sui figli */
    padding: 4px 0;
}

.ge-plugin .card-label .dayOfWeek { font-size: 12px; margin: 0; padding: 0; line-height: 1.2; }
.ge-plugin .card-label .month     { font-size: 12px; margin: 0; padding: 0; line-height: 1.2; }
.ge-plugin .card-label .day       { font-size: 28px; font-weight: 800; margin: 0; padding: 0; line-height: 1.1; }

/* ── Titolo sovrapposto ────────────────────────────────────────────────────── */
.ge-plugin .card-title {
    position: absolute;
    bottom: 20px; left: 20px; right: 20px;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.61);
    padding: 10px;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.3;
    box-sizing: border-box;
}

/* ── Badge "New!" ──────────────────────────────────────────────────────────── */
.ge-plugin .card-badge {
    position: absolute;
    top: 30px; right: 15px;
    color: #fff;
    background-color: var(--ge-badge-color, #E63946);
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 22px;
    text-transform: uppercase;
    font-weight: bold;
    z-index: 1000;
    line-height: 1;
    margin: 0;
}

/* ── Titoli mese ───────────────────────────────────────────────────────────── */
.ge-plugin h3.ge-month-title {
    margin-top: 40px !important;
    margin-bottom: 0 !important;
    padding: 0;
    font-size: 1.4em;
    line-height: 1.3;
}

/* ── Messaggio vuoto ───────────────────────────────────────────────────────── */
.ge-plugin .ge-empty {
    margin-top: 40px;
    font-size: 1.1em;
}

/* ── Loader inline (scroll infinito) ──────────────────────────────────────── */
.ge-plugin #ge-load-more {
    text-align: center;
    padding: 30px 0;
}
.ge-plugin #ge-load-more .loader {
    margin: 0 auto;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media screen and (max-width: 980px) {
    .ge-plugin .eventFilters {
        width: 100% !important;
        flex-direction: column !important;
    }
    .ge-plugin .eventFilters select {
        margin-bottom: 20px !important;
        width: 90% !important;
    }
    .ge-plugin .card-container { flex-direction: column; }
    .ge-plugin .acard          { width: 100% !important; }
    .ge-plugin .card           { width: 100%; }
    .ge-plugin .card-label     { flex-direction: column !important; flex-wrap: wrap; justify-content: center; }
    .ge-plugin .card-label .day { font-size: 22px !important; }
    .ge-plugin .card-title     { font-size: 18px; line-height: 1.2; }
}

/* Su touch, le card sono sempre opache (no hover) */
@media only screen and (max-device-width: 767px) {
    .ge-plugin .card { opacity: 1; }
}
