/* Stili per calendar.html con supporto tema light/dark */
:root {
    --body-bg-light: #f8f9fa;
    --body-color-light: #212529;
    --card-bg-light: #ffffff;
    --card-border-light: rgba(0,0,0,0.125);
    --today-border-light: #7c83fd;
    --text-muted-light: #6c757d;
    --link-color-light: #6f74ee;

    --body-bg-dark: #0f172a;
    --body-color-dark: #f8fafc;
    --card-bg-dark: rgba(0, 0, 0, 0.25);
    --card-border-dark: rgba(255, 255, 255, 0.15);
    --today-border-dark: #8b90ff;
    --text-muted-dark: #cbd5e1; /* più chiaro per contrasto */
    --link-color-dark: #a5b4fc;
}

body { transition: background-color .3s ease, color .3s ease; }
body.light-theme:not(.site-shell) { background-color: var(--body-bg-light); color: var(--body-color-light); }
body.dark-theme:not(.site-shell)  { background-color: var(--body-bg-dark);  color: var(--body-color-dark); }
body.site-shell.light-theme { color: var(--body-color-light); }
body.site-shell.dark-theme  { background-color: var(--body-bg-dark); color: var(--body-color-dark); }

.main-content-wrapper {
    border-radius: 1rem;
    padding: clamp(1rem, 5vw, 2rem);
    transition: background-color .3s ease, box-shadow .3s ease;
}

/* Loader overlay --------------------------------------------------------- */
#calendar-container { position: relative; min-height: 480px; }
.calendar-loader-wrapper {
    position: absolute; inset: 0; display: flex; justify-content: center; align-items: center;
    background-color: rgba(0,0,0,0.1); z-index: 10; opacity: 0; visibility: hidden;
    transition: opacity .2s ease, visibility .2s;
}
.calendar-loader-wrapper.is-loading { opacity: 1; visibility: visible; }
.dark-theme .calendar-loader-wrapper { background-color: rgba(0,0,0,0.4); }

/* Glass card + hover ----------------------------------------------------- */
.calendar-card {
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
    padding: 10px;
    display: flex; flex-direction: column; gap: 8px; height: 100%;
}
.calendar-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(0,0,0,0.35);
    border-color: rgba(255,255,255,0.18);
}
.light-theme .calendar-card {
    background: #ffffff;
    border-color: var(--card-border-light);
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.dark-theme .calendar-card { color: #f1f5f9; } /* testo principale chiaro */

/* evidenzia “oggi” */
.dark-theme  .calendar-card.is-today { border: 1.5px solid rgba(56,189,248,.7);  box-shadow: 0 8px 28px rgba(56,189,248,.18); }
.light-theme .calendar-card.is-today { border: 1.5px solid rgba(13,110,253,.45); box-shadow: 0 8px 28px rgba(13,110,253,.12); }

/* Range pill ------------------------------------------------------------- */
.calendar-range-pill {
    display:inline-block; padding: 6px 12px; border-radius: 999px; font-weight: 600;
    border:1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06);
}
.light-theme .calendar-range-pill { background:#f8f9fa; border-color:#e9ecef; }

/* Event list items ------------------------------------------------------- */
.event-button { align-items: stretch !important; transition: background-color .2s ease; border-radius: 20px; }
.dark-theme .event-button { background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)); border: 1px solid rgba(255,255,255,0.08); color: #f8fafc; }
.light-theme .event-button { background: #f1f3f5; border: 1px solid #dee2e6; color: #212529; }
.event-button:hover { background: rgba(255,255,255,0.1); }
.light-theme .event-button:hover { background: #e9ecef; }

/* Poster mini + shimmer placeholder ------------------------------------- */
.event-button img { width:56px; height:56px; object-fit:cover; border-radius:10px; }
.ph {
    width:56px; height:56px; border-radius:10px; position:relative; overflow:hidden;
    background: linear-gradient(90deg, rgba(255,255,255,.06) 25%, rgba(255,255,255,.12) 37%, rgba(255,255,255,.06) 63%);
    background-size: 400% 100%; animation: shimmer 1.2s infinite;
}
@keyframes shimmer { 0%{background-position:100% 0} 100%{background-position:-100% 0} }

/* Meta: luogo + chip orario --------------------------------------------- */
.event-meta { display: inline-flex; gap: 8px; align-items: center; margin-top: 2px; font-size: 12px; opacity: .95; }
.event-location { display:inline-flex; align-items:center; gap:6px; }
.light-theme .event-location { color:#495057; }
.dark-theme  .event-location { color: #cbd5e1; } /* più chiaro */
.event-location::before { content:"\f3c5"; font-family:"Font Awesome 6 Free"; font-weight:900; font-size:12px; opacity:.7; }
.event-chip {
    border: 1px solid rgba(255,255,255,.14); padding: 2px 8px; border-radius: 999px; line-height: 1.4;
    background: rgba(255,255,255,.06);
}
.light-theme .event-chip { background:#f1f3f5; border-color:#e5e7eb; }
.dark-theme  .event-chip { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.24); color: #f8fafc; }

/* Map link button -------------------------------------------------------- */
.map-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;                /* altezza piena della riga */
    aspect-ratio: 1;             /* quadrato */
    border-radius: inherit;      /* stesso raggio della riga */
    padding: 0;
    width:30px;
}
.light-theme .map-link-btn { background-color: #e9ecef; color: #495057; border-color:#dee2e6; }
.dark-theme  .map-link-btn { color: #f8fafc; border-color: rgba(255,255,255,.3); }

/* Share quick actions ---------------------------------------------------- */
.share-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    aspect-ratio: 1;
    border-radius: inherit;
    padding: 0;
    width: 30px;
    color: #6366f1;
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.08);
}
.share-link-btn:hover,
.share-link-btn:focus {
    background: rgba(99, 102, 241, 0.16);
    color: #4f46e5;
    border-color: rgba(99, 102, 241, 0.5);
}
.light-theme .share-link-btn { background-color: #eef2ff; color: #6366f1; border-color: rgba(99,102,241,.28); }
.dark-theme .share-link-btn { color: #c7d2fe; border-color: rgba(129,140,248,.35); background: rgba(99,102,241,.14); }

.quick-share-btn {
    position: absolute;
    top: 10px;
    right: 56px;           /* spostato a destra, vicino al cuore */
    z-index: 3;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(0,0,0,.35);
    color: #fff;
    border: 1px solid rgba(255,255,255,.2);
    padding: 0;
}
.quick-share-btn:hover,
.quick-share-btn:focus {
    background: rgba(99, 102, 241, .45);
    border-color: rgba(199, 210, 254, .55);
    color: #fff;
}

.agenda-share-btn {
    position: absolute;
    bottom: 8px;
    left: 8px;
    z-index: 2;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    padding: 0;
    border: 1px solid rgba(99, 102, 241, 0.28);
    background: rgba(255, 255, 255, 0.92);
    color: #6366f1;
    box-shadow: 0 4px 12px rgba(97, 94, 155, 0.12);
}
.agenda-share-btn:hover,
.agenda-share-btn:focus {
    background: #eef2ff;
    color: #4f46e5;
}
body.dark-theme .agenda-share-btn {
    background: rgba(31, 41, 55, 0.9);
    border-color: rgba(129, 140, 248, 0.35);
    color: #c7d2fe;
}

.event-share-section .event-share-actions {
    flex-wrap: wrap;
    gap: 8px;
}

.share-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(12px);
    z-index: 11000;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    background: rgba(31, 36, 48, 0.94);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}
.share-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Modal ------------------------------------------------------------------ */
.modal-content-themed { transition: background-color .3s ease, color .3s ease; border-radius:16px; }
.light-theme .modal-content-themed { background-color: var(--body-bg-light); color: var(--body-color-light); }
.dark-theme  .modal-content-themed { background-color: #1f2937; color: #f8fafc; }
.modal-poster { width: 100%; max-height: 420px; object-fit: cover; border-radius: 12px; margin-bottom: 12px; }
.modal-section { margin-bottom: 12px; }
.modal-section h6 { margin: 0 0 6px; font-weight:700; }
.dark-theme .modal-section h6 { color: #f1f5f9; }
.light-theme .btn-close { filter: none; }
.dark-theme  .btn-close { filter: invert(1); }

/* Navbar styles moved to site.css */

/* Accessibility: reduced motion ----------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* Responsive ------------------------------------------------------------- */
.calendar-day-grid {
    --calendar-min-cell: 280px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--calendar-min-cell)), 1fr));
    gap: 1rem;
}

.calendar-day-cell {
    min-width: 0;
}

.day-column.is-today .day-card {
    border-color: rgba(124, 131, 253, 0.55);
    box-shadow: 0 8px 28px rgba(124, 131, 253, 0.14);
}

.day-card {
    padding: 12px;
}

/* Week navigation -------------------------------------------------------- */
.calendar-toolbar-row {
    width: 100%;
}

.week-nav {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(167, 139, 250, 0.24);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 6px 18px rgba(97, 94, 155, 0.08);
}

.week-nav-center {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.week-range-label {
    font-family: var(--site-font, "Geomini", system-ui, sans-serif);
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--site-text, #1f2430);
    white-space: nowrap;
}

.week-nav-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 999px !important;
}

.week-nav.is-search-locked {
    opacity: 0.55;
}

.week-nav.is-search-locked .week-nav-btn,
.week-nav.is-search-locked #btn-today {
    pointer-events: none;
}

/* Day header ------------------------------------------------------------- */
.day-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(167, 139, 250, 0.18);
}

.day-header-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.day-number {
    font-family: var(--site-font, "Geomini", system-ui, sans-serif);
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    color: var(--site-hero-title, #601b6f);
}

.day-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.day-weekday {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #596278;
}

.day-month {
    font-size: 0.82rem;
    color: #6b7280;
    text-transform: capitalize;
}

.day-year {
    font-weight: 600;
    color: #596278;
}

.day-today-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(124, 131, 253, 0.14);
    border: 1px solid rgba(124, 131, 253, 0.28);
    color: #4f46e5;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.day-count {
    font-size: 0.78rem;
    color: #6b7280;
    white-space: nowrap;
}

.day-event-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Day event cards (poster-first) ---------------------------------------- */
.day-event-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: #111;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.day-event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
}

.day-event-poster {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, #7c83fd 0%, #a78bfa 100%);
}

.day-event-poster-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.day-event-poster .poster-fallback {
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
    border-radius: 0;
    font-size: clamp(1.8rem, 6vw, 2.4rem);
}

.day-event-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        to top,
        rgba(8, 12, 24, 0.88) 0%,
        rgba(8, 12, 24, 0.42) 34%,
        rgba(8, 12, 24, 0.08) 62%,
        transparent 78%
    );
}

.day-event-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 12px;
    color: #fff;
}

.day-event-title {
    font-family: var(--site-font, "Geomini", system-ui, sans-serif);
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.25;
    margin-bottom: 6px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.day-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.92);
}

.day-event-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.day-event-fav-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    width: 32px;
    height: 32px;
    padding: 0;
}

.day-event-share-btn {
    position: absolute;
    top: 8px;
    right: 46px;
    z-index: 3;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0;
}

.day-event-share-btn:hover,
.day-event-share-btn:focus {
    background: rgba(99, 102, 241, 0.45);
    border-color: rgba(199, 210, 254, 0.55);
    color: #fff;
}

.agenda-row-head .day-header {
    width: 100%;
}

@media (max-width: 700px) {
    .calendar-day-grid {
        --calendar-min-cell: 260px;
    }

    .calendar-toolbar-row {
        flex-direction: column;
        align-items: stretch !important;
    }

    .week-nav {
        width: 100%;
        justify-content: space-between;
    }

    .week-nav-center {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 575px) {
    .calendar-day-grid {
        --calendar-min-cell: 100%;
    }

    .week-range-label {
        font-size: 0.82rem;
    }
}

/* Titoli e sottotitoli leggibili in dark mode (escluso hero del sito) */
.dark-theme :is(#calendar-app, .modal, .site-navbar) :is(h1, h2, h3, h4, h5, h6),
.dark-theme :is(#calendar-app, .modal) .fw-bold,
.dark-theme :is(#calendar-app, .modal) .fw-semibold,
.dark-theme .site-navbar .navbar-text {
    color: #f8fafc !important; /* quasi bianco */
}

.dark-theme .text-muted {
    color: #cbd5e1 !important; /* grigio chiaro per sottotitoli */
}

/* ==== MODALE LARGO & LAYOUT MIGLIORATO ==== */

/* ancora più largo di modal-xl */
@media (min-width: 1400px) {
    .modal-xxl { max-width: 1100px; }   /* puoi alzare a 1200/1280 se vuoi */
}
@media (min-width: 1700px) {
    .modal-xxl { max-width: 1280px; }
}

/* Hero con immagine full-bleed */
.modal-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 16/6;                 /* banner largo */
    border-radius: 12px;
    overflow: hidden;
    background: #111;
}
.modal-hero img {
    width: 100%; height: 100%; object-fit: cover;
    transform: scale(1.02);
}
.modal-hero::after {                   /* overlay gradiente per leggibilità */
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.55));
}
.modal-hero-title {
    position: absolute; left: 16px; bottom: 12px; right: 16px;
    color: #fff; font-weight: 700; font-size: clamp(18px, 3.2vw, 28px);
    text-shadow: 0 2px 12px rgba(0,0,0,.45);
}

/* Griglia contenuti: main + sidebar */
.modal-grid {
    display: grid; gap: 16px;
    grid-template-columns: 1fr;         /* mobile: una colonna */
    margin-top: 0px;
}
@media (min-width: 992px) {
    .modal-grid { grid-template-columns: 1.45fr .9fr; }  /* desktop: due colonne */
}

/* Card info nella sidebar */
.info-card {
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.04);
}
.light-theme .info-card {
    background: #fff;
    border-color: #e9ecef;
}

/* Elenchi compatti e leggibili */
.info-list { margin: 0; padding-left: 18px; }
.info-list li { margin: 6px 0; }

/* Sezioni */
.section {
    margin-bottom: 14px;
}
.section h6 {
    margin: 0 0 6px; font-weight: 700; letter-spacing: .2px;
}
.dark-theme .section h6 { color: #f1f5f9; }

/* CTA biglietteria */
.ticket-cta {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}

/* Iframe mappa arrotondato */
.map-embed-wrapper iframe { border-radius: 10px; }

/* Migliora contrasto testi nel modale scuro */
.dark-theme .modal-content-themed { color: #f8fafc; }

/* --- Fix titolo hero bianco pieno --- */
.modal-hero-title {
    color: #ffffff !important;     /* bianco pieno */
    text-shadow: 0 2px 14px rgba(0,0,0,.55);
}

/* --- Locandina full-width sotto, responsive --- */
.modal-poster-full {
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    cursor: zoom-in;
}

/* --- Lightbox locandina evento --- */
.poster-lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.86);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1080; /* sopra la modal Bootstrap (1055) */
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease-out;
}
.poster-lightbox-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}
.poster-lightbox-inner {
    max-width: min(96vw, 1080px);
    max-height: min(92vh, 1200px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.poster-lightbox-inner img {
    max-width: 100%;
    max-height: calc(92vh - 2.5rem);
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(0,0,0,.65);
}
.poster-lightbox-caption {
    margin: 0;
    text-align: center;
    color: #e2e8f0;
    font-size: .9rem;
    flex-shrink: 0;
}
.poster-lightbox-backdrop[data-theme="light"] {
    background: rgba(15, 23, 42, 0.78);
}

/* --- Lista icone nei blocchi info --- */
.info-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.info-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 8px 0;
}
.info-list li i {
    flex: 0 0 auto;
    line-height: 1.2;
    opacity: .9;
}


/* === FEATURED STRIP (poster-first) ===================================== */
.featured-title h2 {
  color: var(--site-hero-title, #601b6f);
}
.featured-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 78%;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
@media (min-width: 768px){ .featured-strip { grid-auto-columns: 32%; } }
@media (min-width: 1200px){ .featured-strip { grid-auto-columns: 24%; } }

.featured-card {
    position: relative; scroll-snap-align: start; border-radius: 14px; overflow: hidden;
    background: #111; box-shadow: 0 12px 24px rgba(0,0,0,.35); cursor: pointer;
    transform: translateZ(0); will-change: transform;
}
.featured-card .poster {
    width: 100%; aspect-ratio: 4/5; object-fit: cover; transition: transform .6s ease;
}
.featured-card .poster .poster-fallback {
    aspect-ratio: 4 / 5;
    min-height: 0;
    border-radius: 0;
    font-size: clamp(2rem, 5vw, 3rem);
}
.featured-card:hover .poster { transform: scale(1.06); }
.featured-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        to top,
        rgba(8, 12, 24, 0.82) 0%,
        rgba(8, 12, 24, 0.52) 24%,
        rgba(8, 12, 24, 0.22) 50%,
        rgba(8, 12, 24, 0.06) 68%,
        transparent 82%
    );
}
.featured-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 14px;
    color: #fff;
    background: transparent;
}
.featured-title-text {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.25;
    margin-bottom: 6px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}
.featured-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    font-size: .84rem;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}
.featured-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.featured-meta i { opacity: .92; }

/* Cuore preferiti */
.fav-btn {
    position: absolute; top: 10px; right: 10px; z-index: 3; width: 36px; height: 36px;
    display: grid; place-items: center; border-radius: 999px;
    background: rgba(0,0,0,.35); color: #fff; border: 1px solid rgba(255,255,255,.2);
}
.fav-btn.active { background: rgba(232,121,249,.35); border-color: rgba(232,121,249,.6); }

/* Chip filtri */
.filter-chip {
    padding: 6px 10px; border-radius: 999px; border: 1px solid var(--card-border-dark);
    background: rgba(255,255,255,.06); color: var(--text-muted-dark); font-size: .85rem;
}
.light-theme .filter-chip { background: #f8f9fa; color: #495057; border-color: #dee2e6; }
.filter-chip.active { border-color: #7c83fd; color: #5e66ee; background: rgba(124,131,253,.14); }

/* Progress bar per multi-giorno */
.progress { height: 4px; border-radius: 4px; background: rgba(255,255,255,.14); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg,#7c83fd,#a78bfa); }

/* Parallax tilt (limite) */
.featured-card[data-tilt] { perspective: 600px; }

/* Poster nella lista giorno: armonizza */
.event-button img { border-radius: 12px; }

/* “Aggiungi al calendario” nel modale */
.addcal-wrap { display: flex; gap: 10px; flex-wrap: wrap; }


/* --- Spaziature modale --- */
.modal-hero { margin-bottom: 16px; }
.modal-grid { gap: 24px; margin-top: 12px; }
.info-card { padding: 16px 18px; }
.section { margin-bottom: 18px; }

/* --- Titolo hero: bianco pieno e leggibile --- */
.modal-hero-title {
    color: #fff !important;
    text-shadow: 0 3px 18px rgba(0,0,0,.55), 0 1px 2px rgba(0,0,0,.6);
}

/* --- Cuore attivo: arcobaleno --- */
.fav-btn.active i {
    background: linear-gradient(90deg,#e11d48,#f97316,#eab308,#22c55e,#06b6d4,#6366f1,#a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 6px rgba(168,85,247,.35));
}
.fav-btn.active {
    background: rgba(168,85,247,.22);
    border-color: rgba(168,85,247,.45);
}

/* --- Badge preferiti nel chip --- */
.badge-fav {
    display:inline-flex; align-items:center; justify-content:center;
    min-width: 18px; height: 18px; padding: 0 6px; margin-left: 6px;
    border-radius: 999px; font-size: 11px; font-weight: 700;
    background: #7c83fd; color: #fff;
}
.light-theme .badge-fav { background:#6f74ee; color:#fff; }

/* === Pastel refresh + contrast fixes === */
:root {
    --body-bg-light: #f7f4ff;
    --body-color-light: #24293a;
    --card-bg-light: #ffffff;
    --card-border-light: rgba(167, 139, 250, 0.22);
    --today-border-light: #7c83fd;
    --text-muted-light: #5f677a;
    --link-color-light: #6f74ee;

    --body-bg-dark: #f0efff;
    --body-color-dark: #252a3c;
    --card-bg-dark: #ffffff;
    --card-border-dark: rgba(167, 139, 250, 0.26);
    --today-border-dark: #8b90ff;
    --text-muted-dark: #5f677a;
    --link-color-dark: #6f74ee;
}

body.dark-theme,
body.light-theme {
    color: var(--body-color-light);
}

.calendar-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,255,255,0.9));
    border: 1px solid rgba(167,139,250,0.24);
    box-shadow: 0 12px 24px rgba(120,118,173,.12);
}

.event-button {
    background: #f7f4ff !important;
    border: 1px solid rgba(167,139,250,.2) !important;
    color: #2a3042 !important;
}

.event-location,
.dark-theme .event-location,
.light-theme .event-location,
.dark-theme .text-muted,
.light-theme .text-muted {
    color: #5f677a !important;
}

.event-chip,
.dark-theme .event-chip,
.light-theme .event-chip {
    background: #ede9fe;
    border-color: #d9d0ff;
    color: #444b60;
}

.filter-chip {
    background: #f3f0ff;
    color: #4b5563;
    border-color: #d9d0ff;
}

.filter-chip.active {
    border-color: #7c83fd;
    color: #5e66ee;
    background: #ece9ff;
}

.featured-card {
    background: #fff;
    box-shadow: 0 10px 24px rgba(120,118,173,.18);
}

.calendar-range-pill {
    border-color: #dad3ff;
    background: #f0edff;
    color: #3a4154;
}

/* Final readability safeguards — calendar/modal only, not site hero */
body.dark-theme #calendar-app :is(h1, h2, h3, h4, h5, h6),
body.dark-theme .modal :is(h1, h2, h3, h4, h5, h6),
body.light-theme #calendar-app :is(h1, h2, h3, h4, h5, h6),
body.light-theme .modal :is(h1, h2, h3, h4, h5, h6),
body.dark-theme #calendar-app .fw-bold,
body.dark-theme #calendar-app .fw-semibold,
body.dark-theme .modal .fw-bold,
body.dark-theme .modal .fw-semibold,
body.light-theme #calendar-app .fw-bold,
body.light-theme #calendar-app .fw-semibold,
body.light-theme .modal .fw-bold,
body.light-theme .modal .fw-semibold {
    color: #23293a !important;
}

body.dark-theme .modal-content-themed,
body.light-theme .modal-content-themed {
    background: #ffffff !important;
    color: #23293a !important;
}

body.dark-theme .info-card,
body.light-theme .info-card {
    background: #f8f6ff !important;
    border-color: #ddd5ff !important;
}

body.dark-theme .btn-outline-light,
body.light-theme .btn-outline-light {
    color: #343b52;
    border-color: #cfc6ff;
    background: #f7f4ff;
}

body.dark-theme .btn-outline-light:hover,
body.light-theme .btn-outline-light:hover {
    background: #ece7ff;
    color: #23293a;
}

body.dark-theme #legend,
body.light-theme #legend {
    color: #5f677a !important;
}

.calendar-toolbar {
    position: sticky;
    top: 8px;
    z-index: 20;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(167,139,250,.22);
    backdrop-filter: blur(6px);
}

.calendar-search-wrap .input-group-text {
    background: #f3f1ff;
    border-color: #d9d2ff;
    color: #5e66ee;
}

.calendar-search-wrap .form-control {
    border-color: #d9d2ff;
}

.calendar-empty-state {
    margin: 0 auto 14px;
    max-width: 560px;
    text-align: center;
    background: #f4f2ff;
    border: 1px solid #d8d2ff;
    color: #4b5563;
    border-radius: 12px;
    padding: 1.1rem 1.15rem 1.2rem;
}

.calendar-search-results {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.calendar-search-divider {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 1.15rem 0 0.85rem;
}

.calendar-search-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(96, 27, 111, 0.22),
        transparent
    );
}

.calendar-search-divider-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    font-family: var(--site-font, "Geomini", system-ui, sans-serif);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
    white-space: nowrap;
}

.calendar-day-grid--past .day-card {
    opacity: 0.78;
}

.calendar-day-grid--past .day-column.is-past .day-card {
    border-color: rgba(148, 163, 184, 0.35);
    box-shadow: none;
}

body.dark-theme .calendar-search-divider-line {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(203, 213, 225, 0.28),
        transparent
    );
}

body.dark-theme .calendar-search-divider-label {
    color: #94a3b8;
}

body.dark-theme .calendar-day-grid--past .day-card {
    opacity: 0.7;
}

.calendar-empty-state-lead {
    margin: 0.45rem 0 0.9rem;
    font-size: 0.92rem;
    line-height: 1.45;
    color: inherit;
}

.calendar-empty-state-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    --bs-btn-bg: var(--site-hero-title, #601b6f);
    --bs-btn-border-color: var(--site-hero-title, #601b6f);
    --bs-btn-hover-bg: #501566;
    --bs-btn-hover-border-color: #501566;
    --bs-btn-active-bg: #45124f;
    --bs-btn-active-border-color: #45124f;
    box-shadow: 0 6px 16px rgba(96, 27, 111, 0.2);
}

body.dark-theme .calendar-empty-state {
    background: rgba(55, 65, 81, 0.55);
    border-color: rgba(148, 163, 184, 0.28);
    color: #cbd5e1;
}

body.dark-theme .calendar-empty-state strong {
    color: #f8fafc;
}

body.dark-theme .calendar-empty-state-btn {
    --bs-btn-bg: var(--site-hero-title, #d4a0dc);
    --bs-btn-border-color: var(--site-hero-title, #d4a0dc);
    --bs-btn-hover-bg: #e2b8e8;
    --bs-btn-hover-border-color: #e2b8e8;
    --bs-btn-color: #1f1230;
    --bs-btn-hover-color: #1f1230;
    color: #1f1230;
}

/* Floating suggest CTA */
.suggest-fab {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 1040;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.15rem;
    border-radius: 999px;
    background: var(--site-hero-title, #601b6f);
    color: #fff !important;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(96, 27, 111, 0.34);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.suggest-fab:hover,
.suggest-fab:focus {
    color: #fff !important;
    background: #501566;
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(96, 27, 111, 0.4);
}

.suggest-fab:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.suggest-fab i {
    font-size: 0.95rem;
}

body.modal-open .suggest-fab {
    visibility: hidden;
    pointer-events: none;
}

body.dark-theme .suggest-fab {
    background: var(--site-hero-title, #d4a0dc);
    color: #1f1230 !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

body.dark-theme .suggest-fab:hover,
body.dark-theme .suggest-fab:focus {
    background: #e2b8e8;
    color: #1f1230 !important;
}

@media (max-width: 575px) {
    .suggest-fab {
        padding: 0.95rem;
        width: 3.25rem;
        height: 3.25rem;
        justify-content: center;
    }

    .suggest-fab-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .suggest-fab i {
        font-size: 1.1rem;
    }
}

/* Suggest event CTA (end of calendar list) */
.calendar-suggest-cta {
    margin-top: 1.25rem;
}

.calendar-suggest-cta-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.25rem;
    padding: 1.1rem 1.25rem;
    border-radius: 14px;
    border: 1px solid rgba(96, 27, 111, 0.24);
    background: linear-gradient(135deg, rgba(96, 27, 111, 0.1) 0%, rgba(96, 27, 111, 0.05) 100%);
    box-shadow: 0 8px 22px rgba(96, 27, 111, 0.1);
}

.calendar-suggest-cta-copy {
    flex: 1 1 220px;
    min-width: 0;
}

.calendar-suggest-cta-eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--site-hero-title, #601b6f);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.calendar-suggest-cta-title {
    margin: 0 0 0.35rem;
    font-family: var(--site-font, "Geomini", system-ui, sans-serif);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--site-hero-title, #601b6f);
}

.calendar-suggest-cta-lead {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #5f677a;
    max-width: 52ch;
}

.calendar-suggest-cta-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 700;
    white-space: nowrap;
    --bs-btn-bg: var(--site-hero-title, #601b6f);
    --bs-btn-border-color: var(--site-hero-title, #601b6f);
    --bs-btn-hover-bg: #501566;
    --bs-btn-hover-border-color: #501566;
    --bs-btn-active-bg: #45124f;
    --bs-btn-active-border-color: #45124f;
    box-shadow: 0 6px 18px rgba(96, 27, 111, 0.24);
}

.calendar-suggest-cta-btn:hover,
.calendar-suggest-cta-btn:focus {
    box-shadow: 0 8px 22px rgba(96, 27, 111, 0.32);
}

body.dark-theme .calendar-suggest-cta-inner {
    background: linear-gradient(135deg, rgba(96, 27, 111, 0.22) 0%, rgba(55, 65, 81, 0.55) 100%);
    border-color: rgba(212, 160, 220, 0.28);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}

body.dark-theme .calendar-suggest-cta-title {
    color: var(--site-hero-title, #d4a0dc);
}

body.dark-theme .calendar-suggest-cta-lead {
    color: #cbd5e1;
}

body.dark-theme .calendar-suggest-cta-eyebrow {
    color: var(--site-hero-title, #d4a0dc);
}

@media (max-width: 575px) {
    .calendar-suggest-cta-inner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .calendar-suggest-cta-copy {
        flex-basis: auto;
    }

    .calendar-suggest-cta-eyebrow {
        justify-content: center;
    }

    .calendar-suggest-cta-lead {
        max-width: none;
    }

    .calendar-suggest-cta-btn {
        justify-content: center;
        width: 100%;
    }
}

/* True dark mode restored */
body.dark-theme {
    --body-bg-dark: #111827;
    --body-color-dark: #f8fafc;
    background-color: var(--body-bg-dark) !important;
    color: var(--body-color-dark) !important;
}

body.dark-theme .main-content-wrapper {
    background: rgba(17, 24, 39, 0.62);
}

body.dark-theme .calendar-toolbar {
    background: rgba(17, 24, 39, 0.88);
    border-color: rgba(148, 163, 184, 0.3);
}

body.dark-theme .calendar-search-wrap .input-group-text,
body.dark-theme .calendar-search-wrap .form-control,
body.dark-theme .calendar-search-wrap .btn {
    background: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

body.dark-theme .calendar-card {
    background: linear-gradient(180deg, rgba(31,41,55,0.95), rgba(17,24,39,0.95));
    border-color: rgba(148,163,184,0.25);
    box-shadow: 0 12px 24px rgba(0,0,0,.35);
    color: #f3f4f6;
}

body.dark-theme .event-button {
    background: rgba(55,65,81,.55) !important;
    border-color: rgba(148,163,184,.25) !important;
    color: #f3f4f6 !important;
}

body.dark-theme .event-chip {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

body.dark-theme .event-location,
body.dark-theme .text-muted,
body.dark-theme #legend {
    color: #cbd5e1 !important;
}

body.dark-theme .modal-content-themed {
    background: #111827 !important;
    color: #f8fafc !important;
}

body.dark-theme .info-card {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

body.dark-theme .btn-outline-light {
    color: #e5e7eb;
    border-color: #6b7280;
    background: transparent;
}

/* Hybrid view controls */
.view-toggle .btn.is-active {
    background: #7c83fd;
    color: #fff;
    border-color: #7c83fd;
}

/* Unified poster fallback */
.poster-fallback {
    width: 100%;
    min-height: 56px;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: #4c1d95;
    background: linear-gradient(135deg, #e9d5ff, #ddd6fe);
}
.agenda-poster .poster-fallback { min-height: 72px; }
.modal-hero .poster-fallback {
    aspect-ratio: 16/6;
    min-height: 180px;
    border-radius: 12px;
    font-size: 2rem;
}

/* Agenda mobile view */
.agenda-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.agenda-day {
    border: 1px solid rgba(167,139,250,.24);
    border-radius: 14px;
    padding: 12px;
    background: rgba(255,255,255,.9);
}
body.dark-theme .agenda-day {
    background: rgba(31,41,55,.86);
    border-color: rgba(148,163,184,.3);
}
.agenda-day.is-today {
    border-color: #7c83fd;
}
.agenda-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
}
.agenda-day-header h3 {
    margin: 0;
    font-size: 1rem;
}
.agenda-day-header span {
    font-size: .82rem;
    color: #6b7280;
}
.agenda-event-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.agenda-event-card {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 10px;
    align-items: center;
    border-radius: 12px;
    border: 1px solid rgba(167,139,250,.2);
    background: #f8f7ff;
    padding: 8px;
}
body.dark-theme .agenda-event-card {
    background: rgba(55,65,81,.5);
    border-color: rgba(148,163,184,.24);
}
.agenda-poster {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
}
.agenda-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.agenda-content h4 {
    margin: 0 0 4px;
    font-size: .98rem;
}
.agenda-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.agenda-empty {
    color: #6b7280;
    font-size: .9rem;
}

@media (min-width: 992px) {
    .agenda-event-card {
        grid-template-columns: 64px 1fr auto;
    }
}

/* Horizontal lanes by day (timeline rows) */
.agenda-vertical-scroll {
    max-height: min(72vh, 860px);
    overflow-y: auto;
    padding-right: 4px;
}
.agenda-lanes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 20px;
}
.agenda-row {
    border: 1px solid rgba(167,139,250,.22);
    border-radius: 14px;
    padding: 10px;
    background: rgba(255,255,255,.92);
}
body.dark-theme .agenda-row {
    background: rgba(31,41,55,.9);
    border-color: rgba(148,163,184,.28);
}
.agenda-row.is-today {
    border-color: #7c83fd;
    box-shadow: 0 0 0 2px rgba(124, 131, 253, 0.18);
}
.agenda-row-head {
    margin-bottom: 8px;
}
.agenda-day-count.has-multiple {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(124, 131, 253, 0.14);
    border: 1px solid rgba(124, 131, 253, 0.28);
    color: #4f46e5;
    font-weight: 600;
}
body.dark-theme .agenda-day-count.has-multiple {
    background: rgba(124, 131, 253, 0.2);
    border-color: rgba(167, 139, 250, 0.35);
    color: #c4b5fd;
}
.agenda-row .day-event-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agenda-empty-card {
    border: 1px dashed rgba(148,163,184,.45);
    border-radius: 10px;
    color: #6b7280;
    font-size: .9rem;
    padding: 10px 12px;
    min-width: 200px;
}

@media (max-width: 767px) {
    .agenda-empty-card {
        width: 100%;
    }
}

/* Main calendar page layout */
.calendar-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.featured-column { order: 1; }
.calendar-column { order: 2; min-width: 0; }

@media (min-width: 992px) {
    .calendar-layout {
        grid-template-columns: minmax(0, 1.45fr) minmax(320px, .8fr);
        gap: 18px;
        align-items: start;
    }
    .calendar-column { order: 1; }
    .featured-column {
        order: 2;
        position: sticky;
        top: 10px;
    }
}

.filters-wrap {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Featured strip orientation differs by viewport */
.featured-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 80%;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
}
@media (min-width: 992px) {
    .featured-strip {
        grid-auto-columns: 92%;
    }
}

/* Modern event sheet modal */
.modal-body {
    padding-top: .4rem;
}
.event-sheet {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.event-sheet-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    border-radius: 18px;
    min-height: 240px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(168,85,247,.1));
    border: 1px solid rgba(129,140,248,.22);
}
.event-sheet-hero-media {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    background: #111827;
    min-height: 100%;
    z-index: 0;
}
.event-sheet-hero-media img {
    width: 100%;
    height: 100%;
    min-height: 100%;
    object-fit: cover;
    opacity: .34;
    filter: saturate(.95) contrast(.95);
}
.event-sheet-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(15,23,42,.28) 0%, rgba(15,23,42,.72) 100%);
}
.event-sheet-hero-copy {
    position: relative;
    z-index: 2;
    width: 100%;
    color: #fff !important;
}
.event-sheet-hero-copy,
.event-sheet-hero-copy * {
    color: #fff !important;
}
.event-sheet-hero-copy .event-sheet-actions {
    margin-top: 14px;
}
.event-sheet-hero-copy .btn-outline-secondary {
    color: #fff;
    border-color: rgba(255,255,255,.55);
    background: rgba(15,23,42,.22);
}
.event-sheet-hero-copy .btn-outline-secondary:hover,
.event-sheet-hero-copy .btn-outline-secondary:focus {
    background: rgba(15,23,42,.36);
    color: #fff;
    border-color: rgba(255,255,255,.75);
}
#eventModal #eventModalBody .event-sheet-hero-title {
    margin: 0;
    color: #fff !important;
    -webkit-text-fill-color: #fff;
    opacity: 1 !important;
    text-shadow: 0 4px 18px rgba(0,0,0,.55);
    font-size: clamp(1.25rem, 2.2vw, 1.8rem);
}
.event-sheet-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.event-sheet-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(15,23,42,.42);
    color: #f8fafc;
    border: 1px solid rgba(255,255,255,.34);
    font-size: .82rem;
}
.event-sheet-hero-media .poster-fallback {
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
    border-radius: 0;
    color: #fff;
    background: linear-gradient(135deg, rgba(79,70,229,.65), rgba(30,41,59,.8));
    font-size: clamp(2.2rem, 6vw, 3.2rem);
}
.event-sheet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

/* Event modal: pulsanti viola (tema TantoSoli, non blu Bootstrap) */
#eventModal .btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--site-primary, #7c83fd);
    --bs-btn-border-color: var(--site-primary, #7c83fd);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--site-primary-strong, #6f74ee);
    --bs-btn-hover-border-color: var(--site-primary-strong, #6f74ee);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #5b63e8;
    --bs-btn-active-border-color: #5b63e8;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--site-primary, #7c83fd);
    --bs-btn-disabled-border-color: var(--site-primary, #7c83fd);
}
#eventModal .btn-outline-primary {
    --bs-btn-color: var(--site-primary-strong, #6f74ee);
    --bs-btn-border-color: rgba(124, 131, 253, 0.55);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--site-primary, #7c83fd);
    --bs-btn-hover-border-color: var(--site-primary, #7c83fd);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #6f74ee;
    --bs-btn-active-border-color: #6f74ee;
}
.event-sheet-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}
.event-sheet-section,
.event-sheet-side {
    background: rgba(255,255,255,.76);
    border: 1px solid rgba(167,139,250,.18);
    border-radius: 14px;
    padding: 14px;
}
.event-sheet-section h6 {
    margin: 0 0 8px;
    font-weight: 700;
    color: var(--site-hero-title, #601b6f);
}
.event-sheet-poster .modal-poster-full {
    margin-top: 2px;
    border-radius: 12px;
    max-height: 720px;
    object-fit: contain;
    background: rgba(15,23,42,.06);
}
.map-embed-modern iframe {
    min-height: 260px;
}
@media (min-width: 992px) {
    .event-sheet-hero {
        min-height: 290px;
        padding: 20px;
    }
    .event-sheet-grid {
        grid-template-columns: 1.2fr .8fr;
        gap: 16px;
    }
    .event-sheet-side {
        position: sticky;
        top: 0;
        align-self: start;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
}

body.dark-theme .event-sheet-section h6 {
    color: var(--site-hero-title, #d4a0dc);
}

body.dark-theme .event-sheet-hero {
    background: linear-gradient(135deg, rgba(30,41,59,.92), rgba(55,65,81,.9));
    border-color: rgba(99,102,241,.35);
}
body.dark-theme .event-sheet-hero::after {
    background: linear-gradient(180deg, rgba(2,6,23,.35) 0%, rgba(2,6,23,.78) 100%);
}
body.dark-theme .event-sheet-section,
body.dark-theme .event-sheet-side {
    background: rgba(17,24,39,.92);
    border-color: rgba(99,102,241,.2);
}
body.dark-theme .event-sheet-meta span {
    background: rgba(31,41,55,.86);
    border-color: rgba(148,163,184,.26);
    color: #e5e7eb;
}

/* ── Mobile landscape: usa la larghezza, risparmia altezza ─────────────── */
@media (orientation: landscape) and (max-height: 520px) {
    .main-content-wrapper {
        padding: 0.45rem 0.65rem;
        border-radius: 0.75rem;
    }

    .calendar-layout {
        grid-template-columns: minmax(168px, 30%) minmax(0, 1fr);
        gap: 10px;
        align-items: start;
    }

    .featured-column { order: 1; }
    .calendar-column { order: 2; }

    .featured-wrap.mb-3 {
        margin-bottom: 0 !important;
    }

    .featured-title {
        margin-bottom: 4px !important;
    }

    .featured-title h2 {
        font-size: 0.82rem;
    }

    .featured-strip {
        display: flex;
        flex-direction: column;
        gap: 8px;
        overflow-x: hidden;
        overflow-y: auto;
        max-height: calc(100svh - 6.5rem);
        max-height: calc(100dvh - 6.5rem);
        padding-bottom: 2px;
        scroll-snap-type: none;
        -webkit-overflow-scrolling: touch;
    }

    .featured-card {
        flex: 0 0 auto;
        width: 100%;
    }

    .featured-card .poster,
    .featured-card .poster .poster-fallback {
        aspect-ratio: 16 / 10;
        min-height: 0;
    }

    .featured-overlay {
        padding: 7px 9px;
    }

    .featured-title-text {
        font-size: 0.8rem;
        margin-bottom: 2px;
        line-height: 1.2;
    }

    .featured-meta {
        font-size: 0.7rem;
        gap: 5px;
    }

    .featured-meta span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .fav-btn {
        top: 6px;
        right: 6px;
        width: 30px;
        height: 30px;
    }

    .filters-wrap {
        gap: 4px;
        margin-top: 6px !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }

    .filter-chip {
        padding: 3px 7px;
        font-size: 0.72rem;
    }

    #calendar-container {
        min-height: 140px;
    }

    .calendar-toolbar {
        position: static;
        top: auto;
        padding: 5px 7px;
        margin-bottom: 0.4rem !important;
    }

    .calendar-toolbar .calendar-search-wrap .btn {
        padding-left: 0.55rem;
        padding-right: 0.55rem;
        font-size: 0.78rem;
    }

    .calendar-toolbar > .d-flex {
        gap: 4px !important;
        margin-bottom: 0 !important;
    }

    .calendar-toolbar-row {
        flex-direction: column;
        align-items: stretch !important;
    }

    .week-nav {
        width: 100%;
        justify-content: space-between;
        padding: 4px 6px;
    }

    .week-nav-center {
        flex: 1;
        justify-content: center;
    }

    .week-range-label {
        font-size: 0.8rem;
    }

    .calendar-toolbar .btn,
    .calendar-toolbar .form-control {
        font-size: 0.78rem;
        padding-top: 0.2rem;
        padding-bottom: 0.2rem;
    }

    .agenda-vertical-scroll {
        max-height: calc(100svh - 7.25rem);
        max-height: calc(100dvh - 7.25rem);
    }

    .agenda-row {
        padding: 7px 8px;
    }

    .agenda-row-head {
        margin-bottom: 5px;
    }

    .agenda-row-head .day-number {
        font-size: 1.35rem;
    }

    #legend {
        display: none;
    }

    .calendar-day-grid {
        --calendar-min-cell: 100%;
        gap: 0.6rem;
    }

    .day-number {
        font-size: 1.45rem;
    }

    .day-event-title {
        font-size: 0.88rem;
    }

    /* Modale evento: sfrutta la larghezza in orizzontale */
    #eventModal .modal-dialog {
        margin: 0.4rem auto;
        max-height: calc(100svh - 0.8rem);
        max-height: calc(100dvh - 0.8rem);
    }

    #eventModal .modal-xxl {
        max-width: min(96vw, 920px);
    }

    .event-sheet-hero {
        min-height: 120px;
        padding: 10px 12px;
    }

    #eventModal #eventModalBody .event-sheet-hero-title {
        font-size: 1rem;
    }

    .event-sheet-grid {
        grid-template-columns: 1.15fr 0.85fr;
        gap: 10px;
    }

    .event-sheet-section,
    .event-sheet-side {
        padding: 10px;
    }

    .event-sheet-side {
        position: static;
    }

    .map-embed-modern iframe {
        min-height: 160px;
    }
}

/* Event correction form */
.event-correction-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.event-correction-toggle {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85rem;
    color: #6c757d;
    text-decoration: underline;
    cursor: pointer;
}

.event-correction-toggle:hover,
.event-correction-toggle:focus {
    color: #495057;
}

.event-correction-form {
    margin-top: 10px;
}

.event-correction-guide {
    margin-bottom: 0.85rem;
    padding: 0.7rem 0.8rem;
    border-radius: 10px;
    border: 1px solid rgba(96, 27, 111, 0.18);
    background: linear-gradient(135deg, rgba(96, 27, 111, 0.07) 0%, rgba(96, 27, 111, 0.03) 100%);
}

.event-correction-guide-title {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--site-hero-title, #601b6f);
}

.event-correction-guide-steps {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #5f677a;
}

.event-correction-guide-steps li + li {
    margin-top: 0.2rem;
}

.event-correction-form .form-label-sm {
    font-size: 0.78rem;
    margin-bottom: 0.2rem;
}

.event-correction-status {
    margin-top: 8px;
    font-size: 0.85rem;
}

.event-correction-status.is-ok {
    color: #198754;
}

.event-correction-status.is-err {
    color: #dc3545;
}

body.dark-theme .event-correction-section {
    border-top-color: rgba(255, 255, 255, 0.12);
}

body.dark-theme .event-correction-toggle {
    color: #adb5bd;
}

body.dark-theme .event-correction-guide {
    border-color: rgba(212, 160, 220, 0.22);
    background: linear-gradient(135deg, rgba(96, 27, 111, 0.18) 0%, rgba(55, 65, 81, 0.35) 100%);
}

body.dark-theme .event-correction-guide-title {
    color: var(--site-hero-title, #d4a0dc);
}

body.dark-theme .event-correction-guide-steps {
    color: #cbd5e1;
}
