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

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    color: #333;
    line-height: 1.8;
    position: relative;
    overflow-x: hidden;
}

/* Gradient verticale dal chiaro allo scuro */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        #ffffff 0%,
        #f8faf8 25%,
        #f0f4f0 50%,
        #c7d7c7 75%,
        #e0ede0 100%
    );
    z-index: -1;
    pointer-events: none;
}

/* Stemma di Gnosca singolo in basso a destra */
body::after {
    content: '';
    position: fixed;
    bottom: 0px;
    right: 0px;
    width: 350px;
    height: 350px;
    background-image: url('../images/Gnosca.svg');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.04;
    z-index: 0;
    pointer-events: none;
}

/* Animazioni */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Navigazione */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    z-index: 1000;
    padding: 1.2rem 0;
    transition: all 0.3s ease;
}

nav ul {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    list-style: none;
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    color: #2c5f2d;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: all 0.3s;
    padding: 0.5rem 1rem;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #4a8c4b;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

nav a:hover::after {
    width: 80%;
}

nav a:hover {
    color: #4a8c4b;
}

/* Hero Section con Video */
.hero {
    height: 60vh;
    min-height: 500px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 70px;
}

.hero video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(44, 95, 45, 0.7) 0%, rgba(0, 0, 0, 0.5) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    padding: 2rem;
    animation: fadeInUp 1.2s ease-out;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 4rem;
    margin-bottom: 1.5rem;
    text-shadow: 2px 4px 8px rgba(0,0,0,0.3);
    font-weight: 700;
    letter-spacing: 2px;
}

.hero p {
    font-size: 1.4rem;
    text-shadow: 1px 2px 4px rgba(0,0,0,0.4);
    font-weight: 300;
    letter-spacing: 1px;
}

/* Sezioni generali */
section {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    color: #2c5f2d;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #2c5f2d, #4a8c4b);
    border-radius: 2px;
}

section p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    text-align: justify;
    line-height: 1.9;
}

/* Chi Siamo */
#chi-siamo {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
}

/* Cosa Facciamo */
#cosa-facciamo {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(5px);
}

.attivita-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.attivita-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: all 0.4s ease;
    border: 1px solid rgba(44, 95, 45, 0.1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.attivita-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #2c5f2d, #4a8c4b);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.attivita-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(44, 95, 45, 0.15);
}

.attivita-card:hover::before {
    transform: scaleX(1);
}

.attivita-card h3 {
    font-family: 'Playfair Display', serif;
    color: #2c5f2d;
    margin-bottom: 1.2rem;
    font-size: 1.5rem;
}

/* News & Eventi */
#news {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.news-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: all 0.4s ease;
    border: 1px solid rgba(44, 95, 45, 0.1);
    backdrop-filter: blur(10px);
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(44, 95, 45, 0.15);
}

.news-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    letter-spacing: 0.5px;
}

.news-badge.evento {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #2c5f2d;
}

.news-badge.comunicato {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
}

.news-content {
    padding: 2rem;
}

.news-date {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.news-card h3 {
    font-family: 'Playfair Display', serif;
    color: #2c5f2d;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    line-height: 1.4;
}

.news-card p {
    color: #555;
    margin-bottom: 0;
    text-align: left;
    line-height: 1.8;
}

/* Gallery */
#gallery {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(5px);
}

/* Filtri Gallery */
.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.8rem 1.8rem;
    border: 2px solid #2c5f2d;
    background: white;
    color: #2c5f2d;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.filter-btn:hover {
    background: #f0f4f0;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #2c5f2d, #4a8c4b);
    color: white;
    box-shadow: 0 4px 15px rgba(44, 95, 45, 0.3);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    aspect-ratio: 1;
    background: #f0f0f0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.gallery-item.hidden {
    display: none;
}

.gallery-item:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.15);
}

/* Badge categoria sulla foto */
.gallery-category-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.95);
    color: #2c5f2d;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1;
    backdrop-filter: blur(10px);
}

/* Contatti */
#contatti {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
}

.contatti-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 3rem;
}

.form-group {
    margin-bottom: 1.8rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.7rem;
    color: #2c5f2d;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: inherit;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2c5f2d;
    box-shadow: 0 0 0 3px rgba(44, 95, 45, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 140px;
}

button[type="submit"] {
    background: linear-gradient(135deg, #2c5f2d, #4a8c4b);
    color: white;
    padding: 1.2rem 2.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(44, 95, 45, 0.3);
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 95, 45, 0.4);
}

button[type="submit"]:active {
    transform: translateY(0);
}

.info-contatti h3 {
    font-family: 'Playfair Display', serif;
    color: #2c5f2d;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
}

.info-contatti p {
    margin-bottom: 1.2rem;
    text-align: left;
    line-height: 1.8;
}

/* Footer */
footer {
    background: #2c5f2d;
    color: white;
    text-align: center;
    padding: 2rem;
}

/* Modal Lightbox */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.modal-content img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    max-height: 85vh;
}

.modal-close {
    position: fixed;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 45px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: all 0.3s;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Frecce navigazione lightbox */
.modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 50px;
    cursor: pointer;
    z-index: 10000;
    transition: all 0.3s;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    user-select: none;
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
}

.modal-prev {
    left: 30px;
}

.modal-next {
    right: 30px;
}

/* Contatore immagini */
.modal-counter {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1rem;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    backdrop-filter: blur(10px);
}

/* ===========================================
   STILI SPECIFICI PER PAGINA PATRIMONIO
   =========================================== */

.patrimonio-hero {
    height: 40vh;
    min-height: 350px;
    background: linear-gradient(135deg, rgba(44, 95, 45, 0.85) 0%, rgba(0, 0, 0, 0.6) 100%),
                url('../images/Gnosca1.jpeg') center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-top: 70px;
}

.patrimonio-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 4px 8px rgba(0,0,0,0.3);
}

.patrimonio-hero p {
    font-size: 1.3rem;
    text-shadow: 1px 2px 4px rgba(0,0,0,0.4);
}

.intro-text {
    max-width: 900px;
    margin: 0 auto 4rem;
    text-align: center;
    font-size: 1.2rem;
    line-height: 1.9;
    color: #555;
}

.bene-patrimoniale {
    margin-bottom: 6rem;
    padding-bottom: 4rem;
    border-bottom: 2px solid rgba(44, 95, 45, 0.1);
}

.bene-patrimoniale:last-child {
    border-bottom: none;
}

.bene-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.bene-container.reverse {
    direction: rtl;
}

.bene-container.reverse > * {
    direction: ltr;
}

.bene-image {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    transition: transform 0.5s ease;
}

.bene-image:hover {
    transform: scale(1.02);
}

.bene-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    min-height: 400px;
}

.bene-content h3 {
    font-family: 'Playfair Display', serif;
    color: #2c5f2d;
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.bene-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.bene-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.95rem;
}

.bene-meta-item strong {
    color: #2c5f2d;
}

.bene-content p {
    font-size: 1.1rem;
    line-height: 1.9;
    color: #555;
    margin-bottom: 1.5rem;
    text-align: left;
}

.bene-highlight {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #2c5f2d;
    margin-top: 2rem;
}

.bene-highlight p {
    margin-bottom: 0;
    font-weight: 500;
    color: #2c5f2d;
}

.bene-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-item .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.feature-item h4 {
    color: #2c5f2d;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.feature-item p {
    font-size: 0.9rem;
    margin-bottom: 0;
    color: #666;
}

/* ===========================================
   RESPONSIVE
   =========================================== */

@media (max-width: 768px) {
    .hero {
        height: 50vh;
        min-height: 400px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    section {
        padding: 4rem 1.5rem;
    }

    section h2 {
        font-size: 2.2rem;
    }

    .contatti-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    nav ul {
        gap: 1rem;
    }

    nav a {
        font-size: 0.9rem;
        padding: 0.3rem 0.5rem;
    }

    .attivita-grid,
    .news-grid {
        gap: 1.5rem;
    }

    button[type="submit"] {
        width: 100%;
    }

    body::after {
        width: 200px;
        height: 200px;
    }

    .gallery-filters {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        font-size: 35px;
        width: 40px;
        height: 40px;
    }

    .modal-nav {
        width: 50px;
        height: 50px;
        font-size: 35px;
    }

    .modal-prev {
        left: 10px;
    }

    .modal-next {
        right: 10px;
    }

    .modal-counter {
        bottom: 15px;
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
    }

    /* Responsive Patrimonio */
    .patrimonio-hero h1 {
        font-size: 2.2rem;
    }

    .patrimonio-hero p {
        font-size: 1.1rem;
    }

    .bene-container,
    .bene-container.reverse {
        grid-template-columns: 1fr;
        gap: 2rem;
        direction: ltr;
    }

    .bene-content h3 {
        font-size: 1.8rem;
    }

    .bene-image img {
        min-height: 300px;
    }

    .bene-meta {
        gap: 1rem;
    }
}