/* ------------------------------------------------------------------
   Kingdom Hall kitchen - public donation pages
   Mobile-first. No CSS framework: the whole public side is four screens,
   and hand-rolled CSS keeps it small and fast on a phone.
   ------------------------------------------------------------------ */

:root {
  color-scheme: light;

  --paper:      #FBFAF7;
  --card:       #FFFFFF;
  --ink:        #15221E;
  --muted:      #6F7A75;
  --line:       #E8E4DB;
  --line-soft:  #F1EEE7;

  --brand:      #1E5A4E;
  --brand-dark: #144138;
  --brand-soft: #E9F1EE;
  --accent:     #B0722A;
  --accent-soft:#FBF1E3;
  --success:    #2E7D5B;
  --danger:     #A3372F;
  --danger-soft:#FBEDEB;

  --radius:     16px;
  --radius-sm:  10px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(21, 34, 30, .05);
  --shadow:    0 2px 8px rgba(21, 34, 30, .06), 0 1px 2px rgba(21, 34, 30, .04);
  --shadow-lg: 0 12px 32px rgba(21, 34, 30, .12);

  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
             "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;

  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; margin: 0; }

a { color: var(--brand); }

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

@media (min-width: 768px) { .wrap { padding: 0 32px; } }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- header */

.masthead {
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 28px 0 0;
}

.masthead__eyebrow {
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
  margin: 0 0 6px;
}

.masthead__title { font-size: 1.6rem; color: #fff; letter-spacing: -.01em; }

.masthead__sub {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, .8);
  font-size: .95rem;
  max-width: 46ch;
}

@media (min-width: 768px) {
  .masthead { padding-top: 44px; }
  .masthead__title { font-size: 2.3rem; }
  .masthead__sub { font-size: 1.05rem; }
}

/* Coverage panel that straddles the header edge. */
.coverage {
  margin: 24px 0 -28px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 18px 20px;
}

@media (min-width: 768px) {
  .coverage { padding: 24px 28px; margin-top: 36px; }
}

.coverage__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}

.coverage__pct { font-family: var(--font-display); font-size: 2rem; line-height: 1; }
.coverage__pct span { font-size: 1rem; color: var(--muted); margin-left: 4px; }

.coverage__meta { color: var(--muted); font-size: .875rem; text-align: right; }

.coverage__stats {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 12px; margin-top: 16px;
  border-top: 1px solid var(--line-soft); padding-top: 14px;
}

@media (min-width: 560px) { .coverage__stats { grid-template-columns: repeat(4, 1fr); } }

.stat__value { font-weight: 650; font-variant-numeric: tabular-nums; }
.stat__label { color: var(--muted); font-size: .8rem; }

/* ---------------------------------------------------------------- bars */

.bar {
  height: 8px; border-radius: var(--radius-pill);
  background: var(--line-soft); overflow: hidden;
}

.bar--lg { height: 10px; margin-top: 14px; }

.bar__fill {
  height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--brand) 0%, var(--success) 100%);
  transition: width .4s ease;
}

.bar__fill--done { background: var(--success); }

/* ---------------------------------------------------------------- toolbar */

.toolbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(251, 250, 247, .94);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 12px 0 0;
  margin-top: 44px;
}

.search { position: relative; }

.search input {
  width: 100%;
  font: inherit;
  font-size: 16px; /* anything smaller makes iOS zoom on focus */
  padding: 11px 14px 11px 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--ink);
}

.search input:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: transparent;
}

.search__icon {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; line-height: 0;
}

/* Horizontally scrolling category pills - the whole point of the redesign:
   61 items never appear as one list. */
.pills {
  display: flex; gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 12px 20px;
  margin: 0 -20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.pills::-webkit-scrollbar { display: none; }

@media (min-width: 768px) {
  .pills { padding-left: 32px; padding-right: 32px; margin: 0 -32px; flex-wrap: wrap; }
}

.pill {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--ink);
  font-size: .875rem; font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.pill:hover { border-color: var(--brand); }

.pill[aria-pressed="true"] {
  background: var(--brand); border-color: var(--brand); color: #fff;
}

.pill__count {
  font-size: .75rem; font-variant-numeric: tabular-nums;
  background: var(--line-soft); color: var(--muted);
  border-radius: var(--radius-pill); padding: 1px 7px;
}

.pill[aria-pressed="true"] .pill__count { background: rgba(255,255,255,.2); color: #fff; }

.toolbar__row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding-bottom: 10px; flex-wrap: wrap;
}

.result-count { color: var(--muted); font-size: .8rem; }

/* ---------------------------------------------------------------- switch */

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .8rem; color: var(--muted); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }

.switch__track {
  width: 36px; height: 20px; border-radius: var(--radius-pill);
  background: var(--line); position: relative; transition: background .18s ease;
  flex: 0 0 auto;
}

.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm);
  transition: transform .18s ease;
}

.switch input:checked + .switch__track { background: var(--brand); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------------------------------------------------------------- sections */

.section { padding-top: 32px; }
.section:last-of-type { padding-bottom: 8px; }

.section__head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.section__icon { font-size: 1.15rem; line-height: 1; }
.section__title { font-size: 1.2rem; }
.section__note { color: var(--muted); font-size: .85rem; margin: 0 0 16px; }

/* ---------------------------------------------------------------- cards */

.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }

@media (min-width: 620px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s ease, border-color .18s ease, transform .18s ease;
}

@media (hover: hover) {
  .card:hover { box-shadow: var(--shadow); border-color: #D9D3C7; transform: translateY(-1px); }
}

.card--covered { background: var(--line-soft); border-style: dashed; box-shadow: none; }
.card--covered:hover { transform: none; }

.card__top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.card__name { font-weight: 600; font-size: 1.02rem; letter-spacing: -.005em; }
.card__meta { color: var(--muted); font-size: .82rem; margin-top: 2px; }

.badge {
  flex: 0 0 auto;
  font-size: .68rem; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--radius-pill);
  background: var(--line-soft); color: var(--muted);
  white-space: nowrap;
}

.badge--bulk   { background: var(--brand-soft);  color: var(--brand); }
.badge--weekly { background: var(--accent-soft); color: var(--accent); }
.badge--fresh  { background: #E8F3EC;            color: var(--success); }

.card__need { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: .88rem; }
.card__remaining { font-weight: 650; font-variant-numeric: tabular-nums; }
.card__of { color: var(--muted); font-variant-numeric: tabular-nums; }

.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.card__price { color: var(--muted); font-size: .8rem; }
.card__price b { color: var(--ink); font-weight: 600; }

.covered-note { color: var(--success); font-weight: 600; font-size: .88rem; display: flex; align-items: center; gap: 6px; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: .9rem;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px; /* comfortable thumb target */
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); }

.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }

.btn--block { width: 100%; }
.btn--lg { font-size: 1rem; padding: 14px 24px; min-height: 52px; }

.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------------------------------------------------------------- alerts */

.alert {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: .9rem;
  border: 1px solid transparent;
}

.alert--error   { background: var(--danger-soft); border-color: #F0D5D1; color: var(--danger); }
.alert--success { background: var(--brand-soft);  border-color: #D3E4DE; color: var(--brand-dark); }
.alert ul { margin: 0; padding-left: 18px; }

/* ---------------------------------------------------------------- forms */

.page { padding: 28px 0 48px; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

@media (min-width: 640px) { .panel { padding: 28px; } }

.panel--narrow { max-width: 560px; margin: 0 auto; }

.backlink {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); text-decoration: none; font-size: .875rem;
  margin-bottom: 16px; min-height: 44px;
}

.backlink:hover { color: var(--brand); }

.form-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding-bottom: 18px; margin-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
}

.form-item__icon {
  font-size: 1.5rem; line-height: 1;
  background: var(--brand-soft); border-radius: var(--radius-sm);
  width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto;
}

.need-strip {
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 22px;
  font-size: .9rem;
}

.need-strip b { font-variant-numeric: tabular-nums; }

.field { margin-bottom: 18px; }

.field > label, .field__label {
  display: block; font-weight: 600; font-size: .875rem; margin-bottom: 6px;
}

.req { color: var(--danger); font-weight: 400; }
.opt { color: var(--muted); font-weight: 400; }

.field input[type="text"],
.field input[type="tel"],
.field input[type="number"],
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* prevents the iOS zoom-on-focus jump */
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
}

.field textarea { resize: vertical; min-height: 76px; }

.field input:focus, .field textarea:focus {
  outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent;
}

.field__hint { color: var(--muted); font-size: .8rem; margin-top: 6px; }

.qty-group { display: flex; }

.qty-group input {
  border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important;
  font-variant-numeric: tabular-nums; font-weight: 600;
}

.qty-group__unit {
  display: grid; place-items: center;
  padding: 0 16px;
  border: 1px solid var(--line); border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--line-soft); color: var(--muted);
  font-size: .9rem; white-space: nowrap;
}

/* Checkbox styled as a tappable card, so "do you need help buying this"
   is impossible to miss on a phone. */
.check-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.check-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.check-card:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }

.check-card input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); flex: 0 0 auto; }
.check-card__title { font-weight: 600; font-size: .9rem; }
.check-card__hint { color: var(--muted); font-size: .82rem; }

.form-actions { margin-top: 24px; }

/* ---------------------------------------------------------------- thanks */

.thanks { text-align: center; }

.thanks__mark {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; margin: 0 auto 18px;
}

.thanks__title { font-size: 1.7rem; margin-bottom: 8px; }

.reference {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.15rem; font-weight: 600; letter-spacing: .08em;
  background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: var(--radius-sm);
  margin: 6px 0 4px;
}

.thanks__detail { color: var(--muted); font-size: .9rem; max-width: 42ch; margin: 0 auto; }

.summary-line {
  background: var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 14px 16px; margin: 24px 0;
  font-size: .9rem;
}

/* ---------------------------------------------------------------- misc */

.empty {
  text-align: center; padding: 48px 20px; color: var(--muted);
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius);
}

.site-foot {
  border-top: 1px solid var(--line);
  margin-top: 48px; padding: 24px 0 40px;
  color: var(--muted); font-size: .85rem; text-align: center;
}

.site-foot a { color: var(--muted); }

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------------------------------------------------- critical notice */

/* The delivery instruction on the confirmation page. Deliberately the
   loudest thing on that screen: a donor who dispatches goods before the
   committee has arranged collection creates a real problem at the hall. */
.notice-critical {
  text-align: left;
  border: 2px solid var(--danger);
  background: var(--danger-soft);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 24px 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.notice-critical__icon { color: var(--danger); flex: 0 0 auto; line-height: 0; margin-top: 2px; }

.notice-critical__label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--danger);
  margin-bottom: 6px;
}

.notice-critical__body { font-size: .92rem; line-height: 1.5; margin: 0; }
.notice-critical__body strong { color: var(--danger); }

/* ---------------------------------------------------------------- faq */

.faq { margin-top: 8px; }

.faq__item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}

/* <details>/<summary> so the accordion works with no JavaScript at all. */
.faq__q {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  font-size: .95rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 44px;
}

.faq__q::-webkit-details-marker { display: none; }
.faq__q:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

.faq__q::after {
  content: "+";
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--muted);
  flex: 0 0 auto;
  line-height: 1;
}

.faq__item[open] .faq__q::after { content: "\2212"; }
.faq__item[open] .faq__q { border-bottom: 1px solid var(--line-soft); }

.faq__a { padding: 14px 16px; color: var(--ink); font-size: .92rem; }
.faq__a p { margin: 0 0 10px; }
.faq__a p:last-child { margin-bottom: 0; }

.faq__placeholder {
  border-style: dashed;
  background: var(--line-soft);
}
