/* ============================================================
   Tufts Natural Bodybuilding Club — styles
   ============================================================
   HOW THIS FILE IS ORGANIZED:
     1. Variables   – change colors & fonts here first
     2. Reset/base  – sensible defaults
     3. Layout      – the container that centers content
     4. Components  – header, hero, buttons, cards, footer
     5. Responsive  – phone adjustments (at the very bottom)

   TIP: Almost any color or spacing change can be made in
   section 1 without touching anything else.
   ============================================================ */

/* ---------- 1. VARIABLES ---------- */
:root {
  /* Colors — edit these to re-skin the whole site */
  --ink: #16181d;          /* near-black, used for dark sections & text */
  --accent: #2f7fd1;       /* Tufts blue — buttons, links, highlights */
  --accent-dark: #1f5fa3;  /* darker blue for hover */
  --earth: #7a4a2b;        /* Tufts brown — the thin bar at the very top */
  --surface: #ffffff;      /* page background */
  --surface-alt: #f3f4f6;  /* slightly gray background for alternating sections */
  --text: #1a1c20;         /* main body text */
  --muted: #5b6068;        /* quieter text */
  --line: #e3e6ea;         /* hairline borders */

  /* Fonts */
  --font-display: 'Oswald', system-ui, sans-serif;  /* headings */
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --max-width: 1080px;
  --radius: 10px;
}

/* ---------- 2. RESET / BASE ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth; /* smooth jump when clicking nav links */
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* A thin Tufts-brown bar across the very top — a small signature detail. */
body::before {
  content: "";
  display: block;
  height: 4px;
  background: var(--earth);
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.05;
  margin: 0 0 0.4em;
  font-weight: 600;
}

p {
  margin: 0 0 1rem;
}

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

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

/* Visible outline when navigating by keyboard (accessibility) */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 3. LAYOUT ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Use .narrow for text-heavy sections so lines aren't too long to read. */
.narrow {
  max-width: 680px;
}

.section {
  padding: 5rem 0;
}
.section-alt {
  background: var(--surface-alt);
}
.section-dark {
  background: var(--ink);
  color: #e9eaec;
}
.section-dark .section-eyebrow {
  color: #8fbcec;
}

/* Small label above a section heading */
.section-eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 1.25rem;
}

/* ---------- 4. COMPONENTS ---------- */

/* Header / nav */
.site-header {
  position: sticky;   /* stays at the top as you scroll */
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 1.05rem;
  color: var(--ink);
}
.brand:hover {
  text-decoration: none;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.primary-nav a {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  color: var(--ink);
}
.nav-cta {
  background: var(--accent);
  color: #fff !important;
  padding: 0.45rem 1rem;
  border-radius: 999px;
}
.nav-cta:hover {
  background: var(--accent-dark);
  text-decoration: none;
}

/* Hamburger button (hidden on desktop, shown on phones via the media query) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
/* When open, morph the three bars into an "X" (class added by script.js) */
.nav-toggle.is-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.is-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hero */
.hero {
  background: var(--ink);
  color: #f4f5f7;
  padding: 6rem 0;
}
.hero-inner {
  max-width: 760px;
}
.eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.85rem;
  color: #8fbcec;
  margin: 0 0 1rem;
}
.hero-title {
  text-transform: uppercase;
  font-weight: 700;
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  letter-spacing: 0.005em;
  margin-bottom: 1.25rem;
}
.hero-lede {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: #c7cad0;
  max-width: 46ch;
  margin-bottom: 2rem;
}

/* Buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}
.btn {
  display: inline-block;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 1rem;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover {
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-dark);
}
.btn-ghost {
  background: transparent;
  color: inherit;
  border-color: currentColor;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}
/* On light sections, the ghost button needs a darker outline */
.section:not(.section-dark) .btn-ghost {
  color: var(--ink);
}
.section:not(.section-dark) .btn-ghost:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Card grid (What we do) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 3rem;
  margin-top: 3rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.07);
}
.card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.4rem;
}
.card p {
  color: var(--muted);
  margin: 0;
}

/* Meetings */
.meeting-line {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

/* Footer */
.site-footer {
  background: var(--ink);
  color: #aab0b8;
  padding: 2.5rem 0;
}
.footer-brand {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #f4f5f7;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.footer-meta {
  font-size: 0.9rem;
  margin: 0;
}

/* ---------- 5. RESPONSIVE (phones & small tablets) ---------- */
@media (max-width: 720px) {
  .nav-toggle {
    display: flex;   /* show the hamburger */
  }

  /* Hide the nav by default on small screens; script.js reveals it. */
  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.5rem 1rem;
    display: none;
  }
  .primary-nav.is-open {
    display: flex;   /* opened menu */
  }
  .primary-nav a {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
  }
  .nav-cta {
    text-align: center;
    margin-top: 0.75rem;
    border-bottom: none !important;
  }

  .section {
    padding: 3.5rem 0;
  }
  .hero {
    padding: 4rem 0;
  }
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}
