/* ==========================================================================
   The STAY Project — Components
   ========================================================================== */

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-block;
  font-family: 'Nunito Sans', var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-align: center;
  padding: 0.8rem 1.7rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }

.btn--primary { background: var(--blue-dark); color: var(--white); }
.btn--primary:hover { background: var(--green-dark); color: var(--white); }

.btn--secondary { background: transparent; color: var(--green-dark-text); border-color: var(--green-dark); }
.btn--secondary:hover { background: var(--green-dark); color: var(--white); }

.btn--light { background: var(--off-white); color: var(--blue-dark); }
.btn--light:hover { background: var(--teal-light); color: var(--blue-dark); }

.btn--big { font-size: 1.2rem; padding: 1.05rem 2.6rem; }

/* Anchor-specific repeats so button colors beat contextual link rules like
   `.section--green-dark a { color: white }` (same specificity, later file wins). */
a.btn--primary { color: var(--white); }
a.btn--primary:hover { color: var(--white); }
a.btn--secondary { color: var(--green-dark-text); }
a.btn--secondary:hover { color: var(--white); }
a.btn--light { color: var(--blue-dark); }
a.btn--light:hover { color: var(--blue-dark); }

/* ------------------------------------------------------------------ */
/* Crisis banner (toolkit pages + anywhere sensitive)                  */
/* ------------------------------------------------------------------ */
.crisis-banner {
  background: var(--teal-light);
  border-left: 6px solid var(--blue-dark);
  color: var(--blue-dark);
  padding: 1rem clamp(1.1rem, 4vw, 2rem);
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
}
.crisis-banner a { color: var(--blue-dark); }

/* ------------------------------------------------------------------ */
/* Support Us / Shop Merch CTA band                                    */
/* ------------------------------------------------------------------ */
.support-cta {
  background: var(--white);
  border: 2px solid var(--teal-medium);
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.6rem;
  margin-block: 2.5rem 3rem;
}
.support-cta p { margin: 0; font-weight: 600; color: var(--blue-dark); }

/* ------------------------------------------------------------------ */
/* Stat bands (org impact + donation stats)                            */
/* ------------------------------------------------------------------ */
.stat-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 2rem;
  text-align: center;
}
.stat-band .stat-number {
  display: block;
  font-family: 'Nunito Sans', var(--font-body);
  font-weight: 700;
  font-size: clamp(2.3rem, 5vw, 3.4rem);
  letter-spacing: 0.06em; /* "Nunito Sans Expanded" feel for big numbers */
  color: var(--teal-light);
  line-height: 1.1;
}
.stat-band .stat-label {
  display: block;
  margin-top: 0.4rem;
  font-weight: 600;
  color: var(--off-white);
}

/* Public-awareness stat cards (visually distinct from org stats) */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.4rem;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  border-top: 6px solid var(--teal-dark);
  box-shadow: var(--shadow-soft);
  padding: 1.6rem 1.5rem;
}
.stat-card .stat-figure {
  font-family: 'Nunito Sans', var(--font-body);
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 0.04em;
  color: var(--green-dark);
  display: block;
  margin-bottom: 0.4rem;
}
.stat-card p { margin: 0 0 0.5rem; color: var(--black); }
.stat-card .stat-source {
  font-size: 0.82rem;
  color: var(--blue-medium-text);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------ */
/* Generic cards & grids                                               */
/* ------------------------------------------------------------------ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.card > :last-child { margin-top: auto; }
.card h3 { margin-bottom: 0.2rem; }

.card--link { transition: transform 0.18s ease, box-shadow 0.18s ease; }
.card--link:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }

.card-icon {
  width: 3rem; height: 3rem;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  border-radius: 50%;
  background: var(--teal-light);
  margin-bottom: 0.6rem;
}

/* Two-up split (asymmetric) */
.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.split--reverse { grid-template-columns: 0.9fr 1.1fr; }
@media (max-width: 768px) {
  .split, .split--reverse { grid-template-columns: 1fr; }
}
.split img { border-radius: var(--radius); box-shadow: var(--shadow-lift); }

/* Pull-quote / vision callout */
.pull-quote {
  background: var(--white);
  border-left: 8px solid var(--green-dark);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow-soft);
  padding: 1.8rem 2rem;
  font-size: 1.12rem;
  color: var(--blue-dark);
}
.pull-quote p:last-child { margin-bottom: 0; }

/* Mission statement — large, prominent */
.mission-statement {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--blue-dark);
  line-height: 1.45;
  max-width: 30ch;
}

/* ------------------------------------------------------------------ */
/* Checklist grids (What to Donate)                                    */
/* ------------------------------------------------------------------ */
.donate-list {
  border-radius: var(--radius);
  padding: 1.8rem clamp(1.2rem, 3vw, 2.2rem);
  margin-bottom: 2rem;
}
.donate-list--yes { background: var(--white); border: 2px solid var(--green-medium); }
.donate-list--yes h2, .donate-list--yes h3 { color: var(--green-dark); }
.donate-list--no { background: var(--amber-bg); border: 2px dashed var(--amber-muted); }
.donate-list--no h2, .donate-list--no h3 { color: var(--amber-muted); }

.donate-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.9rem 1.5rem;
}
.donate-items li {
  padding-left: 1.9rem;
  position: relative;
}
.donate-items li::before {
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 800;
}
.donate-list--yes .donate-items li::before { content: "✓"; color: var(--green-dark); }
.donate-list--no .donate-items li::before { content: "—"; color: var(--amber-muted); }
.donate-items li strong { color: var(--blue-dark); }

/* ------------------------------------------------------------------ */
/* Drive cards (Find a Drive)                                          */
/* ------------------------------------------------------------------ */
.drive-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.4rem;
  align-items: center;
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.2rem;
}
@media (max-width: 640px) {
  .drive-card { grid-template-columns: 1fr; text-align: center; }
  .drive-card .drive-date { margin-inline: auto; }
}
.drive-date {
  background: var(--teal-light);
  color: var(--blue-dark);
  border-radius: var(--radius-small);
  text-align: center;
  padding: 0.7rem 1rem;
  min-width: 5.2rem;
  font-family: 'Nunito Sans', var(--font-body);
  font-weight: 700;
}
.drive-date .drive-month { display: block; font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; }
.drive-date .drive-day { display: block; font-size: 1.7rem; line-height: 1.1; }
.drive-card h3 { margin-bottom: 0.15rem; }
.drive-card .drive-meta { color: var(--blue-medium-text); font-weight: 600; font-size: 0.95rem; margin-bottom: 0.4rem; }
.drive-card p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ */
/* Team cards                                                          */
/* ------------------------------------------------------------------ */
.team-grid {
  /* Flex (not grid) so a short last row centers itself */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}
.team-card {
  background: var(--white);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  text-align: center;
  /* Fixed card size: uploaded photos are cropped to fit, never resize the card */
  flex: 0 0 15.5rem;
  max-width: 100%;
}
.team-photo {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--off-white);
  display: grid;
  place-items: center;
  color: var(--blue-medium-text);
  font-weight: 700;
  padding: 1rem;
}
.team-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.team-card .team-body { padding: 1.1rem 1.2rem 1.4rem; }
.team-card h3 { margin-bottom: 0.1rem; font-size: 1.15rem; }
.team-card .team-role { color: var(--green-dark-text); font-weight: 700; font-size: 0.92rem; margin-bottom: 0.6rem; }
.team-card .team-bio { font-size: 0.95rem; margin: 0; }

/* ------------------------------------------------------------------ */
/* Image placeholders (on-brand, obviously replaceable)                */
/* ------------------------------------------------------------------ */
.img-placeholder {
  background: var(--teal-light);
  background-image: radial-gradient(rgba(29,47,111,0.08) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
  border: 2px dashed var(--teal-dark);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--blue-dark);
  font-weight: 700;
  padding: 1rem;
  min-height: 10rem;
}

/* ------------------------------------------------------------------ */
/* Gallery + lightbox                                                  */
/* ------------------------------------------------------------------ */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.9rem;
}

/* Carousel variant: one row of 4, arrows scroll the rest into view */
.gallery-carousel {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.photo-gallery--row {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 0.9rem;
  flex: 1;
  min-width: 0;
  scrollbar-width: none;
}
.photo-gallery--row::-webkit-scrollbar { display: none; }
.photo-gallery--row button {
  flex: 0 0 calc((100% - 3 * 0.9rem) / 4);
  scroll-snap-align: start;
}
@media (max-width: 880px) {
  .photo-gallery--row button { flex-basis: calc((100% - 0.9rem) / 2); }
}
.gallery-arrow {
  flex: none;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  border: 2px solid var(--green-dark);
  background: var(--white);
  color: var(--green-dark-text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.gallery-arrow:hover { background: var(--green-dark); color: var(--white); }
.photo-gallery button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-small);
  overflow: hidden;
  display: block;
}
.photo-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.25s ease;
}
.photo-gallery button:hover img { transform: scale(1.04); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(10, 16, 40, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.lightbox.is-open { display: flex; }
.lightbox img {
  max-width: min(92vw, 70rem);
  max-height: 82vh;
  width: auto;
  border-radius: var(--radius-small);
}
.lightbox figcaption {
  color: var(--off-white);
  text-align: center;
  margin-top: 0.8rem;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(241, 243, 245, 0.14);
  color: var(--white);
  border: 0;
  border-radius: 50%;
  width: 2.9rem; height: 2.9rem;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: var(--green-dark); }
.lightbox-close { top: 1.2rem; right: 1.2rem; }
.lightbox-prev { left: 1.2rem; top: 50%; translate: 0 -50%; }
.lightbox-next { right: 1.2rem; top: 50%; translate: 0 -50%; }

/* ------------------------------------------------------------------ */
/* Blog cards & filtering                                              */
/* ------------------------------------------------------------------ */
.blog-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.8rem;
}
.blog-controls .filter-label { font-weight: 700; color: var(--blue-dark); margin-right: 0.2rem; }
.tag-pill {
  display: inline-block;
  background: var(--teal-light);
  color: var(--blue-dark);
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.25rem 0.8rem;
  cursor: pointer;
  text-decoration: none;
}
button.tag-pill:hover { border-color: var(--teal-dark); }
.tag-pill.is-active { background: var(--blue-dark); color: var(--white); }
.blog-sort {
  margin-left: auto;
  font-family: var(--font-body);
  font-weight: 600;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-small);
  border: 2px solid var(--teal-medium);
  background: var(--white);
  color: var(--blue-dark);
}

.post-card { border-top: 6px solid var(--green-medium); }
.post-card .post-date { color: var(--blue-medium-text); font-weight: 700; font-size: 0.88rem; }
.post-card .post-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.3rem 0 0.6rem; }
.post-card .post-tags .tag-pill { cursor: default; font-size: 0.78rem; }

/* ------------------------------------------------------------------ */
/* Forms                                                               */
/* ------------------------------------------------------------------ */
.stay-form {
  display: grid;
  gap: 1.1rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: clamp(1.4rem, 4vw, 2.2rem);
}
.stay-form .form-row { display: grid; gap: 0.3rem; }
.stay-form label { font-weight: 700; color: var(--blue-dark); }
.stay-form .optional-note { font-weight: 400; color: var(--blue-medium-text); font-size: 0.9rem; }
.stay-form input[type="text"],
.stay-form input[type="email"],
.stay-form input[type="number"],
.stay-form select,
.stay-form textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--teal-medium);
  border-radius: var(--radius-small);
  background: var(--off-white);
  color: var(--black);
  width: 100%;
}
.stay-form input:focus-visible,
.stay-form select:focus-visible,
.stay-form textarea:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--green-dark);
}
.stay-form textarea { min-height: 10rem; resize: vertical; }
.stay-form .checkbox-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.95rem;
}
.stay-form .checkbox-row input { margin-top: 0.3rem; width: 1.1rem; height: 1.1rem; flex: none; }
.stay-form .checkbox-row label { font-weight: 600; }

/* Preset tag choices on the story form */
.tag-choices { border: 0; padding: 0; margin: 0; }
.tag-choices legend { font-weight: 700; color: var(--blue-dark); padding: 0; margin-bottom: 0.5rem; }
.tag-choices__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.45rem 1rem;
}
.tag-choice { display: flex; align-items: center; gap: 0.45rem; }
.tag-choice input { width: 1.05rem; height: 1.05rem; flex: none; }
.tag-choice label { font-weight: 600; }

/* Honeypot — hidden from humans, visible to naive bots (all forms) */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

.form-message {
  border-radius: var(--radius-small);
  padding: 0.9rem 1.1rem;
  font-weight: 700;
  display: none;
}
.form-message.is-visible { display: block; }
.form-message--success { background: var(--green-light); color: #17423d; }
.form-message--error { background: #f7e4e4; color: var(--error-red); }

/* Footer newsletter form variant */
.footer-newsletter { display: grid; gap: 0.7rem; margin-top: 0.8rem; }
.footer-newsletter label { font-weight: 700; font-size: 0.9rem; }
.footer-newsletter input[type="text"],
.footer-newsletter input[type="email"] {
  font-family: var(--font-body);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-small);
  border: 0;
  width: 100%;
  font-size: 0.95rem;
}
.footer-newsletter .checkbox-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.83rem;
  color: var(--teal-light);
}
.footer-newsletter .checkbox-row input { margin-top: 0.25rem; flex: none; }

/* ------------------------------------------------------------------ */
/* Toolkit pages                                                       */
/* ------------------------------------------------------------------ */
.toolkit-section { margin-bottom: 2.6rem; }
.toolkit-section h2 {
  border-bottom: 3px solid var(--teal-medium);
  padding-bottom: 0.35rem;
  display: inline-block;
}

.resource-card {
  border-left: 6px solid var(--teal-dark);
}
.resource-card .resource-type {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-dark);
}

.video-placeholder {
  aspect-ratio: 16 / 9;
  width: 100%;
}
.video-embed { aspect-ratio: 16 / 9; width: 100%; border-radius: var(--radius); overflow: hidden; }
.video-embed iframe { width: 100%; height: 100%; border: 0; }

.crisis-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; }
.crisis-list li {
  background: var(--white);
  border-left: 6px solid var(--blue-dark);
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
  padding: 0.9rem 1.2rem;
}
.crisis-list strong { color: var(--blue-dark); }

.toolkit-disclaimer {
  background: var(--off-white);
  border: 2px solid var(--blue-medium);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  font-weight: 600;
  color: var(--blue-dark);
  font-style: italic;
}

/* ------------------------------------------------------------------ */
/* CTA banners inside content                                          */
/* ------------------------------------------------------------------ */
.cta-banner {
  background: var(--blue-dark);
  color: var(--off-white);
  border-radius: var(--radius);
  text-align: center;
  padding: clamp(2rem, 5vw, 3.2rem);
}
.cta-banner h2 { color: var(--white); }
.cta-banner--green { background: var(--green-dark); }
.cta-banner p { max-width: 55ch; margin-inline: auto; }
.cta-banner .btn { margin-top: 0.8rem; }

/* Chapter spotlight (empty state) — text centered both ways */
.chapter-empty {
  background: var(--white);
  border: 2px dashed var(--teal-dark);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 9rem;
  padding: 2rem 1.5rem;
  color: var(--blue-dark);
  font-weight: 700;
  font-size: 1.1rem;
}
.chapter-empty p { margin: 0; }

/* Steps list */
.steps-list { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.steps-list li {
  counter-increment: step;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1.2rem 1.4rem 1.2rem 4.2rem;
  position: relative;
}
.steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 1.1rem;
  top: 1.1rem;
  width: 2.1rem; height: 2.1rem;
  border-radius: 50%;
  background: var(--green-dark);
  color: var(--white);
  font-weight: 800;
  display: grid;
  place-items: center;
}

/* Fixed 3-per-row grid (toolkit hub cards, What to Donate rows) */
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.donate-items--rows { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1000px) {
  .card-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .donate-items--rows { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .card-grid--3 { grid-template-columns: 1fr; }
  .donate-items--rows { grid-template-columns: 1fr; }
}

/* Whole-card click target: the .card-link inside a .card--link stretches
   over the full card (used by the toolkit hub cards) */
.card--link { position: relative; }
.card--link .card-link { font-weight: 700; color: var(--green-dark-text); text-decoration: none; }
.card--link .card-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card--link .card-link:focus-visible::after { outline: var(--focus-ring); outline-offset: 2px; }

/* Centered placeholder-image row (toolkit sub-pages) */
.placeholder-images {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}
.placeholder-images .img-placeholder {
  width: min(19rem, 100%);
  aspect-ratio: 4 / 3;
}

/* Full-width centered lead sentence */
.lead-center { max-width: none; text-align: center; }

/* Centered mission statement */
.text-center .mission-statement { margin-inline: auto; }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.section-intro { max-width: 60ch; }
.section-intro--center { margin-inline: auto; text-align: center; }
.eyebrow {
  font-family: 'Nunito Sans', var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green-dark-text);
  margin-bottom: 0.4rem;
}
.section--dark .eyebrow, .section--green-dark .eyebrow { color: var(--teal-light); }
