/*
Theme Name: 702 Racing
Theme URI:
Author: 702 Racing
Description: Custom theme for 702 Racing — classic and professional layout with custom logo, background, and navigation.
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: seven02-racing
*/

/* ===========================
   CUSTOM FONTS
=========================== */
@font-face {
    font-family: 'Racing Sans One';
    src: url('fonts/RacingSansOne-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ===========================
   RESET & BASE
=========================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #dddddd;
    background-color: #2c2c2c !important;
    background-image: none !important;
    line-height: 1.7;
}

a {
    color: #6bb3d6;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===========================
   SITE WRAPPER
=========================== */
#page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#content {
    flex: 1;
}

/* ===========================
   HEADER
=========================== */
#masthead {
    background-color: #1a1a1a;
    border-bottom: 4px solid #d4789a;
}

.site-branding {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 40px;
}

.site-logo {
    max-height: 120px;
    width: auto;
    display: block;
}

.site-title-text {
    font-family: 'Racing Sans One', 'Arial Black', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.site-title-text a {
    color: #ffffff;
    text-decoration: none;
}

.site-title-text a:hover {
    color: #b00000;
    text-decoration: none;
}

.site-description {
    font-size: 0.85rem;
    color: #aaaaaa;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 2px;
}

/* ===========================
   PRIMARY NAVIGATION
=========================== */
#site-navigation {
    background-color: #2a2a2a;
    position: relative;
}

/* Hamburger button — hidden on desktop */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 14px 20px;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.hamburger-bar {
    display: block;
    width: 26px;
    height: 3px;
    background-color: #dddddd;
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}

/* Animate to X when open */
.menu-toggle.is-active .hamburger-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.menu-toggle.is-active .hamburger-bar:nth-child(2) {
    opacity: 0;
}
.menu-toggle.is-active .hamburger-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

#site-navigation .nav-menu {
    list-style: none;
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
}

#site-navigation .nav-menu li {
    position: relative;
}

#site-navigation .nav-menu li a {
    display: block;
    padding: 16px 22px;
    color: #dddddd;
    font-family: 'Racing Sans One', 'Arial', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
    border-bottom: 3px solid transparent;
}

#site-navigation .nav-menu li a:hover,
#site-navigation .nav-menu li.current-menu-item > a,
#site-navigation .nav-menu li.current-page-ancestor > a {
    color: #ffffff;
    background-color: #1a1a1a;
    border-bottom-color: #6bb3d6;
    text-decoration: none;
}

/* Dropdown sub-menus */
#site-navigation .nav-menu ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #1a1a1a;
    min-width: 200px;
    z-index: 999;
    border-top: 3px solid #6bb3d6;
    list-style: none;
    padding: 0;
}

#site-navigation .nav-menu li:hover > ul {
    display: block;
}

#site-navigation .nav-menu ul li a {
    padding: 12px 20px;
    border-bottom: 1px solid #333;
    border-left: none;
}

/* ===========================
   MAIN CONTENT AREA
=========================== */
.site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 40px;
    background-color: transparent;
}

/* ===========================
   PAGE / POST
=========================== */
.entry-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #444;
}

.entry-title {
    font-family: 'Racing Sans One', 'Arial Black', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.entry-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #dddddd;
}

.entry-content p {
    margin-bottom: 1.4em;
}

.entry-content h2,
.entry-content h3 {
    font-family: 'Racing Sans One', 'Arial Black', sans-serif;
    margin-top: 1.6em;
    margin-bottom: 0.6em;
    color: #ffffff;
}

/* ===========================
   FOOTER
=========================== */
#colophon {
    background-color: #1a1a1a;
    border-top: 4px solid #d4789a;
    color: #aaaaaa;
    text-align: center;
    padding: 24px 40px;
    font-family: 'Arial', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

#colophon a {
    color: #cccccc;
}

#colophon a:hover {
    color: #ffffff;
}

/* ===========================
   LIVE STREAMS
=========================== */
.streams-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 24px;
}

.stream-block {
    background-color: #2c2c2c;
    border: none;
    border-radius: 4px;
    overflow: hidden;
}

.stream-label {
    font-family: 'Racing Sans One', 'Arial Black', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6bb3d6;
    background-color: #2c2c2c;
    padding: 10px 16px;
    margin: 0;
    border-bottom: 1px solid #444;
}

.stream-block .video-js {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    display: block;
}

.stream-source-note {
    margin-top: 16px;
    font-size: 0.82rem;
    color: #888;
    text-align: right;
}

@media (max-width: 768px) {
    .streams-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================
   SCHEDULES / RESULTS
=========================== */
.schedule-page {
    padding: 20px 0;
}

.schedule-season-title {
    font-family: 'Racing Sans One', 'Arial Black', sans-serif;
    font-size: 1.6rem;
    font-weight: 900;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: center;
    margin-bottom: 28px;
}

.schedule-table-wrap {
    overflow-x: auto;
    border: 2px solid #d4789a;
    border-radius: 4px;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Arial', sans-serif;
    font-size: 0.95rem;
}

.schedule-table thead tr {
    background-color: #6bb3d6;
    color: #000000;
}

.schedule-table th {
    padding: 14px 18px;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.82rem;
    font-weight: 800;
    color: #000000;
    border-right: 1px solid rgba(0,0,0,0.2);
}

.schedule-table th:last-child {
    border-right: none;
}

.schedule-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #d4789a;
    border-right: 1px solid #333;
    color: #dddddd;
}

.schedule-table td:last-child {
    border-right: none;
}

.schedule-table tbody tr:last-child td {
    border-bottom: none;
}

.schedule-table tbody tr {
    background-color: #1e1e1e;
    border-left: 4px solid #d4789a;
}

.schedule-table tbody tr:nth-child(even) {
    background-color: #252525;
}

.schedule-table tbody tr:hover {
    background-color: rgba(107,179,214,0.12);
}

/* Column specific colours */
.race-name {
    font-weight: 700;
    color: #ffffff;
}

.race-date {
    color: #d4789a;
    font-weight: 600;
}

.race-vehicle {
    color: #6bb3d6;
}

.race-org {
    color: #aaaaaa;
    font-size: 0.88rem;
    letter-spacing: 0.05em;
}

.race-tbd {
    color: #555555;
}

.result-first {
    color: #f5c542 !important;
    font-weight: 700;
}

.result-dnf {
    color: #f5c542 !important;
}

.schedule-footer {
    margin-top: 18px;
    text-align: center;
    color: #777777;
    font-family: 'Arial', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
}

.schedule-empty {
    color: #999;
    font-style: italic;
    text-align: center;
}

/* ===========================
   PREVIOUS RACES
=========================== */
.races-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

@media (max-width: 768px) {
    .races-grid {
        grid-template-columns: 1fr;
    }
}

.race-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-top: 3px solid #d4789a;
    border-radius: 4px;
    overflow: hidden;
}

.race-title {
    font-family: 'Racing Sans One', 'Arial Black', sans-serif;
    font-size: 0.95rem;
    color: #ffffff;
    background-color: #1a1a1a;
    padding: 12px 16px;
    margin: 0;
    border-bottom: 2px solid #d4789a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.race-video {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.race-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.races-empty {
    color: #999;
    font-style: italic;
    grid-column: 1 / -1;
}

/* ===========================
   WORDPRESS OVERRIDES
   Kill any white/light backgrounds injected by WordPress
=========================== */
#page,
#content,
#primary,
#secondary,
.site,
.site-content,
.hentry,
.entry,
.wp-block-post,
.wp-block-post-content,
.wp-site-blocks,
.is-layout-flow,
.wp-block-group,
.wp-block-group__inner-container,
.wp-block-template-part,
.editor-styles-wrapper,
body.page,
body.home,
body.front-page,
.page-template-default,
.page-template-template-live-streams,
.page-template-template-schedules,
.page-template-template-previous-races {
    background-color: transparent !important;
    background-image: none !important;
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 768px) {
    .site-branding {
        padding: 16px 20px;
        justify-content: center;
    }

    .site-logo {
        max-height: 80px;
    }

    /* Show hamburger, hide nav by default on mobile */
    .menu-toggle {
        display: flex;
    }

    #site-navigation .nav-menu {
        display: none;
        flex-direction: column;
        padding: 0;
        border-top: 2px solid #d4789a;
    }

    /* Show nav when toggled open */
    #site-navigation .nav-menu.nav-open {
        display: flex;
    }

    #site-navigation .nav-menu li {
        width: 100%;
        border-bottom: 1px solid #333;
    }

    #site-navigation .nav-menu li a {
        padding: 16px 24px;
        font-size: 1rem;
        text-align: center;
        border-bottom: none;
    }

    #site-navigation .nav-menu li a:hover,
    #site-navigation .nav-menu li.current-menu-item > a {
        background-color: #1a1a1a;
        border-bottom-color: transparent;
        border-left: 4px solid #6bb3d6;
    }

    .site-main {
        padding: 30px 20px;
    }
}
