/* Why Racing Events - Unified Brand Styles */

:root {
    --brand-red: #E31837;
    --brand-blue: #000000;
    --dark: #0a0a0a;
    --light: #ffffff;
    --grey: #f4f4f4;

    /* Default Theme Variables (Will be overridden by JS) */
    --theme-primary: var(--brand-red);
    --theme-secondary: var(--brand-blue);
    --theme-accent: #ffd700;
    --theme-dark: #0a0a0a;
    --theme-gold: #ffd700;
}

/* --- THEME ANIMATIONS --- */
.floating-icons {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.floating-icons span {
    position: absolute;
    font-size: 2.5rem;
    opacity: 0.15;
    animation: floatIcon 15s infinite ease-in-out;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

@keyframes floatIcon {
    0% {
        transform: translateY(0) rotate(0deg) scale(0.9);
    }

    33% {
        transform: translateY(-20px) rotate(10deg) scale(1);
    }

    66% {
        transform: translateY(10px) rotate(-5deg) scale(0.95);
    }

    100% {
        transform: translateY(0) rotate(0deg) scale(0.9);
    }
}

/* --- NAVIGATION --- */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 24px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.95) 0%, rgba(227, 24, 55, 0.95) 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: 0.4s;
}

.logo img {
    height: 45px;
    transform: scale(2.5);
    transform-origin: left center;
    filter: invert(1) brightness(2);
}

.nav-links {
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-links a {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    letter-spacing: 1px;
}

.nav-links a:hover {
    color: var(--brand-red);
}

.nav-btn {
    background: white;
    color: var(--brand-red);
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
}

/* --- UTILITIES --- */
.brand-link-enhanced {
    color: var(--brand-red) !important;
    font-weight: 600 !important;
    text-decoration: underline !important;
}


/* MOBILE MENU STYLES */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(227, 24, 55, 0.95));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    z-index: 999;
    transform: translateY(-100%);
    transition: 0.4s;
}

.mobile-menu.active {
    transform: translateY(0);
}

.mobile-menu a {
    font-family: 'Oswald', sans-serif;
    font-size: 2rem;
    color: white;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: 0.3s;
}

@media (max-width: 768px) {

    .nav-links,
    .nav-btn {
        display: none;
    }

    .hamburger {
        display: flex;
    }
}

/* Nine nav links + Find My Race need ~1370px; collapse to the hamburger
   before they overflow. #navbar outranks per-page .nav-links rules. The logo
   is scaled 2.5x visually, so reserve room for it beside the links. */
#navbar .logo {
    margin-right: 70px;
}

@media (max-width: 1500px) {
    #navbar .nav-links {
        gap: 18px;
    }
}

@media (max-width: 1366px) {
    #navbar .nav-links,
    #navbar .nav-btn {
        display: none;
    }

    #navbar .hamburger {
        display: flex;
    }
}

/* Closed menu is fully hidden (on short screens its links used to peek out
   below the top edge); tall menus scroll instead of spilling off-screen. */
#mobileMenu.mobile-menu {
    overflow-y: auto;
    justify-content: safe center;
}

.mobile-menu:not(.active) {
    visibility: hidden;
    transition: transform 0.4s, visibility 0s linear 0.4s;
}

.mobile-menu.active {
    visibility: visible;
    transition: transform 0.4s, visibility 0s;
}

/* --- FOOTER --- */
footer {
    background: #111;
    color: #888;
    padding: 50px 5%;
    text-align: center;
}

.footer-brand {
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 10px;
}

.footer-brand span {
    color: var(--brand-red);
}

.footer-tagline {
    margin-bottom: 25px;
    font-style: italic;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.footer-links a:hover {
    color: var(--brand-red);
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    border: 1px solid #444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: 0.3s;
}

.footer-social a:hover {
    background: var(--brand-red);
    border-color: var(--brand-red);
}

.footer-copy {
    font-size: 13px;
    opacity: 0.5;
}

/* --- RACE CARD PRICING --- */
.card-pricing {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 12px 0;
    padding: 10px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.price-now {
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-blue);
    line-height: 1;
}

.price-was {
    font-size: 1rem;
    color: #888;
    text-decoration: line-through;
    margin-left: 8px;
    font-weight: 400;
}

.save {
    background: #28a745;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Support for Dark Section Overrides */
section[style*="background: linear-gradient"] .card-pricing,
section[style*="background: var(--brand-blue)"] .card-pricing {
    border-color: rgba(255, 255, 255, 0.1);
}

section[style*="background: linear-gradient"] .price-now,
section[style*="background: var(--brand-blue)"] .price-now {
    color: white;
}

section[style*="background: var(--brand-blue)"] .price-was {
    color: rgba(255, 255, 255, 0.5);
}

/* --- UTILITIES & LAYOUT HELPER --- */
.mt-20 {
    margin-top: 20px !important;
}

.mt-30 {
    margin-top: 30px !important;
}

.mb-40 {
    margin-bottom: 40px !important;
}

.mb-60 {
    margin-bottom: 60px !important;
}

.text-center {
    text-align: center !important;
}

.brand-red-text {
    color: var(--brand-red) !important;
}

.opacity-50 {
    opacity: 0.5 !important;
}

.fs-11 {
    font-size: 11px !important;
}

.staff-portal-footer {
    margin-top: 20px;
    opacity: 0.5;
    font-size: 11px;
}

.staff-portal-link {
    color: grey;
    text-decoration: none;
}

/* Card & Testimonial common styles */
.brand-card-white {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 3px solid var(--brand-red);
}

.italic-text {
    font-style: italic;
}

.small-text {
    font-size: 0.95rem;
}

.mb-15 {
    margin-bottom: 15px !important;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.testimonial-author {
    font-size: 1.1rem;
    color: var(--brand-blue);
}

/* --- SPONSOR TICKER --- */
.sponsor-ticker {
    background: white;
    padding: 20px 0;
    overflow: hidden;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    position: relative;
    z-index: 5;
}

.sponsor-ticker-label {
    text-align: center;
    font-size: 15px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    margin-bottom: 15px;
}

.sponsor-track {
    display: flex;
    width: max-content;
    animation: sponsorScroll 45s linear infinite;
}

.sponsor-track img {
    height: 62.5px;
    margin: 0 30px;
    opacity: 1;
    vertical-align: middle;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.sponsor-track a {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.sponsor-track a:hover img {
    opacity: 0.75;
}

/* Specific overrides for smaller logos to improve legibility */
.sponsor-track img[alt="PeaceHealth"],
.sponsor-track img[alt="Foot Traffic"],
.sponsor-track img[alt="PepsiCo"] {
    height: 75px;
}

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

    100% {
        transform: translateX(-16.6667%);
    }
}


/* --- HERO COLLAGE --- */
.hero-collage {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    grid-auto-rows: 1fr;
    gap: 0;
    z-index: 0;
    overflow: hidden;
    background: #000;
    /* Ensure gaps show black instead of hero background */
}

.hero-collage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(80%) brightness(0.5) blur(5px);
    opacity: 0;
    transform: scale(0.9);
    background-color: #000;
    /* Fallback for image load gaps */
    backface-visibility: hidden;
    /* Improve antialiasing */
    outline: 1px solid transparent;
    /* Force hardware acceleration and smoother edges */
    transition:
        opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1),
        transform 1.2s cubic-bezier(0.4, 0, 0.2, 1),
        filter 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform, filter;
}

/* Revealed State */
.hero-collage img.revealed {
    opacity: 0.4;
    transform: scale(1.01);
    /* More aggressive overlap to eliminate sub-pixel gaps */
    filter: grayscale(60%) brightness(1) blur(0);
}

/* Shimmer only active AFTER reveal */
.hero-collage img.revealed.shimmering {
    animation-name: collage-shimmer;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

/* Organic Shimmer Variance (Only targets shimmering class) */
.hero-collage img.shimmering:nth-child(3n) {
    animation-duration: 13s;
    animation-delay: -2s;
}

.hero-collage img.shimmering:nth-child(5n) {
    animation-duration: 17s;
    animation-delay: -5s;
}

.hero-collage img.shimmering:nth-child(7n) {
    animation-duration: 19s;
    animation-delay: -3s;
}

.hero-collage img.shimmering:nth-child(11n) {
    animation-duration: 23s;
    animation-delay: -7s;
}

@keyframes collage-shimmer {

    0%,
    100% {
        transform: scale(1);
        filter: grayscale(60%) brightness(1);
    }

    50% {
        transform: scale(1.05);
        filter: grayscale(40%) brightness(1.15);
    }
}

.hero-collage img:hover {
    filter: grayscale(0%) brightness(1.3) !important;
    transform: scale(1.15) !important;
    z-index: 2;
    animation-play-state: paused;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.25) 100%);
    z-index: 1;
    pointer-events: none;
}

/* Hero text always paints above the photo and overlay (training.html had no
   rule, so its title rendered underneath the photo and was invisible). */
.hero .hero-content {
    position: relative;
    z-index: 2;
}

@media (max-width: 1200px) {
    .hero-collage {
        grid-template-columns: repeat(10, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-collage {
        grid-template-columns: repeat(8, 1fr);
    }
}

@media (max-width: 480px) {
    .hero-collage {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* --- ANIMATION UTILITIES --- */
.delay-50 {
    transition-delay: 0.05s !important;
}

.delay-100 {
    transition-delay: 0.1s !important;
}

.delay-150 {
    transition-delay: 0.15s !important;
}

.delay-200 {
    transition-delay: 0.2s !important;
}

.delay-250 {
    transition-delay: 0.25s !important;
}

.delay-300 {
    transition-delay: 0.3s !important;
}

.delay-350 {
    transition-delay: 0.35s !important;
}

.delay-400 {
    transition-delay: 0.4s !important;
}

.delay-450 {
    transition-delay: 0.45s !important;
}

/* --- SIGNUP SECTION --- */
.signup-section {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-bottom: 4px solid var(--brand-red);
}

.signup-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.signup-title {
    font-size: 2.2rem;
    margin-bottom: 10px;
    font-style: italic;
}

.signup-description {
    color: #64748b;
    margin-bottom: 30px;
}

#email-signup-form {
    text-align: left;
}

#email-signup-form .honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
}

.signup-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.signup-form-row>div {
    flex: 1;
}

.signup-input-group {
    margin-bottom: 20px;
}

.signup-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.signup-input:focus {
    border-color: var(--brand-red);
}

.signup-submit {
    width: 100%;
    padding: 16px;
    font-size: 16px;
}

.signup-success {
    padding: 24px;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #166534;
    border-radius: 8px;
    text-align: center;
}

.signup-success i {
    font-size: 24px;
    margin-bottom: 12px;
    display: block;
    color: #22c55e;
}

@media (max-width: 480px) {
    .signup-form-row {
        flex-direction: column;
        gap: 15px;
    }
}

/* --- GLOBAL NEWSLETTER FOOTER --- */
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 40px;
    text-align: left;
    padding-bottom: 40px;
}

footer {
    background: #0a0a0a;
    color: #888;
    padding: 80px 5% 40px;
}

.footer-brand-section .footer-brand {
    font-family: 'Oswald', sans-serif;
    font-size: 2rem;
    color: white;
    margin-bottom: 15px;
    text-align: left;
}

.footer-brand-section .footer-brand span {
    color: var(--brand-red);
}

.footer-brand-section .footer-tagline {
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.footer-links-section h4,
.footer-newsletter-section h4 {
    color: white;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    margin-bottom: 25px;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.footer-links-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.footer-links-grid a {
    font-size: 0.9rem;
    transition: 0.3s;
    color: #999;
}

.footer-links-grid a:hover {
    color: var(--brand-red);
}

/* Newsletter Spot */
.newsletter-spot {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 25px;
    border-radius: 12px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.newsletter-spot p {
    font-size: 0.85rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.newsletter-signup-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.newsletter-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 15px;
    border-radius: 6px;
    color: white;
    font-size: 0.9rem;
    transition: 0.3s;
}

.newsletter-input:focus {
    outline: none;
    border-color: var(--brand-red);
    background: rgba(255, 255, 255, 0.08);
}

.newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.newsletter-submit {
    width: 100%;
    margin-top: 5px;
    padding: 12px;
    font-size: 0.9rem;
    background: var(--brand-red);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    transition: 0.3s;
}

.newsletter-submit:hover {
    background: #b00e26;
    transform: translateY(-2px);
}

.newsletter-email-input {
    margin-bottom: 10px;
}

.newsletter-status-message {
    margin-top: 10px;
    font-size: 14px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-social-links {
    display: flex;
    gap: 15px;
}

.footer-social-links a {
    width: 36px;
    height: 36px;
    border: 1px solid #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: 0.3s;
    font-size: 0.9rem;
}

.footer-social-links a:hover {
    background: var(--brand-red);
    border-color: var(--brand-red);
}

.footer-copy {
    font-size: 0.8rem;
    color: #777;
}

.staff-portal-footer {
    font-size: 0.75rem;
}

.staff-portal-link {
    color: #777;
    transition: 0.3s;
    text-decoration: none;
}

.staff-portal-link:hover {
    color: var(--brand-red);
}

.honeypot {
    display: none;
}

/* Mobile Footer Refinement */
@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 50px;
        text-align: center;
    }

    .footer-brand-section .footer-brand {
        text-align: center;
    }

    .footer-links-grid {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* --- CHARITY LOGO SECTION (GLOBAL) --- */
.charity-section {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    color: white;
    text-align: center;
    padding: 100px 5%;
    position: relative;
    overflow: hidden;
}

.charity-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(227, 24, 55, 0.12) 0%, transparent 60%);
    pointer-events: none;
}

.charity-section h2 {
    font-size: 3rem;
    color: white;
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}

.charity-section p {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto 40px;
    opacity: 0.9;
}

.charity-logos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.charity-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px 15px;
    gap: 15px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    min-height: 150px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    text-align: center;
}

.charity-link:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--brand-red);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(227, 24, 55, 0.3);
}

.charity-logo-img {
    max-width: 85%;
    max-height: 70px;
    object-fit: contain;
    transition: all 0.4s ease;
}

.placeholder-logo {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--brand-red);
    font-size: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 5px;
}

.charity-icon {
    font-size: 40px;
    color: var(--brand-red);
    margin-bottom: 10px;
}

.charity-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.4;
    font-family: 'Inter', sans-serif;
}

/* luxury glassmorphism */
.charity-link:hover .charity-label {
    color: white;
    text-shadow: 0 0 10px rgba(227, 24, 55, 0.5);
}

.charity-cta {
    margin-top: 60px;
    position: relative;
    z-index: 1;
}

/* --- ANIMATION UTILITIES (GLOBAL) --- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-100 {
    transition-delay: 0.1s;
}

.delay-150 {
    transition-delay: 0.15s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-250 {
    transition-delay: 0.25s;
}

.delay-300 {
    transition-delay: 0.3s;
}

.delay-350 {
    transition-delay: 0.35s;
}

.delay-400 {
    transition-delay: 0.4s;
}

/* Tripadvisor Button Container */
.tripadvisor-btn-container {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}


/* === Shared utilities (extracted from per-page inline CSS) === */

.skip-to-content {
    position: absolute;
    left: -9999px;
    top: 0;
    background: #000;
    color: #fff;
    padding: 12px 20px;
    z-index: 10000;
    text-decoration: none;
    font-weight: 700;
}
.skip-to-content:focus {
    left: 0;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
