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

:root {
    --bg-cream: #f0e5d6;
    --bg-light: #faf8f4;
    --text-dark: #3d3d3d;
    --text-brown: #5c4a3d;
    --accent-orange: #c4713b;
    --accent-rust: #a65d2e;
    --accent-gold: #d4a24c;
    --card-orange: #c97d4a;
    --card-border: #b86b38;
    --btn-dark: #4a3f35;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--bg-cream);
    color: var(--text-dark);
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: 'Merriweather', serif;
    color: var(--text-brown);
}

/* Navigation */
header {
    background-color: var(--bg-light);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Merriweather', serif;
    font-weight: 700;
    color: var(--text-brown);
    font-size: 1.1rem;
}

.nav-logo-img {
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-brown);
    font-weight: 600;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-orange);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2rem 1rem 0;
    background: linear-gradient(to bottom, var(--bg-light), var(--bg-cream));
}

.hero-logo {
    max-width: 1014px;
    width: 90%;
    height: auto;
}

/* Event Info Section */
.event-info {
    text-align: center;
    padding: 1rem 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.event-info h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.event-date {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-brown);
    margin-bottom: 0.25rem;
}

.event-location {
    font-size: 1rem;
    color: var(--text-brown);
    margin-bottom: 2.5rem;
}

.btn-register {
    display: inline-block;
    background: linear-gradient(145deg, #5a9a5a 0%, #4a8a4a 50%, #3a7a3a 100%);
    color: white;
    text-decoration: none;
    padding: 0.9rem 2.5rem;
    border-radius: 8px;
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Merriweather', serif;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border: 2px solid #2d6a2d;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 1rem;
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.3rem;
    text-align: left;
    margin-top: 2rem;
}

.info-card {
    padding: 1rem;
}

.info-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-icon {
    color: var(--accent-gold);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.info-card p {
    font-size: 0.95rem;
    color: var(--text-dark);
}

.info-card ul {
    font-size: 0.95rem;
    color: var(--text-dark);
    padding-left: 1.2rem;
}

.info-card ul li {
    margin-bottom: 0.25rem;
}

/* Course Maps Section */
.course-maps {
    padding: 3rem 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.course-maps h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.maps-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.map-card {
    background: var(--bg-light);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.map-card h3 {
    text-align: center;
    padding: 1rem;
    font-size: 1.2rem;
}

.map-placeholder {
    padding: 0 1rem 1rem;
}

.map-image-container {
    padding: 0 1rem 1rem;
}

.course-map-img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.course-map-img {
    cursor: pointer;
}

.course-map-img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.map-route-link {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    color: var(--accent-orange);
    font-weight: 600;
    text-decoration: none;
}

.map-route-link:hover {
    text-decoration: underline;
}

.map-image {
    height: 200px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.map-5k {
    background: linear-gradient(135deg, #e8e4dc 0%, #d4d0c8 100%);
}

.map-10k {
    background: linear-gradient(135deg, #6b6b6b 0%, #4a4a4a 100%);
    color: white;
}

.map-label {
    font-family: 'Merriweather', serif;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--accent-orange);
    position: absolute;
    left: 20px;
}

.map-10k .map-label {
    color: #e8e4dc;
}

.map-label-right {
    left: auto;
    right: 20px;
}

.map-image p {
    font-size: 0.85rem;
    color: #666;
    margin-top: auto;
    padding-bottom: 0.5rem;
}

.map-10k p {
    color: #ccc;
}

/* Past Results Section */
.past-results {
    padding: 3rem 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.past-results h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.year-card {
    background: linear-gradient(145deg, #d4956a 0%, #c4713b 50%, #a65d2e 100%);
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    border: 2px solid var(--card-border);
}

.year-card h3 {
    font-size: 2rem;
    color: #f5f0e6;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.result-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-result {
    background-color: var(--btn-dark);
    color: white;
    text-decoration: none;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: background-color 0.3s;
}

.btn-result:hover {
    background-color: #3a3229;
}

/* Best Performances Section */
.best-performances {
    padding: 3rem 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.best-performances h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.top-times-filters {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.top-times-btn {
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 4px;
    background-color: var(--btn-dark);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.top-times-btn:hover {
    background-color: #4a4239;
}

.top-times-btn.active {
    background-color: var(--accent-orange);
}

.performances-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.performance-card {
    background: var(--bg-light);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.performance-card h3 {
    text-align: center;
    padding: 1rem;
    font-size: 1.4rem;
    background: linear-gradient(145deg, #d4956a 0%, #c4713b 50%, #a65d2e 100%);
    color: #f5f0e6;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    margin: 0;
}

.performance-table {
    width: 100%;
    border-collapse: collapse;
}

.performance-table th,
.performance-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
}

.performance-table th {
    background-color: var(--btn-dark);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.performance-table th:first-child,
.performance-table td:first-child {
    width: 35px;
    text-align: center;
}

.performance-table td:first-child {
    font-weight: 600;
    color: var(--accent-orange);
}

.performance-table th:nth-child(3),
.performance-table td:nth-child(3) {
    width: 60px;
    text-align: right;
}

.performance-table td:nth-child(3) {
    font-weight: 600;
    font-family: 'Courier New', monospace;
    position: relative;
    top: 2px;
}

.performance-table th:last-child,
.performance-table td:last-child {
    width: 50px;
    text-align: center;
}

.performance-table td:last-child {
    font-weight: 700;
}

.performance-table tbody tr:nth-child(odd) {
    background-color: rgba(196, 113, 59, 0.08);
}

.performance-table tbody tr:hover {
    background-color: rgba(196, 113, 59, 0.15);
}

/* Contact Section */
.contact {
    padding: 3rem 2rem;
    text-align: center;
    background-color: #4A3F35;
}

.contact h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #f5f0e6;
}

.contact p {
    margin-bottom: 0.5rem;
    color: #e8e4dc;
}

.contact-email {
    font-weight: 600;
    color: var(--accent-gold);
    font-size: 1.1rem;
}

/* Photo Carousel */
.photo-carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

.carousel-container {
    overflow: hidden;
    width: 100%;
    max-width: 800px;
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease;
}

.carousel-slide {
    flex: 0 0 25%;
    padding: 0.25rem;
    cursor: pointer;
}

.carousel-slide img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}

.carousel-slide img:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.carousel-arrow {
    background: var(--btn-dark);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    flex-shrink: 0;
}

.carousel-arrow:hover {
    background-color: var(--accent-orange);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.modal-image {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--accent-orange);
}

.modal-arrow {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    flex-shrink: 0;
    margin: 0 2rem;
}

.modal-arrow:hover {
    background: rgba(255, 255, 255, 0.4);
}

@media (max-width: 768px) {
    .modal-arrow {
        width: 40px;
        height: 40px;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        margin: 0;
    }

    .modal-prev {
        left: 10px;
    }

    .modal-next {
        right: 10px;
    }

    .modal-content {
        padding: 0 50px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .info-card h3 {
        justify-content: center;
    }

    .info-card ul {
        list-style-position: inside;
        padding-left: 0;
    }

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

    .course-map-img {
        pointer-events: none;
        cursor: default;
    }

    .course-map-img:hover {
        transform: none;
        box-shadow: none;
    }

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

    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .event-info h1 {
        font-size: 1.8rem;
    }

    .carousel-slide {
        flex: 0 0 50%;
    }

    .carousel-slide img {
        height: auto;
        aspect-ratio: 4/3;
        object-fit: cover;
    }
}

@media (max-width: 480px) {
    nav {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 0.75rem;
        font-size: 0.9rem;
    }

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

    .year-card h3 {
        font-size: 1.5rem;
    }

    .btn-result {
        font-size: 0.65rem;
        padding: 0.3rem 0.4rem;
    }
}
