@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800;900&display=swap');

:root {
    --black: #080808;
    --dark: #141414;
    --gray: #222;
    --light-gray: #ddd;
    --white: #fff;
    --blue: #002366;
    /* dark blue */
    --light-blue: #00b0f0;
    /* celeste */
    --font-primary: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--black);
    color: var(--white);
    overflow-x: hidden;
}

/* Header */
.header {
    background: var(--black);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    height: 80px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 2px solid var(--blue);
}

.header .logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--white);
    font-weight: 900;
    font-size: 2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.header .logo img {
    height: 68px;
}

.menu-btn {
    cursor: pointer;
    font-size: 1.8rem;
    color: var(--light-blue);
    padding: 10px;
    z-index: 1000;
}

/* CHC Header Logo */
.header-chc {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    z-index: 999;
    transition: opacity 0.3s;
}

.header-chc:hover {
    opacity: 0.85;
}

.header-chc img {
    height: 52px;
    width: auto;
}

.header-chc span {
    color: #e50914; /* red */
    font-weight: 900;
    text-transform: uppercase;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* Social icons in header - desktop only */
.header-socials {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 30px;
}

.header-socials a {
    color: var(--white);
    background: var(--blue);
    width: 36px;
    height: 36px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transform: skewX(-15deg);
    transition: opacity 0.3s, transform 0.3s;
    font-size: 1rem;
    border-radius: 4px;
}

.header-socials a:hover {
    opacity: 0.85;
    transform: skewX(-15deg) scale(1.1);
}

.header-socials a i {
    transform: skewX(15deg);
}

.header-socials a.yt { background: #FF0000; }
.header-socials a.fb { background: #1877F2; }
.header-socials a.ig { background: linear-gradient(135deg, #f9ce34, #ee2a7b, #6228d7); }
.header-socials a.tk { background: #000000; }
.header-socials a.tk i { color: #ffffff; text-shadow: -2px -1px 0px #00f2ea, 2px 1px 0px #ff0050; }

.sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: var(--dark);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    z-index: 999;
    transition: right 0.3s ease;
    padding-top: 80px;
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    right: 0;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    color: var(--white);
    cursor: pointer;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
}

.sidebar-nav a {
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 15px;
    border-bottom: 1px solid #333;
    transition: color 0.3s;
}

.sidebar-nav a:hover {
    color: var(--light-blue);
}

.marquee-container {
    overflow: hidden;
    white-space: nowrap;
    background: transparent;
    position: absolute;
    top: 75px;
    left: 0;
    width: 100%;
    z-index: 3;
}

.marquee-content {
    display: inline-flex;
    align-items: center;
    gap: 80px;
    animation: marquee 30s linear infinite;
    padding-left: 80px;
}

.marquee-content img {
    height: 140px;
    object-fit: contain;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-50% - 50px));
    }
}

/* Background image for non-home pages */
.page-bg {
    background-color: #1c1c1c;
    position: relative;
}

.page-bg::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../immagini/sfondo.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.35;
    z-index: 0;
}

.page-bg .main-content {
    position: relative;
    z-index: 1;
}

.page-bg .footer {
    position: relative;
    z-index: 1;
}

.page-bg .sidebar {
    z-index: 1000;
}

/* Page Layout */
.main-content {
    margin-top: 80px;
    min-height: calc(100vh - 80px - 100px);
}

/* Hero Section */
.hero {
    position: relative;
    height: calc(100vh - 80px);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    padding: 0 5%;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.1) 100%);
    z-index: 1;
}

.slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.slide-1 {
    animation: slide1 15s infinite ease-in-out;
}

.slide-2 {
    animation: slide2 15s infinite ease-in-out;
}

.slide-3 {
    animation: slide3 15s infinite ease-in-out;
}

@keyframes slide1 {
    0%, 26.66% { transform: translateX(0); }
    33.33% { transform: translateX(-100%); }
    33.34%, 93.33% { transform: translateX(100%); }
    100% { transform: translateX(0); }
}

@keyframes slide2 {
    0%, 26.66% { transform: translateX(100%); }
    33.33%, 60% { transform: translateX(0); }
    66.66% { transform: translateX(-100%); }
    66.67%, 100% { transform: translateX(100%); }
}

@keyframes slide3 {
    0% { transform: translateX(-100%); }
    0.01%, 60% { transform: translateX(100%); }
    66.66%, 93.33% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.tag {
    display: inline-block;
    background: var(--blue);
    color: var(--white);
    padding: 5px 15px;
    font-weight: 800;
    text-transform: uppercase;
    transform: skewX(-15deg);
    margin-bottom: 20px;
}

.tag span {
    display: inline-block;
    transform: skewX(15deg);
}

.hero h1 {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1.1;
    text-transform: uppercase;
    margin-bottom: 30px;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
}

.hero h1 span.light-blue {
    color: var(--light-blue);
}

.btn {
    display: inline-block;
    background: var(--light-blue);
    color: var(--black);
    padding: 15px 30px;
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    text-decoration: none;
    transform: skewX(-15deg);
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn span {
    display: inline-block;
    transform: skewX(15deg);
}

.btn:hover {
    background: var(--white);
    color: var(--black);
    box-shadow: 0 0 15px rgba(0, 176, 240, 0.5);
}

/* Content Sections */
.section-title {
    font-size: 3rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 40px;
    color: var(--white);
    display: inline-block;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60%;
    height: 4px;
    background: var(--light-blue);
}

.page-wrapper {
    padding: 60px 5%;
}

/* Upcoming Events (Home) */
.info-bar {
    display: flex;
    background: var(--light-blue);
    padding: 3px;
    color: var(--black);
    position: absolute;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    clip-path: polygon(0 0, 100% 0, 98% 100%, 0 100%);
    width: 95%;
    margin-left: 0;
    margin-right: auto;
}

.info-box {
    flex: 1;
    background: var(--white);
    padding: 40px;
    display: flex;
    gap: 30px;
    align-items: center;
}

.info-box.dark {
    background: var(--dark);
    color: var(--white);
    clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%);
    margin-left: -5%;
    padding-left: 10%;
    border-bottom: 4px solid var(--blue);
}

.info-box h3 {
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.info-box p {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 15px;
    line-height: 1.5;
}

.info-box.dark p {
    color: #aaa;
}

.track-img {
    height: 120px;
    width: auto;
}

/* Footer */
.footer {
    background: var(--black);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid var(--blue);
}

.footer .social-links {
    display: none; /* Hidden on desktop */
}

.footer .footer-policy {
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: right;
}

.footer .footer-policy a {
    color: var(--light-gray);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer .footer-policy a:hover {
    color: var(--light-blue);
}

.footer .logo img {
    width: 320px;
    height: auto !important;
}

.footer-info {
    display: flex;
    gap: 30px;
}

.footer-info p {
    color: var(--light-gray);
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-info p i {
    color: var(--light-blue);
}

.social-links a {
    color: var(--white);
    background: var(--blue);
    width: 48px;
    height: 48px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transform: skewX(-15deg);
    margin-left: 12px;
    transition: opacity 0.3s, transform 0.3s;
    font-size: 1.2rem;
    border-radius: 4px;
}

.social-links a:hover {
    opacity: 0.85;
    transform: skewX(-15deg) scale(1.1);
}

.social-links a i {
    transform: skewX(15deg);
}

/* Social brand colors */
.social-links a.yt {
    background: #FF0000;
}

.social-links a.fb {
    background: #1877F2;
}

.social-links a.ig {
    background: linear-gradient(135deg, #f9ce34, #ee2a7b, #6228d7);
}

.social-links a.tk {
    background: #000000;
}

.social-links a.tk i {
    color: #ffffff;
    text-shadow: -2px -1px 0px #00f2ea, 2px 1px 0px #ff0050;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

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

/* Cards (Posts, Cars, Gallery) */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.card {
    background: var(--dark);
    border: 1px solid #222;
    overflow: hidden;
    transition: transform 0.3s, border-color 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--light-blue);
}

.card-img {
    height: 220px;
    background-size: cover;
    background-position: center;
    border-bottom: 3px solid var(--blue);
}

.card-content {
    padding: 25px;
}

.card-content h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: var(--light-blue);
    text-transform: uppercase;
    font-weight: 800;
}

.card-content p {
    font-size: 0.95rem;
    color: #ccc;
    line-height: 1.6;
}

/* Forms */
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    background: var(--black);
    border: 1px solid #333;
    color: var(--white);
    font-family: var(--font-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--light-blue);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .header {
        padding: 0 20px;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .header-chc span {
        display: none;
    }

    @media (max-width: 480px) {
        .header-chc {
            display: none;
        }
    }

    .marquee-container {
        top: 80px;
        bottom: auto;
    }

    .marquee-content img {
        height: 90px;
    }

    .header-socials {
        display: none;
    }

    .info-bar {
        position: relative;
        bottom: auto;
        flex-direction: column;
        margin-top: -120px;
        margin-left: auto;
        margin-right: auto;
        width: 90%;
        clip-path: none;
        border-radius: 10px;
        padding: 3px;
        background: var(--light-blue);
    }

    .info-box {
        padding: 30px 20px;
        border-radius: 7px 7px 0 0;
    }

    .info-box.dark {
        margin-left: 0;
        padding-left: 20px;
        clip-path: none;
        border: none;
        border-top: 3px solid var(--light-blue);
        border-radius: 0 0 7px 7px;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .footer {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }

    .footer .social-links {
        display: flex;
        justify-content: center;
        margin-top: 15px;
    }
    
    .footer .footer-policy {
        text-align: center;
        margin-top: 15px;
    }

    .footer-info {
        flex-direction: column;
        gap: 15px;
        margin: 0;
    }

    .footer-info p {
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .sponsor-container img {
        height: auto;
        max-height: 70px;
    }

    .race-row {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .race-row>div:last-child {
        margin-left: 0 !important;
        text-align: center !important;
    }
}