/* ==========================================================
   ANXA - Feste di Settembre 2026
   Widget programma giornaliero + ricerca per data
   ========================================================== */

.anxa-feste-section {
    width: calc(100% - 1.7rem);
    max-width: 1240px;
    margin: 0 auto 28px;
    box-sizing: border-box;
}

.anxa-feste-card {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 22px;
    background:
        
        linear-gradient(
            135deg,
            rgba(0,51,160,.24) 0%,
            rgba(77,126,214,.18) 28%,
            rgba(255,255,255,.90) 52%,
            rgba(255,226,120,.72) 76%,
            rgba(255,213,79,.88) 100%
        );
    border: 1px solid rgba(0,51,160,.14);
    box-shadow: 0 12px 30px rgba(26,53,110,.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.anxa-feste-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.anxa-feste-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 13px;
}

.anxa-feste-icon {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(145deg, #0033A0, #174FB8);
    color: #fff;
    font-size: 24px;
    box-shadow: 0 7px 18px rgba(0,51,160,.22);
}

.anxa-feste-kicker {
    margin: 0 0 3px;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: 1.25px;
    color: #8B2443;
    text-transform: uppercase;
}

.anxa-feste-title {
    margin: 0;
    font-size: clamp(22px, 2.4vw, 32px);
    line-height: 1.05;
    font-weight: 900;
    color: #102A56;
    letter-spacing: -.45px;
}

.anxa-feste-subtitle {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: #61708A;
    font-weight: 600;
}

.anxa-feste-controls {
    display: flex;
    align-items: end;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.anxa-feste-date-wrap {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.anxa-feste-date-wrap label {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .8px;
    color: #52627A;
    text-transform: uppercase;
}

.anxa-feste-date {
    min-height: 42px;
    box-sizing: border-box;
    border: 1px solid rgba(0,51,160,.18);
    border-radius: 12px;
    background: rgba(255,255,255,.92);
    color: #17315E;
    padding: 8px 11px;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    outline: none;
}

.anxa-feste-date:focus {
    border-color: #0033A0;
    box-shadow: 0 0 0 3px rgba(0,51,160,.10);
}

.anxa-feste-btn {
    min-height: 42px;
    border: 0;
    border-radius: 12px;
    padding: 0 13px;
    background: rgba(0,51,160,.08);
    color: #0033A0;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    transition: transform .16s ease, background .16s ease;
}

.anxa-feste-btn:hover {
    background: rgba(0,51,160,.14);
    transform: translateY(-1px);
}

.anxa-feste-btn-today {
    background: #0033A0;
    color: #fff;
}

.anxa-feste-daybar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 15px;
    background: linear-gradient(90deg, rgba(0,51,160,.08), rgba(255,213,79,.14));
    border: 1px solid rgba(0,51,160,.08);
    margin-bottom: 13px;
}

.anxa-feste-dayname {
    font-size: 17px;
    font-weight: 900;
    color: #17315E;
    text-transform: capitalize;
}

.anxa-feste-daycount {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(0,51,160,.10);
    color: #52627A;
    font-size: 10px;
    font-weight: 900;
}

.anxa-feste-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.anxa-feste-event {
    position: relative;
    min-width: 0;
    border-radius: 16px;
    padding: 14px 15px;
    background: rgba(255,255,255,.82);
    border: 1px solid rgba(31,56,105,.10);
    box-shadow: 0 5px 14px rgba(40,61,99,.06);
}

.anxa-feste-event-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 7px;
}

.anxa-feste-time {
    font-size: 12px;
    font-weight: 950;
    color: #0033A0;
}

.anxa-feste-type {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .55px;
    text-transform: uppercase;
}

.anxa-feste-type.civile {
    background: rgba(0,51,160,.09);
    color: #0033A0;
}

.anxa-feste-type.religioso {
    background: rgba(139,36,67,.10);
    color: #8B2443;
}

.anxa-feste-event h3 {
    margin: 0;
    font-size: 15px;
    line-height: 1.25;
    color: #172B4D;
    font-weight: 900;
}

.anxa-feste-place {
    margin-top: 6px;
    display: flex;
    align-items: flex-start;
    gap: 5px;
    color: #68768D;
    font-size: 11.5px;
    line-height: 1.35;
    font-weight: 650;
}

.anxa-feste-desc {
    margin: 7px 0 0;
    color: #56657B;
    font-size: 11.5px;
    line-height: 1.4;
}

.anxa-feste-empty {
    grid-column: 1 / -1;
    padding: 26px 18px;
    text-align: center;
    border-radius: 16px;
    background: rgba(255,255,255,.72);
    border: 1px dashed rgba(0,51,160,.20);
    color: #5E6C82;
    font-size: 13px;
    font-weight: 700;
}

.anxa-feste-source {
    margin: 13px 2px 0;
    color: #778399;
    font-size: 9.5px;
    line-height: 1.4;
}

/* Dark mode */
html.rossonero-mode .anxa-feste-card {
    background:
        radial-gradient(circle at 92% 8%, rgba(255,213,79,.11), transparent 28%),
        radial-gradient(circle at 8% 100%, rgba(205,18,30,.14), transparent 32%),
        rgba(8,8,8,.94);
    border-color: rgba(255,213,79,.16);
    box-shadow: 0 12px 30px rgba(0,0,0,.38);
}

html.rossonero-mode .anxa-feste-title,
html.rossonero-mode .anxa-feste-dayname,
html.rossonero-mode .anxa-feste-event h3 {
    color: #F5F5F5;
}

html.rossonero-mode .anxa-feste-subtitle,
html.rossonero-mode .anxa-feste-place,
html.rossonero-mode .anxa-feste-desc,
html.rossonero-mode .anxa-feste-source {
    color: #C9C9C9;
}

html.rossonero-mode .anxa-feste-date-wrap label {
    color: #D4D4D4;
}

html.rossonero-mode .anxa-feste-date {
    background: #171717;
    color: #F5F5F5;
    border-color: rgba(255,213,79,.20);
}

html.rossonero-mode .anxa-feste-btn {
    background: rgba(255,255,255,.08);
    color: #FFD54F;
}

html.rossonero-mode .anxa-feste-btn-today {
    background: #B3131D;
    color: #fff;
}

html.rossonero-mode .anxa-feste-daybar {
    background: linear-gradient(90deg, rgba(179,19,29,.20), rgba(255,213,79,.08));
    border-color: rgba(255,255,255,.08);
}

html.rossonero-mode .anxa-feste-daycount {
    background: #171717;
    color: #E3E3E3;
    border-color: rgba(255,255,255,.10);
}

html.rossonero-mode .anxa-feste-event {
    background: rgba(24,24,24,.90);
    border-color: rgba(255,255,255,.08);
    box-shadow: none;
}

html.rossonero-mode .anxa-feste-time {
    color: #FFD54F;
}

html.rossonero-mode .anxa-feste-type.civile {
    background: rgba(255,213,79,.10);
    color: #FFD54F;
}

html.rossonero-mode .anxa-feste-type.religioso {
    background: rgba(205,18,30,.18);
    color: #FF9299;
}

html.rossonero-mode .anxa-feste-empty {
    background: rgba(24,24,24,.80);
    border-color: rgba(255,255,255,.13);
    color: #D1D1D1;
}

@media (max-width: 720px) {
    .anxa-feste-section {
        width: calc(100% - 20px);
        margin-bottom: 22px;
    }

    .anxa-feste-card {
        padding: 15px;
        border-radius: 20px;
    }

    .anxa-feste-header {
        flex-direction: column;
        gap: 14px;
    }

    .anxa-feste-brand {
        align-items: flex-start;
    }

    .anxa-feste-icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        border-radius: 14px;
        font-size: 21px;
    }

    .anxa-feste-title {
        font-size: 22px;
    }

    .anxa-feste-subtitle {
        font-size: 12px;
    }

    .anxa-feste-controls {
        width: 100%;
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        gap: 7px;
        align-items: end;
    }

    .anxa-feste-date-wrap {
        min-width: 0;
    }

    .anxa-feste-date {
        width: 100%;
        min-width: 0;
        font-size: 16px; /* evita zoom iOS */
    }

    .anxa-feste-btn {
        padding: 0;
        min-width: 44px;
        min-height: 44px;
    }

    .anxa-feste-btn-today {
        grid-column: 1 / -1;
        padding: 0 12px;
    }

    .anxa-feste-daybar {
        padding: 11px 12px;
    }

    .anxa-feste-dayname {
        font-size: 15px;
    }

    .anxa-feste-list {
        grid-template-columns: 1fr;
    }

    .anxa-feste-event {
        padding: 13px;
    }

    .anxa-feste-event h3 {
        font-size: 14.5px;
    }
}


/* ==========================================================
   MOBILE - RISULTATI COMPATTI PER CATEGORIA + MODALE EVENTI
   ========================================================== */

.anxa-feste-category-list {
    display: none;
}

.anxa-feste-modal {
    position: fixed;
    inset: 0;
    z-index: 100500;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 14px;
    background: rgba(0,0,0,.62);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.anxa-feste-modal.is-open {
    display: flex;
}

.anxa-feste-modal-card {
    width: 100%;
    max-width: 620px;
    max-height: min(78vh, 720px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 22px;
    background: #fff;
    color: #172B4D;
    border: 1px solid rgba(0,51,160,.12);
    box-shadow: 0 18px 55px rgba(0,0,0,.30);
}

.anxa-feste-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 13px;
    border-bottom: 1px solid rgba(0,51,160,.10);
    background: linear-gradient(135deg, rgba(0,51,160,.07), rgba(255,213,79,.10));
}

.anxa-feste-modal-heading {
    min-width: 0;
}

.anxa-feste-modal-kicker {
    margin: 0 0 3px;
    font-size: 9px;
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #68768D;
}

.anxa-feste-modal-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.15;
    font-weight: 900;
    color: #17315E;
}

.anxa-feste-modal-close {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(0,0,0,.06);
    color: #172B4D;
    font-size: 26px;
    line-height: 1;
    font-weight: 500;
    cursor: pointer;
}

.anxa-feste-modal-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
}

.anxa-feste-modal-events {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
}

.anxa-feste-modal .anxa-feste-event {
    box-shadow: none;
    background: #F8FAFD;
}

html.rossonero-mode .anxa-feste-modal-card {
    background: #0C0C0C;
    color: #F5F5F5;
    border-color: rgba(255,213,79,.16);
}

html.rossonero-mode .anxa-feste-modal-head {
    background: linear-gradient(135deg, rgba(179,19,29,.20), rgba(255,213,79,.06));
    border-bottom-color: rgba(255,255,255,.08);
}

html.rossonero-mode .anxa-feste-modal-title {
    color: #F5F5F5;
}

html.rossonero-mode .anxa-feste-modal-kicker {
    color: #C9C9C9;
}

html.rossonero-mode .anxa-feste-modal-close {
    background: rgba(255,255,255,.08);
    color: #FFF;
}

html.rossonero-mode .anxa-feste-modal .anxa-feste-event {
    background: #171717;
    border-color: rgba(255,255,255,.08);
}

@media (max-width: 720px) {
    .anxa-feste-list.is-mobile-categories {
        display: grid;
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .anxa-feste-category-list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .anxa-feste-category-btn {
        width: 100%;
        min-height: 70px;
        border: 1px solid rgba(0,51,160,.11);
        border-radius: 16px;
        background: rgba(255,255,255,.84);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 13px;
        text-align: left;
        cursor: pointer;
        box-shadow: 0 5px 14px rgba(40,61,99,.05);
    }

    .anxa-feste-category-main {
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 11px;
    }

    .anxa-feste-category-icon {
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        display: grid;
        place-items: center;
        border-radius: 13px;
        font-size: 21px;
    }

    .anxa-feste-category-icon.religioso {
        background: rgba(139,36,67,.10);
    }

    .anxa-feste-category-icon.civile {
        background: rgba(0,51,160,.09);
    }

    .anxa-feste-category-copy {
        min-width: 0;
    }

    .anxa-feste-category-title {
        display: block;
        font-size: 14.5px;
        line-height: 1.15;
        font-weight: 900;
        color: #172B4D;
    }

    .anxa-feste-category-sub {
        display: block;
        margin-top: 4px;
        font-size: 11px;
        color: #68768D;
        font-weight: 650;
    }

    .anxa-feste-category-arrow {
        flex: 0 0 auto;
        font-size: 23px;
        color: #0033A0;
        line-height: 1;
    }

    .anxa-feste-category-btn[disabled] {
        opacity: .48;
        cursor: default;
    }

    html.rossonero-mode .anxa-feste-category-btn {
        background: rgba(24,24,24,.90);
        border-color: rgba(255,255,255,.08);
        box-shadow: none;
    }

    html.rossonero-mode .anxa-feste-category-title {
        color: #F5F5F5;
    }

    html.rossonero-mode .anxa-feste-category-sub {
        color: #C9C9C9;
    }

    html.rossonero-mode .anxa-feste-category-arrow {
        color: #FFD54F;
    }

    .anxa-feste-modal {
        padding: 10px;
    }

    .anxa-feste-modal-card {
        max-height: 82vh;
        border-radius: 20px;
    }

    .anxa-feste-modal-body {
        padding: 10px;
    }
}


/* ==========================================================
   MOBILE - MODALE EVENTI A TUTTO SCHERMO
   ========================================================== */
@media (max-width: 720px) {
    .anxa-feste-modal {
        align-items: stretch !important;
        justify-content: stretch !important;
        padding: 0 !important;
        background: rgba(0,0,0,.72) !important;
    }

    .anxa-feste-modal-card {
        width: 100% !important;
        max-width: none !important;
        height: 100% !important;
        max-height: none !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border: 0 !important;
    }

    .anxa-feste-modal-head {
        flex: 0 0 auto !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 5 !important;
        padding-top: max(16px, env(safe-area-inset-top)) !important;
        padding-left: max(16px, env(safe-area-inset-left)) !important;
        padding-right: max(16px, env(safe-area-inset-right)) !important;
    }

    .anxa-feste-modal-close {
        flex: 0 0 48px !important;
        width: 48px !important;
        height: 48px !important;
    }

    .anxa-feste-modal-body {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        padding: 12px max(12px, env(safe-area-inset-right))
                 max(18px, env(safe-area-inset-bottom))
                 max(12px, env(safe-area-inset-left)) !important;
    }
}


/* ==========================================================
   MOBILE - MODALE EVENTI CON MARGINE
   ========================================================== */
@media (max-width: 720px) {
    .anxa-feste-modal {
        align-items: center !important;
        justify-content: center !important;
        padding:
            max(12px, env(safe-area-inset-top))
            max(12px, env(safe-area-inset-right))
            max(12px, env(safe-area-inset-bottom))
            max(12px, env(safe-area-inset-left)) !important;
    }

    .anxa-feste-modal-card {
        width: 100% !important;
        max-width: none !important;
        height: calc(100% - 0px) !important;
        max-height: none !important;
        margin: 0 !important;
        border-radius: 22px !important;
        border: 1px solid rgba(0,51,160,.12) !important;
        overflow: hidden !important;
    }

    .anxa-feste-modal-head {
        padding-top: 16px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .anxa-feste-modal-body {
        padding:
            12px
            12px
            max(16px, env(safe-area-inset-bottom))
            12px !important;
    }
}
