/* ==========================================================================
   Virginia City Grand Prix — style.css
   Palette: charcoal + ochre (gold rush) + rust (dirt/motion) + parchment
   Type: Oswald (display/headings/nav) + Barlow (body)
   ========================================================================== */

:root {
  --charcoal: #1b1712;
  --charcoal-2: #262019;
  --charcoal-3: #322a20;
  --cream: #f2ece0;
  --parchment: #f5f1e8;
  --white: #ffffff;
  --ochre: #c1873f;
  --ochre-dark: #9c6a2c;
  --rust: #a5402c;
  --rust-dark: #8a3222;
  --ink: #362f26;
  --ink-soft: #6b6153;
  --border-soft: rgba(242, 236, 224, 0.14);

  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Barlow', -apple-system, 'Segoe UI', sans-serif;

  --container-w: 1180px;
  --radius: 3px;
}

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
p { margin: 0 0 1em; max-width: 62ch; }
.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}
.content { padding: 88px 0; }
.parchment-background { background: var(--parchment); }
.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  color: var(--rust);
  margin-bottom: 10px;
}
.section-heading {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  color: var(--ochre-dark);
}
.section-heading.on-dark { color: var(--ochre); }
.section-intro { color: var(--ink-soft); font-size: 1.05rem; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
  padding: 14px 30px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-rust { background: var(--rust); color: var(--white); }
.btn-rust:hover { background: var(--rust-dark); }
.btn-cream-rust {
  background: var(--cream);
  color: var(--rust);
}
.btn-cream-rust:hover {
  background: var(--white);
  color: var(--rust-dark);
}
.btn-outline { background: transparent; border-color: var(--cream); color: var(--cream); }
.btn-outline:hover { background: var(--cream); color: var(--charcoal); }
.btn-outline-dark { background: transparent; border-color: var(--ochre-dark); color: var(--ochre-dark); }
.btn-outline-dark:hover { background: var(--ochre-dark); color: var(--white); }

/* ---------- Header ---------- */
#site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--charcoal);
  border-bottom: 1px solid var(--border-soft);
}
#site-header .header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.logo {
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  color: var(--cream);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}
.logo img { height: 64px; width: auto; display: block; }

nav#main-nav { display: flex; }
nav#main-nav > ul { display: flex; align-items: center; gap: 2px; }
nav#main-nav > ul > li { position: relative; }
nav#main-nav > ul > li > a,
nav#main-nav > ul > li > .dropdown-toggle {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--cream);
  text-transform: uppercase;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}
nav#main-nav > ul > li > a:hover,
nav#main-nav > ul > li.has-dropdown:hover > .dropdown-toggle,
nav#main-nav > ul > li.has-dropdown.open > .dropdown-toggle { color: var(--ochre); }
nav#main-nav > ul > li > a[aria-current="page"],
nav#main-nav > ul > li.current-section > .dropdown-toggle,
.dropdown li a[aria-current="page"] { color: var(--ochre); }
nav#main-nav .cta-link a {
  background: var(--rust);
  border-radius: var(--radius);
  color: var(--white) !important;
}
nav#main-nav .cta-link a:hover { background: var(--rust-dark); color: var(--white) !important; }

.has-dropdown .dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: var(--charcoal-2);
  border: 1px solid var(--border-soft);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}
.has-dropdown:hover .dropdown,
.has-dropdown.open .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown li a {
  display: block;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--cream);
}
.dropdown li a:hover { color: var(--ochre); background: rgba(242,236,224,0.04); }

#nav-toggle {
  display: none;
  position: relative;
  z-index: 210;
  background: none;
  border: none;
  color: var(--cream);
  font-size: 1.4rem;
  cursor: pointer;
  margin-right: 6px;
}

/* ---------- Hero ---------- */
#hero {
  position: relative;
  min-height: 82vh;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, rgba(27,23,18,0.55) 0%, rgba(27,23,18,0.85) 100%), var(--charcoal-3);
  background-size: cover;
  background-position: center;
  color: var(--cream);
  overflow: hidden;
  /* The real photo (images/homepage-hero.webp) is layered in via an inline
     style on the #hero element in index.php, so it can use $asset_path.
     This gradient-only background is the fallback if that's ever removed. */
}
#hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 90px;
  background: var(--white);
  clip-path: polygon(0 100%, 100% 40%, 100% 100%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 270px);
  align-items: center;
  gap: clamp(40px, 7vw, 100px);
  padding: 60px 0 120px;
}

.hero-content {
  min-width: 0;
}
.hero-eyebrow {
  font-family: var(--font-display);
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  color: var(--ochre);
  margin-bottom: 18px;
}
.hero-title {
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  line-height: 0.98;
  color: var(--white);
  margin-bottom: 14px;
}
.hero-title span { color: var(--ochre); }
.hero-dates {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  letter-spacing: 0.08em;
  color: var(--cream);
  margin-bottom: 30px;
}
.hero-dates .divider { color: var(--rust); margin: 0 10px; }

.countdown { display: flex; gap: 22px; margin-bottom: 36px; flex-wrap: wrap; }
.countdown .unit { text-align: center; }
.countdown .num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--white);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.countdown .label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
  margin-top: 6px;
  text-transform: uppercase;
}
.hero-ctas { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-sponsors {
	justify-self: end;
	width: 100%;
	max-width: 230px;
	text-align: center;
}

.hero-sponsors-label {
	display: block;
	margin-bottom: 18px;
	color: var(--white);
	font-family: var(--font-display);
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	opacity: 0.9;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}

.hero-sponsor-logos {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
}

.hero-sponsor-logos a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 210px;
	height: 72px;
	border-radius: 4px;
}

#hero .hero-sponsor-logos a img {
	display: block;
	width: 190px;
	height: 64px;
	object-fit: contain;

	/* Muted white appearance */
	filter: grayscale(1) brightness(0) invert(1) !important;
	opacity: 0.68 !important;

	transition:
		filter 0.25s ease,
		opacity 0.25s ease,
		transform 0.25s ease;
}

/* Reveal original logo colors on hover or keyboard focus */
#hero .hero-sponsor-logos a:hover img,
#hero .hero-sponsor-logos a:focus-visible img {
	filter: none !important;
	opacity: 1 !important;
	transform: scale(1.05);
}

.hero-sponsor-logos a:focus-visible {
	outline: 2px solid var(--white);
	outline-offset: 5px;
}

/* ---------- Stats ---------- */
#stats { background: var(--white); padding: 0 0 90px; margin-top: -70px; position: relative; z-index: 3; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-soft-2, #e7e0d2);
  border: 1px solid #e7e0d2;
}
.stat-card {
  background: var(--white);
  padding: 32px 20px;
  text-align: center;
}
.stat-card i { color: var(--rust); font-size: 1.4rem; margin-bottom: 12px; }
.stat-card .num {
  display: block;
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--ochre-dark);
}
.stat-card .label {
  font-size: 0.85rem;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
}

/* ---------- Intro ---------- */
#intro .container { max-width: 820px; text-align: center; }
#intro p { margin-left: auto; margin-right: auto; font-size: 1.1rem; color: var(--ink-soft); }

/* ---------- Schedule preview ---------- */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 48px;
}
.day-card {
  background: var(--white);
  border: 1px solid #e7e0d2;
  border-top: 4px solid var(--rust);
  padding: 30px 26px;
}
.day-card .day-tag {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--rust);
  margin-bottom: 8px;
  display: block;
}
.day-card h4 { font-size: 1.3rem; color: var(--ink); margin-bottom: 6px; }
.day-card .day-date { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 16px; }
.day-card ul { margin-bottom: 18px; }
.day-card li {
  padding: 6px 0;
  border-top: 1px solid #f0ebe0;
  font-size: 0.92rem;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.day-card li:first-child { border-top: none; }
.day-card .more-link { font-family: var(--font-display); font-size: 0.85rem; letter-spacing: 0.06em; color: var(--ochre-dark); }
.day-card .more-link:hover { color: var(--rust); }
.schedule-footer { text-align: center; margin-top: 40px; }

/* ---------- Sponsors ---------- */
#sponsors {
  background: var(--charcoal);
  color: var(--cream);
  padding: 80px 0;
}
#sponsors .section-heading { color: var(--ochre); }
.sponsor-tier { margin-bottom: 40px; }
.sponsor-tier:last-child { margin-bottom: 0; }
.sponsor-tier-label {
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  margin-bottom: 22px;
}
.sponsor-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 40px;
}
.sponsor-row.tier-presenting img { height: 64px; }
.sponsor-row.tier-other img { height: 40px; }
.sponsor-row img { width: auto; filter: grayscale(1) brightness(1.6); opacity: 0.85; transition: opacity 0.25s ease, filter 0.25s ease; }
.sponsor-row a:hover img { filter: none; opacity: 1; }
.sponsors-cta { text-align: center; margin-top: 44px; }

/* Shared "Presenting Sponsors" band (sponsors-band.php) — used site-wide,
   including the homepage, so it lives here rather than in subpage-styles.css. */
.sponsors-band { background: var(--charcoal); color: var(--cream); padding: 90px 0; }
.sponsors-band .sponsor-tier-label { color: var(--ink-soft); }
.sponsors-band p { color: var(--cream); opacity: 0.8; }

/* Move the bottom two presenting-sponsor logos left on mobile */
@media (max-width: 640px) {
	.hero-sponsor-logos a:nth-child(3),
	.hero-sponsor-logos a:nth-child(4) {
		transform: translateX(-40px);
	}
}

/* ---------- CTA band ---------- */
#cta-band {
  background: var(--rust);
  color: var(--white);
  padding: 64px 0;
  text-align: center;
}
#cta-band h2 { color: var(--white); font-size: clamp(1.6rem, 3vw, 2.2rem); }
#cta-band p { color: rgba(255,255,255,0.85); margin: 0 auto 26px; }

/* ---------- Footer ---------- */
#site-footer { background: var(--charcoal); color: var(--cream); padding: 70px 0 0; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1.1fr;
  gap: 40px;
  padding-bottom: 50px;
  border-bottom: 1px solid var(--border-soft);
}
.footer-about .logo img { height: 72px; }
.footer-about p { color: var(--ink-soft); font-size: 0.92rem; margin-top: 14px; }
.footer-social { display: flex; gap: 14px; margin-top: 18px; }
.footer-social a {
  width: 36px; height: 36px;
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--cream);
}
.footer-social a:hover { background: var(--ochre); border-color: var(--ochre); color: var(--charcoal); }
.footer-col h5 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--ochre);
  margin-bottom: 16px;
}
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--cream); font-size: 0.92rem; }
.footer-col a:hover { color: var(--ochre); }
.footer-col .fa-li-row { display: flex; gap: 10px; align-items: flex-start; color: var(--cream); font-size: 0.9rem; margin-bottom: 12px; }
.footer-col .fa-li-row i { color: var(--rust); margin-top: 3px; width: 14px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
  flex-wrap: wrap;
  gap: 10px;
}
.footer-bottom a { color: var(--ink-soft); }
.footer-bottom a:hover { color: var(--ochre); }

/* Improve hero date and countdown visibility */
.hero-dates .date-divider {
	color: var(--white);
	text-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
}

.countdown .num,
.countdown .label {
	color: var(--white);
	text-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
}

.countdown .label {
	font-weight: 600;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .schedule-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  #nav-toggle { display: block; }

  body.nav-open { overflow: hidden; }

  #nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 150;
  }
  #nav-overlay.open { opacity: 1; visibility: visible; }

  nav#main-nav {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    height: 100vh;
    height: 100dvh;
    width: min(320px, 82vw);
    background: var(--charcoal-2);
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: -12px 0 40px rgba(0,0,0,0.4);
    transform: translateX(100%);
    transition: transform 0.32s ease;
    z-index: 160;
  }
  nav#main-nav.open { transform: translateX(0); }
  nav#main-nav > ul { flex-direction: column; width: 100%; align-items: stretch; padding: 100px 0 40px; }
  nav#main-nav > ul > li > a,
  nav#main-nav > ul > li > .dropdown-toggle { padding: 14px 28px; }
  .has-dropdown .dropdown {
    position: static; opacity: 1; visibility: visible; transform: none;
    display: block;
    max-height: 0;
    overflow: hidden;
    border: none;
    background: var(--charcoal-3);
    border-left: 3px solid var(--rust);
    padding: 0;
    box-shadow: inset 0 10px 14px -12px rgba(0,0,0,0.6);
    transition: max-height 0.32s ease, padding 0.32s ease;
  }
  .has-dropdown.open .dropdown { max-height: 340px; padding: 6px 0; }
  .has-dropdown .dropdown li a {
    padding: 12px 24px 12px 30px;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
  }
  .has-dropdown .dropdown li a:hover,
  .has-dropdown .dropdown li a:active { color: var(--ochre); background: rgba(255,255,255,0.05); }
  .has-dropdown .dropdown-toggle i { transition: transform 0.25s ease; }
  .has-dropdown.open .dropdown-toggle i { transform: rotate(180deg); }
  .content { padding: 60px 0; }
}
@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .hero-ctas { flex-direction: column; align-items: flex-start; }
  .hero-inner { padding: 90px 24px 120px; }
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-sponsors {
    justify-self: start;
    max-width: 520px;
    text-align: left;
  }

  .hero-sponsor-logos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 34px;
  }

  .hero-sponsor-logos img {
    width: 100%;
    max-width: 190px;
  }
}