/* =========================
   Baxter Trail Club – Global Styles
   ========================= */

/* Theme variables */
:root {
  --primary: rgb(96, 125, 139);
  --accent: #f4a261;
  --bg: #fdfcf9;
  --text: #1a1a1a;
  --muted: #555;
  --card: #ffffff;
  --ring: rgba(25, 118, 210, 0.35);
}

/* Base reset + typography */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  text-rendering: optimizeLegibility;
  padding-bottom: 80px; /* Add space for fixed footer */
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
p { margin: 0 0 1rem; }

/* Containers */
main { display: block; }
.container, .homepage-grid {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* =========================
   Header & Navigation
   ========================= */
.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .15rem 1.25rem;
  background: var(--primary);
  color: #fff;
}
.site-header a {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}
.site-header .logo { height: 80px; }
.site-header .title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
}

.site-nav { display: flex; gap: 1.25rem; }
.site-nav a { color: #fff; font-weight: 600; }
.site-nav a:hover { text-decoration: underline; }

/* Mobile hamburger */
.menu-toggle {
  display: none;
  font-size: 1.6rem;
  color: #fff;
  background: none;
  border: 0;
  cursor: pointer;
  line-height: 1;
}

/* Mobile slide-out */
@media (max-width: 768px) {
  .menu-toggle { display: inline-block; }
  .site-nav {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--primary);
    flex-direction: column;
    width: 240px;
    transform: translateX(100%);
    transition: transform .3s ease-in-out;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    z-index: 20;
  }
  .site-nav.open { transform: translateX(0); }
  .site-nav a {
    padding: 1rem 1rem;
    margin: 0;
    border-top: 1px solid rgba(255,255,255,.25);
  }
}

/* =========================
   Homepage – Two Column Layout
   ========================= */
.homepage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 900px) {
  .homepage-grid { grid-template-columns: 1fr; }
}

/* Upcoming events (left column) */
.upcoming-event h2 {
  display: inline-block;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--primary);
}
.upcoming-event article {
  background: var(--card);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  margin-bottom: 1rem;
}
.upcoming-event .meta {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: .5rem;
}
.upcoming-event h3 { margin-bottom: .25rem; }
.upcoming-event a { font-weight: 700; }

/* Slideshow (right column) – fade effect */
.slideshow {
  position: relative;
  height: 600px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  background: #e6eef8;
}
.slideshow .slides { position: relative; height: 100%; }
.slideshow .slides img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}
.slideshow .slides img.active { opacity: 1; }

/* =========================
   Generic Page Layout
   ========================= */
.page {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}
.page-header {
  margin-bottom: 2rem;
}
.page-header h1 {
  margin-bottom: .5rem;
  border-bottom: 3px solid var(--primary);
  display: inline-block;
  padding-bottom: .25rem;
}
.page-header p {
  color: var(--muted);
}

/* =========================
   Events Layout
   ========================= */
.event-list article {
  background: var(--card);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  margin-bottom: 1.25rem;
}
.event-list h2 { margin-bottom: .25rem; }
.event-list .meta {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: .5rem;
}

/* =========================
   Footer
   ========================= */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1rem;
  background: var(--primary);
  color: #fff;
  z-index: 10;
}
.site-footer .social a { color: #fff; text-decoration: underline; }

/* =========================
   Utilities & A11y
   ========================= */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,1px,1px);
  white-space: nowrap; border: 0;
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
