/* RESET DI BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2EA867; /* Verde */
    --primary-light: #74C59C;
    --dark: #244092;    /* Blu scuro */
    --blue-medium: #244F8A;
    --blue-accent: #009CDC;
    --blue-light: #49BEEA;
    --light: #ffffff;
    --gray: #f4f4f4;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--blue-medium);
    scroll-behavior: smooth;
}

/* NAVBAR */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px; 
    background: var(--dark);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo { 
    font-weight: 900; 
    font-size: 1.5rem; 
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 40px; 
    width: auto;
}

.logo span { color: var(--primary-light); }

.nav-links { display: flex; list-style: none; gap: 20px; align-items: center; }
.nav-links a { color: white; text-decoration: none; font-weight: 600; font-size: 0.9rem; transition: 0.3s; }
.nav-links a:hover { color: var(--primary-light); }

.btn-nav {
    background: var(--primary);
    padding: 8px 15px;
    border-radius: 5px;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: 0.3s;
}

/* HERO */
.hero {
    height: 56vh;
    background: linear-gradient(rgba(36, 64, 146, 0.7), rgba(36, 64, 146, 0.7)), url('https://images.unsplash.com/photo-1530549387631-6c129c1abc7a?auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 0 20px;
}

.hero h1 { font-size: 4rem; font-weight: 900; margin: 10px 0; letter-spacing: -2px; }
.badge { background: var(--primary); padding: 5px 15px; border-radius: 20px; font-weight: bold; }

.hero-btns { margin-top: 30px; display: flex; gap: 15px; justify-content: center; }

.btn-primary, .btn-secondary {
    display: inline-block;
    text-align: center;
    line-height: 1.4;
    padding: 15px 30px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: 0.3s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { transform: scale(1.05); background: var(--primary-light); }

.btn-secondary { border: 2px solid white; color: white; }
.btn-secondary:hover { background: white; color: var(--dark); }

/* INFO CARDS */
.quick-info {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 50px 5%;
    background: var(--gray);
    margin-top: -50px;
}

.info-card {
    background: white;
    padding: 30px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(36, 64, 146, 0.05);
    flex: 1;
}

.info-card h3 { margin: 10px 0; font-size: 1.5rem; color: var(--blue-medium); }

/* TIMELINE */
.timeline-section { padding: 80px 5%; max-width: 800px; margin: 0 auto; }
.section-title { text-align: center; margin-bottom: 50px; font-size: 2rem; color: var(--dark); }

.timeline { border-left: 4px solid var(--primary); padding-left: 30px; }
.event { margin-bottom: 30px; position: relative; }
.event::before {
    content: '';
    position: absolute;
    left: -38px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
}

.event.highlight { background: #f0f9f4; padding: 15px; border-radius: 8px; }
.time { font-weight: 900; color: var(--primary); font-size: 1.2rem; }
.desc { font-weight: 600; font-size: 1.1rem; color: var(--blue-medium); }

.sub-events {
    list-style: none;
    margin-top: 10px;
    padding-left: 0;
    font-size: 0.95rem;
    font-weight: 400;
}

.sub-events li {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
}

.path-dot {
    display: inline-block;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1px solid #ccc;
    vertical-align: middle;
}
.dot-white { background: white; }
.dot-blue { background: #009CDC; }
.dot-green { background: #2EA867; }

.info-card .path-dot {
    display: block;
    margin: 0 auto 15px auto;
}

/* PERCORSI SPECIFICI */
.route-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 40px;
    border-left: 10px solid var(--gray);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.route-card.white { border-left-color: #ffffff; border: 1px solid #eee; border-left-width: 10px; }
.route-card.blue { border-left-color: var(--blue-accent); }
.route-card.green { border-left-color: var(--primary); }

.route-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.route-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.route-title h2 { font-size: 1.8rem; }

.route-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.feature-box {
    background: var(--gray);
    padding: 15px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.feature-box strong { display: block; color: var(--blue-medium); margin-bottom: 5px; }

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--blue-medium);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: 0.3s;
}

.btn-download:hover { background: var(--dark); transform: translateY(-2px); }

/* FOOTER */
footer { text-align: center; padding: 40px; background: var(--blue-medium); color: #a5c7e5; font-size: 0.8rem; }

/* MOBILE */
@media (max-width: 950px) {
    .hero h1 { font-size: 2.5rem; }
    .hero-btns { flex-direction: column; }

    .quick-info {
        flex-direction: column;
    }
    
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        display: none; /* Nascosto di default su mobile */
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--dark);
        padding: 20px;
        text-align: center;
        gap: 15px;
        border-top: 1px solid rgba(255,255,255,0.1);
        box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    }

    .nav-links.active {
        display: flex; /* Mostra quando attivo */
    }

    .nav-links li {
        width: 100%;
    }

    .btn-nav {
        display: block;
        width: fit-content;
        margin: 0 auto;
    }
}

/* PAGINA PERCORSI */
.page-header {
    background: var(--blue-medium);
    color: white;
    padding: 60px 5%;
    text-align: center;
}

.container { max-width: 1000px; margin: 0 auto; padding: 40px 20px; }

.map-placeholder {
    width: 100%;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.map-placeholder img { width: 100%; display: block; filter: grayscale(20%); }

.map-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    font-weight: bold;
    border-radius: 5px;
}

.route-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 15px;
}

.stat-box {
    flex: 1;
    background: var(--gray);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-box h4 { font-size: 0.8rem; text-transform: uppercase; color: var(--blue-accent); }

/* TABELLA RISTORI */
.aid-stations { margin-top: 60px; }
.aid-stations h2 { margin-bottom: 30px; color: var(--dark); }

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th { background: var(--gray); font-weight: bold; color: var(--dark); }

@media (max-width: 600px) {
    .route-stats { flex-direction: column; }
}

/* REGISTRATION PAGE */
.registration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.registration-card {
    padding: 40px;
    border: 1px solid #eee;
    border-radius: 15px;
    text-align: center;
    position: relative;
    transition: 0.3s;
}

.registration-card.featured {
    border: 2px solid var(--primary);
    box-shadow: 0 10px 40px rgba(46, 168, 103, 0.1);
    transform: scale(1.05);
}

.registration-card.featured2 {
    border: 2px solid var(--blue-accent);
    box-shadow: 0 10px 40px rgba(0, 156, 220, 0.1);
    transform: scale(1.05);
}

.price {
    font-size: 3rem;
    font-weight: 900;
    margin: 20px 0;
    color: var(--dark);
}

.feat-list {
    list-style: none;
    margin: 30px 0;
    text-align: left;
}

.feat-list li {
    margin-bottom: 10px;
    padding-left: 25px;
    position: relative;
}

.feat-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.full-width { display: block; width: 100%; }

.requirements {
    background: #eef8f2;
    padding: 40px;
    border-radius: 15px;
}

.req-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.req-item { font-size: 0.9rem; }
.req-item strong { display: block; color: var(--primary); margin-bottom: 5px; }

/* RITROVO & MAPS */
.venue-description {
    margin-bottom: 40px;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.map-container {
    width: 100%;
    height: 400px;
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
    border: 1px solid #eee;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.parking-info {
    background: #e9f4ff;
    padding: 30px;
    border-radius: 15px;
    border-left: 5px solid var(--blue-accent);
    margin-top: 40px;
}

.parking-info h2 { color: var(--blue-medium); margin-bottom: 15px; }

@media (max-width: 950px) {
    .registration-card.featured { transform: scale(1); }
}

/* ========================================= */
/* LAYOUT A COLONNE E SIDEBAR NEWS           */
/* ========================================= */
.layout-wrapper {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    gap: 30px;
    align-items: flex-start;
}

.main-content {
    flex: 1;
    min-width: 0; /* Previene overflow */
}

/* Rimuove padding extra se il container classico è usato dentro il layout-wrapper */
.layout-wrapper .container {
    padding: 0;
    margin: 0;
    max-width: none;
}

.sidebar {
    width: 320px;
    flex-shrink: 0;
    background: var(--gray);
    padding: 25px 20px;
    border-radius: 15px;
    position: sticky;
    top: 90px; /* Offset per la navbar fissa */
}

.sidebar h3 {
    color: var(--dark);
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    text-align: center;
}

.news-widget {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.news-item-mini {
    display: block;
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--blue-medium);
    border-left: 4px solid var(--primary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.news-item-mini:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.news-date {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 5px;
    display: block;
    font-weight: 600;
}

.news-item-mini h4 {
    font-size: 1rem;
    margin-bottom: 5px;
    color: var(--dark);
    line-height: 1.3;
}

.news-item-mini p {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.4;
}

/* Adattamento Mobile Sidebar */
@media (max-width: 950px) {
    .layout-wrapper {
        flex-direction: column;
        padding: 20px;
    }
    .sidebar {
        width: 100%;
        position: static;
        margin-top: 20px;
    }
}