/**
 * Public track pages (/tracks/{slug}/). Enqueued only on is_singular('track_record')
 * by inc/track-pages.php. Uses the site tokens from src/styles.css.
 */

.track-page {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Hero ------------------------------------------------------------------- */
.tp-hero {
    position: relative;
    overflow: hidden;
    padding: var(--space-3xl) 0 var(--space-2xl);
    background: linear-gradient(135deg, var(--raw-navy) 0%, #0a1628 100%);
    border-bottom: 3px solid var(--raw-orange);
}

.tp-hero__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.35;
}

.tp-hero--photo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(4, 30, 66, 0.55) 0%, rgba(4, 30, 66, 0.92) 100%);
}

.tp-hero__inner {
    position: relative;
    z-index: 1;
}

.tp-eyebrow {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--raw-orange);
    margin: 0 0 var(--space-sm);
}

.tp-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5.5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.05;
    text-transform: uppercase;
    margin: 0 0 var(--space-md);
}

.tp-hero__intro {
    max-width: 44rem;
    font-size: var(--text-lg);
    color: var(--text-muted);
    margin: 0 0 var(--space-lg);
}

.tp-hero__stat {
    display: inline-flex;
    flex-direction: column;
    padding: var(--space-md) var(--space-lg);
    border-left: 4px solid var(--raw-orange);
    background: rgba(4, 30, 66, 0.7);
}

.tp-hero__time {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 7vw, 4rem);
    font-weight: 700;
    line-height: 1;
    color: var(--raw-cyan);
}

.tp-hero__label {
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* Sections --------------------------------------------------------------- */
.tp-section {
    padding: var(--space-2xl) 0;
}

.tp-section:nth-of-type(even) {
    background: var(--bg-tertiary);
}

.tp-section h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 700;
    text-transform: uppercase;
    margin: 0 0 var(--space-lg);
}

/* Map + record ----------------------------------------------------------- */
.tp-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    align-items: stretch;
}

@media (min-width: 800px) {
    .tp-split:not(.tp-split--single) {
        grid-template-columns: 3fr 2fr;
    }
}

.tp-map {
    margin: 0;
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid rgba(71, 199, 252, 0.25);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.tp-map img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: contain;
}

.tp-map figcaption,
.tp-source {
    font-size: var(--text-xs);
    color: var(--text-dim);
}

.tp-map figcaption a,
.tp-source a {
    color: var(--raw-cyan);
    text-decoration: underline;
}

.tr-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: var(--space-lg);
}

.tp-record {
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top: 4px solid var(--raw-orange);
}

.tr-card__label {
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.tr-card__time {
    font-family: var(--font-display);
    font-size: clamp(2.75rem, 8vw, 4.5rem);
    font-weight: 700;
    line-height: 1.05;
    color: var(--raw-cyan);
}

.tr-card__track {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    text-transform: uppercase;
    color: var(--raw-orange);
}

.tr-card__driver {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-top: var(--space-sm);
}

.tr-card__driver a {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--raw-orange);
}

.tr-card__date,
.tr-card__series {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.tr-card--empty {
    color: var(--text-dim);
}

/* Facts ------------------------------------------------------------------ */
.tp-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-md);
    margin: 0 0 var(--space-md);
}

.tp-fact {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: var(--space-md);
}

.tp-fact dt {
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin: 0 0 var(--space-xs);
}

.tp-fact dd {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--raw-cyan);
    margin: 0;
}

/* Video + gallery -------------------------------------------------------- */
.tp-video {
    position: relative;
    aspect-ratio: 16 / 9;
    max-width: 960px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.tp-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.tp-gallery {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

@media (min-width: 600px) {
    .tp-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .tp-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

.tp-gallery li {
    margin: 0;
    aspect-ratio: 3 / 2;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-card);
}

.tp-gallery img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Weekends + CTA --------------------------------------------------------- */
.tp-weekends {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    list-style: none;
    margin: 0;
    padding: 0;
}

.tp-weekends li {
    background: var(--bg-card);
    border: 1px solid rgba(71, 199, 252, 0.25);
    border-radius: 999px;
    padding: var(--space-xs) var(--space-md);
    font-size: var(--text-sm);
}

.tp-cta {
    text-align: center;
}

.tp-cta .btn {
    margin: var(--space-xs);
}

@media (max-width: 600px) {
    .tp-hero {
        padding: var(--space-2xl) 0 var(--space-xl);
    }

    .tp-section {
        padding: var(--space-xl) 0;
    }
}
