:root {
    --secondary-color: #e60000;
    --text-color: #f4f4f9;
    --background-color: #111;
    --card-background: #1a1a1a;
}
html { scroll-behavior: smooth; }
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}
.container { max-width: 1100px; margin: auto; padding: 0 2rem; }
h1, h2, h3 { font-family: 'Teko', sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
h2 { font-size: 3rem; text-align: center; margin-bottom: 3rem; }
header {
    background: rgba(17, 17, 17, 0.8);
    backdrop-filter: blur(10px);
    padding: 0.5rem 0;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 1000;
}
header .container { display: flex; justify-content: space-between; align-items: center; }
header #logo img { height: 50px; }
header nav a { color: var(--text-color); text-decoration: none; margin-left: 1.5rem; font-weight: 700; transition: color 0.3s ease; }
header nav a:hover { color: var(--secondary-color); }
#hero {
    height: 85vh;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}
#hero h1 { font-size: 6rem; margin: 0; line-height: 1; }
#hero p { font-size: 1.5rem; }
section { padding: 4rem 0; }
#stats { background-color: var(--card-background); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; text-align: center; }
.stat-item .number { font-family: 'Teko', sans-serif; font-size: 3.5rem; color: var(--secondary-color); line-height: 1; }
.stat-item .label { font-size: 1rem; color: #aaa; text-transform: uppercase; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.news-card { background: var(--card-background); border: 1px solid #333; border-radius: 8px; overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; display: flex; flex-direction: column; }
.news-card:hover { transform: translateY(-10px); box-shadow: 0 5px 20px rgba(230, 0, 0, 0.2); }
.news-card img { width: 100%; height: 200px; object-fit: cover; }
.news-card-content { padding: 1.5rem; flex-grow: 1; }
.news-card h3 { margin-top: 0; font-size: 1.8rem; }
.results-table { width: 100%; border-collapse: collapse; margin: 0 auto; }
.results-table th, .results-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid #333; }
.results-table th { font-family: 'Teko', sans-serif; font-size: 1.2rem; color: #aaa; }
.results-table tr:nth-child(even) { background-color: var(--card-background); }
.btn-view-all { display: block; width: fit-content; margin: 2rem auto 0 auto; padding: 0.75rem 2rem; background: var(--secondary-color); color: #fff; text-decoration: none; border-radius: 5px; font-weight: bold; transition: background-color 0.3s ease; }
.btn-view-all:hover { background-color: #b30000; }
.about-layout { display: grid; grid-template-columns: 1fr 1.5fr; gap: 3rem; align-items: center; }
.about-image img { width: 100%; border-radius: 8px; }
.about-text h2 { text-align: left; margin-bottom: 1.5rem; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.gallery-item { overflow: hidden; border-radius: 8px; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.gallery-item:hover img { transform: scale(1.05); }
#partners { background-color: var(--card-background); }
.partners-grid { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 2.5rem; }
.partner-logo { height: 50px; opacity: 0.7; transition: opacity 0.3s ease; filter: grayscale(50%); }
.partner-logo:hover { opacity: 1; filter: grayscale(0%); }
#contact form { max-width: 600px; margin: auto; display: flex; flex-direction: column; }
#contact input, #contact textarea { padding: 0.8rem; margin-bottom: 1rem; border: 1px solid #444; background: var(--card-background); border-radius: 5px; color: var(--text-color); }
#contact button { background: var(--secondary-color); color: #fff; padding: 0.8rem; border: none; border-radius: 5px; font-size: 1rem; font-weight: bold; cursor: pointer; transition: background 0.3s ease; }
#contact button:hover { background: #b30000; }
footer { text-align: center; padding: 3rem 0; background: #000; color: #aaa; }
.social-links a { color: #aaa; margin: 0 0.75rem; text-decoration: none; transition: color 0.3s ease; }
.social-links a:hover { color: var(--secondary-color); }
.nav-toggle { display: none; }
@media (max-width: 800px) {
    .about-layout { grid-template-columns: 1fr; }
    .about-text h2 { text-align: center; }
    .main-nav { display: none; position: absolute; top: 66px; left: 0; right: 0; background: var(--background-color); flex-direction: column; text-align: center; padding: 2rem 0; border-bottom: 1px solid #333; }
    .main-nav.is-open { display: flex; }
    .main-nav a { margin: 0.5rem 0; }
    .nav-toggle { display: block; background: transparent; border: 0; cursor: pointer; }
    .hamburger { display: block; position: relative; width: 2em; height: 3px; background: white; }
    .hamburger::before, .hamburger::after { content: ''; position: absolute; left: 0; right: 0; height: 3px; background: white; }
    .hamburger::before { top: -8px; }
    .hamburger::after { top: 8px; }
}

/* =========================================
   Profile Header & eWRC Results List
   ========================================= */

.profile-header {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid #333;
}
.profile-photo img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--secondary-color);
    object-fit: cover;
}
.profile-summary-stats {
    flex-grow: 1;
}
.stats-title {
    margin: 0 0 1rem 0;
    font-size: 1.8rem;
    border-bottom: 2px solid #333;
    padding-bottom: 0.5rem;
}
.stat-line {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    padding: 0.4rem 0;
}
.stat-category {
    color: #aaa;
    font-weight: 700;
}
.stat-value {
    color: var(--text-color);
}

.results-list-container {
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
}

.results-year-header {
    font-family: 'Teko', sans-serif;
    font-size: 2rem;
    background-color: var(--card-background);
    color: var(--secondary-color);
    padding: 0.5rem 1.5rem;
    margin: 0;
    text-align: left;
    border-bottom: 1px solid #333;
}

.result-item {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    align-items: center;
    border-bottom: 1px solid #333;
    background-color: #161616;
    transition: background-color 0.3s ease;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item:nth-child(odd) {
     background-color: var(--card-background);
}

.result-item:hover {
    background-color: #2a2a2a;
}

.result-event {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.flag-icon {
    width: 20px;
    height: auto;
    margin-bottom: 0.5rem;
}

.result-event a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.result-event a:hover {
    color: var(--secondary-color);
}

.result-championship {
    font-size: 0.85rem;
    color: #aaa;
    margin-top: 0.25rem;
}

.result-car {
    font-size: 1rem;
    color: #ccc;
    line-height: 1.4;
}

.result-team {
    display: block;
    font-size: 0.85rem;
    color: #999;
    margin-top: 0.25rem;
}

.result-position {
    font-family: 'Teko', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: right;
    line-height: 1;
}

.result-class-pos {
    display: block;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    color: #aaa;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    .stat-line {
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        margin-bottom: 0.5rem;
    }
    .result-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .result-event, .result-car, .result-position {
        align-items: center;
        text-align: center;
    }
    .result-position {
        margin-top: 1rem;
        text-align: center;
    }
    .results-year-header {
        text-align: center;
    }
}