/* --- Impostazioni Globali e Palette Colori --- */
:root {
    --primary-color: #1E8A8B; 
    --secondary-color: #F38F1F; 
    --accent-color: #CADB2A;
    --background-color: #ffffff; 
    --dark-background-color: #f0f4f8; 
    --text-color: #333333; 
    --light-text-color: #ffffff;
    --heading-font: 'Poppins', sans-serif; 
    --body-font: 'Open Sans', sans-serif;
}

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

html { 
    scroll-behavior: smooth; 
}

body { 
    font-family: var(--body-font); 
    line-height: 1.7; 
    background-color: var(--background-color); 
    color: var(--text-color); 
}

.container { 
    max-width: 1100px; 
    margin: auto; 
    padding: 0 1.5rem; 
}

h1, h2, h3 { 
    font-family: var(--heading-font); 
    color: var(--primary-color); 
    margin-bottom: 1rem; 
}

h2 { 
    text-align: center; 
    font-size: 2.5rem; 
    margin-bottom: 3rem; 
}

a { 
    color: var(--secondary-color); 
    text-decoration: none; 
}

/* --- Header e Navigazione --- */
.main-header { 
    background-color: var(--background-color); 
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
}

.navbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    height: 80px; 
}

.logo { 
    height: 50px; 
}

.nav-links { 
    display: flex; 
    gap: 2.5rem; 
    list-style: none; 
}

.nav-links a { 
    font-weight: 700; 
    color: var(--primary-color); 
    font-size: 1rem; 
    transition: color 0.3s ease; 
}

.nav-links a:hover, .nav-links a:focus { 
    color: var(--secondary-color); 
}

.hamburger { 
    display: none; 
    background: none; 
    border: none; 
    cursor: pointer; 
}

.hamburger span { 
    display: block; 
    width: 28px; 
    height: 3px; 
    background-color: var(--primary-color); 
    margin: 6px 0; 
    transition: all 0.3s ease-in-out; 
}

/* --- Sezione Hero --- */
.hero-section { 
    background-color: var(--primary-color); 
    color: var(--light-text-color); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    text-align: center; 
    padding: 6rem 1.5rem; 
}

.hero-content h1 { 
    font-size: 3.5rem; 
    color: var(--light-text-color); 
}

.hero-content .subtitle { 
    font-size: 1.3rem; 
    margin-bottom: 2rem; 
    max-width: 600px; 
    margin-left: auto; 
    margin-right: auto; 
    opacity: 0.9; 
}

.cta-button { 
    background-color: var(--secondary-color); 
    color: var(--light-text-color); 
    padding: 1rem 2.5rem; 
    border-radius: 50px; 
    font-weight: 700; 
    transition: transform 0.3s ease, background-color 0.3s ease; 
    display: inline-block; 
}

.cta-button:hover { 
    background-color: #e07e15; 
    transform: translateY(-3px); 
}

/* --- Sezioni di Contenuto --- */
.content-section, .content-section-dark { 
    padding: 5rem 0; 
}

.content-section-dark { 
    background-color: var(--dark-background-color); 
}

.about-me-text { 
    max-width: 800px; 
    margin: 0 auto; 
    text-align: center; 
    font-size: 1.1rem; 
}

/* --- Sezione Ricerca Google --- */
#search-section { 
    text-align: center; 
}

.search-subtitle { 
    max-width: 600px; 
    margin: -1rem auto 2rem auto; 
    color: #666; 
}

.gcse-search { 
    max-width: 700px; 
    margin: 0 auto; 
}

/* --- Griglia Progetti --- */
#progetti.content-section-dark {
    background-color: var(--dark-background-color);
}

#progetti h2 { 
    color: var(--primary-color); 
}

.projects-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 2rem; 
}

.project-card { 
    background: var(--background-color); 
    border-radius: 10px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.07); 
    padding: 2rem; 
    text-align: center; 
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
}

.project-card:hover { 
    transform: translateY(-10px); 
    box-shadow: 0 8px 25px rgba(0,0,0,0.1); 
}

.project-card h3 { 
    color: var(--primary-color); 
    font-size: 1.5rem; 
}

.project-link { 
    display: inline-block; 
    margin-top: 1rem; 
    background-color: var(--primary-color); 
    color: var(--light-text-color); 
    padding: 0.75rem 1.5rem; 
    border-radius: 50px; 
    font-weight: 700; 
    transition: background-color 0.3s ease; 
}

.project-link:hover { 
    background-color: #166b6c; 
}

/* --- Timeline Esperienze --- */
#esperienze.content-section-dark {
    background-color: var(--dark-background-color);
}

#esperienze h2 { 
    color: var(--primary-color); 
}

.timeline { 
    position: relative; 
    max-width: 800px; 
    margin: 0 auto; 
}

.timeline::after { 
    content: ''; 
    position: absolute; 
    width: 3px; 
    background-color: var(--secondary-color); 
    top: 0; 
    bottom: 0; 
    left: 20px; 
}

.timeline-item { 
    position: relative; 
    padding-left: 50px; 
    margin-bottom: 2rem; 
}

.timeline-item::after { 
    content: ''; 
    position: absolute; 
    width: 15px; 
    height: 15px; 
    background-color: var(--background-color); 
    border: 3px solid var(--secondary-color); 
    top: 5px; 
    left: 13px; 
    border-radius: 50%; 
    z-index: 1; 
}

.timeline-content { 
    background-color: #fff; 
    border-radius: 6px; 
    padding: 1.5rem; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
}

.job-title { 
    font-style: italic; 
    opacity: 0.8; 
    font-size: 0.9rem; 
}

/* --- Footer --- */
.main-footer { 
    background-color: var(--text-color); 
    color: rgba(255, 255, 255, 0.8); 
    text-align: center; 
    padding: 4rem 1.5rem; 
}

.main-footer h2 { 
    color: var(--light-text-color); 
}

.main-footer a { 
    color: var(--light-text-color); 
}

.footer-email { 
    font-size: 1.2rem; 
    display: inline-block; 
    margin-bottom: 1.5rem; 
}

.social-links { 
    margin-bottom: 2rem; 
}

.social-link { 
    font-weight: bold; 
    border: 2px solid var(--light-text-color); 
    padding: 0.5rem 1.5rem; 
    border-radius: 20px; 
    transition: background-color 0.3s, color 0.3s; 
}

.social-link:hover { 
    background-color: var(--light-text-color); 
    color: var(--text-color); 
}

.copyright { 
    font-size: 0.9rem; 
    opacity: 0.7; 
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    h2 { font-size: 2rem; }
    .hero-content h1 { font-size: 2.5rem; }

    .nav-links { 
        display: none; 
        flex-direction: column; 
        background-color: white; 
        position: absolute; 
        top: 80px; 
        right: 0; 
        width: 100%; 
        text-align: center; 
        box-shadow: 0 4px 6px rgba(0,0,0,0.1); 
    }

    .nav-links.active { 
        display: flex; 
    }

    .nav-links li { 
        padding: 1rem 0; 
    }

    .hamburger { 
        display: block; 
    }

    .hamburger.active span:nth-child(1) { 
        transform: translateY(9px) rotate(45deg); 
    }

    .hamburger.active span:nth-child(2) { 
        opacity: 0; 
    }

    .hamburger.active span:nth-child(3) { 
        transform: translateY(-9px) rotate(-45deg); 
    }
}