.wem-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin: 20px 0;
}

.wem-event-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow .2s ease, transform .2s ease;
}

.wem-event-card:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.wem-event-image {
    width: 100%;
    height: 170px;
    background-size: cover;
    background-position: top center;
    background-color: #f0f0f0;
    position: relative;
}

.wem-lightbox-trigger {
    cursor: pointer;
    position: relative;
}

.wem-lightbox-trigger::after {
    content: '🔍';
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,.55);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity .2s ease;
}

.wem-lightbox-trigger:hover::after {
    opacity: 1;
}

.wem-event-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wem-event-date {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #c40000;
}

.wem-event-title {
    margin: 2px 0 4px;
    font-size: 18px;
    font-weight: 700;
    color: #111;
    line-height: 1.3;
}

.wem-event-meta {
    font-size: 13px;
    color: #555;
}

.wem-event-meta a {
    color: #2563eb;
    text-decoration: none;
}

.wem-event-meta a:hover {
    text-decoration: underline;
}

.wem-event-description {
    font-size: 13px;
    color: #444;
    line-height: 1.5;
    margin-top: 6px;
}

.wem-event-description.wem-desc-clamped {
    max-height: 4.6em;
    overflow: hidden;
    position: relative;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.4em), transparent 100%);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 1.4em), transparent 100%);
}

.wem-event-description.wem-desc-clamped.wem-desc-expanded {
    max-height: none;
    -webkit-mask-image: none;
    mask-image: none;
}

.wem-desc-toggle {
    background: none;
    border: none;
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 0 0;
    margin-bottom: 2px;
}

.wem-desc-toggle:hover {
    text-decoration: underline;
}

.wem-event-description p:first-child { margin-top: 0; }
.wem-event-description p:last-child { margin-bottom: 0; }
.wem-event-description a { color: #2563eb; text-decoration: none; word-break: break-word; }
.wem-event-description a:hover { text-decoration: underline; }

.wem-event-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    font-size: 13px;
}

.wem-event-price {
    font-weight: 700;
    color: #c40000;
    font-size: 16px;
}

.wem-event-price-reentry {
    font-weight: 400;
    color: #888;
    font-size: 11px;
    display: block;
}

.wem-event-seats {
    color: #888;
    font-size: 12px;
}

.wem-no-events {
    text-align: center;
    color: #888;
    padding: 30px 0;
}

@media (max-width: 600px) {
    .wem-events-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Lightbox (locandina evento a schermo intero)
   ============================================================ */
.wem-lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 30px;
    cursor: zoom-out;
}

.wem-lightbox-overlay.is-active {
    display: flex;
}

.wem-lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
    cursor: default;
}

.wem-lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: rgba(255,255,255,.15);
    color: #fff;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wem-lightbox-close:hover {
    background: rgba(255,255,255,.3);
}

@media (max-width: 600px) {
    .wem-lightbox-close {
        top: 12px;
        right: 12px;
    }
}

/* ============================================================
   Sezione Eventi passati
   ============================================================ */
.wem-past-heading {
    margin: 40px 0 16px;
    font-size: 18px;
    font-weight: 700;
    color: #888;
    border-top: 1px solid #e5e7eb;
    padding-top: 24px;
}

.wem-event-card-past {
    opacity: .65;
    filter: grayscale(.3);
    transition: opacity .2s ease, filter .2s ease;
}

.wem-event-card-past:hover {
    opacity: 1;
    filter: grayscale(0);
}

.wem-past-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 3px 10px;
    border-radius: 10px;
}


/* ============================================================
   Popup pubblicitario homepage (evento "Pubblicizza in home page")
   ============================================================ */
.wem-homepopup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,10,15,.72);
    backdrop-filter: blur(2px);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity .3s ease;
}

.wem-homepopup-overlay.is-active {
    display: flex;
    opacity: 1;
}

.wem-homepopup-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 70px rgba(0,0,0,.45);
    transform: scale(.96) translateY(14px);
    transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}

.wem-homepopup-overlay.is-active .wem-homepopup-card {
    transform: scale(1) translateY(0);
}

.wem-homepopup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255,255,255,.9);
    color: #222;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    transition: background .15s ease, transform .15s ease;
}

.wem-homepopup-close:hover {
    background: #fff;
    transform: scale(1.08);
}

.wem-homepopup-image {
    width: 100%;
    height: 280px;
    background-size: cover;
    background-position: top center;
    background-color: #1a1a1a;
    position: relative;
}

.wem-homepopup-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,.05) 0%, rgba(0,0,0,0) 35%, rgba(0,0,0,.55) 100%);
}

.wem-homepopup-image-empty {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.wem-homepopup-eyebrow {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    background: linear-gradient(135deg, #c40000, #8b0000);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 7px 14px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(196,0,0,.4);
}

.wem-homepopup-body {
    padding: 22px 24px 26px;
}

.wem-homepopup-date {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #c40000;
    margin-bottom: 4px;
}

.wem-homepopup-title {
    margin: 0 0 12px;
    font-size: 23px;
    font-weight: 800;
    color: #111;
    line-height: 1.25;
}

.wem-homepopup-meta-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.wem-homepopup-meta {
    font-size: 13.5px;
    color: #555;
}

.wem-homepopup-meta a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.wem-homepopup-meta a:hover {
    text-decoration: underline;
}

.wem-homepopup-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.wem-homepopup-price {
    font-weight: 800;
    color: #c40000;
    font-size: 19px;
}

.wem-homepopup-price small {
    font-weight: 400;
    color: #888;
    font-size: 11px;
    display: block;
    margin-top: 2px;
}

.wem-homepopup-seats {
    color: #666;
    font-size: 12.5px;
    font-weight: 600;
}

.wem-homepopup-cta {
    display: block;
    text-align: center;
    background: linear-gradient(135deg, #c40000, #a00000);
    color: #fff !important;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    padding: 13px 20px;
    border-radius: 10px;
    transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 6px 16px rgba(196,0,0,.3);
}

.wem-homepopup-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(196,0,0,.4);
    color: #fff;
}

@media (max-width: 500px) {
    .wem-homepopup-card {
        max-width: 100%;
        border-radius: 14px;
    }
    .wem-homepopup-image {
        height: 200px;
    }
    .wem-homepopup-title {
        font-size: 20px;
    }
}
