/* GOLEM ARCHIVE - Global Stylesheet
   Design: Minimale / Brutalista
*/

:root {
    --black: #080808;
    --white: #f5f5f5;
    --dim: rgba(255, 255, 255, 0.78); /* Grigio medio/chiaro calibrato per UX */
    --border: rgba(255, 255, 255, 0.08); /* Linee geometriche sottili */
    --accent: #ffffff;
    --search-overlay-bg: rgba(8, 8, 8, 0.98);
    --font-main: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-mono: 'Source Code Pro', monospace;
}

[data-theme="light"] {
    --black: #EFE6D5;
    --white: #3A2A1F;
    --dim: rgba(58, 42, 31, 0.75);
    --border: rgba(58, 42, 31, 0.14);
    --accent: #A05C3F;
    --search-overlay-bg: rgba(239, 230, 213, 0.98);
}

/* Gestione inversione logo in light mode */
[data-theme="light"] .side-logo img {
    filter: invert(1);
    opacity: 1;
}

/* Pulsante per lo Switcher di Tema Brutalista (icona in alto a destra) */
.theme-switch-box {
    position: absolute;
    top: clamp(8px, 1.5vh, 16px);
    right: 24px;
    height: 16px;
    display: flex;
    align-items: center;
    z-index: 20;
    margin: 0;
}

.theme-switch-box + .newsletter-box {
    margin-top: 12px;
}

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    width: auto;
    height: auto;
    font-size: 0; /* Nasconde il testo, mantenuto per l'accessibilità */
    outline: none;
}

/* Icona: sole (tema scuro -> passa al chiaro) */
.theme-toggle-btn::before {
    content: "";
    width: 13px;
    height: 13px;
    background-color: var(--dim);
    transition: background-color 0.3s ease;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Cline x1='12' y1='1' x2='12' y2='3'/%3E%3Cline x1='12' y1='21' x2='12' y2='23'/%3E%3Cline x1='4.22' y1='4.22' x2='5.64' y2='5.64'/%3E%3Cline x1='18.36' y1='18.36' x2='19.78' y2='19.78'/%3E%3Cline x1='1' y1='12' x2='3' y2='12'/%3E%3Cline x1='21' y1='12' x2='23' y2='12'/%3E%3Cline x1='4.22' y1='19.78' x2='5.64' y2='18.36'/%3E%3Cline x1='18.36' y1='5.64' x2='19.78' y2='4.22'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Cline x1='12' y1='1' x2='12' y2='3'/%3E%3Cline x1='12' y1='21' x2='12' y2='23'/%3E%3Cline x1='4.22' y1='4.22' x2='5.64' y2='5.64'/%3E%3Cline x1='18.36' y1='18.36' x2='19.78' y2='19.78'/%3E%3Cline x1='1' y1='12' x2='3' y2='12'/%3E%3Cline x1='21' y1='12' x2='23' y2='12'/%3E%3Cline x1='4.22' y1='19.78' x2='5.64' y2='18.36'/%3E%3Cline x1='18.36' y1='5.64' x2='19.78' y2='4.22'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Icona: luna (tema chiaro -> passa allo scuro) */
[data-theme="light"] .theme-toggle-btn::before {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.theme-toggle-btn:hover::before {
    background-color: var(--white);
}

/* Selettore di lingua (in alto a destra nella sidebar, accanto al tema) */
.lang-switch-box {
    position: absolute;
    top: clamp(8px, 1.5vh, 16px);
    right: 56px;
    height: 16px;
    display: flex;
    align-items: center;
    z-index: 20;
}
.lang-toggle {
    display: inline-flex;
    gap: 4px;
}
.lang-option {
    font-family: var(--font-mono);
    font-size: 7px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1px 5px;
    border: 1px solid var(--border);
    color: var(--dim);
    background: none;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}
.lang-option:hover {
    color: var(--white);
    border-color: var(--white);
}
.lang-option.active {
    color: var(--black);
    background: var(--white);
    border-color: var(--white);
    font-weight: 600;
    cursor: default;
}

@media (max-width: 768px) {
    .theme-switch-box {
        display: none !important;
    }
}

/* Disattiva le transizioni istantaneamente per il cambio tema istantaneo (Brutalismo) */
.no-transition,
.no-transition *,
.no-transition *::before,
.no-transition *::after {
    transition: none !important;
    animation: none !important;
}

/* Dissolvenza breve applicata durante il cambio tema */
.theme-transition,
.theme-transition *,
.theme-transition *::before,
.theme-transition *::after {
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, fill 0.18s ease, opacity 0.18s ease !important;
}

/* Reset base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--black);
    color: var(--white);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Struttura Layout Principale */
.layout { 
    display: grid; 
    grid-template-columns: 1fr 1px 220px; 
    min-height: 100vh; 
}

/* Colonna Contenuti (Sinistra) */
.main-col { 
    padding: 60px;
}

/* Intestazione Sezione / Articolo */
.section-header { 
    margin-bottom: 40px; 
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--black);
    padding-top: 30px;
    margin-top: -60px;
    padding-bottom: 14px;
}
.section-label { 
    font-size: 10px; 
    text-transform: uppercase; 
    letter-spacing: 0.3em; 
    color: var(--dim); 
    display: block; 
    margin-bottom: 16px; 
}
.path-link {
    color: inherit;
    text-decoration: none;
    transition: none !important;
}
.path-link:hover {
    color: var(--white);
}

/* Divisore Verticale */
.divider { 
    background: var(--border); 
}

/* Sidebar Destra */
.side-col { 
    padding: clamp(20px, 4vh, 40px) 0 0 0; /* Rimosso padding inferiore per far scendere la newsletter sul fondo */ 
    position: sticky; 
    top: 0; 
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: clamp(16px, 3vh, 32px);
    background-color: var(--black);
}

/* Logo */
.side-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 24px 0 24px; /* Spazio in alto per non sovrapporsi ai toggle */
    margin-bottom: 0;
}

.side-logo img {
    max-width: 120px; 
    height: auto;
    display: inline-block;
    opacity: 0.8;
}

/* Navigazione a Celle Uniformi */
.side-nav {
    margin-top: clamp(32px, 8vh, 80px); /* Sposta il menù più in basso */
}
.side-nav ul {
    list-style: none;
}

.side-nav li {
    border-bottom: 1px solid var(--border);
}

.side-nav a {
    display: block;
    padding: clamp(8px, 1.8vh, 18px) 24px;
    text-decoration: none;
    color: var(--dim);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    text-align: right;
    transition: all 0.3s ease;
}

.side-nav a:hover, .side-nav a.active {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.03);
}

/* Newsletter Box */
.side-footer {
    margin-top: auto; /* Spinge la newsletter sul fondo */
    padding: 24px 24px 12px 24px; /* Ridotto drasticamente il padding inferiore a 12px per farlo scendere al massimo */
}

.newsletter-box {
    border: none;
    padding: 0;
    background: none;
    margin-top: clamp(24px, 4.5vh, 48px);
}

.newsletter-label {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--dim);
    display: block;
    margin-bottom: 10px;
}

.newsletter-form { 
    display: flex; 
    align-items: center;
    gap: 10px; 
}

.newsletter-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--white);
    padding: 6px 0;
    font-family: var(--font-mono);
    font-size: 10px;
    outline: none;
    transition: border-color 0.2s ease;
}

.newsletter-input:focus {
    border-color: var(--white);
}

.newsletter-button {
    background: none;
    border: none;
    color: var(--dim);
    padding: 0;
    font-family: var(--font-mono);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.newsletter-button:hover {
    color: var(--white);
}

/* Responsive per schermi piccoli */
@media (max-width: 768px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .side-col {
        position: relative;
        height: auto;
        order: -1;
    }
    .divider { display: none; }
    
    .section-header {
        position: sticky;
        top: 60px; /* immediately below the mobile top bar */
        z-index: 900;
        background-color: var(--black);
        padding-top: 16px; /* tighter spacing on mobile */
        margin-top: -28px;
        padding-bottom: 10px;
    }
}

/* Stili Leggibilità Articoli (UX Premium) */
.article-content {
    max-width: 65ch !important;
    line-height: 1.85 !important;
}

/* --- NASCONDIMENTO ELEMENTI MOBILE SU DESKTOP --- */
.mobile-top-bar,
.mobile-tab-bar,
.mobile-bottom-drawer,
.mobile-drawer-overlay,
.mobile-home-feed-container,
.mobile-menu-btn {
    display: none !important;
}

/* --- ESTENSIONE MOBILE APP-LIKE --- */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }

    /* RIMOZIONE TOTALE DEL DECORO ROTONDO E STILE GENERALE */
    * {
        border-radius: 0 !important;
    }

    body.mobile-app-active {
        background-color: var(--black);
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif !important;
        overflow-x: hidden !important;
    }

    /* Isolamento del layout Desktop */
    .side-col, .divider {
        display: none !important;
    }

    .layout {
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow: hidden !important;
    }

    .main-col {
        padding: 88px 20px 100px 20px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .event-overlay {
        display: none !important;
    }

    /* 1. Mobile Top Bar */
    .mobile-top-bar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background: var(--black);
        border-bottom: 1px solid var(--border);
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
        z-index: 1000;
    }

    .mobile-top-left, .mobile-top-right {
        display: flex;
        align-items: center;
    }
    .mobile-top-left {
        gap: 10px;
    }
    .mobile-top-right {
        justify-content: flex-end;
        gap: 4px;
    }

    .mobile-menu-btn {
        display: flex !important;
        background: none;
        border: none;
        color: var(--white);
        cursor: pointer;
        padding: 4px 0;
        align-items: center;
        justify-content: center;
        outline: none;
    }
    .mobile-menu-btn:active {
        opacity: 0.6;
    }

    .mobile-theme-btn {
        background: none;
        border: none;
        cursor: pointer;
        padding: 4px;
        outline: none;
    }
    .mobile-theme-btn:active {
        opacity: 0.6;
    }
    .mobile-top-bar .theme-toggle-btn::before {
        width: 18px;
        height: 18px;
        background-color: var(--white);
    }

    .mobile-back-btn {
        background: none;
        border: none;
        color: var(--white);
        cursor: pointer;
        padding: 4px 0;
        opacity: 0;
        transform: translateX(-8px);
        transition: all 0.2s ease;
        pointer-events: none;
        display: flex;
        align-items: center;
    }
    .mobile-back-btn:not(.show) {
        display: none;
    }
    .mobile-back-btn.show {
        opacity: 0.7;
        transform: translateX(0);
        pointer-events: auto;
    }
    .mobile-back-btn:hover {
        opacity: 1;
    }

    .mobile-logo-link {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        text-decoration: none;
    }
    .mobile-logo-link img {
        max-height: 24px;
        width: auto;
        display: block;
        opacity: 0.9;
    }
    [data-theme="light"] .mobile-logo-link img {
        filter: invert(1);
        opacity: 1;
    }

    .mobile-lang-toggle {
        font-family: var(--font-mono);
        font-size: 9px;
        background: none;
        border: 1px solid var(--border);
        color: var(--dim);
        padding: 3px 6px;
        cursor: pointer;
        text-transform: uppercase;
        text-decoration: none;
        letter-spacing: 0.1em;
        transition: all 0.2s;
    }
    .mobile-lang-toggle:hover {
        color: var(--white);
        border-color: var(--white);
    }

    /* 2. Persistent Bottom Tab Bar */
    .mobile-tab-bar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 64px;
        background: var(--black);
        border-top: 1px solid var(--border);
        display: flex !important;
        align-items: center;
        justify-content: space-around;
        z-index: 9999 !important;
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(64px + env(safe-area-inset-bottom));
    }

    .tab-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: 25%;
        height: 100%;
        background: none;
        border: none;
        color: var(--dim);
        cursor: pointer;
        text-decoration: none;
        transition: color 0.15s;
        outline: none;
    }

    .tab-item svg {
        width: 18px;
        height: 18px;
        stroke: currentColor;
        stroke-width: 1.75;
    }

    .tab-item span {
        font-family: var(--font-mono);
        font-size: 8px;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        font-weight: 400;
    }

    .tab-item.active-tab {
        color: var(--white);
    }
    .tab-item.active-tab svg {
        stroke-width: 2.25;
    }

    /* 3. Bottom Sheet Drawer (Istantaneo Brutale) */
    .mobile-drawer-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: rgba(0, 0, 0, 0.8);
        z-index: 99998 !important;
        opacity: 0;
        pointer-events: none;
        display: none;
    }
    .mobile-drawer-overlay.open {
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .mobile-bottom-drawer {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-height: 85vh !important;
        background: var(--black);
        border-top: 1px solid var(--white);
        z-index: 99999 !important;
        transform: translateY(100%);
        padding: 24px 20px 34px 20px;
        display: flex !important;
        flex-direction: column;
        overflow-y: auto;
    }
    .mobile-bottom-drawer.open {
        transform: translateY(0);
    }

    .mobile-drawer-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 28px;
        border-bottom: 1px solid var(--border);
        padding-bottom: 12px;
    }
    .mobile-drawer-header h2 {
        font-size: 10px;
        font-family: var(--font-mono);
        text-transform: uppercase;
        letter-spacing: 0.2em;
        color: var(--dim);
    }
    .mobile-close-drawer-btn {
        background: none;
        border: none;
        color: var(--white);
        cursor: pointer;
        font-size: 20px;
        font-family: var(--font-mono);
        opacity: 0.7;
    }
    .mobile-close-drawer-btn:hover {
        opacity: 1;
    }

    .mobile-drawer-nav {
        list-style: none;
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-bottom: 36px;
    }
    .mobile-drawer-nav li a {
        font-size: 20px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: -0.02em;
        text-decoration: none;
        color: var(--white);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 0;
        border-bottom: 1px solid var(--border);
        transition: padding-left 0.15s;
    }
    .mobile-drawer-nav li a:hover {
        padding-left: 8px;
        border-bottom-color: var(--white);
    }
    .mobile-drawer-nav li a::after {
        content: "→";
        font-size: 16px;
        font-weight: 300;
        opacity: 0.4;
    }

    .mobile-drawer-newsletter {
        border: 1px solid var(--border);
        background: rgba(255, 255, 255, 0.01);
        padding: 20px;
        margin-bottom: 24px;
    }
    .mobile-newsletter-title {
        font-size: 9px;
        font-family: var(--font-mono);
        text-transform: uppercase;
        letter-spacing: 0.2em;
        color: var(--dim);
        margin-bottom: 14px;
        display: block;
    }
    .mobile-newsletter-form {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    .mobile-newsletter-form input {
        background: transparent;
        border: 1px solid var(--border);
        padding: 12px;
        font-family: var(--font-mono);
        font-size: 11px;
        color: var(--white);
        outline: none;
    }
    .mobile-newsletter-form input:focus {
        border-color: var(--white);
    }
    .mobile-newsletter-form button {
        background: var(--white);
        color: var(--black);
        border: none;
        padding: 12px;
        font-family: var(--font-mono);
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.15em;
        font-weight: 700;
        cursor: pointer;
        transition: background-color 0.15s;
    }
    .mobile-newsletter-form button:hover {
        background: #d4d4d4;
    }

    .mobile-drawer-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 10px;
        font-family: var(--font-mono);
        color: var(--dim);
        border-top: 1px solid var(--border);
        padding-top: 16px;
    }

    /* 4. Dynamic Home Feed UI (Swiss List) */
    .mobile-home-feed-container {
        margin-top: 12px;
        display: block !important;
    }
    .mobile-feed-header {
        margin-bottom: 20px;
    }
    .mobile-feed-path {
        font-family: var(--font-mono);
        font-size: 9px;
        color: var(--dim);
        text-transform: uppercase;
        letter-spacing: 0.2em;
        margin-bottom: 6px;
        display: block;
    }
    .mobile-feed-title {
        font-size: 32px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: -0.04em;
        line-height: 1.0;
    }

    .mobile-feed-section-title {
        font-size: 9px;
        font-family: var(--font-mono);
        text-transform: uppercase;
        letter-spacing: 0.2em;
        color: var(--dim);
        border-bottom: 1px solid var(--border);
        padding-bottom: 6px;
        margin-top: 24px;
        margin-bottom: 0;
    }

    .mobile-article-card-link {
        text-decoration: none;
        display: block;
    }

    .mobile-article-card {
        border-bottom: 1px solid var(--border);
        padding: 14px 0;
        display: flex;
        flex-direction: column;
        gap: 6px;
        transition: padding-left 0.2s ease, background-color 0.2s ease;
    }
    .mobile-article-card-link:hover .mobile-article-card {
        background-color: rgba(255, 255, 255, 0.02);
        padding-left: 8px;
    }

    .mobile-card-meta {
        font-size: 9px;
        font-family: var(--font-mono);
        text-transform: uppercase;
        letter-spacing: 0.15em;
        color: var(--dim);
        display: flex;
        gap: 12px;
        align-items: center;
    }

    .mobile-card-tag {
        border: 1px solid rgba(255, 255, 255, 0.2);
        padding: 1px 4px;
        font-size: 8px;
        letter-spacing: 0.1em;
        color: var(--white);
    }

    .mobile-card-title {
        font-size: 16px;
        line-height: 1.35;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: -0.01em;
        color: var(--white);
        white-space: normal !important;
        word-wrap: break-word;
    }

    .mobile-card-author {
        font-size: 12px;
        color: var(--dim);
        font-weight: 300;
    }

    /* 5. Horizontal Scroll Container (Umido) */
    .mobile-horizontal-scroll-container {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 16px;
        margin: 0 -20px;
        padding: 16px 20px;
        scrollbar-width: none;
    }
    .mobile-horizontal-scroll-container::-webkit-scrollbar {
        display: none;
    }

    .mobile-horizontal-card {
        flex: 0 0 170px;
        scroll-snap-align: start;
        text-decoration: none;
        display: block;
    }
    .mobile-horizontal-card img {
        width: 100%;
        height: 220px;
        object-fit: cover;
        border: 1px solid var(--border);
        transition: border-color 0.2s;
    }
    .mobile-horizontal-card:hover img {
        border-color: var(--white);
    }

    .mobile-horizontal-card-title {
        font-size: 9px;
        font-family: var(--font-mono);
        text-transform: uppercase;
        letter-spacing: 0.15em;
        color: var(--dim);
        margin-top: 8px;
    }

    /* 6. Fallback UI */
    .mobile-welcome-badge {
        border: 1px solid var(--border);
        background: rgba(255, 255, 255, 0.01);
        padding: 20px;
        margin-bottom: 24px;
        margin-top: 12px;
    }
    .mobile-welcome-badge h3 {
        font-size: 18px;
        text-transform: uppercase;
        margin-bottom: 8px;
        font-weight: 700;
        letter-spacing: 0.05em;
    }
    .mobile-welcome-badge p {
        font-size: 13px;
        line-height: 1.6;
        color: var(--dim);
    }

    .mobile-fallback-card {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 20px 0;
        border-bottom: 1px solid var(--border);
        text-decoration: none;
        color: var(--white);
        transition: padding-left 0.2s;
    }
    .mobile-fallback-card:hover {
        padding-left: 8px;
        background-color: rgba(255, 255, 255, 0.02);
    }
    .fallback-tag {
        font-family: var(--font-mono);
        font-size: 9px;
        color: var(--dim);
    }
    .fallback-title {
        font-size: 18px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
}

/* ==========================================================================
   EVENT OVERLAY (DESKTOP)
   ========================================================================== */

/* Preveniamo lo scroll del body quando l'overlay è attivo */
body.overlay-open {
    overflow: hidden !important;
}

.event-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    overflow: hidden; /* Evita lo stretch orizzontale dovuto al pannello laterale posizionato fuori schermo */
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.event-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sfondo semitrasparente */
.event-overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Pannello laterale che riempie 3/4 (75%) della pagina */
.event-overlay-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 75%;
    height: 100%;
    background: var(--black);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.event-overlay.active .event-overlay-content {
    transform: translateX(0);
}

/* Intestazione brutalista dell'overlay */
.event-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 60px;
    border-bottom: 1px solid var(--border);
    background: var(--black);
}

.event-overlay-title {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.25em;
}

.event-overlay-close-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--dim);
    padding: 8px 16px;
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.event-overlay-close-btn:hover {
    color: var(--white);
    border-color: var(--white);
    background: rgba(255, 255, 255, 0.05);
}

/* Corpo dell'overlay con scroll indipendente */
.event-overlay-body {
    flex: 1;
    overflow-y: auto;
    padding: 60px;
    background: var(--black);
}

/* Layout del contenuto dell'evento caricato nell'overlay */
.event-overlay-body .article-container {
    max-width: 720px;
    margin: 0 auto;
    padding-bottom: 60px;
}

.event-overlay-body .article-header {
    margin-bottom: 48px;
    border-bottom: 3px solid var(--border);
    padding-bottom: 32px;
}

.event-overlay-body .article-meta {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--dim);
    margin-bottom: 16px;
    display: block;
}

.event-overlay-body .article-title {
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: var(--white);
}

.event-overlay-body .article-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--white);
}

.event-overlay-body .article-content p {
    margin-bottom: 24px;
}

.event-overlay-body .article-content blockquote {
    border-left: 2px solid var(--white);
    padding: 10px 0 10px 24px;
    margin: 36px 0;
    font-style: italic;
    color: var(--white);
}

.event-overlay-body .article-content h2 {
    font-size: 18px;
    text-transform: uppercase;
    margin: 48px 0 20px 0;
    letter-spacing: 0.1em;
    color: var(--white);
}

.event-overlay-body .article-content ul {
    margin-bottom: 24px;
    padding-left: 20px;
}

.event-overlay-body .article-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Loader brutalista */
.event-overlay-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--dim);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.event-overlay-loader::before {
    content: "";
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--white);
    margin-bottom: 16px;
    animation: spin 0.8s linear infinite;
}

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

/* Per schermi piccoli (mobile), l'overlay non viene attivato da JS (la navigazione è standard).
   Nel caso in cui venisse attivato per errore o test, forziamo la copertura totale. */
@media (max-width: 768px) {
    .event-overlay-content {
        width: 100%;
    }
    .event-overlay-header {
        padding: 16px 20px;
    }
    .event-overlay-body {
        padding: 30px 20px;
    }
}

/* Event Gallery (Detail Pages & Overlays) */
.event-gallery-container {
    margin-top: 48px;
    border-top: 1px solid var(--border);
    padding-top: 32px;
}

.event-gallery-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 12px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.event-gallery-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.event-gallery-item {
    flex: 0 0 calc(50% - 8px);
    scroll-snap-align: start;
    min-width: 260px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.01);
}

.event-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

@media (max-width: 768px) {
    .event-gallery-container {
        margin-top: 32px;
        padding-top: 24px;
    }
    .event-gallery-item {
        flex: 0 0 85%;
        aspect-ratio: 16 / 10;
    }
}

/* Lightbox per espansione immagini brutalista */
body.lightbox-open {
    overflow: hidden !important;
}

.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: lightboxFadeIn 0.25s forwards;
}

.image-lightbox.closing {
    animation: lightboxFadeOut 0.2s forwards;
}

.image-lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    cursor: zoom-out;
}

.image-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border: 1px solid var(--border);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
    transform: scale(0.95);
    animation: lightboxScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.image-lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--dim);
    padding: 8px 16px;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.image-lightbox-close:hover {
    color: var(--white);
    border-color: var(--white);
    background: rgba(255, 255, 255, 0.05);
}

@keyframes lightboxFadeIn {
    to { opacity: 1; }
}

@keyframes lightboxFadeOut {
    to { opacity: 0; }
}

@keyframes lightboxScaleIn {
    to { transform: scale(1); }
}

/* ==========================================================================
   PROGRAM DETAIL LAYOUT & CAROUSEL (DESKTOP / MOBILE)
   ========================================================================== */

.program-detail-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
    max-width: 100%;
    margin-top: 20px;
}

.program-text-box {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.program-divider-box {
    border-left: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

/* Carousel */
.carousel-container {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.carousel-slides {
    position: relative;
    width: 100%;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.01);
    overflow: hidden;
}

@media (min-width: 769px) {
    .program-divider-box {
        min-height: 360px;
    }
    .carousel-container {
        position: absolute;
        inset: 0;
        gap: 0;
    }
    .carousel-slides {
        flex: 1;
        min-height: 0;
        border: none;
    }
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* L'immagine riempie tutta la superficie del box */
    transform: scale(1.6); /* Zoom aggiuntivo */
    display: block;
    cursor: zoom-in;
}

.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.carousel-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--dim);
    cursor: pointer;
    text-transform: uppercase;
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 6px 12px;
    letter-spacing: 0.1em;
    transition: all 0.2s ease;
}

.carousel-btn:hover {
    color: var(--white);
    border-color: var(--white);
    background: rgba(255, 255, 255, 0.03);
}

.carousel-counter {
    color: var(--dim);
    letter-spacing: 0.1em;
    font-size: 11px;
}

/* Responsive per schermi tablet/mobile */
@media (max-width: 900px) {
    .program-detail-container {
        grid-template-columns: 1.5fr 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .program-detail-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .program-divider-box {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--border);
        padding-top: 40px;
        order: -1; /* Metti l'immagine/carosello in cima su mobile */
    }
    
    .carousel-slides {
        aspect-ratio: 4 / 3; /* Aspect ratio orizzontale per il mobile feed */
    }
}

/* ==========================================================================
   GLOBAL SEARCH LAYOUT & OVERLAY (Svizzero Brutalista)
   ========================================================================== */

/* Contenitore della barra di ricerca nella sidebar */
.search-box {
    position: relative;
    border: none;
    padding: 0;
    background: none;
    margin: 0 24px; /* Allineato perfettamente ai 24px di rientro della sidebar */
}

.search-label {
    display: none; /* Etichetta "Cerca" rimossa */
}

.search-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--white);
    padding: 8px 22px 8px 0; /* Spazio a destra per la lente */
    font-family: var(--font-mono);
    font-size: 10px; /* Testo leggermente più compatto */
    outline: none;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    border-color: var(--white);
}

/* Lente di ricerca sulla destra */
.search-box::after {
    content: "";
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 13px;
    height: 13px;
    background-color: var(--dim);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center / contain no-repeat;
    pointer-events: none;
}

/* Contenitore Risultati Ricerca Overlay */
.search-results-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: calc(100% - 220px); /* Copre l'area contenuti lasciando visibile la sidebar desktop */
    height: 100%;
    background: var(--search-overlay-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    padding: 60px;
    overflow-y: auto;
    display: none; /* Inizialmente nascosto */
    border-right: 1px solid var(--border);
}

body.search-open {
    overflow: hidden !important;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border);
    padding-bottom: 20px;
    margin-bottom: 40px;
}

.search-results-path {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.25em;
}

.search-results-close {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--dim);
    padding: 8px 16px;
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-results-close:hover {
    color: var(--white);
    border-color: var(--white);
    background: rgba(255, 255, 255, 0.05);
}

.search-results-sections {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

/* Overlay Search Input (inside the search-results-overlay header) */
.overlay-search-box {
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
}

.overlay-search-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--white);
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 6px 0;
    letter-spacing: 0.05em;
    outline: none;
    transition: border-color 0.3s ease;
}

.overlay-search-input::placeholder {
    color: var(--dim);
    font-style: italic;
}

.overlay-search-input:focus {
    border-bottom-color: var(--white);
}

/* Mobile Search Button (injected by mobile-app.js) */
.mobile-search-btn {
    background: transparent;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.mobile-search-btn:active {
    opacity: 0.6;
}

.search-results-section {
    border-top: 1px solid var(--border);
    padding-top: 24px;
}

.search-results-section-title {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--white);
    margin-bottom: 20px;
    font-weight: 600;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.search-result-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.01);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-result-card:hover {
    border-color: var(--white);
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-2px);
}

.search-result-meta {
    font-size: 9px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--dim);
}

.search-result-title {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    text-transform: uppercase;
    color: var(--white);
}

.search-empty-state {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 40px 0;
}

/* Adattamenti Responsive per Mobile */
@media (max-width: 768px) {
    .search-results-overlay {
        width: 100%;
        padding: 88px 20px 100px 20px;
        z-index: 950; /* Sotto la barra di navigazione mobile fissa */
    }
    
    .search-results-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .search-results-header {
        margin-bottom: 24px;
        padding-bottom: 12px;
    }
    
    .search-result-card {
        padding: 16px;
    }
    
    .search-result-title {
        font-size: 13px;
    }
    
    /* Su mobile nascondiamo la barra di ricerca nella sidebar in quanto
       la navigazione mobile non mostra la sidebar standard di index.html */
    .side-col .search-box {
        display: none !important;
    }

    .search-results-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .overlay-search-box {
        order: 3;
        width: 100%;
    }
}

/* ==========================================================================
   SEZIONI SPECIFICHE (Pre-renderizzate SSR)
   ========================================================================== */

/* ─── Globale Sezioni ─── */
.section-title {
    font-size: 48px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .section-title {
        font-size: 32px;
    }
}

/* ─── Sezione Testi ─── */
/* Stili Filtri */
.filter-container {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
}
.filter-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--dim);
    padding: 6px 16px;
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}
.filter-btn:hover {
    color: var(--white);
    border-color: var(--white);
}
.filter-btn.active {
    color: var(--black);
    background: var(--white);
    border-color: var(--white);
    font-weight: 600;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px 40px;
}
.article-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border);
    padding-top: 20px;
    transition: all 0.4s ease;
}
.article-card:hover {
    border-top-color: var(--white);
}
.card-meta {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--dim);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-tag {
    border: 1px solid var(--border);
    padding: 2px 6px;
    font-size: 8px;
    letter-spacing: 0.05em;
    color: var(--white);
    text-transform: uppercase;
    font-weight: 400;
}
.card-title {
    font-size: 15px;
    line-height: 1.4;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-weight: 500;
}
.card-author {
    font-size: 11px;
    color: var(--dim);
    margin-top: auto;
}

/* Animazione per i filtri */
.article-card.hidden {
    display: none !important;
}

@media (max-width: 1100px) {
    .article-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .filter-container {
        margin-bottom: 24px;
        padding-bottom: 12px;
        gap: 8px;
        flex-wrap: wrap;
    }
    .filter-btn {
        font-size: 9px;
        padding: 5px 12px;
    }
    .article-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px 20px;
    }
    .article-card {
        padding-top: 14px;
    }
}
@media (max-width: 500px) {
    .article-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ─── Sezione Umido (Split-Screen Layout) ─── */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 40px;
    align-items: start;
    margin-top: 30px;
}

.split-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border);
}

.split-row {
    display: flex;
    gap: 15px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    align-items: center;
    transition: background 0.15s ease;
}

.split-row:hover {
    background: rgba(255, 255, 255, 0.015);
}

[data-theme="light"] .split-row:hover {
    background: rgba(61, 46, 37, 0.03);
}

.split-row-date {
    flex: 0 0 90px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--dim);
}

.split-row-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    color: var(--dim);
    border: 1px solid var(--border);
    padding: 2px 6px;
    flex-shrink: 0;
}

.split-row-title {
    flex: 1;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0;
}

.preview-panel {
    position: sticky;
    top: 40px;
    border: 1px solid var(--border);
    padding: 16px;
    background: var(--black);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.preview-img-box {
    height: 180px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #000;
}

.preview-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1) contrast(1.15);
    transition: opacity 0.15s ease, filter 0.2s ease;
}

.preview-panel:hover .preview-img-box img {
    filter: none;
}

.preview-meta {
    font-size: 9px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    color: var(--dim);
    display: flex;
    justify-content: space-between;
}

.preview-title {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.4;
    color: var(--white);
}

.preview-desc {
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.5;
    color: var(--dim);
    margin: 0;
    margin-top: 8px;
}

@media (max-width: 900px) {
    .split-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .preview-panel {
        position: static;
        order: -1; /* Porta la card introduttiva SOPRA la lista articoli */
    }
    .split-row {
        gap: 10px;
    }
    .split-row-date {
        flex-basis: 80px;
    }
    .split-row-tag {
        display: none; /* Troppo stretto su mobile, nascondi il tag */
    }
}

/* ─── Sezione Programma ─── */
.event-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}
.event-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: none !important;
}
.event-card img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border: 1px solid var(--border);
}
.event-info {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.event-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.3;
    font-weight: 500;
}
.event-meta {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--dim);
}
.event-luogo {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--dim);
}
.event-card.hidden {
    display: none !important;
}

#event-overlay {
    transition: none !important;
}
#event-overlay .event-overlay-content {
    transition: none !important;
}

@media (max-width: 900px) {
    .event-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .event-grid {
        gap: 24px;
    }
}
@media (max-width: 500px) {
    .event-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Sezione Produzioni ─── */
.prod-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.prod-card {
    display: grid;
    grid-template-columns: 120px 280px 1fr;
    gap: 40px;
    align-items: start;
    border-top: 1px solid var(--border);
    padding: 40px 10px;
    text-decoration: none;
    color: inherit;
}
.prod-card:last-child {
    border-bottom: 1px solid var(--border);
}
.prod-meta {
    font-family: var(--font-main);
    font-size: 24px;
    color: var(--dim);
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.05em;
}
.prod-img-wrapper {
    width: 100%;
    height: auto;
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.01);
}
.prod-card img {
    width: 100%;
    height: auto;
    display: block;
}
.prod-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 580px;
}
.prod-title {
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    line-height: 1.2;
}
.prod-description {
    font-size: 13px;
    line-height: 1.7;
    color: var(--dim);
}

/* Gestione solo testo */
.prod-card-textonly {
    grid-template-columns: 120px 1fr;
}
.prod-card-textonly .prod-description {
    font-size: 16px;
    font-weight: 300;
    line-height: 1.6;
    color: var(--white);
    opacity: 0.9;
    max-width: 720px;
    margin-top: 4px;
    border-left: 1px solid var(--border);
    padding-left: 20px;
}

@media (max-width: 1024px) {
    .prod-card {
        grid-template-columns: 100px 220px 1fr;
        gap: 24px;
    }
}
@media (max-width: 768px) {
    .prod-card {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 30px 0;
    }
    .prod-meta {
        font-size: 18px;
    }
    .prod-img-wrapper {
        height: auto;
    }
    .prod-card-textonly {
        grid-template-columns: 1fr;
    }
    .prod-card-textonly .prod-description {
        font-size: 14px;
        border-left: none;
        padding-left: 0;
    }
}

/* ─── Sezione About ─── */
.about-layout {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 60px;
    align-items: start;
    margin-top: 20px;
}
.about-manifesto {
    font-size: 17px;
    line-height: 1.8;
    font-weight: 400;
    color: var(--white);
}
.about-manifesto p {
    margin-bottom: 24px;
}
.about-sidebar {
    border-left: 1px solid var(--border);
    padding-left: 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.about-block-title {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--dim);
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
}
.about-list {
    list-style: none;
    font-size: 13px;
    line-height: 1.8;
}
.about-list li {
    margin-bottom: 6px;
}
.about-list a {
    color: var(--white);
    text-decoration: none;
    transition: opacity 0.2s;
}
.about-list a:hover {
    opacity: 0.6;
}

@media (max-width: 900px) {
    .about-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .about-sidebar {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--border);
        padding-top: 30px;
    }
}


/* ─── Pagina 404 ─────────────────────────────────────────────────────────── */
.not-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: calc(100vh - 220px);
    justify-content: center;
    gap: 14px;
}

.not-found-img {
    width: min(420px, 80%);
    height: auto;
    /* L'incisione è nero su bianco: in tema scuro la invertiamo e il fondo bianco sparisce */
    filter: invert(1);
    mix-blend-mode: lighten;
    margin-bottom: 10px;
}

[data-theme="light"] .not-found-img {
    filter: none;
    mix-blend-mode: multiply;
}

.not-found-code {
    font-family: var(--font-mono);
    font-size: 18px;
    margin-bottom: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--white);
}

.not-found-text {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--dim);
    max-width: 420px;
    line-height: 1.6;
}
