/*
Theme Name:  GERCC Racing
Theme URI:   https://gercc.co.uk
Description: Official theme for the Gloucester Electric Racing Car Club race management system.
Version:     1.0.0
Author:      GERCC
Text Domain: gercc
*/

/* ── Google Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Open+Sans:wght@400;600&display=swap');

/* ── CSS Variables ────────────────────────────────────────────────────────── */
:root {
  --red:        #CC0000;
  --red-dark:   #990000;
  --dark:       #1A1A1A;
  --mid:        #2A2A2A;
  --header-bg: #111111;
  --light:      #F5F5F5;
  --white:      #FFFFFF;
  --text:       #222222;
  --muted:      #666666;
  --border:     #E0E0E0;
  --card-bg:    #FFFFFF;
  --shadow:     0 2px 8px rgba(0,0,0,0.10);
  --radius:     4px;
  --font-head:  'Oswald', 'Impact', 'Arial Narrow', sans-serif;
  --font-body:  'Open Sans', -apple-system, 'Helvetica Neue', sans-serif;
}

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--light);
  line-height: 1.65;
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); text-decoration: underline; }

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

/* ── Layout ──────────────────────────────────────────────────────────────── */
.gercc-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--header-bg);
}

.site-header__top {
  background: #FFFFFF;
  padding: 12px 0;
  border-bottom: 4px solid var(--red);
}

.site-header__top .gercc-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.site-logo img {
  height: 70px;
  width: auto;
}

.site-logo__text {
  display: none; /* logo image carries the brand */
}

.site-header__tagline {
  font-family: var(--font-head);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  text-align: right;
}

/* Checkered stripe */
.site-header__stripe {
  height: 10px;
  background-image:
    linear-gradient(45deg, #000 25%, transparent 25%),
    linear-gradient(-45deg, #000 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #000 75%),
    linear-gradient(-45deg, transparent 75%, #000 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
  background-color: #FFFFFF;
}

/* ── Navigation ──────────────────────────────────────────────────────────── */
.site-nav {
  background: var(--dark);
}

.site-nav .gercc-wrap {
  display: flex;
  align-items: stretch;
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.site-nav ul li a {
  display: block;
  padding: 14px 18px;
  color: #DDDDDD;
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.site-nav ul li a:hover,
.site-nav ul li.current-menu-item > a,
.site-nav ul li.current_page_item > a {
  background: var(--red);
  color: #FFFFFF;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 14px 18px;
  color: #DDD;
  font-size: 1.4rem;
}

/* ── Hero (home page) ────────────────────────────────────────────────────── */
.site-hero {
  background: var(--dark);
  color: #FFF;
  padding: 60px 0 50px;
  position: relative;
  overflow: hidden;
}

.site-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(204,0,0,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.site-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.site-hero__title {
  font-family: var(--font-head);
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-transform: uppercase;
}

.site-hero__title span { color: var(--red); }

.site-hero__sub {
  margin-top: 12px;
  font-size: 1.05rem;
  color: #AAAAAA;
  line-height: 1.5;
}

.site-hero__cta {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.site-hero__event {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 24px;
}

.site-hero__event-label {
  font-family: var(--font-head);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}

.site-hero__event-date {
  font-family: var(--font-head);
  font-size: 1.9rem;
  font-weight: 600;
  color: #FFF;
}

.site-hero__event-meta {
  margin-top: 6px;
  font-size: 0.9rem;
  color: #AAAAAA;
}

.site-hero__event-stat {
  margin-top: 16px;
  display: flex;
  gap: 20px;
}

.stat-box {
  text-align: center;
}

.stat-box__num {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
}

.stat-box__label {
  font-size: 0.75rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 11px 24px;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--red);
  color: #FFF;
  border-color: var(--red);
}

.btn-primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: #FFF;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: #FFF;
  border-color: rgba(255,255,255,0.4);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  color: #FFF;
  text-decoration: none;
}

/* ── Content area ────────────────────────────────────────────────────────── */
.site-content {
  padding: 40px 0 60px;
}

.site-content .gercc-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.entry-header { margin-bottom: 28px; }

.entry-title {
  font-family: var(--font-head);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--dark);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--red);
  display: inline-block;
}

.entry-content {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.entry-content h2 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--dark);
  margin: 28px 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.entry-content h3 {
  font-family: var(--font-head);
  font-size: 1.2rem;
  margin: 20px 0 10px;
  color: var(--dark);
}

.entry-content p { margin-bottom: 1rem; }

.entry-content ul, .entry-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.entry-content li { margin-bottom: 0.4rem; }

/* ── Home page cards ─────────────────────────────────────────────────────── */
.gercc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 40px 0 0;
}

.gercc-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-top: 3px solid var(--red);
  transition: transform 0.15s, box-shadow 0.15s;
}

.gercc-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.13);
}

.gercc-card__inner { padding: 22px; }

.gercc-card__icon {
  font-size: 2rem;
  margin-bottom: 10px;
  line-height: 1;
}

.gercc-card__title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--dark);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.gercc-card__text {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.gercc-card__link {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gercc-card__link:hover { color: var(--red-dark); }

/* ── GERCC shortcode overrides (public-facing table styles) ──────────────── */
.entry-content table,
.gercc-schedule-table,
table.widefat {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.95rem;
}

.entry-content table th,
table.widefat th {
  background: var(--dark);
  color: #FFF;
  font-family: var(--font-head);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.8rem;
  padding: 10px 14px;
  text-align: left;
}

.entry-content table td,
table.widefat td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.entry-content table tr:nth-child(even) td,
table.widefat.striped tr:nth-child(even) td {
  background: #FAFAFA;
}

.entry-content table tr:hover td {
  background: #F0F6FC;
}

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

.gercc-schedule li {
  padding: 12px 16px;
  border-left: 3px solid var(--red);
  background: #FAFAFA;
  margin-bottom: 8px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95rem;
}

.gercc-schedule li strong { color: var(--dark); }

.gercc-schedule li a {
  display: inline-block;
  margin-left: 10px;
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--red);
}

/* Booking form overrides for theme */
.gercc-booking-wrap {
  font-family: var(--font-body) !important;
}

.gercc-book-btn {
  font-family: var(--font-head) !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  background: var(--red) !important;
}

.gercc-book-btn:hover {
  background: var(--red-dark) !important;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--header-bg);
  color: #999;
  font-size: 0.875rem;
  padding: 32px 0;
  margin-top: 0;
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer__brand {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: #FFF;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.site-footer a { color: #AAAAAA; }
.site-footer a:hover { color: var(--red); text-decoration: none; }

.site-footer__nav { display: flex; gap: 20px; flex-wrap: wrap; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-hero__inner { grid-template-columns: 1fr; }
  .site-hero__title { font-size: 2.2rem; }
  .site-hero__event { margin-top: 0; }

  .site-nav ul {
    display: none;
    flex-direction: column;
    width: 100%;
  }
  .site-nav ul.open { display: flex; }
  .nav-toggle { display: block; }

  .site-nav .gercc-wrap {
    flex-wrap: wrap;
    padding: 0;
  }

  .site-header__top .gercc-wrap { flex-direction: column; text-align: center; }
  .site-header__tagline { text-align: center; }

  .entry-content { padding: 20px; }
  .entry-title { font-size: 1.6rem; }
}
