/* =========================================================
   Books & Cloud — Donate page (v12)
   Calm directory layout that respects the museum aesthetic.
   Uses existing CSS variables, so it inherits Sunlit/Candlelit.
   ========================================================= */

/* ----------- HERO (v13: image background) ----------- */
.don-hero {
  position: relative;
  overflow: hidden;
  padding: 110px 0 120px;
  color: #fdf8ed;
  background-image: url('../images/hero/donate-hero.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* When the page is scrolled, the hero feels more cinematic if it stays put */
  background-attachment: scroll;
}
/* Dark gradient overlay — keeps the hero copy readable on top of any image,
   and gently darker at the bottom so the filter chip rail underneath gets
   a clean visual handoff. */
.don-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    180deg,
    rgba(20, 16, 12, 0.55) 0%,
    rgba(20, 16, 12, 0.50) 45%,
    rgba(20, 16, 12, 0.78) 100%
  );
  pointer-events: none;
}
/* Candlelit (dark) mode: deepen the overlay so the hero blends with the
   night palette instead of feeling like a window into another room. */
html[data-theme="candlelit"] .don-hero::before {
  background: linear-gradient(
    180deg,
    rgba(10, 8, 6, 0.72) 0%,
    rgba(10, 8, 6, 0.68) 45%,
    rgba(10, 8, 6, 0.88) 100%
  );
}
.don-hero-inner {
  position: relative; z-index: 1;
  max-width: 760px;
  text-align: center;
  margin: 0 auto;
}
.don-eyebrow {
  display: inline-block;
  font: 500 0.7rem/1 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.32);
  border-radius: 999px;
  margin-bottom: 26px;
}
.don-hero-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
  color: #fdf8ed;
}
.don-hero-lead {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.6;
  color: rgba(255,255,255,0.88);
  margin: 0 auto;
  max-width: 600px;
}

/* ----------- FILTER CHIP RAIL ----------- */
.don-filter {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--cream);
  border-bottom: 1px solid var(--hairline);
}
.don-filter-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0;
  justify-content: center;
}
.don-filter a {
  display: inline-block;
  padding: 8px 16px;
  font: 500 0.74rem/1 var(--sans);
  letter-spacing: 0.08em;
  color: var(--brown);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  text-decoration: none;
  transition: all .2s ease;
}
.don-filter a:hover {
  border-color: var(--gold);
  color: var(--gold-deep);
}
.don-filter a.is-active {
  background: var(--green);
  color: var(--cream);
  border-color: var(--green);
}
html[data-theme="candlelit"] .don-filter a.is-active {
  background: var(--gold);
  color: #1a1612;
  border-color: var(--gold);
}

/* ----------- MAIN ----------- */
.don-main { padding: 60px 0 100px; }

.don-empty {
  text-align: center;
  font-style: italic;
  color: var(--brown);
  padding: 80px 20px;
  font-size: 1.05rem;
}

/* ----------- DIRECTORY GRID ----------- */
.don-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 28px;
  margin-bottom: 80px;
}
.don-card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 26px;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.don-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(28,27,24,.08);
  border-color: var(--gold);
}
.don-card.is-featured {
  border-color: var(--gold);
  box-shadow: 0 8px 20px rgba(182, 140, 63, 0.12);
}
.don-card-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.don-card-photo {
  flex: 0 0 64px;
  width: 64px; height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--cream-2);
  border: 1px solid var(--hairline);
}
.don-card-photo img { width: 100%; height: 100%; object-fit: cover; }

/* Type pill — color-coded by recipient type */
.don-type-pill {
  display: inline-block;
  font: 500 0.62rem/1 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.don-type-pill.type-library     { background: rgba(30, 51, 41, 0.12);  color: var(--green); }
.don-type-pill.type-school      { background: rgba(182, 140, 63, 0.16); color: var(--gold-deep); }
.don-type-pill.type-charity     { background: rgba(143, 106, 39, 0.16); color: var(--gold-deep); }
.don-type-pill.type-bookshop    { background: rgba(90, 58, 34, 0.12);   color: var(--brown); }
.don-type-pill.type-individual  { background: rgba(28, 27, 24, 0.06);   color: var(--ink-2); }
.don-type-pill.type-other       { background: rgba(28, 27, 24, 0.06);   color: var(--ink-2); }

.don-card-name {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.3rem;
  line-height: 1.2;
  margin: 0 0 4px;
  color: var(--ink);
}
.don-card-loc {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 500 0.78rem/1 var(--sans);
  letter-spacing: 0.04em;
  color: var(--brown-2);
  margin: 0;
}
.don-card-short {
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--brown);
  margin: 0 0 16px;
}

/* Expand / read more */
.don-card-details {
  margin: 12px 0 18px;
  border-top: 1px solid var(--hairline);
  padding-top: 14px;
}
.don-card-details summary {
  cursor: pointer;
  font: 500 0.74rem/1 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  list-style: none;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.don-card-details summary::-webkit-details-marker { display: none; }
.don-card-details summary::after {
  content: '+';
  font-size: 1rem;
  transition: transform .2s ease;
}
.don-card-details[open] summary::after { transform: rotate(45deg); }
.don-card-detail-body {
  margin-top: 14px;
  font-family: var(--serif);
  color: var(--ink-2);
}
.don-card-detail-body p { margin: 8px 0 16px; line-height: 1.6; font-size: 0.98rem; }
.don-card-detail-body h4 {
  font: 500 0.7rem/1 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 18px 0 6px;
}
.don-contact-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  font-size: 0.92rem;
  line-height: 1.7;
}
.don-contact-list li { padding: 2px 0; }
.don-contact-list strong { display: inline-block; width: 22px; }
.don-contact-list a { color: var(--green); }
html[data-theme="candlelit"] .don-contact-list a { color: var(--gold); }

.don-card-actions {
  margin-top: auto;
  padding-top: 10px;
}
.don-card-actions .btn-sm {
  padding: 0.5em 1.1em !important;
  font-size: 0.7rem !important;
  width: 100%;
  text-align: center;
}

/* ----------- INQUIRY FORM ----------- */
.don-form-wrap {
  scroll-margin-top: 100px;
}
.don-form-inner {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 48px;
  max-width: 720px;
  margin: 0 auto;
}
.don-form-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 8px;
  color: var(--ink);
  text-align: center;
}
.don-form-intro {
  text-align: center;
  font-family: var(--serif);
  color: var(--brown);
  margin: 0 0 32px;
  font-size: 1.02rem;
  line-height: 1.55;
}
.don-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 560px) {
  .don-form-row { grid-template-columns: 1fr; }
  .don-form-inner { padding: 28px 20px; }
}
.don-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}
.don-form-row .don-field { margin-bottom: 0; }
.don-label {
  font: 500 0.72rem/1 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brown);
  margin-bottom: 8px;
}
.don-field input,
.don-field textarea,
.don-field select {
  width: 100%;
  padding: 12px 14px;
  background: var(--cream);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink);
  transition: border-color .2s ease;
}
.don-field input:focus,
.don-field textarea:focus,
.don-field select:focus {
  outline: none;
  border-color: var(--gold);
}
.don-field textarea { resize: vertical; min-height: 100px; }
.don-form-actions {
  text-align: center;
  margin-top: 28px;
}

/* Honeypot — invisible to humans, irresistible to bots */
.don-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Alerts */
.don-alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin: 0 0 22px;
  font-family: var(--serif);
  font-size: 1rem;
}
.don-alert.success {
  background: rgba(30, 51, 41, 0.08);
  border: 1px solid var(--green);
  color: var(--green);
}
.don-alert.error {
  background: rgba(168, 50, 50, 0.08);
  border: 1px solid #a83232;
  color: #a83232;
}
html[data-theme="candlelit"] .don-alert.success {
  background: rgba(212, 178, 119, 0.1);
  border-color: var(--gold);
  color: var(--gold);
}
