/* Malaika Africa – Kampagnen-Seite (#62), Option C of the Kampagne mock.
   Scoped to .ks-page; the Stand in the hero is the Kampagnen widget
   (stripe-campaign.css). Duda styles headings and text with
   `#dm div.dmContent h1` and the like, so the type rules here start with
   #ks-page.ks-page to outrank them. */
.ks-page { --ks-hero:#4470D9; --ks-ink:#3C3C3C; --ks-muted:#555; --ks-line:#DCE6FA; --ks-link:#4470D9;
  font-family: Montserrat, system-ui, sans-serif; color: var(--ks-ink); background: #fff; width: 100%; }
.ks-page *, .ks-page *::before, .ks-page *::after { box-sizing: border-box; }
#ks-page.ks-page :is(h1, h2, h3, p) { margin: 0; letter-spacing: normal; text-transform: none; }

.ks-hero { background: var(--ks-hero); color: #fff; padding: 64px 24px 72px; }
.ks-hero__inner { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
#ks-page.ks-page .ks-hero__title {
  font-family: 'Amatic SC', 'Amatic SC Fallback', cursive; font-weight: 700;
  font-size: clamp(52px, 8vw, 100px); line-height: .92; color: #fff; overflow-wrap: break-word;
}
/* The hero's columns (#156): the pitch (intro, Stand) and the donation
   flow (return message, inline form, widget). One column up to 960px,
   as if the wrappers weren't there – Duda's tablet page is 960px wide,
   so tablets keep it too; two columns wider (at the end). */
.ks-hero__pitch, .ks-hero__give { display: contents; }
#ks-page.ks-page .ks-hero__intro { max-width: 520px; font-size: 19px; line-height: 1.55; color: #fff; }
.ks-hero .ma-campaign { padding-top: 12px; }
/* Duda's `#dm div.dmContent p` outranks the widget's own sizes here. */
#ks-page.ks-page .ma-campaign p { font-size: 15px; line-height: 1.4; }

/* The inline donation form (#64), only while a running Kampagne's Stand
   is shown (stripe-campaign.js sets is-live) – and not while the donor is
   in the main widget's later steps (stripe-donate.js sets hidden). The
   widget itself keeps its own look (stripe-donate.css). */
.ks-hero .ks-donate { display: none; max-width: 520px; margin: 0; }
.ks-hero:has(.ma-campaign.is-live) .ks-donate:not([hidden]) { display: flex; flex-direction: column; gap: 14px; }
/* A browser without :has() (Firefox before 121) still gets the form, if
   then also without a Stand: better than no way to give. */
@supports not selector(:has(*)) {
  .ks-hero .ks-donate:not([hidden]) { display: flex; flex-direction: column; gap: 14px; }
}
.ks-hero .stripe-donate { width: 100%; max-width: 520px; box-sizing: border-box; margin: 0; }
.ks-hero .stripe-donate[hidden] { display: none; }
.ks-donate__label { font-size: 15px; font-weight: 700; }
.ks-donate__field { position: relative; }
/* Duda styles every `div.dmInner input[type="text"]` (grey, white border, 40 px). */
#ks-page.ks-page .ks-donate__input {
  width: 100%; box-sizing: border-box; height: auto; min-height: 64px; margin: 0; padding: 10px 52px 10px 16px;
  border: 1px solid #d0d0d0; border-radius: 10px; background: #fff; box-shadow: none;
  font: inherit; font-size: 32px; font-weight: 700; color: var(--ks-ink);
}
#ks-page.ks-page .ks-donate__input:focus { outline: 3px solid var(--ks-link); outline-offset: 1px; border-color: var(--ks-link); }
.ks-donate__currency {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-size: 28px; font-weight: 700; color: var(--ks-muted); pointer-events: none;
}
.ks-donate__picks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ks-donate .ks-donate__pick {
  appearance: none; min-height: 44px; padding: 10px 4px; border: 1px solid #d0d0d0; border-radius: 8px;
  background: #f7f7f7; color: var(--ks-ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.ks-donate .ks-donate__pick:hover { background: #f0f0f0; }
.ks-donate .ks-donate__pick[aria-pressed="true"] {
  border-color: var(--ks-link); background: #fff; box-shadow: 0 0 0 2px rgba(68, 112, 217, .18);
}
.ks-donate .ks-donate__pick:focus-visible, .ks-donate .ks-donate__submit:focus-visible { outline: 3px solid var(--ks-link); outline-offset: 2px; }
.ks-donate .sd-message { margin: 0; min-height: 0; }
.ks-donate .sd-message:empty { display: none; }
/* "Das sind X m² Land in Bwawani" (#65) – only for an amount. */
#ks-page.ks-page .ks-donate__area { font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--ks-link); }
#ks-page.ks-page .ks-donate__area:empty { display: none; }
#ks-page.ks-page .ks-donate .ks-donate__methods { font-size: 13px; line-height: 1.5; color: var(--ks-muted); text-align: center; }
/* After a redirect-based payment that failed or can't be confirmed – also
   when the form is hidden, so the donor always learns how it went. */
#ks-page.ks-page .ks-donate__return { max-width: 520px; box-sizing: border-box; font-size: 15px; line-height: 1.5; }
#ks-page.ks-page .ks-donate__return:empty { display: none; }
#ks-page.ks-page .ks-donate__return:not(:empty) { padding: 12px 16px; border-radius: 10px; background: #fff; color: #b3261e; }
#ks-page.ks-page .ks-donate__return.is-info { color: var(--ks-muted); }
/* The page resets paragraph margins; the widget's own spacing comes back. */
#ks-page.ks-page .stripe-donate .sd-legend { margin-bottom: 12px; }
#ks-page.ks-page .stripe-donate .sd-summary { margin-bottom: 14px; }

/* The 3-Ekari plot (#65): ten fields a row, filled from the left as the
   Stand grows (kampagnen-seite.js). Hidden with the Stand. */
.ks-plot { max-width: 820px; margin: 0 auto; padding: 56px 24px 0; display: flex; flex-direction: column; gap: 14px; }
.ks-plot[hidden] { display: none; }
#ks-page.ks-page .ks-plot h2 { margin-bottom: 6px; color: var(--ks-ink); font-size: 28px; line-height: 1.3; }
.ks-plot__grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.ks-plot__field { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 6px; background: #f3e9df; }
.ks-plot__fill { position: absolute; inset: 0 auto 0 0; background: var(--ks-hero); }
#ks-page.ks-page .ks-plot__done { font-size: 20px; line-height: 1.4; color: var(--ks-ink); }
#ks-page.ks-page .ks-plot__total { font-size: 15px; line-height: 1.5; color: var(--ks-muted); }

/* The story (#237): photo above the text, beside it from 700px on. */
.ks-story {
  max-width: 1200px; margin: 0 auto; padding: 56px 24px 0;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start;
}
.ks-story__photo { display: block; width: 100%; height: auto; border-radius: 16px; }
.ks-story__text { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
#ks-page.ks-page .ks-story h2 { margin-bottom: 6px; color: var(--ks-ink); font-size: 28px; line-height: 1.3; }
#ks-page.ks-page .ks-story p { font-size: 17px; line-height: 1.6; color: var(--ks-ink); }
@media (width >= 700px) {
  .ks-story { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; }
}

/* The banner (#238): the whole photo on a phone, wider screens cut sky
   and foreground; 40% keeps the buildings in view. Never
   taller than the screen, so the caption is seen with the photo. */
.ks-banner { margin: 56px 0 0; }
.ks-banner img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; max-height: 75vh; object-fit: cover; object-position: 50% 40%; }
.ks-banner figcaption { max-width: 1200px; margin: 0 auto; padding: 12px 24px 0; font-size: 15px; line-height: 1.5; color: var(--ks-muted); }
@media (width >= 700px) { .ks-banner img { aspect-ratio: 16 / 9; } }
@media (width > 960px) { .ks-banner img { aspect-ratio: 21 / 9; } }

.ks-tiles {
  max-width: 1200px; margin: 0 auto; padding: 56px 24px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 24px;
}
.ks-tile { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ks-tile img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; }
#ks-page.ks-page .ks-tile h2 { margin-top: 4px; color: var(--ks-ink); font-size: 20px; line-height: 1.3; }
#ks-page.ks-page .ks-tile p { font-size: 16px; line-height: 1.6; color: var(--ks-muted); }

.ks-faq { max-width: 820px; margin: 0 auto; padding: 24px 24px 96px; display: flex; flex-direction: column; gap: 12px; }
#ks-page.ks-page .ks-faq h2 { margin-bottom: 8px; color: var(--ks-ink); font-size: 28px; line-height: 1.3; }
.ks-faq details { border: 1px solid var(--ks-line); border-radius: 14px; }
.ks-faq summary { cursor: pointer; padding: 18px 22px; font-size: 17px; font-weight: 600; line-height: 1.4; }
.ks-faq summary:focus-visible { outline: 3px solid var(--ks-link); outline-offset: 2px; border-radius: 14px; }
#ks-page.ks-page .ks-faq details p { padding: 0 22px 18px; font-size: 16px; line-height: 1.6; color: var(--ks-muted); }

/* Four quick picks don't fit 44 px wide in the narrowest phones: two rows. */
@media (max-width: 374px) {
  .ks-donate__picks { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .ks-hero { padding: 48px 16px 56px; }
  .ks-hero .stripe-donate { padding: 18px; }
  .ks-plot { padding: 40px 16px 0; }
  .ks-plot__grid { gap: 4px; }
  .ks-story { padding: 40px 16px 0; }
  .ks-banner { margin-top: 40px; }
  .ks-banner figcaption { padding: 12px 16px 0; }
  .ks-tiles { padding: 40px 16px; }
  .ks-faq { padding: 16px 16px 72px; }
  .ks-faq summary { padding: 16px 18px; }
  #ks-page.ks-page .ks-faq details p { padding: 0 18px 16px; }
}

/* Wide screens: the title across the hero, the pitch left, the donation
   flow right and top-aligned with the intro. Its column keeps its place
   when the form is hidden (an ended Kampagne, no Stand). */
@media (width > 960px) {
  .ks-hero__inner {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
    column-gap: 48px; row-gap: 18px; align-items: start;
  }
  .ks-hero__title { grid-column: 1 / -1; }
  .ks-hero__pitch, .ks-hero__give { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
}
