/* ============ Variaibli di Sistema & Base ============ */
:root {
    --primary-color: #237259;
    --primary-light: #34c759;
    /* Più vivace */
    --secondary-color: #1d1d1f;
    /* Stile Apple chiaro-scuro */
    --light-background: #f5f5f7;
    /* Background grigio Apple */
    --white-background: #ffffff;
    --accent-gold: #ffcc00;
    --accent-blue: #007aff;
    --border-color: rgba(0, 0, 0, 0.08);
}

app-header,
app-footer {
    display: block;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Open Sans', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: var(--light-background);
    color: var(--secondary-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ============ Tipografia ============ */
h1,
h2,
h3 {
    font-family: 'Montserrat', sans-serif;
    color: var(--primary-color);
}

h1 {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 20px;
}

h2 {
    font-size: 2em;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

/* ============ Header & Navigazione ============ */
header {
    background-color: var(--white-background);
    padding: 10px 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 20px;
}

.logo {
    max-width: 500px;
    max-height: 120px;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.02);
}

.main-nav {
    display: flex;
    align-items: center;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    color: var(--primary-color);
    padding: 5px;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 25px;
}

.nav-links a {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: bold;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    font-size: 0.95em;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* ============ Layout Sezioni ============ */
section {
    padding: 40px 0;
}

section:nth-child(even) {
    background-color: var(--light-background);
}

.hero-section {
    background: url('https://via.placeholder.com/1500x500/28a745/ffffff?text=Immagine+di+sfondo+Comunit%C3%A0+Energetica') no-repeat center center/cover;
    color: #fff;
    text-align: center;
    padding: 100px 20px;
    position: relative;
    margin-bottom: 30px;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 39, 12, 0.4);
}

.hero-section .content {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    color: #fff;
    font-size: 3.5em;
    margin-bottom: 15px;
}

.hero-section p {
    font-size: 1.3em;
    max-width: 800px;
    margin: 0 auto 30px auto;
}

.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}

.cta-button:hover {
    background-color: #218838;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.feature-item {
    background-color: var(--white-background);
    padding: 30px 25px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.feature-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Animations global class for consistency */
.interactive-card {
    background-color: var(--white-background);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.interactive-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

.feature-item i {
    font-size: 3em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.feature-item h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.contact {
    text-align: center;
    padding: 30px 0;
    font-size: 1.2em;
}

.contact a {
    color: var(--primary-color);
    font-weight: bold;
    text-decoration: none;
    word-break: break-all;
}

.contact a:hover {
    text-decoration: underline;
}

/* ============ Footer ============ */
footer {
    background-color: var(--secondary-color);
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    font-size: 0.9em;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ============ MEDIA QUERY: MOBILE ============ */
@media (max-width: 670px) {
    .container {
        padding: 20px;
    }

    .header-container {
        padding-top: 10px;
        padding-bottom: 10px;
        position: relative;
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    .menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        font-size: 35px;
        color: var(--primary-color) !important;
        background: transparent;
        z-index: 9999;
        position: relative;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: var(--white-background);
        position: absolute;
        top: 100%;
        left: 0;
        padding: 20px 0;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        z-index: 999;
        text-align: center;
    }

    .nav-links.active {
        display: flex !important;
    }

    .logo {
        max-width: 300px;
        max-height: 90px;
    }

    .hero-section {
        padding: 60px 10px;
    }

    .hero-section h1 {
        font-size: 2.2em;
    }

    .hero-section p {
        font-size: 1.1em;
    }

    h2 {
        font-size: 1.8em;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .cta-button {
        padding: 12px 20px;
        font-size: 1em;
    }
}