/* ===== Variabili ===== */
:root {
    --primary:      #0055a5;
    --primary-dark: #003d82;
    --primary-light:#e3eef8;
    --text:         #333333;
    --text-muted:   #6c757d;
}

/* ===== Base ===== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
}

/* ===== Top Bar ===== */
.top-bar {
    background-color: var(--primary-dark);
    color: #fff;
    padding: 8px 0;
    font-size: 13px;
}

.top-bar a {
    color: #fff;
    text-decoration: none;
}

.top-bar a:hover {
    text-decoration: underline;
}

.top-bar i {
    margin-right: 4px;
}

/* ===== Navbar ===== */
.navbar {
    padding: 0.75rem 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 1px;
    color: var(--primary-dark) !important;
    text-decoration: none;
}

.brand-logo {
    height: 56px;
    width: auto;
}

.footer-logo {
    height: 64px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.85;
}

.nav-link {
    font-weight: 500;
    color: var(--text) !important;
    padding: 0.5rem 0.85rem !important;
    transition: color 0.2s;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.85rem;
    right: 0.85rem;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary) !important;
}

.nav-link.active::after,
.nav-link:hover::after {
    transform: scaleX(1);
}

/* ===== Slider / Carousel ===== */
.hero-slider {
    height: 520px;
}

.hero-slider .carousel-inner,
.hero-slider .carousel-item {
    height: 520px;
}

.hero-slider .carousel-item img {
    height: 520px;
    object-fit: cover;
    filter: brightness(0.65);
}

.carousel-caption {
    bottom: 50%;
    transform: translateY(50%);
    text-align: center;
}

.carousel-caption h1,
.carousel-caption h2 {
    font-weight: 700;
    text-shadow: 2px 2px 10px rgba(0,0,0,.8);
    margin-bottom: 0.75rem;
}

.carousel-caption p {
    font-size: 1.25rem;
    text-shadow: 1px 1px 6px rgba(0,0,0,.8);
}

.carousel-caption .btn {
    margin-top: 1rem;
}

/* ===== Hero pagine interne ===== */
.page-hero {
    height: 260px;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
}

.page-hero h1 {
    color: #fff;
    font-weight: 700;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 10px rgba(0,0,0,.8);
}

/* ===== Cards ===== */
.card {
    border: none;
    transition: transform .3s, box-shadow .3s;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0,0,0,.15) !important;
}

.card-img-top {
    height: 240px;
    object-fit: cover;
}

.card-title {
    font-weight: 700;
    color: var(--primary-dark);
}

/* ===== Bottoni ===== */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    font-weight: 500;
    padding: 0.5rem 1.75rem;
    transition: background-color .25s, transform .15s;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: scale(1.04);
}

/* ===== Sezione parallax ===== */
.parallax-strip {
    /* immagine override via style inline nella pagina */
    background-image: url('../images/parallax.jpg');
    height: 220px;
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
    position: relative;
}

.parallax-strip::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,61,130,.55);
}

.parallax-strip .parallax-caption {
    position: relative;
    z-index: 1;
    color: #fff;
    text-align: center;
}

/* ===== Info Box ===== */
.info-box {
    background: #fff;
    padding: 28px 24px;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    margin-bottom: 24px;
    transition: transform .3s;
}

.info-box:hover {
    transform: translateY(-4px);
}

.info-box > i {
    font-size: 2.4rem;
    color: var(--primary);
    display: block;
    margin-bottom: 12px;
}

.info-box h4 {
    color: var(--primary-dark);
    font-weight: 700;
    margin-bottom: 10px;
}

/* ===== Sponsor Logo ===== */
.sponsor-logo {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: transform .3s, box-shadow .3s;
}

.sponsor-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 28px rgba(0,0,0,.14);
}

.sponsor-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ===== Timeline ===== */
.timeline {
    border-left: 3px solid var(--primary);
    padding-left: 24px;
    margin-left: 8px;
}

.timeline-item {
    position: relative;
    margin-bottom: 36px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -34px;
    top: 4px;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-item h4 {
    color: var(--primary);
    font-weight: 700;
}

/* ===== Sezione contenuto interno ===== */
.content-section {
    padding: 64px 0;
}

.content-section h2 {
    color: var(--primary-dark);
    font-weight: 700;
    margin-bottom: 28px;
}

.content-section p {
    line-height: 1.85;
    font-size: 1.05rem;
}

.content-section img {
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
}

/* ===== Form contatti ===== */
.contact-form {
    background: #f8f9fa;
    padding: 40px 36px;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,.08);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(0,85,165,.2);
}

/* ===== Mappa ===== */
.map-container {
    height: 420px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* ===== Footer ===== */
.footer {
    background-color: var(--primary-dark);
    color: #fff;
    margin-top: 60px;
}

.footer h5 {
    font-weight: 700;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: rgba(255,255,255,.6);
    text-decoration: none;
    transition: color .2s;
}

.footer-links a:hover {
    color: #fff;
}

.social-links a {
    display: inline-block;
    transition: transform .25s;
}

.social-links a:hover {
    transform: scale(1.2);
}

/* ===== Statistiche ===== */
.stat-box {
    text-align: center;
    padding: 32px 16px;
}

.stat-box .stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-box .stat-label {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ===== Responsive ===== */
@media (max-width: 991px) {
    .navbar-brand {
        font-size: 1rem;
    }
    .brand-icon i {
        font-size: 1.6rem;
    }
    .nav-link::after {
        display: none;
    }
}

@media (max-width: 767px) {
    .hero-slider,
    .hero-slider .carousel-inner,
    .hero-slider .carousel-item,
    .hero-slider .carousel-item img {
        height: 320px;
    }

    .carousel-caption h1,
    .carousel-caption h2 {
        font-size: 1.4rem;
    }

    .carousel-caption p {
        font-size: 1rem;
    }

    .page-hero {
        height: 180px;
        background-attachment: scroll;
    }

    .parallax-strip {
        background-attachment: scroll;
        height: 160px;
    }

    .top-bar .text-md-end {
        text-align: left !important;
        margin-top: 4px;
    }

    .content-section {
        padding: 40px 0;
    }
}
