/* ============================================ */
/* HISTORICRACING.COM - UNIVERSAL STYLESHEET
/* ============================================ */

/* ---------- IMPORTS ---------- */
@import url('https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Montserrat:wght@300;400;800;900&display=swap');

/* ---------- RESET / BASE ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    line-height: 1.4;
}

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3, .font-display {
    font-family: 'Abril Fatface', serif;
    font-weight: normal;
	color: #FFF;
}

/* ---------- HEADER & NAVIGATION ---------- */

/* Logo Styles */
.site-logo {
    font-family: 'Montserrat', 'Helvetica Neue', sans-serif;
    text-transform: lowercase;
    text-decoration: none;
    display: inline-block;
}

.site-logo .historic {
    font-weight: 300;
    font-size: 1.8rem;
    color: #1a2a2a;
    letter-spacing: -0.5px;
}

.site-logo .racing {
    font-weight: 800;
    font-size: 1.8rem;
    color: #008282;
    letter-spacing: -0.5px;
}

.site-logo .com {
    font-weight: 300;
    font-size: 1rem;
    color: #999;
    margin-left: 3px;
}

/* Header - Base styles */
.site-header {
    text-align: center;
    padding: 2rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.site-tagline {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Navigation Bar - Base */
.nav-container {
    border-bottom: 1px solid rgba(255,255,255,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 70px;
}

/* Desktop Navigation */
.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links li a {
    text-decoration: none;
    font-family: 'Abril Fatface', serif;
    font-size: 1.1rem;
    transition: color 0.2s ease;
    padding: 0.5rem 0;
    display: inline-block;
}

.nav-links li a.active {
    border-bottom: 2px solid;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* ---------- PAGE BACKGROUND & HEADER COLORS (body classes) ---------- */

/* HOMEPAGE */
body.home { background: #f5f3ef; }
body.home .site-header,
body.home .nav-container,
body.home .nav-bar { background: #f5f3ef !important; }
body.home .site-header { border-bottom-color: #e2dfd9 !important; }
body.home .site-tagline { color: #666 !important; }
body.home .nav-links li a { color: #1a2a2a !important; }
body.home .nav-links li a:hover { color: #008282 !important; }
body.home .nav-links li a.active { color: #008282 !important; border-bottom-color: #ff9900 !important; }
body.home .menu-toggle span { background: #1a2a2a !important; }

/* DRIVERS - Teal */
body.dr { background: #008282; }
body.dr .site-header,
body.dr .nav-container,
body.dr .nav-bar { background: #008282 !important; }
body.dr .site-header { border-bottom-color: rgba(255,255,255,0.2) !important; }
body.dr .site-tagline { color: rgba(255,255,255,0.85) !important; }
body.dr .nav-links li a { color: #ffffff !important; }
body.dr .nav-links li a:hover { color: #ff9900 !important; }
body.dr .nav-links li a.active { color: #ff9900 !important; border-bottom-color: #ff9900 !important; }
body.dr .menu-toggle span { background: #ffffff !important; }

/* ARTICLES - Gold */
body.ar { background: #ff9900; }
body.ar .site-header,
body.ar .nav-container,
body.ar .nav-bar { background: #ff9900 !important; }
body.ar .site-header { border-bottom-color: rgba(255,255,255,0.2) !important; }
body.ar .site-tagline { color: rgba(255,255,255,0.85) !important; }
body.ar .nav-links li a { color: #ffffff !important; }
body.ar .nav-links li a:hover { color: #1a2a2a !important; }
body.ar .nav-links li a.active { color: #1a2a2a !important; border-bottom-color: #1a2a2a !important; }
body.ar .menu-toggle span { background: #ffffff !important; }

/* VEHICLES - Warm Gray */
body.ve { background: #c7c1b6; }
body.ve .site-header,
body.ve .nav-container,
body.ve .nav-bar { background: #c7c1b6 !important; }
body.ve .site-header { border-bottom-color: rgba(0,0,0,0.1) !important; }
body.ve .site-tagline { color: rgba(0,0,0,0.6) !important; }
body.ve .nav-links li a { color: #1a2a2a !important; }
body.ve .nav-links li a:hover { color: #008282 !important; }
body.ve .nav-links li a.active { color: #008282 !important; border-bottom-color: #008282 !important; }
body.ve .menu-toggle span { background: #1a2a2a !important; }

/* GALLERIES - Muted Teal */
body.ga { background: #84a3ab; }
body.ga .site-header,
body.ga .nav-container,
body.ga .nav-bar { background: #84a3ab !important; }
body.ga .site-header { border-bottom-color: rgba(255,255,255,0.2) !important; }
body.ga .site-tagline { color: rgba(255,255,255,0.85) !important; }
body.ga .nav-links li a { color: #ffffff !important; }
body.ga .nav-links li a:hover { color: #ff9900 !important; }
body.ga .nav-links li a.active { color: #ff9900 !important; border-bottom-color: #ff9900 !important; }
body.ga .menu-toggle span { background: #ffffff !important; }

/* RACES - Stone */
body.ra { background: #a39d94; }
body.ra .site-header,
body.ra .nav-container,
body.ra .nav-bar { background: #a39d94 !important; }
body.ra .site-header { border-bottom-color: rgba(255,255,255,0.2) !important; }
body.ra .site-tagline { color: rgba(255,255,255,0.85) !important; }
body.ra .nav-links li a { color: #ffffff !important; }
body.ra .nav-links li a:hover { color: #ff9900 !important; }
body.ra .nav-links li a.active { color: #ff9900 !important; border-bottom-color: #ff9900 !important; }
body.ra .menu-toggle span { background: #ffffff !important; }

/* SHOP - Darker Stone */
body.sh { background: #8f8980; }
body.sh .site-header,
body.sh .nav-container,
body.sh .nav-bar { background: #8f8980 !important; }
body.sh .site-header { border-bottom-color: rgba(255,255,255,0.2) !important; }
body.sh .site-tagline { color: rgba(255,255,255,0.85) !important; }
body.sh .nav-links li a { color: #ffffff !important; }
body.sh .nav-links li a:hover { color: #ff9900 !important; }
body.sh .nav-links li a.active { color: #ff9900 !important; border-bottom-color: #ff9900 !important; }
body.sh .menu-toggle span { background: #ffffff !important; }

/* ---------- HOMEPAGE GRID ---------- */
.homeGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    max-width: 1200px;
    margin: 2rem auto;
}

.homeBox {
    aspect-ratio: 1 / 1;
    display: flex;
    text-decoration: none;
    color: #111;
    overflow: hidden;
    position: relative;
    border-radius: 0;
    transition: box-shadow 0.2s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

a.homeBox:hover {
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.homeInner {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    width: 100%;
    position: relative;
    z-index: 2;
    background: linear-gradient(0deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0) 60%);
}

.homeInitial {
    font-family: 'Abril Fatface', serif;
    font-size: 10rem;
    transform: rotate(-90deg);
    opacity: 0.5;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    line-height: 1;
}

.homeTitle {
    font-family: 'Abril Fatface', serif;
    font-size: 4rem;
    z-index: 2;
    margin-bottom: 40px;
}

.img-tile {
    background-size: cover;
    background-position: center;
}

/* ---------- DRIVER TILE STYLES ---------- */
.homeInner-driver {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto 1fr;
    gap: 0.5rem;
    height: 100%;
    width: 100%;
    position: relative;
    z-index: 2;
}

.homeInitial-driver {
    font-family: 'Abril Fatface', serif;
    font-size: 7rem;
    transform: rotate(-90deg);
    opacity: 0.4;
    line-height: 1;
    text-transform: lowercase;
    white-space: nowrap;
    justify-self: start;
    align-self: start;
    margin-top: 20px;
    margin-left: -10px;
    grid-row: 1;
    grid-column: 1;
}

.driver-thumbnail {
    width: 200px;
    height: 200px;
    object-fit: cover;
    z-index: 3;
    border: 2px solid rgba(255,255,255,0.3);
    background: #f5f3ef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    justify-self: end;
    align-self: start;
    grid-row: 1;
    grid-column: 2;
}

.homeContent {
    grid-row: 2;
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-align: left;
    margin-top: auto;
}

.homeTitle-driver {
    font-family: 'Abril Fatface', serif;
    font-size: 1.8rem;
    z-index: 2;
    letter-spacing: -0.02em;
    line-height: 1.2;
    word-break: break-word;
    width: 100%;
    text-align: left;
}

.driver-years {
    font-family: inherit;
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

.driver-nationality {
    font-family: inherit;
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 0.2rem;
}

.homeBox:hover .driver-thumbnail {
    width: 210px;
    height: 210px;
    transition: all 0.2s ease;
}

/* ---------- COLOUR PALETTE (Tile backgrounds) ---------- */
.dr { background: #008282; }
.ar { background: #ff9900; }
.ve { background: #c7c1b6; }
.ga { background: #84a3ab; }
.ra { background: #a39d94; }
.ob { background: #8f8980; }
.sh { background: #8f8980; }

.dr .homeTitle, .ar .homeTitle, .ve .homeTitle,
.ga .homeTitle, .ra .homeTitle, .ob .homeTitle,
.sh .homeTitle {
    color: #111;
}

/* Alternate box colors for drivers page */
.homeGrid .homeBox.dr:nth-child(even) {
    background: #006565;
}

.homeGrid .homeBox.dr:nth-child(odd) {
    background: #008282;
}

/* ---------- FOOTER ---------- */
.site-footer {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.8rem;
    color: #6c6b68;
    border-top: 1px solid #e2dfd9;
    margin-top: 1rem;
}

/* ---------- RESPONSIVE STYLES ---------- */

/* Tablet */
@media (max-width: 1024px) {
    .homeGrid {
        grid-template-columns: repeat(2, 1fr);
        margin: 1rem;
    }
    
    .homeTitle {
        font-size: 2.5rem;
    }
    
    .homeInitial {
        font-size: 7rem;
        top: 20px;
    }
    
    .homeInitial-driver {
        font-size: 6rem;
        margin-top: 15px;
    }
    
    .driver-thumbnail {
        width: 150px;
        height: 150px;
    }
    
    .homeBox:hover .driver-thumbnail {
        width: 160px;
        height: 160px;
    }
    
    .homeTitle-driver {
        font-size: 1.5rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 70px;
        left: 0;
        background: inherit;
        padding: 1rem 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        gap: 0;
        border-top: 1px solid rgba(255,255,255,0.2);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links li {
        width: 100%;
        text-align: center;
    }
    
    .nav-links li a {
        padding: 1rem;
        display: block;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .homeGrid {
        grid-template-columns: 1fr;
        margin: 0.5rem;
    }
    
    .homeTitle {
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }
    
    .homeInner {
        padding: 1.2rem;
    }
    
    .site-logo .historic,
    .site-logo .racing {
        font-size: 1.4rem;
    }
    
    .site-logo .com {
        font-size: 0.8rem;
    }
    
    .nav-bar {
        min-height: 60px;
    }
    
    .homeInitial {
        font-size: 6rem;
        top: 20px;
        left: -0.5rem;
    }
    
    .homeInitial-driver {
        font-size: 5rem;
        margin-top: 10px;
    }
    
    .driver-thumbnail {
        width: 100px;
        height: 100px;
    }
    
    .homeBox:hover .driver-thumbnail {
        width: 110px;
        height: 110px;
    }
    
    .homeTitle-driver {
        font-size: 1.2rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .driver-thumbnail {
        width: 80px;
        height: 80px;
    }
    
    .homeTitle-driver {
        font-size: 1rem;
    }
    
    .homeInitial-driver {
        font-size: 4rem;
    }
}

/* ---------- UTILITY CLASSES ---------- */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ---------- ACCESSIBILITY ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid #008282;
    outline-offset: 2px;
}

.homeBox:focus-visible {
    outline: 3px solid #008282;
    outline-offset: -2px;
}