/* =========================
   Frontend theme (light-on-dark)
   ========================= */
:root {
  --bg:#0b0d10;
  --surface:#151922;
  --surface-2:#1b2030;
  --text:#e9edf4;
  --muted:#aeb6c3;
  --accent:#0d6efd;      /* site accent for hovers/lines */
  --border:#2a3142;

  /* brand reds for bands/buttons */
  --oak-red:#b62327;
  --oak-red-dark:red;
}

/* Base */
html { background: var(--bg); }
body {
  background-color: #0b0d10; /* fallback */
  background-image: url("https://oakshaderaceway.com/wp-content/uploads/2016/11/BG2.jpg");
  background-repeat: repeat;
  background-position: top center;
  background-attachment: fixed;
  background-size: cover;
  color: var(--text);
}

/* Global link colors */
a, a:visited { color: var(--oak-red); text-decoration: none; }
a:hover, a:focus { color: var(--oak-red-dark); text-decoration: underline; }
a { transition: color .2s ease, text-decoration-color .2s ease; }

/* Footer (adds the blue top line) */
.footer {
  background: var(--surface);
  border-top: 4px solid var(--accent); /* CHANGED: blue line */
}
.footer a { color: var(--muted); text-decoration:none; }
.footer a:hover { color:#fff; }

/* Sections & cards */
.section.alt { background: var(--surface-2); }
.card { background: var(--surface); border-color: var(--border); color: var(--text); }
.card .muted { color: var(--muted); }

/* Utilities */
.text-muted, .muted { color: var(--muted) !important; }

/* =========================
   Masthead (with real graphics)
   ========================= */
.masthead {
  position: relative;
  overflow: visible; /* allow overlap */
  background:
    linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.55) 100%),
    var(--masthead-photo, linear-gradient(180deg, #151922 0%, #10131a 100%));
  background-size: cover;
  background-position: center;
}

/* subtle tire-tread texture (SVG data URI) */
.masthead::before {
  content:"";
  position:absolute; inset:0;
  background-image: url("data:image/svg+xml,%3Csvg width='240' height='240' viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cg opacity='.18' fill='%23ffffff'%3E%3Cpath d='M0 210l30-30h20L20 210H0zm50 0l30-30h20l-30 30H50zm50 0l30-30h20l-30 30h-20zm50 0l30-30h20l-30 30h-20zM0 160l30-30h20L20 160H0zm50 0l30-30h20l-30 30H50zm50 0l30-30h20l-30 30h-20zm50 0l30-30h20l-30 30h-20z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 320px 320px;
  background-position: top right;
  background-repeat: no-repeat;
  pointer-events: none;
}

/* Checkered ribbon (SVG) just below masthead */
.ribbon-checkered {
  position: absolute; left:0; right:0; bottom: -8px; height:18px;
  background-image: url("data:image/svg+xml,%3Csvg width='120' height='18' viewBox='0 0 120 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='chk' width='12' height='12' patternUnits='userSpaceOnUse'%3E%3Crect width='12' height='12' fill='%23000'/%3E%3Crect width='6' height='6' fill='%23fff'/%3E%3Crect x='6' y='6' width='6' height='6' fill='%23fff'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='120' height='18' fill='url(%23chk)'/%3E%3C/svg%3E");
  background-size: 120px 18px;
  filter: brightness(.8);
  box-shadow: 0 4px 10px rgba(0,0,0,.35);
}

/* Logo / brand block */
.brand-logo {
  height: 140px; width: auto;
  position: relative; z-index: 10000;
  margin-bottom: -48px; /* overlap into nav */
  filter: drop-shadow(0 4px 14px rgba(0,0,0,.65));
}

.masthead .container { padding-top: 1rem; padding-bottom: .75rem; }

/* =========================
   Main Navigation (single navbar)
   ========================= */
.mainnav {
  margin-top: -14px;     /* tuck under overlapping logo */
  padding-top: 1rem;
  position: relative;
  z-index: 2100;         /* CHANGED: ensure above slider overlay */
  background-color: #3a54a2 !important;
  border-bottom: 1px solid #242b38;
}
.mainnav .nav-link {
  text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
  padding: .85rem 1rem; color: #c8cfdb; position: relative;
}
.mainnav .nav-link:hover,
.mainnav .nav-link.active { color:#fff; }
.mainnav .nav-link::after {
  content:""; position:absolute; left:1rem; right:1rem; bottom:.5rem;
  height:2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: .18s ease;
}
.mainnav .nav-link:hover::after,
.mainnav .nav-link.active::after { transform: scaleX(1); }

/* Ensure dropdown is above slider overlay */
.navbar,
.dropdown-menu { position: relative; z-index: 2200; }

/* =========================
   Social links (header)
   ========================= */
.social-links .social-link {
  color: #fff; font-size: 1.6rem;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .2s ease, transform .2s ease;
  margin-bottom: 10px;
}
.social-links .social-link:hover { color: var(--accent); transform: scale(1.1); }

/* =========================
   Buttons
   ========================= */
.btn-primary { background: #b62327; border-color: #000; color: #fff !important; }
.btn-primary:hover { background: red; border-color: #000; }
.btn-outline-light { color: red; border-color: #000; }
.btn-outline-light:hover { color: #0b0d10; background: #b62327; }

/* =========================
   Main content container (white)
   ========================= */
main.container {
  background: #fff; color: #111;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  padding: 2rem;
  margin-top: 12px;
}

/* Red accent bar below nav */
.nav-accent-bar {
  height: 10px;
  background: repeating-linear-gradient(45deg, var(--oak-red) 0 10px, #b62327 10px 20px);
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}

/* =========================
   Slider (homepage)
   ========================= */
.carousel-item { position: relative; }

/* CHANGED: Lower the full-slide link under dropdowns */
.slide-link { position: absolute; inset: 0; z-index: 1; } /* full-slide click */
.slider-caption {
  z-index: 2;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: linear-gradient(to right, rgba(0,0,0,.55), rgba(0,0,0,.2));
  backdrop-filter: blur(1px);
  padding: .75rem 1rem;
  border-radius: .5rem;
}
.slider-caption h5 { font-size: 1.4rem; margin: 0; color: #fff; flex: 1 1 auto; }
.slider-caption .btn { white-space: nowrap; font-size: .95rem; }
.carousel-control-prev, .carousel-control-next { z-index: 3; }

/* Hide the "Read Now" button on mobile */
@media (max-width: 767.98px) {
  .slider-caption .btn { display: none !important; }
}

/* =========================
   Upcoming Events (red band)
   ========================= */
.upcoming-section {
  background: linear-gradient(90deg, var(--oak-red-dark) 0%, var(--oak-red) 100%);
  color: #fff;
  margin: 2rem 0;
  box-shadow: 0 4px 10px rgba(0,0,0,.3);
  margin-left: -2rem; margin-right: -2rem;
  padding-left: 2rem; padding-right: 2rem;
}
.upcoming-section .d-flex.flex-wrap.gap-3 { justify-content: center; }
.upcoming-section .card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.upcoming-section .ratio { aspect-ratio: 16 / 9; overflow: hidden; }
.upcoming-section .ratio img { width: 100%; height: 100%; object-fit: cover; }
.upcoming-section .card-body { padding: .75rem; }
.upcoming-section .card-body .fw-semibold { font-size: .95rem; font-weight: 600; }

/* =========================
   Event cards (consolidated)
   ========================= */
.event-card {
  position: relative;
  width: 350px;            /* unified width */
  background: #fff; color: #111;
  border: none; border-radius: 6px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  transition: transform .2s ease, box-shadow .2s ease;
}
.event-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.35); }

.event-card .event-media { position: relative; }
.event-card .event-media img { object-fit: cover; }

/* Date pill (over image) */
.event-card .event-date{
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: #000; color: #fff; font-weight: 800;
  font-size: .85rem; line-height: 1; padding: .4rem .6rem;
  border-radius: 999px; letter-spacing: .02em;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}

@media (max-width: 767.98px){
  .event-card { width: 92%; }
  .event-card .event-date { font-size: .8rem; padding: .35rem .55rem; }
}

/* shorter event card images */
.event-card .event-image-box {
  position: relative; height: 120px; overflow: hidden;
}
.event-card .event-image-box img { height: 100%; width: 100%; object-fit: cover; }

/* tighten overall card spacing */
.event-card .card-body { padding: .6rem .75rem .9rem; }

/* Pulse status (shared) */
.status-dot {
  position: absolute; top: 8px; right: 8px;
  width: 12px; height: 12px; border-radius: 50%;
  z-index: 2; animation: statusPulse 1.8s infinite;
}
.status-green  { --dot:#22c55e;  --glow: rgba(34,197,94,.55);  background: var(--dot); box-shadow: 0 0 0 0 var(--glow); }
.status-yellow { --dot:#facc15;  --glow: rgba(250,204,21,.55); background: var(--dot); box-shadow: 0 0 0 0 var(--glow); }
.status-red    { --dot:#ef4444;  --glow: rgba(239,68,68,.55);  background: var(--dot); box-shadow: 0 0 0 0 var(--glow); }
@keyframes statusPulse {
  0% { box-shadow: 0 0 0 0 var(--glow); }
  60% { box-shadow: 0 0 0 10px rgba(0,0,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}

/* =========================
   News cards
   ========================= */
.news-card {
  border: none; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transition: transform .2s ease, box-shadow .2s ease;
  background: #fff;
}
.news-card:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0,0,0,.18); }
.news-card .news-media { height: 180px; overflow: hidden; background: #111; }
.news-card .news-media img { width: 100%; height: 100%; object-fit: cover; display:block; }
.news-card .card-body { padding: .9rem .95rem 1rem; }
.news-card .news-date { margin-bottom: .25rem; }
.news-card h3 { color: #111; }
.news-card p  { color: #333; }

@media (min-width: 992px) {
  .news-card .news-media { height: 190px; }
}

/* Full-width checkered divider inside main container */
.section-sep { margin: 1.25rem 0 1.5rem; }
.section-sep--checkered{
  height: 14px;
  margin-left: -2rem; margin-right: -2rem;
  background-image: url("data:image/svg+xml,%3Csvg width='120' height='14' viewBox='0 0 120 14' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='chk2' width='12' height='12' patternUnits='userSpaceOnUse'%3E%3Crect width='12' height='12' fill='%23000'/%3E%3Crect width='6' height='6' fill='%23fff'/%3E%3Crect x='6' y='6' width='6' height='6' fill='%23fff'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='120' height='14' fill='url(%23chk2)'/%3E%3C/svg%3E");
  background-size: 120px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
@media (max-width: 575.98px){
  .section-sep--checkered{ margin-left: -1rem; margin-right: -1rem; }
}

/* Oakshade red pagination */
.pagination .page-link { color: var(--oak-red); border-color: var(--oak-red); }
.pagination .page-link:hover { color: #fff; background-color: var(--oak-red); border-color: var(--oak-red); }
.pagination .page-item.active .page-link { background-color: var(--oak-red); border-color: var(--oak-red); color: #fff; }
.pagination .page-item.disabled .page-link { color: #aaa; border-color: #ddd; background-color: #f8f9fa; }

/* =========================
   News list (mobile tweaks)
   ========================= */
@media (max-width: 767.98px) {
  .news-list-card img { width: 100% !important; height: auto !important; }
  .news-list-card .flex-grow-1 { margin-top: .5rem; }
}

/* =========================
   Brand text + socials (mobile)
   ========================= */
@media (max-width: 767.98px) {
  .brand-text { flex-direction: column; align-items: flex-start; width: 100%; }
  .brand-text .social-links { align-self: flex-end; margin-top: .25rem; }
}

/* =========================
   Event list cards (match news list look, light theme)
   ========================= */
.event-list-card {
  background: #fff; border: 1px solid #ddd;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  transition: transform .15s ease, box-shadow .15s ease;
}
.event-list-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.16); }

.event-list-card .event-thumb {
  width: 160px; height: 90px; border-radius: .25rem; overflow: hidden;
}
.event-list-card .event-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.event-list-card .event-thumb .no-thumb { width: 100%; height: 100%; background: #2b2f3a; }

/* Reuse pulse status dot */
.event-list-card .status-dot { top: 6px; right: 6px; }

/* Mobile: stack like news cards */
@media (max-width: 767.98px){
  .event-list-card .event-thumb { width: 100% !important; height: auto !important; }
  .event-list-card .event-thumb img,
  .event-list-card .event-thumb .no-thumb { height: auto; aspect-ratio: 16 / 9; }
  .event-list-card .status-dot { top: 8px; right: 8px; }
}

/* =========================
   Gallery cards
   ========================= */
.gallery-card {
  background: #fff; border: 1px solid #ddd;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  transition: transform .15s ease, box-shadow .15s ease;
}
.gallery-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.16); }
.gallery-card .gallery-cover { height: 190px; overflow: hidden; background:#111; }
.gallery-card .gallery-cover img { width:100%; height:100%; object-fit: cover; display:block; }

/* Thumbnails on gallery view */
.thumb { overflow: hidden; border-radius: .25rem; background:#111; }

/* =========================
   Dropdown styling (single, dark)
   ========================= */
.dropdown-menu.dropdown-menu-dark {
  background: #111520;
  border: 1px solid #242b38;
}
.dropdown-menu .dropdown-item { color: #c8cfdb; }
.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus,
.dropdown-menu .dropdown-item.active {
  background: var(--oak-red); color: #fff;
}

/* Desktop hover-open (optional) */
@media (min-width: 992px){
  .navbar .dropdown:hover .dropdown-menu { display: block; margin-top: 0; }
}

/* Toggler tweaks */
.navbar-toggler { border-color: rgba(255,255,255,.25); }
.navbar-toggler-icon { filter: invert(1); } /* white icon on dark nav */

/* Right-align nav on lg+ */
@media (min-width: 992px){
  .mainnav .navbar-nav { margin-left: auto !important; }
}

/* =========================
   Sponsors
   ========================= */
.sponsor-card .sponsor-frame{
  background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 6px;
  display: flex; align-items: center; justify-content: center;
  height: 110px;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
  transition: transform .15s ease, box-shadow .15s ease;
}
.sponsor-card:hover .sponsor-frame{
  transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.12);
}
.sponsor-banner{ max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.sponsor-name{ color: #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
