/* Header */
.library-header{display:flex;flex-direction:column;align-items:center;gap:8px;margin-bottom:16px;}
.library-logo{max-width:340px;height:auto;}
.info-text{font-size:16px;text-align:center;}
.info-text a{color:#4da3ff;text-decoration:underline;}

/* Filters */
.filters-row{display:flex;justify-content:center;gap:12px;margin:8px 0;flex-wrap:wrap;}
.filters-actions{display:flex;justify-content:center;margin:6px 0 14px;}
.clear-filters{padding:6px 10px;border:1px solid #333;background:#1a1a1a;color:#eee;border-radius:6px;cursor:pointer;}
.dropdown{position:relative;}
.dropdown-toggle{padding:8px 12px;border:1px solid #333;background:#111;color:#eee;border-radius:8px;cursor:pointer;min-width:160px;text-align:left}
.dropdown-menu{position:absolute;top:110%;left:0;background:#111;border:1px solid #333;border-radius:10px;padding:10px;display:none;z-index:50;min-width:240px;box-shadow:0 10px 18px rgba(0,0,0,.35);}
.dropdown-menu.open{display:block;}
.dropdown-menu label{display:block;color:#eee;font-size:14px;margin:6px 0;}

/* Highlighted - Infinite Scroll Version */
.insurgence-section.highlighted h2 {
    text-align: center;
    margin-bottom: 10px;
}

.highlighted-wrap {
    position: relative;
    overflow: hidden;
    padding: 4px 0;
    /* Rimuoviamo il padding laterale per permettere il flow continuo */
}

.highlighted-track {
    display: flex;
    gap: 24px;
    will-change: transform;
    /* Rimuoviamo la transizione per permettere l'animazione fluida */
    padding-left: 24px;
    padding-right: 24px;
    /* Larghezza molto ampia per contenere i duplicati */
    width: max-content;
}

.highlight-item {
    flex: 0 0 auto;
    width: 540px;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.highlight-item:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

.highlight-poster {
    position: relative;
}

.highlight-poster img {
    width: 100%;
    height: auto;
    border-radius: 14px;
    display: block;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
}

.highlight-poster .reflection {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -24%;
    height: 24%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0));
    transform: scaleY(-1);
    border-radius: 0 0 14px 14px;
    opacity: .25;
    pointer-events: none;
}

/* Nascondi i pulsanti di navigazione per l'infinite scroll */
.highlighted-wrap .nav {
    display: none !important;
}

/* Sections */
.insurgence-section{margin:22px 0;}
.insurgence-section h2{text-align:center;margin:0 0 10px;font-size:22px;letter-spacing:.5px;}

/* Grid */
.grid{display:grid;grid-template-columns:repeat(6,1fr);gap:14px;}
.card{background:#111;border:1px solid #2a2a2a;border-radius:12px;overflow:hidden;text-align:center;display:flex;flex-direction:column;}
.poster{aspect-ratio:2/3;background:#000;}
.poster img{width:100%;height:100%;object-fit:cover;display:block;}
.info{padding:8px;min-height:80px;display:flex;flex-direction:column;justify-content:center;align-items:center;}
.info .t1{font-weight:700;font-size:15px;margin-bottom:6px;color:#eee;text-align:center;}
.info .t2{font-size:13px;color:#cfcfcf;text-align:center;}

/* Modal */
.insurgence-modal[hidden]{display:none;}
.insurgence-modal{position:fixed;inset:0;background:rgba(0,0,0,.78);display:flex;align-items:center;justify-content:center;z-index:2147483647;}
.insurgence-modal .backdrop{position:fixed;inset:0;background:rgba(0,0,0,.78);} /* ensure full-screen clicking */
.insurgence-modal .dialog{position:relative;background:#0f0f0f;color:#f2f2f2;border-radius:12px;max-width:1000px;width:92%;max-height:92vh;overflow:auto;padding:18px 18px 22px;box-shadow:0 10px 30px rgba(0,0,0,.45);z-index:1;}
.modal-header.lowered{position:sticky;top:24px; /* lowered more */ background:#0f0f0f; z-index:2; display:flex; align-items:center; gap:10px; padding-bottom:6px;}
.modal-title{font-size:26px;margin:0;flex:1;}
.close{width:36px;height:36px;border:none;border-radius:50%;background:#2b2b2b;color:#fff;cursor:pointer;font-size:20px;line-height:1;}
.modal-video iframe{width:100%;height:420px;max-height:48vh;border-radius:8px;margin:12px 0;}
.modal-body{display:grid;grid-template-columns:360px 1fr;gap:16px;}
.modal-left img{width:100%;height:auto;border-radius:8px;display:block;}
.modal-right .btn.request{display:inline-block;margin-top:12px;padding:10px 14px;background:#4da3ff;color:#0f0f0f;border-radius:8px;text-decoration:none;font-weight:700;}
.press-box{margin-top:14px;}
.press-box h3{margin:0 0 6px;font-size:16px;}
.press-box ul{margin:0;padding-left:18px;}
.press-box li{margin:4px 0;}

/* Responsive adjustments */
@media (max-width:1100px){
    .grid{grid-template-columns:repeat(3,1fr)}
    .highlight-item{width:360px}
    .modal-body{grid-template-columns:1fr}
}

@media (max-width:700px){
    .grid{grid-template-columns:repeat(2,1fr)}
    .library-logo{max-width:280px}
    .highlight-item{width:280px}
    
    .highlighted-track{
        gap:16px;
        padding-left:16px;
        padding-right:16px;
    }
}