/* =========================================
   RACE DETAILS SPECIFIC STYLES (details.css)
   ========================================= */

/* --- 1. HERO SECTION --- */
.details-hero {
    background: linear-gradient(rgba(20, 39, 33, 0.8), rgba(20, 39, 33, 0.7)), 
                url('/images/gravel-road-runners.webp') no-repeat center center/cover;
    height: 50vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    background-attachment: fixed;
}

.details-hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--white);
    text-shadow: 0 4px 8px rgba(0,0,0,0.6);
}

.details-hero .hero-date {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-gold);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* --- 2. QUICK SPECS GRID --- */
.specs-section {
    padding: 60px 0;
    background: var(--white);
    border-bottom: 1px solid #eee;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: center;
}

.spec-item i {
    font-size: 2.5rem;
    color: var(--brand-dark);
    margin-bottom: 15px;
}

.spec-item h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 5px;
}

.spec-item p {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

/* --- 3. SCHEDULE & PRICING (Split Layout) --- */
.logistics-section {
    padding: 80px 0;
    background-color: #f8f9fa;
}

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

/* Schedule List */
.schedule-list {
    list-style: none;
    padding: 0;
}

.schedule-list li {
    display: flex;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid #ddd;
}

.schedule-list .time {
    font-weight: 800;
    color: var(--brand-dark);
    width: 30%;
}

.schedule-list .event {
    width: 70%;
    color: #555;
}

/* Pricing Card */
.pricing-card {
    background: var(--white);
    padding: 40px;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border-top: 5px solid var(--brand-gold);
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.price-row h3 { font-size: 1.5rem; margin: 0; }
.price-row .price { font-size: 1.8rem; font-weight: 800; color: var(--brand-dark); }

.included-list {
    margin: 30px 0;
    list-style: none;
    padding: 0;
}

.included-list li {
    margin-bottom: 10px;
    color: #666;
}

.included-list li i {
    color: var(--brand-green); /* Success green */
    margin-right: 10px;
}

/* --- 4. ROUTE TABLE --- */
.route-section {
    padding: 80px 0;
    background: var(--white);
}

.route-table-container {
    overflow-x: auto; /* Scroll on mobile */
    margin-top: 40px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.route-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.route-table th, .route-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.route-table th {
    background-color: var(--brand-dark);
    color: var(--white);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.route-table tr:hover {
    background-color: #f9f9f9;
}

.route-table .leg-col { font-weight: 800; color: var(--brand-dark); }
.route-table .dist-col { font-weight: 700; color: #555; }

/* --- 5. FINISH LINE PARTY --- */
.finish-section {
    padding: 80px 0;
    background: linear-gradient(rgba(20, 39, 33, 0.9), rgba(20, 39, 33, 0.8)), 
                url('/images/frisbee-game.webp');
    background-size: cover;
    color: var(--white);
    text-align: center;
}

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

.finish-item {
    background: rgba(255,255,255,0.1);
    padding: 30px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.2);
}

.finish-item h4 {
    color: var(--brand-gold);
    font-size: 1.4rem;
    margin-bottom: 15px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .specs-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
    .logistics-grid { grid-template-columns: 1fr; }
    .finish-grid { grid-template-columns: 1fr; }
    .details-hero h1 { font-size: 2.5rem; }
}
/* --- UPDATED: PRICING CARD IMAGE --- */
.pricing-card-header {
    height: 150px;
    /* Image of medals/swag */
    background: url('/images/gravel-road-runners.webp') no-repeat center center/cover;
    border-radius: 4px 4px 0 0;
    position: relative;
}
/* Overlay for text readability */
.pricing-card-header::after {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(20, 39, 33, 0.5);
    border-radius: 4px 4px 0 0;
}
.pricing-card-header h2 {
    position: relative;
    z-index: 2;
    color: var(--white);
    padding: 40px;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* --- UPDATED: FINISH SECTION GALLERY --- */
.finish-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 50px;
}

.finish-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    color: var(--text-main); /* Reset text color for white card */
    text-align: left;
}

.finish-card-img {
    height: 200px;
    width: 100%;
    object-fit: cover;
}

.finish-card-content {
    padding: 25px;
}

.finish-card h4 {
    color: var(--brand-dark);
    font-size: 1.4rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.finish-card p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* Mobile fix */
@media (max-width: 768px) {
    .finish-grid { grid-template-columns: 1fr; }
}

.finish-card-visual {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand-light), #dfe9e5);
    border-bottom: 5px solid var(--brand-gold);
}

.finish-card-visual i {
    color: var(--brand-dark);
    font-size: 4.5rem;
}

/* =========================================
   TEAM RELAY + SOLO MARATHON CLARITY
   ========================================= */
.details-hero-copy {
    max-width: 760px;
    margin: 0 auto;
    color: rgba(255,255,255,0.94);
    font-size: 1.2rem;
    line-height: 1.7;
    text-shadow: 0 2px 4px rgba(0,0,0,0.45);
}

.compact-section-header {
    margin-bottom: 42px;
}

.specs-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.spec-item {
    background: var(--brand-light);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--brand-gold);
    border-radius: 8px;
    padding: 28px 18px;
}

.spec-item p {
    margin: 0;
}

.race-format-section {
    padding: 90px 0;
    background: var(--brand-light);
}

.race-format-section .section-header p,
.race-faq-section .section-header p {
    color: var(--text-muted);
}

.format-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
    max-width: 1050px;
    margin: 0 auto 38px;
}

.format-card {
    position: relative;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 38px;
    box-shadow: 0 12px 30px rgba(20,39,33,0.08);
}

.format-card-featured {
    border-top: 6px solid var(--brand-gold);
}

.format-icon {
    width: 62px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--brand-dark);
    color: var(--white);
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.format-card-featured .format-icon {
    background: var(--brand-gold);
    color: var(--brand-dark);
}

.format-label {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.format-card h3 {
    margin-bottom: 15px;
    font-size: 1.65rem;
}

.format-card > p {
    color: #53615b;
    line-height: 1.75;
}

.format-card ul {
    margin-top: 24px;
    display: grid;
    gap: 12px;
}

.format-card li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #46534e;
}

.format-card li i {
    margin-top: 5px;
    color: #9b7816;
}

.support-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    max-width: 1100px;
    margin: 0 auto;
}

.support-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: var(--brand-dark);
    color: var(--white);
    border-radius: 8px;
    padding: 24px;
}

.support-card > i {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--brand-gold);
    color: var(--brand-dark);
    font-size: 1.05rem;
}

.support-card h3 {
    margin: 0 0 6px;
    color: var(--white);
    font-size: 1rem;
}

.support-card p {
    margin: 0;
    color: rgba(255,255,255,0.78);
    font-size: 0.9rem;
    line-height: 1.55;
}

.exchange-challenge-callout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    align-items: center;
    max-width: 900px;
    margin: 38px auto 20px;
    padding: 30px;
    background: #fff9e8;
    border: 1px solid #ead99d;
    border-left: 6px solid var(--brand-gold);
    border-radius: 8px;
}

.exchange-challenge-icon {
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--brand-gold);
    color: var(--brand-dark);
    font-size: 1.7rem;
}

.exchange-challenge-callout h3 {
    margin: 4px 0 8px;
}

.exchange-challenge-callout p {
    margin: 0;
    color: #53615b;
}

.route-support-note {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 18px;
    background: var(--brand-light);
    border-radius: 6px;
    color: #52605a;
    text-align: center;
}

.route-support-note i {
    margin-right: 8px;
    color: var(--brand-dark);
}

.race-faq-section {
    padding: 90px 0;
    background: #f7f9f8;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    max-width: 1000px;
    margin: 0 auto;
}

.faq-item {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 24px;
    box-shadow: 0 8px 20px rgba(20,39,33,0.05);
}

.faq-item summary {
    position: relative;
    padding: 24px 34px 24px 0;
    cursor: pointer;
    color: var(--brand-dark);
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    line-height: 1.4;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 20px;
    font-size: 1.5rem;
    color: #9b7816;
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item p {
    padding: 0 0 24px;
    margin: 0;
    color: #56635e;
    line-height: 1.7;
}

@media (max-width: 900px) {
    .specs-grid,
    .support-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 640px) {
    .details-hero {
        min-height: 360px;
        height: auto;
        padding: 80px 0;
        background-attachment: scroll;
    }

    .details-hero h1 {
        font-size: 2.25rem;
    }

    .details-hero .hero-date {
        font-size: 1rem;
    }

    .details-hero-copy {
        font-size: 1rem;
    }

    .specs-grid,
    .support-grid,
    .faq-grid {
        grid-template-columns: 1fr;
    }

    .spec-item {
        padding: 22px 16px;
    }

    .race-format-section,
    .race-faq-section {
        padding: 65px 0;
    }

    .format-card {
        padding: 28px 22px;
    }

    .support-card {
        padding: 20px;
    }

    .exchange-challenge-callout {
        grid-template-columns: 1fr;
        padding: 24px 20px;
        text-align: left;
    }

    .exchange-challenge-icon {
        width: 54px;
        height: 54px;
        font-size: 1.35rem;
    }

    .route-support-note {
        text-align: left;
    }

    .schedule-list li {
        gap: 15px;
    }

    .schedule-list .time {
        width: 28%;
        min-width: 76px;
    }

    .schedule-list .event {
        width: 72%;
    }
}
