/* =========================
   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, body {
  background: var(--bg);
  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 0.2s ease, text-decoration-color 0.2s ease;
}

/* Footer */
.footer { background: var(--surface); border-top:1px solid var(--border); }
.footer a { color: var(--muted); text-decoration:none; }
.footer a:hover { color:#fff; }

/* Sections & cards */
/*.section { padding: 2rem 0; }*/
.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:
    /* darken gradient over the image */
    linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.55) 100%),
    /* fallback if no --masthead-photo passed from PHP */
    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;      /* adjust to taste */
  width: auto;
  position: relative;
  z-index: 3;
  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: 1;            /* under the logo */
  background-color: #3a54a2 !important; /* your chosen nav color */
  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 { color:#fff; }
.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); }

/* =========================
   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: white !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;
}

/* Sitewide dark textured background behind content box */
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);
}

/* 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; }
.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 {
  /* red band that fills the full width of the white content area */
  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);

  /* break out of main.container’s 2rem padding to edge of white box */
  margin-left: -2rem;
  margin-right: -2rem;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* center the row emitted by the widget */
.upcoming-section .d-flex.flex-wrap.gap-3 { justify-content: center; }

/* cards: compact with 16:9 image */

.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; }

/* =========================
   Responsive tweaks
   ========================= */
@media (max-width: 991.98px) {
  .brand-logo { height: 76px; margin-bottom: -18px; }
  .masthead::before { background-size: 240px 240px; }
  .social-links .social-link { font-size: 1rem; margin-bottom: 10px; }
  .slider-caption h5 { font-size: 1.1rem; }
  .slider-caption .btn { font-size: .85rem; padding: .25rem .75rem; }
}

@media (max-width: 575.98px) {
  .slider-caption { flex-direction: column; align-items: flex-start; }
  .slider-caption h5 { font-size: 1rem; margin-bottom: .5rem; }
  /* cards go full-ish width on small screens */
  .upcoming-section .card { width: 92% !important; }
  /* make the red band square-edge on mobile if you prefer */
  .upcoming-section { border-radius: 0; }
}

/* date pill */
.event-date{
  display: inline-block;
  background: #ffe5e7;           /* light red */
  color: #b3151b;                 /* brand dark red */
  font-weight: 700;
  font-size: .85rem;
  line-height: 1;
  padding: .35rem .55rem;
  border-radius: 999px;
  box-shadow: 0 1px 0 rgba(0,0,0,.05);
  margin-bottom: .35rem;
}

/* Event cards: width + positioning */
.event-card {
  position: relative;
  width: 340px;                 /* wider cards */
  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); }

/* Ensure the 16:9 image is the overlay container */
.event-card .event-media { position: relative; }
.event-card .event-media img { object-fit: cover; }

/* Date/time pill OVER the image (top-left) */
.event-card .event-date{
  position: absolute;
  top: 8px; left: 8px;
  z-index: 2;
  display: inline-block;
  background: #000; /* Oakshade red with opacity for any photo */
  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);
}

/* Pulsing status dot (top-right) with matching glow color */
.status-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 12px; height: 12px;
  border-radius: 50%;
  z-index: 2;
  animation: statusPulse 1.8s infinite;
}

/* Use CSS variables so glow matches the dot color */
.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); }
}

/* Card shell (kept compact + responsive) */
.event-card {
  position: relative;
  width: 350px;
  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); }

@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;        /* adjust this number: try 140–180px for your taste */
  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;
}
/* Latest 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; /* ensure white even on dark theme */
}
.news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
}

/* Wider visual header image (not locked to 16:9; a bit shorter than hero) */
.news-card .news-media {
  height: 180px;           /* tweak 160–220px to taste */
  overflow: hidden;
  background: #111;
}
.news-card .news-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
}

/* Typography inside card body */
.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; }

/* Optional: slightly wider columns feel */
@media (min-width: 992px) {
  /* give cols a bit more breathing room on large screens */
  .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;   /* match main.container padding */
  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;
}

@media (max-width: 767.98px) {
  .news-list-card img {
    width: 100% !important;        /* full width on mobile */
    height: auto !important;
  }
  .news-list-card .flex-grow-1 {
    margin-top: .5rem;             /* small gap below the thumbnail */
  }
}
@media (max-width: 767.98px) {
  .brand-text {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }
  .brand-text .social-links {
    align-self: flex-end; /* move to right side when stacked */
    margin-top: .25rem;
  }
}

/* Events 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);
}

/* Thumbnail block (same size as your news list thumb) */
.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;
}

/* Pulsing status dot over the thumb (top-right) */
.event-list-card .status-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  z-index: 2;
  animation: statusPulse 1.8s infinite;
}

/* Matching glow color */
.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); }
}

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

  .event-list-card .event-thumb img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }
}

/* 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; }

/* Dark dropdown to match .mainnav */
.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);   /* your red */
  color: #fff;
}

/* Optional: show dropdown on hover for desktops */
@media (min-width: 992px){
  .navbar .dropdown:hover .dropdown-menu { display: block; margin-top: 0; }
}
/* Ensure right alignment on lg+ and a visible toggler icon */
.navbar-toggler { border-color: rgba(255,255,255,.25); }
.navbar-toggler-icon { filter: invert(1); } /* white icon on dark nav */

/* Hard-align the nav to the right on desktop */
@media (min-width: 992px){
  .mainnav .navbar-nav { margin-left: auto !important; }
}

/* Optional: dark dropdown to match your nav */
.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;
}
.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; /* fits 200x100 nicely with padding */
  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;
}