/* --- BASIC PAGE SETUP --- */
body {
    background-color: #ffffff;
    color: black;
    font-family: "Jost", sans-serif;
    margin: 0;
}

/* --- THE MAIN LAYOUT --- */
.container {
    display: flex;     
    height: 100vh;     
}

/* --- LEFT SIDE (MENU) --- */
.sidebar {
    width: 20%;        
    padding: 50px;     
    box-sizing: border-box; 
    
    display: flex;
    flex-direction: column;
    justify-content: center; 
}

/* Styling the menu list */
.sidebar ul {
    list-style-type: none; 
    padding: 0;
    margin: 0;
}

.sidebar li {
    margin-bottom: 8px; 
}

/* Styling the links */
.sidebar a {
    text-decoration: none; 
    color: black;
    font-size: 18px;
    font-weight: 400; 
}

.sidebar a:hover {
    color: gray; 
}

/* Active link styling */
.sidebar a.active {
    font-weight: 600; 
    color: black;
}

/* --- RIGHT SIDE (CONTENT) --- */
.content {
    width: 80%;        
    padding: 50px;
    box-sizing: border-box;
    overflow-y: auto;  
}

.content h1 {
    font-weight: 300; 
}

.content img {
    max-width: 100%;   
    height: auto;      
    margin-top: 20px;  
}

/* --- VIDEO GRID LAYOUT --- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 30px; 
    margin-top: 40px;
}

/* --- VIDEO THUMBNAILS --- */
.video-thumbnail {
    position: relative;
    display: block; 
    aspect-ratio: 16 / 9; 
    overflow: hidden; 
    border-radius: 6px; 
    text-decoration: none;
    background-color: #000; 
}

.video-thumbnail img {
    margin-top: 0 !important; 
    width: 100%;
    height: 100%;
    object-fit: contain; 
    transition: transform 0.6s ease, filter 0.6s ease;
}

/* --- VIDEO TITLE OVERLAY --- */
.video-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -35%); 
    width: 90%; 
    text-align: center;
    color: white;
    font-size: 24px;
    font-weight: 300; 
    letter-spacing: 1px;
    opacity: 0; 
    transition: opacity 0.5s ease, transform 0.5s ease;
    z-index: 2; 
}

/* --- VIDEO HOVER ANIMATIONS --- */
.video-thumbnail:hover img {
    transform: scale(1.05); 
    filter: brightness(0.4); 
}

.video-thumbnail:hover .video-title {
    opacity: 1; 
    transform: translate(-50%, -50%); 
}

/* --- RESPONSIVE FIX FOR SMALLER SCREENS --- */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 20px; 
        border-bottom: 1px solid #eee; 
    }

    .sidebar ul {
        display: flex;
        flex-wrap: wrap; 
        justify-content: center; 
        gap: 25px; 
    }

    .sidebar li {
        margin-bottom: 0; 
    }

    .content {
        width: 100%;
        padding: 30px 20px; 
        flex: 1; 
    }

    .video-grid {
        grid-template-columns: 1fr; 
    }
}

/* --- YOUTUBE VIDEO MODAL (LIGHTBOX) --- */
.modal {
    display: none; 
    position: fixed;
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); 
    backdrop-filter: blur(5px); 
    align-items: center; 
    justify-content: center; 
}

.modal-content {
    position: relative;
    width: 80%; 
    max-width: 1100px; 
    background: #000;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; 
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 35px;
    font-weight: 100;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #aaa;
}

@media (max-width: 900px) {
    .modal-content {
        width: 95%; 
    }
}

/* --- SLIDESHOW CROSSFADE IMAGES (VIDEO PAGE) --- */
.slide-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; 
    opacity: 0; 
    z-index: 1; 
    pointer-events: none; 
    transition: transform 0.6s ease, filter 0.6s ease, opacity 0.8s ease-in-out !important;
}

.video-title {
    z-index: 2 !important; 
}


/* =========================================
   === PHOTO GALLERY STYLES (photo.html) ===
   ========================================= */

/* Filtri */
.filter-section {
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-label {
    font-weight: 600;
    font-size: 18px;
}

.filter-buttons button {
    background: transparent;
    border: 1px solid #ddd;
    padding: 8px 18px;
    margin-right: 5px;
    border-radius: 20px;
    cursor: pointer;
    font-family: "Jost", sans-serif;
    font-size: 15px;
    transition: all 0.3s ease;
}

.filter-buttons button:hover, 
.filter-buttons button.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* Bottone Tendina (Accordion) */
.group-accordion {
    width: 100%;
    background-color: #fcfcfc;
    border: 1px solid #eee;
    color: #000;
    padding: 18px 25px;
    font-size: 18px;
    font-weight: 400;
    text-align: left;
    outline: none;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    border-radius: 6px;
    font-family: "Jost", sans-serif;
}

.group-accordion:hover, 
.group-accordion.active {
    background-color: #f0f0f0;
}

.group-accordion span {
    font-weight: 300;
    color: gray;
}

/* Pannello sotto la tendina */
.group-panel {
    display: none; 
    margin-bottom: 25px;
}

.group-panel.open {
    display: block; 
}

/* --- MASONRY LAYOUT PER LE FOTO --- */
.photo-grid {
    column-count: 3; 
    column-gap: 20px; 
    margin-top: 15px;
}

.photo-wrapper {
    break-inside: avoid; 
    margin-bottom: 20px; 
    transform: translateZ(0); 
    will-change: transform;
}

/* --- ANIMAZIONE FADE-IN FOTO --- */
.photo-item {
    width: 100%;
    display: block;
    border-radius: 6px;
    cursor: zoom-in;
    margin-top: 0 !important; 
    
    /* Le foto sono invisibili e spostate leggermente in basso di default */
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease, transform 0.6s ease, filter 0.3s ease;
}

/* Quando la foto ha caricato (via JS), appare dolcemente! */
.photo-item.loaded {
    opacity: 1;
    transform: translateY(0);
}

.photo-item.loaded:hover {
    filter: brightness(0.6);
}

/* --- MODAL FOTOGRAFICO E BOTTONE X FISSO --- */
.photo-modal-content {
    background: transparent;
    box-shadow: none;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.photo-modal-content img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 4px;
    object-fit: contain; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

/* Il bottone X sganciato dal contenitore e fissato allo schermo! */
.photo-close {
    position: fixed !important;
    top: 20px !important;
    right: 35px !important;
    font-size: 45px !important;
    z-index: 1001 !important;
}

/* Adattamento Foto per schermi più piccoli */
@media (max-width: 900px) {
    .filter-section {
        flex-direction: column;
        align-items: flex-start;
    }
    .photo-grid {
        column-count: 2; 
    }
    .photo-close {
        top: 10px !important;
        right: 20px !important;
    }
}

@media (max-width: 500px) {
    .photo-grid {
        column-count: 1; 
    }
}