/* ── Vote-a-Thon Fundraiser — hopeful nonprofit warmth ──────────────
   Off-white ground, raspberry + apricot, humanist serif headlines,
   soft-shadow cards, heart accents. Hand-coded. */

:root {
  --ground: #faf7f2;
  --card: #ffffff;
  --raspberry: #b435608c;
  --rasp: #b43560;
  --rasp-deep: #932a4e;
  --apricot: #f5a86c;
  --apricot-soft: #fbe3cd;
  --ink: #3c2a33;
  --ink-soft: #907882;
  --line: #ecdfe4;
  --err: #ce4257;
  --font-display: 'Lora', serif;
  --font-body: 'Rubik', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.hidden { display: none !important; }

body {
  font-family: var(--font-body);
  background-color: var(--ground);
  background-image: radial-gradient(52% 34% at 90% 0%, rgba(245, 168, 108, 0.18), transparent 70%);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.page { display: flex; flex-direction: column; min-height: 100vh; }

.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 20px; }

main { flex: 1 0 auto; padding-bottom: 70px; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 66px 0 40px; }

.badge {
  display: inline-block;
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rasp);
  border: 1.5px solid rgba(180, 53, 96, 0.35);
  border-radius: 999px;
  padding: 8px 22px;
  margin-bottom: 20px;
  background: rgba(180, 53, 96, 0.05);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 8.5vw, 4.2rem);
  line-height: 1.08;
}

.hero h1 em { color: var(--rasp); }

.hero .sub {
  max-width: 520px;
  margin: 16px auto 0;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.goal { font-weight: 700; color: var(--rasp); margin-top: 8px; }

.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }

.tally { margin-top: 30px; }

.tally-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 7vw, 3.4rem);
  color: var(--rasp);
  line-height: 1.1;
}

.tally-label {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ── Sections ─────────────────────────────────────────────────────── */
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  text-align: center;
  margin: 30px 0 26px;
}

/* ── Gallery ──────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.pet-card {
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(60, 42, 51, 0.1);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pet-card:hover { transform: translateY(-4px); box-shadow: 0 20px 44px rgba(60, 42, 51, 0.16); }

.pet-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: var(--apricot-soft);
}

.pet-body { padding: 14px 16px 16px; }

.pet-caption {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pet-author { color: var(--ink-soft); font-size: 0.8rem; margin-top: 2px; }

.pet-votes {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  gap: 8px;
}

.vote-count { font-weight: 700; font-size: 0.88rem; color: var(--rasp); }

.vote-btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  background: var(--rasp);
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.vote-btn:hover { transform: scale(1.04); background: var(--rasp-deep); }

.vote-btn.is-voted { background: var(--apricot); color: var(--ink); cursor: default; transform: none; }

.empty { text-align: center; padding: 50px 20px; }
.empty-icon { font-size: 3rem; display: block; margin-bottom: 12px; }
.empty p { font-size: 1.08rem; font-weight: 700; }
.empty-sub { color: var(--ink-soft); font-weight: 400; font-size: 0.95rem !important; margin-top: 6px; }

.load-wrap { text-align: center; margin-top: 28px; }

/* ── Entry card ───────────────────────────────────────────────────── */
.enter-section { margin-top: 60px; }

.card {
  background: var(--card);
  border-radius: 20px;
  padding: 34px 30px;
  max-width: 560px;
  margin: 0 auto;
  box-shadow: 0 18px 44px rgba(60, 42, 51, 0.12);
  border-top: 5px solid var(--rasp);
}

.card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  text-align: center;
}

.card-sub { text-align: center; color: var(--ink-soft); font-size: 0.95rem; margin: 8px 0 24px; }

.field { margin-bottom: 16px; }

.field-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 18px; }

@media (min-width: 540px) { .field-grid { grid-template-columns: 1fr 1fr; } }

label { display: block; font-weight: 500; font-size: 0.88rem; margin-bottom: 6px; }

input[type="text"],
input[type="email"],
input[type="file"] {
  width: 100%;
  padding: 13px 15px;
  font-size: 0.98rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--ground);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus {
  outline: none;
  border-color: var(--rasp);
  box-shadow: 0 0 0 4px rgba(180, 53, 96, 0.12);
}

input.error { border-color: var(--err); }

.form-error { color: var(--err); font-weight: 500; font-size: 0.9rem; text-align: center; margin-top: 14px; }

.share-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── Lightbox ─────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(60, 42, 51, 0.9);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lb-content {
  background: var(--card);
  border-radius: 18px;
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.lb-img { width: 100%; max-height: 56vh; object-fit: contain; background: var(--apricot-soft); }

.lb-meta { padding: 18px 22px 22px; }

.lb-caption { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; }

.lb-author { color: var(--ink-soft); font-size: 0.85rem; margin-top: 2px; }

.lb-actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }

.lb-votes { font-weight: 700; color: var(--rasp); }

.lb-close {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 2rem;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  line-height: 1;
}

.lb-nav {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 2.2rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0 10px;
  transition: background 0.15s ease;
}

.lb-nav:hover { background: rgba(255, 255, 255, 0.3); }

@media (max-width: 640px) {
  .lb-nav { position: absolute; bottom: 18px; top: auto; }
  .lb-prev { left: 22%; }
  .lb-next { right: 22%; }
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  padding: 14px 32px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, filter 0.12s ease;
  line-height: 1.2;
}

.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: 3px solid rgba(180, 53, 96, 0.4); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(120deg, var(--rasp), var(--rasp-deep));
  color: #fff;
  box-shadow: 0 12px 30px rgba(180, 53, 96, 0.35);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid rgba(60, 42, 51, 0.25);
  color: var(--ink);
}

.btn-block { width: 100%; }

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--err);
  color: #fff;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 700;
  z-index: 300;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
  max-width: 92vw;
  text-align: center;
}

.toast.toast-ok { background: #4c9067; }

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  flex-shrink: 0;
  text-align: center;
  padding: 26px 20px;
  color: var(--ink-soft);
  font-size: 0.85rem;
  border-top: 1.5px solid var(--line);
}

#wbx-powered-by-slot { margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
