/* ===============================
   Theme tokens
================================= */
:root {
  --primary:#ff9800;   /* orange */
  --accent:#4caf50;    /* green */
  --highlight:#ffc107; /* yellow */
  --ink:#222;
  --bg:#fafafa;
  --card:#fff;
  --shadow:0 10px 24px rgba(0,0,0,.08);

  /* spacing scale */
  --space-1: 0.75rem;  /* ~12px */
  --space-2: 1rem;     /* 16px */
  --space-3: 1.25rem;  /* 20px */
  --space-4: 2rem;     /* 32px */
}

/* ===============================
   Base
================================= */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-size: 100%; } /* 16px baseline */

.meta-spacing { margin-top: -6px; margin-bottom: 12px; }


body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 1rem; /* base */
}

h1 { font-size: clamp(1.375rem, 2.4vw, 1.75rem); }
h2 { font-size: clamp(1.125rem, 1.5vw, 1.25rem); }
small, .meta { font-size: 0.875rem; }

/* ===============================
   Header
================================= */
.site-header {
  padding: var(--space-4) var(--space-2);
  background: linear-gradient(120deg, var(--primary), var(--highlight));
  color: #fff;
  text-align: center;
}
.site-header h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.site-header p { margin: 0; opacity: .95; }

/* ===============================
   Nav (sticky)
================================= */
nav.primary {
  position: sticky; top: 0; z-index: 50;
  background: #111; box-shadow: var(--shadow);
}
nav.primary ul {
  list-style: none; margin: 0 auto; padding: 0; max-width: 1100px;
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
}
nav.primary a {
  display: block; padding: var(--space-2) var(--space-2);
  color: #fff; text-decoration: none; font-weight: 700;
  border-bottom: 3px solid transparent; transition: .25s ease;
}
nav.primary a:hover { color: var(--highlight); border-color: var(--highlight); }
nav.primary a:focus { outline: 2px solid var(--highlight); outline-offset: 2px; }

/* ===============================
   Hero (background + overlay)
================================= */
.hero {
  position: relative;
  min-height: 54vh;
  height: 54vh;
  min-height: 340px;

  display: grid;
  place-items: center;
  text-align: center;
  color: #fff;

  background:
    linear-gradient(180deg, rgba(0,0,0,.3), rgba(0,0,0,.55)),
    -webkit-image-set(url("../images/hero-1200.jpg") 1x, url("../images/hero-2400.jpg") 2x);
  background:
    linear-gradient(180deg, rgba(0,0,0,.3), rgba(0,0,0,.55)),
    image-set(url("../images/hero-1200.jpg") 1x, url("../images/hero-2400.jpg") 2x);
  background-position: center;
  background-size: cover;
}
.hero .inner { position: relative; z-index: 1; padding: 0 var(--space-2); }
.hero h1 { margin: .2rem 0 .4rem; font-size: clamp(1.6rem, 4.2vw, 2.6rem); }
.hero p { margin: 0 0 12px; opacity: .95; }

/* ===============================
   Buttons
================================= */
.btn {
  appearance: none; border: none; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 800;
  padding: 12px 18px; border-radius: 12px;
  text-decoration: none; display: inline-block;
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn.cta { background: var(--accent); }

/* ===============================
   Sections
================================= */
.section {
  margin: var(--space-4) auto;
  padding: var(--space-3);
  max-width: 1100px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.section.lead { text-align: center; }
.section h2 { margin: 0 0 10px; color: var(--primary); }

/* ===============================
   Grid + Cards
================================= */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width:900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width:600px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,.1); text-align: center;
}
.card img {
  width: 100%; height: 200px; object-fit: cover; display: block;
  transform: scale(1.01); transition: transform .3s ease, filter .3s ease;
}
.card:hover img { transform: scale(1.04); filter: brightness(.95); }
.card .body { padding: var(--space-3); }

/* ===============================
   Split (text + image)
================================= */
.split { display: flex; gap: 30px; align-items: flex-start; }
.split .text { flex: 2; }
.split .image { flex: 1; display: flex; justify-content: center; }
.split .image img {
  max-width: 100%; height: auto;
  border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

/* ===============================
   Map (responsive iframe)
================================= */
.map-wrap {
  position: relative; width: 100%; height: 0; padding-bottom: 56.25%; /* 16:9 */
  border-radius: 16px; overflow: hidden; box-shadow: var(--shadow);
}
.map-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ===============================
   Footer
================================= */
.site-footer {
  background: #0d0d0d; color: #eee; text-align: center;
  padding: 28px 16px; margin-top: var(--space-4);
}
.site-footer .meta { opacity: .75; }

/* ===============================
   Responsive
================================= */
@media (max-width:980px) {
  .grid { grid-template-columns: repeat(2,1fr); }
  .hero { height: 46vh; }
}
@media (max-width:768px) {
   .split { flex-direction: column; text-align: center; }
  .split .image { margin-top: var(--space-2); }
}
@media (max-width:680px) {
  .grid { grid-template-columns: 1fr; }
  .hero { height: 42vh; min-height: 300px; }
  .section { margin: var(--space-2); padding: var(--space-2); }
}

/* ===============================
   Two-column grid (programs)
================================= */
.grid-2col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: stretch;
}
.grid-2col > .card {
  display: flex;
  flex-direction: column;
}
.grid-2col > .card .body { padding: var(--space-3); }

.card-image { padding: 0; }
.card-image .img-fill {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px;
}
@media (max-width:900px) {
  .grid-2col { grid-template-columns: 1fr; }
  .card-image .img-fill { height: 300px; }
}

/* ===============================
   Accessibility
================================= */
:focus-visible { outline: 3px solid var(--highlight); outline-offset: 2px; }
nav.primary a:focus-visible { border-color: var(--highlight); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Mini hero (Get Involved page) */
.mini-hero {
  height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #fff;
  background: url('../images/volunteer-hero.jpg') center/cover no-repeat;
  position: relative;
}
.mini-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.55));
}
.mini-hero h1 {
  position: relative;
  z-index: 1;
  margin: 0;
}

/* Form styling */
form {
  display: grid;
  gap: 12px;
}
input, select, textarea {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  width: 100%;
}
textarea {
  min-height: 120px;
  resize: vertical;
}
.form-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Secondary button */
.btn.secondary {
  background: var(--primary);
  color: #fff;
}
.btn.secondary:hover {
  filter: brightness(1.1);
}

/* Error message styling */
.error {
  color: red;
  font-size: 0.9rem;
  margin-top: -8px;
  margin-bottom: 8px;
  display: block;
}
/* Mobile: make the nav non-sticky and compact */
@media (max-width: 768px){
  nav.primary { 
    position: static;                 /* not sticky on small screens */
  }
  nav.primary ul{
    flex-direction: row;              /* put items side-by-side */
    flex-wrap: wrap;                  /* wrap to 2 lines if needed */
    gap: 6px 10px;                    /* smaller spacing */
    padding: 6px var(--space-2);
    justify-content: center;
  }
  nav.primary a{
    padding: 8px 10px;                /* smaller touch target */
    font-size: 0.95rem;
    border-bottom-width: 2px;         /* thinner underline */
  }
}

/* Extra small phones */
@media (max-width: 480px){
  .site-header { padding: var(--space-3) var(--space-2); }  /* slightly shorter header */
  nav.primary ul{ gap: 4px 8px; }
  nav.primary a{ font-size: 0.9rem; padding: 8px 10px; }
}


/* ===============================
   Scroll offset fix
================================= */
html { scroll-padding-top: 64px; }
