/* Campaign block (spec/04-design/campaign.md): the doc picture of "Current situation" rebuilt as real, responsive
   HTML. Linked only by pages that have a campaign block, after site.css. No JS, no animation, no request. */

.campaign {
  /* Picture palette: the site's brown as the panel and as the ink; card, beige, tan and copper sampled from the doc picture. */
  --c-card: #fffdf9;
  --c-beige: #eee2d2;
  --c-copper: #b67a49;
  --c-tan: #dcb387;
  --c-track: #745c4b;
  --c-radius: 6px;
  /* System serif only: no webfont, no request. One line to change to the site face: `var(--font)`. */
  --font-display: Georgia, 'Times New Roman', serif;
}

/* The picture's page colour, a shade darker than paper, so the light cards stand out as in the doc picture.
   Without :has() support the band stays paper and the cards keep their soft shadow. */
.band:has(> .campaign) { --band-bg: #f6f0e7; }

/* Wider than the reading column (video width): cards and tiers sit side by side. */
.band > .campaign { max-width: var(--w-wide); }
.band > * + .campaign,
.band > .campaign + * { margin-top: clamp(2rem, 4vw, 2.75rem); }

.campaign > * { margin: 0; }
.campaign__title + .campaign__lead { margin-top: clamp(16px, 2.4vw, 22px); }
.campaign__lead + .campaign__panel { margin-top: clamp(28px, 4vw, 36px); }
.campaign__panel + .campaign__cards { margin-top: clamp(20px, 3vw, 30px); }
.campaign__cards + .campaign__heading { margin-top: clamp(44px, 6.5vw, 60px); }
.campaign__heading + .campaign__intro { margin-top: 14px; }
.campaign__intro + .campaign__tiers { margin-top: clamp(22px, 3vw, 28px); }
/* FI (doc words only): no title, lead, cards, heading or intro, so the tiers follow the panel straight away. */
.campaign__panel + .campaign__tiers { margin-top: clamp(16px, 2.4vw, 22px); }

/* ------------------------------------------------------------------ headings + lead */

.campaign__title,
.campaign__heading,
.campaign__card-title,
.campaign__tier-title,
.campaign__figure {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.005em;
}

.campaign__title {
  font-size: clamp(2.25rem, 7.4vw, 3.9rem);
  line-height: 1.06;
  letter-spacing: -0.012em;
  text-wrap: wrap; /* as the doc picture breaks it: "…already taking / shape." */
}

.campaign__lead,
.campaign__intro {
  max-width: 40rem;
  font-size: 1.0625rem;
  line-height: 1.6;
}

@media (min-width: 900px) {
  .campaign__lead,
  .campaign__intro { font-size: 1.125rem; }
}

.campaign__heading {
  font-size: clamp(1.75rem, 3.8vw, 2.2rem);
  line-height: 1.2;
  letter-spacing: -0.005em;
}

/* ------------------------------------------------------------------ dark panel: three figures + progress bar */

.campaign__panel {
  padding: clamp(22px, 3.4vw, 32px) clamp(20px, 3.2vw, 30px) clamp(20px, 3vw, 28px);
  border-radius: var(--c-radius);
  background: var(--brown);
  color: #fffdf9;
}

.campaign__stats {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 560px) {
  .campaign__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
}

.campaign__figure {
  display: block;
  font-size: clamp(1.75rem, 3.6vw, 2.25rem);
  line-height: 1.1;
  white-space: nowrap;
}

.campaign__caption {
  display: block;
  margin-top: 6px;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: rgba(255, 253, 249, 0.86);
}

.campaign__bar {
  height: 18px;
  margin-top: clamp(20px, 3vw, 26px);
  overflow: hidden;
  border-radius: 3px;
  background: var(--c-track);
}

.campaign__fill {
  display: block;
  width: var(--w);
  height: 100%;
  background: var(--c-tan);
}

.campaign__progress {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  color: #fffdf9;
}

/* ------------------------------------------------------------------ two cards, about 60 / 40 */

.campaign__cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* a long word may not widen the column past a 320px screen (200% text) */
  gap: 16px;
}

@media (min-width: 760px) {
  .campaign__cards { grid-template-columns: 1.4fr 1fr; gap: 24px; }
}

.campaign__card {
  padding: clamp(20px, 3vw, 26px) clamp(20px, 3vw, 28px);
  border-radius: var(--c-radius);
  font-size: 0.875rem;
  line-height: 1.6;
}

.campaign__card p { margin-top: 12px; }

.campaign__card--local,
.campaign__tier { box-shadow: var(--shadow-soft); }

.campaign__card--local {
  border-left: 4px solid var(--c-copper);
  border-radius: 2px var(--c-radius) var(--c-radius) 2px;
  background: var(--c-card);
}

.campaign__card--local .campaign__card-title { font-weight: 700; font-size: clamp(1.3rem, 2.4vw, 1.5rem); }

.campaign__card--goal { background: var(--c-beige); }

.campaign__card--goal .campaign__card-title { font-size: clamp(1.35rem, 2.6vw, 1.65rem); }

.campaign__card-title { line-height: 1.22; text-wrap: balance; }

/* ------------------------------------------------------------------ three tiers */

.campaign__tiers {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 800px) {
  .campaign__tiers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.campaign__tier {
  padding: 24px clamp(20px, 2.6vw, 24px) 26px;
  border-top: 5px solid var(--c-copper);
  border-radius: 2px 2px var(--c-radius) var(--c-radius);
  background: var(--c-card);
}

.campaign__tier-title {
  font-size: clamp(1.15rem, 2vw, 1.3rem);
  line-height: 1.3;
}

.campaign__amount {
  margin-top: 14px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.campaign__tier > :first-child { margin-top: 0; } /* a tier the doc gives no title (FI 18 000 €): amount on top */

.campaign__tier-text {
  margin-top: 14px;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ------------------------------------------------------------------ print: light panel, bar kept */

@media print {
  .campaign__panel,
  .campaign__card,
  .campaign__tier { break-inside: avoid; background: none; border: 1px solid #999; box-shadow: none; color: #000; }

  .campaign__caption,
  .campaign__progress { color: #000; }

  .campaign__bar,
  .campaign__fill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .campaign__bar { background: #ddd; }
  .campaign__fill { background: #777; }
}

/* ------------------------------------------------------------------ forced colours (Windows high contrast) */

/* The browser replaces backgrounds there, so the dark panel and the 37% bar would lose their shape (the text stays
   readable, the bar is decorative). System colours are kept: an edge round each, the fill in the highlight colour. */
@media (forced-colors: active) {
  .campaign__panel,
  .campaign__bar { border: 1px solid CanvasText; }

  .campaign__fill { background: Highlight; }
}
