/* Base Styles & Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: "Montserrat", sans-serif;
    font-weight: 400;
    color: #000;
    background-color: #fff;
    line-height: 1.5;
    overflow-x: hidden;
}

h1, h2, h3, h4, .heavy-text, .banner-column-title {
    font-family: "Bebas Neue", sans-serif;
    text-transform: uppercase;
    line-height: 1.1;
    font-weight: normal;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utility Classes */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.btn {
    background: #000;
    color: #fff;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-family: "Montserrat", sans-serif;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 14px;
    transition: opacity 0.2s, transform 0.2s;
    display: inline-block;
}

.btn-blue {
    background: #007bff;
}

.btn-blue:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.btn:hover {
    opacity: 0.9;
}


/* Navigation */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky; 
    top: 0;
    width: 100%;
    background: linear-gradient(to right, #ffffff 50%, #007bff 50%, #007bff 59%, #000000 59%);
    z-index: 100;
    padding: 20px 40px;
}

/* Fix sticky header overlap for all anchor targets */
section[id], h2[id], footer[id] {
    scroll-margin-top: 100px;
}

.nav-left {
    display: flex;
    flex: 1;
    justify-content: flex-start;
}

.nav-right {
    display: flex;
    flex: 1;
    justify-content: flex-end;
}

nav ul {
    display: flex;
    gap: 40px;
    font-size: 16px;
    font-family: "Montserrat", sans-serif;
    font-weight: 600;
    letter-spacing: 1px;
    margin: 0;
    padding: 0;
}

.nav-left ul {
    color: #000;
}

.nav-right ul {
    color: #fff;
    align-items: center;
}

nav a {
    position: relative;
    color: inherit;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: #007bff;
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

.nav-iscrizioni {
    position: absolute;
    left: 50%;
    width: 9%;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: "Montserrat", sans-serif;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 0.3s;
}

.nav-iscrizioni:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.lang-toggle {
    position: absolute;
    right: 51%;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    font-family: "Montserrat", sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #000;
    cursor: pointer;
    z-index: 102;
    padding: 0 10px;
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    flex-direction: column;
    min-width: 100%;
    border-radius: 0 0 5px 5px;
    overflow: hidden;
}

.lang-dropdown.show {
    display: flex;
}

.lang-option {
    padding: 10px;
    cursor: pointer;
    text-align: center;
}

.lang-option:hover {
    background: #f0f0f0;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    z-index: 101;
    background: #fff;
    padding: 10px;
    border-radius: 5px;
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: #000;
    transition: all 0.3s ease;
}

/* Fullscreen Navigation Overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.nav-overlay-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

.nav-overlay-content ul li {
    margin-bottom: 20px;
}

.nav-overlay-content ul li a {
    text-decoration: none;
    color: #000;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 28px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.nav-overlay-content ul li a:hover {
    color: #007bff;
}

body.no-scroll {
    overflow: hidden;
}

/* Hero Section */
.hero {
    width: 100%;
    position: relative;
}

.hero-content {
    position: absolute;
    bottom: 10%;
    right: 10%;
}

.hero-btn {
    font-size: 24px;
    padding: 20px 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    font-family: "Bebas Neue", sans-serif;
    letter-spacing: 2px;
}


/* Rules Section */
.rules-section {
    background: #fff; /* White background as requested */
    padding: 100px 0;
}

.banner-category-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    text-align: center;
}

.banner-column-title {
    font-size: 32px;
    border-bottom: 2px solid #007bff;
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 40px;
    letter-spacing: 1px;
}

.banner-subgrid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 100%; /* Ensure full height */
}

.banner-subgrid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    height: 100%;
}

.rule-card {
    display: block;
    text-decoration: none;
    background: #fff;
    transition: transform 0.3s ease;
    height: 500px; /* Increased from 200px */
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    max-width: 300px;
    width: 100%;
    margin: 0 auto;
}

.rule-card:hover {
    transform: translateY(-5px);
}

.rule-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.rule-img {
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: auto; 
    display: block;
    z-index: 0;
}

.offset-img {
    top: 70px;
}

.route-img {
    left: 1px;
}

.rule-caption-container {
    border-bottom: 3px solid transparent;
    display: inline-block;
    padding-bottom: 3px;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    background: transparent;
    transition: border-color 0.3s ease;
    white-space: nowrap;
}

.rule-card:hover .rule-caption-container {
    border-bottom-color: #007bff;
}

.rule-caption {
    font-family: 'Bebas Neue', sans-serif;
    color: #000;
    font-size: 24px;
    letter-spacing: 1px;
    margin: 0;
}

.rule-caption span {
    color: #007bff;
    margin-left: 5px;
    font-weight: 800;
}


/* Registration Section */
.services {
    background-color: #fff;
    padding: 80px 0;
}

.registration-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.registration-card {
    background: #fff; 
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    padding-top: 280px; 
    max-width: 320px;
    width: 100%;
    margin: 0 auto;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.registration-card:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.registration-card .reg-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    background: transparent;
    display: block;
    z-index: 0;
}

.reg-card-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex: 1; 
    text-align: left;
    position: relative;
    z-index: 1;
}

.registration-card h3 {
    font-size: 32px;
    margin-bottom: 15px;
    color: #000;
    align-self: center;
    border-bottom: 3px solid transparent;
    display: inline-block;
    padding-bottom: 3px;
    transition: border-color 0.3s ease;
}

.registration-card:hover h3 {
    border-bottom-color: #007bff;
}

.registration-card .reg-desc {
    font-size: 14px;
    margin-bottom: 20px;
    color: #555;
}

.registration-card ul {
    margin-bottom: 30px;
    text-align: left;
    width: 100%;
}

.registration-card ul li {
    font-size: 14px;
    margin-bottom: 10px;
    color: #333;
    position: relative;
    padding-left: 15px;
}

.registration-card ul li::before {
    content: '•';
    color: #007bff;
    position: absolute;
    left: 0;
    font-weight: bold;
}

.price-container {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #ccc;
    color: #007bff;
    display: flex;
    align-items: baseline;
    gap: 20px;
}

.currency {
    font-family: "Montserrat", sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: #000;
}

.price-val {
    font-family: "DIN Condensed", "Arial Narrow", sans-serif;
    font-size: 48px;
    line-height: 1;
}


/* Gallery & Lightbox */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    background: #fff;
    padding: 0 40px 80px;
}

.gallery-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-img:hover {
    transform: scale(1.02);
}

.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    padding: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 5px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    animation: zoom 0.3s;
}

@keyframes zoom {
    from {transform:scale(0.9)} 
    to {transform:scale(1)}
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox-prev, .lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 40px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
}

.lightbox-next {
    right: 20px;
    border-radius: 3px 0 0 3px;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-prev:hover, .lightbox-next:hover {
    background-color: rgba(0,0,0,0.8);
}


/* Sponsors Section */
.sponsors-section {
    background: #fff;
    padding: 80px 40px;
    border-top: 1px solid #eee;
}

.sponsors-section img {
    transition: transform 0.3s ease;
    cursor: pointer;
}

.sponsors-section img:hover {
    transform: scale(1.05);
}

/* Footer */
footer {
    background: #f4f4f5; 
    padding: 80px 40px 40px;
    border-top: 1px solid #ddd;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1.5fr 2fr;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #ccc;
    padding-right: 20px;
}

.footer-links {
    border-right: 1px solid #ccc;
    padding-right: 20px;
}

.footer-links h4, .newsletter h4 {
    font-size: 24px;
    margin-bottom: 20px;
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 1px;
}

.footer-links ul li {
    margin-bottom: 10px;
    font-size: 14px;
}

.contact-list a {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-links ul li a:hover {
    text-decoration: underline;
    color: #007bff;
}

.newsletter p {
    font-size: 14px;
    margin-bottom: 20px;
}

.newsletter-form {
    display: flex;
    gap: 10px;
}

.newsletter-form input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #fff; /* white input against off-white footer */
    font-family: "Montserrat", sans-serif;
}


/* Responsive Design */
@media (max-width: 900px) {
    header {
        background: #fff; /* Solid background on mobile */
        padding: 15px 20px;
        flex-wrap: wrap;
        z-index: 1001; /* Keep header above overlay */
    }
    .hero-content {
        bottom: 30%;
        left: 0;
        right: 0;
        display: flex;
        justify-content: center;
    }
    .hero-btn {
        width: auto;
        padding: 16px 36px;
        font-size: 24px;
    }
    .hero-title {
        font-size: 8vw;
    }
    .rule-card {
        max-width: 100%;
        height: 220px;
    }
    .rule-caption {
        font-size: 16px;
    }
    .rule-caption-container {
        bottom: 5px;
    }
    .offset-img {
        top: 20px; /* Scale down the push-down effect on mobile */
    }
    .route-img {
        left: 10%; 
    }
    .rule-img {
        width: 80%;
        left: 10%; 
        top: 15px; 
    }
    .registration-card .reg-icon {
        width: 85%;
        left: 7.5%; 
    }
    .registration-card {
        max-width: 260px;
        padding-top: 200px;
    }
    .registration-card h3 {
        font-size: 24px;
    }
    .registration-card .btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    .banner-category-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 30px 10px;
    }
    .banner-column:nth-child(1) {
        width: 100%;
    }
    .banner-column:nth-child(2),
    .banner-column:nth-child(3) {
        width: calc(50% - 10px);
    }
    .banner-subgrid-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    .registration-grid {
        grid-template-columns: 1fr;
    }
    .banner-column-title {
        text-align: center;
        margin-bottom: 30px;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .footer-logo, .footer-links {
        border-right: none;
        border-bottom: 1px solid #ccc;
        padding-right: 0;
        padding-bottom: 20px;
        text-align: center;
    }
    .newsletter {
        text-align: center;
    }
    .menu-toggle {
        display: flex;
        margin: 0 auto;
        z-index: 1002; /* Ensure it stays above everything */
    }
    .lang-toggle {
        display: none !important;
    }
    .nav-left, .nav-right, .nav-iscrizioni {
        display: none;
        width: 100%;
    }
    .gallery { grid-template-columns: 1fr; }
}