:root {
    --primary-bg: #ffffff;
    --accent-color: #f2e1db;
    --text-color: #4a4a4a;
    --rosa-cipria: #fff5ee;
    --heading-font: 'Playfair Display', serif;
    --body-font: 'Montserrat', sans-serif;
}

/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-color);
    font-family: var(--body-font);
    line-height: 1.6;
    overflow-x: hidden; /* Sicurezza contro lo scorrimento orizzontale su mobile */
}

/* NAVBAR */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background: white;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1); 
    min-height: 130px;
    position: relative !important; 
    top: auto !important;
}

.nav-container, 
.nav-spacer {
    flex: 1;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-links li a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 400;
    transition: opacity 0.3s;
}

.nav-links li a:hover {
    opacity: 0.6;
}

/* LOGO */
.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.logo-initial {
    font-family: var(--heading-font);
    font-size: 4rem;
    font-weight: 400;
    line-height: 0.7;
    margin-bottom: 10px;
    color: var(--text-color);
}

.logo-name {
    font-family: var(--heading-font);
    font-size: 1rem;
    letter-spacing: 8px;
    font-weight: 400;  
    white-space: nowrap;
    border: none; 
    padding-top: 0;
}

.has-submenu {
    position: relative;
}

.submenu {
    display: none; 
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    padding: 15px 0;
    min-width: 180px;
    border: 1px solid rgba(0,0,0,0.1);
    list-style: none;
    z-index: 999;
}

.has-submenu:hover .submenu {
    display: block;
}

.submenu li {
    width: 100%;
}

.submenu li a {
    display: block;
    padding: 10px 20px;
    font-size: 0.7rem !important;
    color: var(--text-color);
    letter-spacing: 1px;
    text-align: left;
}

.submenu li a:hover {
    background-color: #f9f9f9;
    opacity: 1 !important;
}

/* RESPONSIVE SMARTPHONE NAVBAR */
@media (max-width: 900px) {
    .navbar {
        flex-direction: column;
        min-height: auto;
        padding: 20px 0;
        gap: 15px;
    }

    .nav-container {
        order: 2;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .nav-links {
        gap: 15px;
        padding: 0 10px;
    }

    .nav-links li a {
        font-size: 0.65rem;
        letter-spacing: 1px;
    }

    .logo-initial {
        font-size: 2.5rem;
    }

    .logo-name {
        font-size: 0.75rem;
        letter-spacing: 3px;
        white-space: normal;
        text-align: center;
    }
}

/* --- CONTENITORE --- */
.grid-container {
    background-color: #ffffff;
    max-width: 1400px;
    margin: 0 auto;
    /* MODIFICA: Padding superiore aumentato a 90px per ricreare lo spazio sopra al titolo visto in "Progetti" */
    padding: 90px 5% 60px 5%; 
}

.section-title {
    font-family: var(--heading-font);
    font-size: clamp(1.6rem, 5vw, 2.5rem); 
    text-align: center;
    letter-spacing: 8px; 
    text-transform: uppercase;
    font-weight: 300;
    /* MODIFICA: Spazio sotto il titolo aumentato a 100px per staccarlo perfettamente dalla prima foto come in "Progetti" */
    margin-bottom: 100px; 
    padding: 0 10px;
}

/* --- GRID ITEM --- */
.grid-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 100px;
    margin-bottom: 100px;
    gap: 80px;
    width: 100%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.10);
    position: relative;
    z-index: 1;
}

.grid-item:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.grid-item:nth-child(even) {
    flex-direction: row-reverse;
}

/* --- TESTO --- */
.grid-text {
    flex: 0 0 45%; 
    max-width: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    position: relative !important;
    z-index: 100 !important;
}

.grid-text h2 {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    letter-spacing: 1px;
    font-weight: 400;
    text-transform: uppercase;
    line-height: 1.2;
    margin-bottom: 8px;
}

.grid-subtitle {
    font-size: 0.7rem;
    letter-spacing: 4px;
    color: #999;
    margin-bottom: 25px;
    text-transform: uppercase;
    font-weight: 400;
}

.grid-text p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: #666;
    margin-bottom: 35px;
    text-align: justify; /* Giustificato su PC */
}

/* --- BOTTONE --- */
.btn-view {
    display: inline-block;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 5px 0;
    transition: all 0.3s ease;
}

.btn-view:hover {
    opacity: 0.5;
    padding-left: 5px;
}

/* --- IMMAGINE --- */
.grid-img {
    flex: 0 0 45%;
    max-width: 500px;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 5;
}

.grid-img img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
    filter: grayscale(10%);
    transition: all 0.5s ease;
}

.grid-img img:hover {
    filter: grayscale(0%);
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 900px) {
    .grid-container { 
        padding: 50px 20px 40px 20px; 
    }

    .section-title {
        margin-bottom: 50px; /* Spaziatura bilanciata del titolo su smartphone */
        letter-spacing: 4px; 
    }

    .grid-item, .grid-item:nth-child(even) {
        flex-direction: column-reverse !important; 
        gap: 30px;
        margin-bottom: 60px;
        padding-bottom: 60px;
    }

    .grid-text, .grid-img {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .grid-text {
        align-items: flex-start; 
        text-align: justify;
    }

    .grid-text h2,
    .grid-subtitle,
    .btn-view {
        align-self: center;
        text-align: center;
    }

    .grid-text p { 
        text-align: justify; 
        margin-bottom: 25px;
    }

    .grid-img img {
        height: 280px;
    }
}

/* --- FOOTER --- */
.main-footer {
    background-color: #ffffff;
    padding: 80px 5% 40px;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
    text-align: center;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-logo .logo-initial {
    font-family: var(--heading-font);
    font-size: 3.5rem;
    font-weight: 400;
    height: auto;
    line-height: 0.7;
    margin-bottom: 10px;
    color: var(--text-color);
}

.footer-logo .logo-name {
    font-family: var(--heading-font);
    font-size: 0.9rem;
    letter-spacing: 6px;
    font-weight: 400;
    text-transform: uppercase;
}

.footer-links {
    display: flex;
    list-style: none;
    gap: 30px;
    padding: 0;
}

.footer-links li a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: opacity 0.3s;
}

.footer-links li a:hover {
    opacity: 0.6;
}

.footer-bottom {
    width: 100%;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 40px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 20px;
}

.social-links a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}


@media (max-width: 768px) {
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
    
