/* =========================================================
   BookFit Club — design system
   Palette pulled from the mascot logo: book red, ink black,
   warm cream paper, and a sunshine-yellow accent for energy.
   ========================================================= */

:root {
  --red: #e5342e;
  --red-dark: #c11f1f;
  --red-light: #ffe3e1;
  --ink: #1a1a1a;
  --cream: #fff8ef;
  --paper: #ffffff;
  --yellow: #ffc93c;
  --yellow-dark: #f2a900;
  --gray: #6b6558;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 30px;

  --shadow-sm: 0 4px 14px rgba(26, 26, 26, 0.08);
  --shadow-md: 0 10px 30px rgba(26, 26, 26, 0.12);
  --shadow-pop: 6px 6px 0 var(--ink);

  --font-display: "Baloo 2", "Nunito", sans-serif;
  --font-body: "Nunito", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 700;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }

a { color: var(--red-dark); }

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.text-center { text-align: center; }

.lede {
  font-size: 1.15rem;
  color: var(--gray);
  max-width: 60ch;
}
.text-center .lede { margin-left: auto; margin-right: auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow-pop);
}
.btn:hover { transform: translate(-2px, -2px); }
.btn:active { transform: translate(0, 0); box-shadow: 2px 2px 0 var(--ink); }

.btn-primary { background: var(--red); color: var(--paper); }
.btn-secondary { background: var(--yellow); color: var(--ink); }
.btn-ghost { background: var(--paper); color: var(--ink); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}
.text-center .btn-row { justify-content: center; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 3px solid var(--ink);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand img { width: 44px; height: 44px; }
.brand span {
  font-family: "Poppins", var(--font-display), sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}
.brand span em {
  font-style: normal;
  color: var(--red);
}

.nav-toggle {
  display: none;
  background: none;
  border: 3px solid var(--ink);
  border-radius: 10px;
  width: 46px;
  height: 42px;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  height: 3px;
  background: var(--ink);
  border-radius: 2px;
  margin: 4px 0;
}

.main-nav ul {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.main-nav a:hover { background: var(--red-light); color: var(--red-dark); }
.main-nav a.active { background: var(--red); color: var(--paper); }

/* ---------- hero ---------- */
.hero {
  padding: 64px 0 40px;
  overflow: hidden;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
.hero-art {
  position: relative;
  display: flex;
  justify-content: center;
}
.hero-art img {
  width: min(340px, 80%);
  filter: drop-shadow(var(--shadow-md));
  animation: float 4s ease-in-out infinite;
}
.hero-art .blob {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 360px;
  height: 360px;
  background: var(--yellow);
  border-radius: 42% 58% 65% 35% / 45% 45% 55% 55%;
  z-index: -1;
  opacity: 0.55;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-14px) rotate(2deg); }
}

/* ---------- page hero (inner pages) ---------- */
.page-hero {
  padding: 56px 0 36px;
  text-align: center;
  border-bottom: 3px dashed var(--ink);
  margin-bottom: 56px;
}

/* ---------- sections ---------- */
section { padding: 56px 0; }
.section-alt { background: var(--paper); border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); }

.section-head { max-width: 720px; margin: 0 auto 40px; text-align: center; }

/* ---------- cards / grids ---------- */
.grid {
  display: grid;
  gap: 26px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-pop);
  transition: transform 0.15s ease;
}
.card:hover { transform: translateY(-4px); }

.card .icon-badge {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--red-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 16px;
}

/* stat strip */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
}
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--red);
  font-weight: 800;
}
.stat-label { color: var(--gray); font-weight: 600; font-size: 0.95rem; }

/* steps */
.steps {
  counter-reset: step;
  display: grid;
  gap: 24px;
}
.step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  box-shadow: var(--shadow-sm);
}
.step-num {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--yellow);
  border: 3px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
}

/* callout banner */
.banner {
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
}
.banner h2 { color: var(--paper); }
.banner .lede { color: #d8d3c6; margin-left: auto; margin-right: auto; }

/* forms */
.form-card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-pop);
  max-width: 640px;
  margin: 0 auto;
}
.form-row { margin-bottom: 18px; }
.form-row label {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 6px;
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--cream);
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: 3px solid var(--yellow);
  outline-offset: 1px;
}
.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; }
.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
}
.checkbox-group input { width: auto; }

.form-note {
  font-size: 0.9rem;
  color: var(--gray);
  margin-top: 8px;
}

.form-success {
  display: none;
  background: var(--red-light);
  border: 3px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  font-weight: 700;
  color: var(--red-dark);
  max-width: 640px;
  margin: 0 auto;
}

/* donate levels */
.donate-levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.level-card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 26px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

/* next-event spotlight */
.event-spotlight {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  background: var(--yellow);
}
.event-spotlight .icon-badge {
  margin: 0 auto 12px;
  background: var(--paper);
}
.event-spotlight .when {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0;
}
.level-card .amount {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--red);
  font-weight: 800;
}
.level-card.featured {
  background: var(--yellow);
  transform: scale(1.05);
  box-shadow: var(--shadow-pop);
}

/* address / dropoff */
.info-list { list-style: none; margin: 0; padding: 0; }
.info-list li {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 2px dashed #e2dcce;
}
.info-list li:last-child { border-bottom: none; }
.info-list .ico { font-size: 1.4rem; flex: none; }

/* ---------- photo gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.gallery-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 3px solid var(--ink);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  background: var(--paper);
  box-shadow: var(--shadow-pop);
  transition: transform 0.15s ease;
}
.gallery-item:hover { transform: translateY(-4px); }
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-item figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(26,26,26,0.75), transparent);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 24px 14px 10px;
  text-align: left;
}

/* empty gallery slot — swap for a real <img> when a photo is added */
.gallery-item.is-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-style: dashed;
  background: var(--paper);
  color: var(--gray);
  cursor: default;
  box-shadow: none;
}
.gallery-item.is-placeholder:hover { transform: none; }
.gallery-item.is-placeholder .cam { font-size: 1.8rem; }
.gallery-item.is-placeholder span.label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(26, 26, 26, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: min(900px, 100%);
  max-height: 85vh;
  border-radius: var(--radius-md);
  border: 4px solid var(--paper);
}
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  cursor: pointer;
}

/* footer */
.site-footer {
  background: var(--ink);
  color: var(--cream);
  padding: 48px 0 24px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.footer-grid h4 { color: var(--yellow); font-family: var(--font-display); }
.footer-grid a { color: var(--cream); text-decoration: none; opacity: 0.85; }
.footer-grid a:hover { opacity: 1; text-decoration: underline; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-brand img { width: 40px; height: 40px; }
.footer-brand span { font-family: "Poppins", var(--font-display), sans-serif; font-weight: 900; font-size: 1.3rem; letter-spacing: -0.02em; color: var(--paper); }
.footer-brand span em { font-style: normal; color: var(--red); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 20px;
  font-size: 0.85rem;
  opacity: 0.7;
  text-align: center;
}

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero-art { order: -1; }
  .grid-3, .grid-4, .donate-levels { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 3px solid var(--ink);
    padding: 10px 24px 20px;
    max-height: calc(100vh - 74px);
    overflow-y: auto;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 4px; }
  .main-nav a { display: block; }
  .grid-3, .grid-4, .grid-2, .donate-levels { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .level-card.featured { transform: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .banner { padding: 32px 20px; }
}

@media (max-width: 480px) {
  .container { padding: 0 18px; }
  .brand span { font-size: 1.1rem; }
  .brand img { width: 36px; height: 36px; }
  .hero { padding: 40px 0 24px; }
  .btn-row { flex-direction: column; align-items: stretch; }
  .btn-row .btn { justify-content: center; }
  .stats { grid-template-columns: 1fr 1fr; gap: 14px; }
  .step { flex-direction: column; padding: 20px; }
  .card, .form-card, .level-card, .event-spotlight { padding: 20px; }
  section { padding: 40px 0; }
  .banner { padding: 26px 16px; border-radius: var(--radius-md); }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-art img { animation: none; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
