/* Fundacja Leonarda — site styles.
 *
 * Tokens mirror the old WordPress theme (GreenShift presets); see docs/MIGRATION_PLAN.md R-G5.
 * Brand orange stays exact: white text on it is 4.38:1 — passes AA for large/bold text only (R-N2, accepted).
 */

@font-face {
    font-family: "Montserrat";
    src: url("../fonts/Montserrat-Variable.6ee754a25217.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Montserrat";
    src: url("../fonts/Montserrat-Italic-Variable.418da7b4c3c4.woff2") format("woff2");
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

:root {
    --color-magenta: #b80e7a;
    --color-orange: #d84522;
    --color-purple: #59428e;
    --color-white: #fff;
    --color-text: #000001;
    --color-text-muted: #333;
    --color-border-subtle: rgb(0 0 0 / 7%);

    --gradient-magenta-orange: linear-gradient(to bottom right, var(--color-magenta), var(--color-orange));
    --gradient-purple-orange: linear-gradient(to bottom right, var(--color-purple), var(--color-orange));

    --font-sans: "Montserrat", system-ui, sans-serif;

    --gutter: 1.25rem;
    --container: 1170px;
    --container-narrow: 1080px;
    --container-text: 760px;
    --radius-sm: 5px;
    --radius: 10px;
    --section-space: clamp(2.5rem, 6vw, 4.5rem);

    --nav-breakpoint: 768px; /* documentation only — media queries can't read custom properties */
}

/* Type scale. Re-declared on blocks with a text size (see "Text sizes"), so everything inside — headings, body,
 * captions — scales together. Sizes not on this scale multiply by --text-scale themselves. */
:root,
[data-text-size] {
    --text-xs: calc(0.8125rem * var(--text-scale, 1));
    --text-sm: calc(1rem * var(--text-scale, 1));
    --text-md: calc(1.2rem * var(--text-scale, 1));
    --text-lg: calc(clamp(1.4rem, 2.45vw, 1.75rem) * var(--text-scale, 1));
    --text-xl: calc(clamp(1.75rem, 3vw, 2.2rem) * var(--text-scale, 1));
    --text-2xl: calc(clamp(2.3rem, 4vw, 2.75rem) * var(--text-scale, 1));
    --text-stat: calc(clamp(2.8rem, 6vw, 3.6rem) * var(--text-scale, 1));
}

/* ---------- Base ---------- */

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

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

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: var(--color-white);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: var(--text-md);
    font-weight: 400;
    line-height: 1.7;
}

img,
svg,
video {
    max-width: 100%;
    height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.75em;
}

h1 { font-size: var(--text-xl); }
h2 { font-size: var(--text-lg); }
h3 { font-size: calc(1.45rem * var(--text-scale, 1)); }
h4,
h5 { font-size: var(--text-md); line-height: 1.2; }
h6 { font-size: var(--text-sm); line-height: 1.2; }

p,
ul,
ol {
    margin: 0 0 1em;
}

a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

a:hover {
    text-decoration: none;
}

:focus-visible {
    outline: 2px solid var(--color-magenta);
    outline-offset: 2px;
}

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

.skip-link {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2000;
    padding: 0.5rem 1rem;
    background: var(--color-magenta);
    color: var(--color-white);
    border-radius: var(--radius-sm);
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
}

/* ---------- Layout ---------- */

main {
    flex: 1 0 auto;
}

/* Page shown in its original language until translated (plan R-L2). */
.untranslated-notice {
    max-width: var(--container);
    margin: 1rem auto 0;
    padding: 0.75rem var(--gutter);
    border-left: 4px solid var(--color-purple);
    background: var(--color-border-subtle);
    color: var(--color-text);
    font-size: var(--text-sm);
}

.container {
    width: 100%;
    max-width: calc(var(--container) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.container--narrow { max-width: calc(var(--container-narrow) + 2 * var(--gutter)); }
.container--text { max-width: calc(var(--container-text) + 2 * var(--gutter)); }

.section {
    padding-block: var(--section-space);
}

.grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(var(--columns, 3), minmax(0, 1fr));
}

@media (max-width: 900px) {
    .grid { grid-template-columns: repeat(min(var(--columns, 3), 2), minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Tones (fixed palette editors pick from — R-E2) ---------- */

.tone-magenta { --tone: var(--color-magenta); }
.tone-orange { --tone: var(--color-orange); }
.tone-purple { --tone: var(--color-purple); }

.bg-magenta { background: var(--color-magenta); color: var(--color-white); --tone: var(--color-magenta); }
.bg-orange { background: var(--color-orange); color: var(--color-white); --tone: var(--color-orange); }
.bg-purple { background: var(--color-purple); color: var(--color-white); --tone: var(--color-purple); }
.bg-gradient-magenta-orange { background: var(--gradient-magenta-orange); color: var(--color-white); }
.bg-gradient-purple-orange { background: var(--gradient-purple-orange); color: var(--color-white); }

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border-subtle);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 132px;
    padding-inline: var(--gutter);
}

.site-header__logo {
    display: block;
    line-height: 0;
    flex-shrink: 0;
}

.site-header__logo img {
    width: 100px;
}

.site-nav__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav__link {
    position: relative;
    display: inline-block;
    padding: 0.25em 0;
    color: var(--color-text-muted);
    font-size: 16px;
    line-height: 1.7;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-nav__link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: var(--color-magenta);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.site-nav__link:hover {
    color: var(--color-magenta);
}

.site-nav__link:hover::after,
.site-nav__link.is-active::after {
    transform: scaleX(1);
}

/* Language switcher — <details> dropdown, works without JS */

.lang-switch {
    position: relative;
}

.lang-switch__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border: 1px solid rgb(0 0 0 / 12%);
    border-radius: 6px;
    color: var(--color-text-muted);
    line-height: 0;
    cursor: pointer;
    list-style: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.lang-switch__toggle::-webkit-details-marker {
    display: none;
}

.lang-switch__toggle:hover {
    background: rgb(0 0 0 / 3%);
    border-color: var(--color-magenta);
}

.lang-switch__code {
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1;
}

.lang-switch__chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.lang-switch[open] .lang-switch__chevron {
    transform: rotate(180deg);
}

.lang-switch__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1002;
    width: max-content;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: var(--color-white);
    border: 1px solid rgb(0 0 0 / 10%);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgb(0 0 0 / 12%);
}

.lang-switch__option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.lang-switch__option:hover,
.lang-switch__option:focus-visible {
    background: rgb(0 0 0 / 5%);
}

.lang-switch__option[aria-current] {
    opacity: 0.5;
}

.flag {
    display: block;
    flex-shrink: 0;
    width: 22px;
    height: auto;
    border: 1px solid rgb(0 0 0 / 10%);
    border-radius: 2px;
}

/* Mobile menu toggle — hidden on desktop and when JS is off (the menu then just wraps) */

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    z-index: 1001;
}

.nav-toggle__bars {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
}

.nav-toggle__bars > span {
    display: block;
    height: 2px;
    border-radius: 1px;
    background: var(--color-text-muted);
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
}

.nav-open .nav-toggle__bars > span { background: var(--color-white); }
.nav-open .nav-toggle__bars > span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-open .nav-toggle__bars > span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle__bars > span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 768px) {
    .site-header__inner {
        min-height: 120px;
    }

    .js .nav-toggle {
        display: flex;
    }

    .js .site-nav {
        position: fixed;
        inset: 0;
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow-y: auto;
        background: rgb(0 0 0 / 95%);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .js .nav-open .site-nav {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.3s ease, visibility 0s; /* visible at once, so JS can move focus into it */
    }

    .js .site-nav__list {
        flex-direction: column;
        gap: 24px;
        padding: 40px 20px;
        text-align: center;
    }

    .js .site-nav__link {
        color: var(--color-white);
        font-size: 24px;
        padding: 0.5em 0;
    }

    .js .site-nav__link:hover,
    .js .site-nav__link.is-active {
        color: var(--color-magenta); /* 3.1:1 on the overlay — OK, 24px counts as large text */
    }

    .js .site-nav__lang {
        align-self: stretch;
    }

    .js .lang-switch__toggle {
        justify-content: center;
        width: 100%;
        color: var(--color-white);
        border-color: rgb(255 255 255 / 25%);
    }

    .js .lang-switch__menu {
        position: static;
        width: 100%;
        margin-top: 12px;
        background: rgb(0 0 0 / 20%);
        border-color: rgb(255 255 255 / 20%);
        box-shadow: none;
    }

    .js .lang-switch__option {
        justify-content: center;
        color: var(--color-white);
        font-size: var(--text-sm);
    }

    .js .lang-switch__option:hover {
        background: rgb(255 255 255 / 8%);
    }
}

body.nav-locked {
    overflow: hidden;
}

/* ---------- Footer ---------- */

.site-footer {
    margin-top: 100px;
    padding: 40px var(--gutter) 36px;
    background: var(--color-magenta);
    border-top: 1px solid rgb(207 207 207 / 27%);
    color: #f0f0f0;
    font-size: var(--text-sm);
}

.site-footer a {
    color: var(--color-white);
}

.site-footer p {
    margin: 0;
}

.site-footer__social {
    display: flex;
    justify-content: center;
    gap: 26px;
    margin: 0 0 40px;
    padding: 0;
    list-style: none;
}

.site-footer__social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-white);
    color: #000;
    transition: transform 0.1s ease;
}

.site-footer__social a:hover {
    transform: scale(1.1);
}

.site-footer__social svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.site-footer__row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    padding-inline: 20px;
}

.site-footer__privacy { text-align: left; }
.site-footer__copy { text-align: center; }
.site-footer__terms { text-align: right; }

.site-footer__credit {
    margin-top: 48px !important;
    text-align: center;
    font-size: var(--text-xs);
}

@media (max-width: 768px) {
    .site-footer__row {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 1.5rem;
    }

    .site-footer__privacy,
    .site-footer__terms { text-align: center; }
    .site-footer__privacy:empty,
    .site-footer__terms:empty { display: none; }
}

/* ---------- Shape dividers ----------
 * Rendered by {% divider %}: an SVG that sits just outside its parent's top/bottom edge and takes the parent's
 * --tone (or currentColor). Parent needs .has-dividers. The two back layers are 50% opaque, as on the old site.
 */

.has-dividers {
    position: relative;
}

.divider {
    position: absolute;
    left: 0;
    display: block;
    width: 100%;
    height: var(--divider-height, 20px);
    fill: var(--tone, currentColor);
    pointer-events: none;
    transform: scale(var(--divider-sx, 1), var(--divider-sy, 1));
}

.divider path:not(:last-child) {
    opacity: 0.5;
}

/* 1px overlap hides the hairline gap some browsers leave between the SVG and the box */
.divider--top { bottom: calc(100% - 1px); }
.divider--bottom { top: calc(100% - 1px); }
.divider--flip-y { --divider-sy: -1; }
.divider--mirror { --divider-sx: -1; }
.divider--tabs { --divider-height: 12px; }

/* ---------- Headings ---------- */

.section-heading {
    margin-bottom: 1.5em;
    color: var(--tone, inherit);
    font-size: var(--text-xl);
    text-align: center;
}

/* As wide as its text, centred, but never past the page gutters (long titles wrap) */
.pill-heading {
    width: fit-content;
    max-width: calc(100% - 2 * var(--gutter));
    margin: 30px auto 60px;
    padding: 0.45em 2.8em;
    background: var(--tone, var(--color-magenta));
    border-radius: 2px;
    color: var(--color-white);
    font-size: var(--text-xl);
    font-weight: 700; /* also when it isn't a heading element (a project's subpages) */
    line-height: 1.3;
    text-align: center;
}

@media (max-width: 600px) {
    /* a long single word ("Transparentność") must still fit a 320px screen */
    .pill-heading { padding-inline: 1.2em; font-size: min(var(--text-xl), 7.5vw); overflow-wrap: break-word; }
}

/* The tab edges take the box colour, not the white text (currentColor) */
.pill-heading .divider { fill: var(--tone, var(--color-magenta)); }

/* ---------- Buttons ---------- */

.button {
    display: inline-block;
    padding: calc(0.5em + 2px) calc(1.333em + 2px);
    background: var(--tone, var(--color-purple));
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--color-white);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.2s ease;
}

.button:hover {
    filter: brightness(1.12);
}

.button--outline {
    background: transparent;
    border: 2px solid var(--tone, var(--color-purple));
    color: var(--tone, var(--color-purple));
}

/* ---------- Cards ---------- */

/* Solid colour card with wavy edges (Misja / Wizja / Cele, SZPI Prowadzące) */
.color-card {
    padding: 2.5rem 1.6rem 2rem;
    background: var(--tone);
    color: var(--color-white);
}

.color-card > :last-child { margin-bottom: 0; }

.color-card__title {
    margin-bottom: 1.6rem;
    font-size: var(--text-lg);
}

.color-card.has-dividers {
    margin-block: 20px; /* room for the waves */
}

/* Card with a paper-stack edge and drop shadow ("Kim jesteśmy?") */
.stacked-card {
    padding: 2rem 2rem 2.5rem;
    background: var(--tone);
    border-radius: 3px;
    color: var(--color-white);
    box-shadow: 0 10px 30px rgb(0 0 0 / 15%);
}

.stacked-card.has-dividers {
    margin-block: 12px;
}

.stacked-card > :last-child { margin-bottom: 0; }

/* Bordered card, image on top (Nasze Wartości, Nasze działania, testimonials) */
.border-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-white);
    border: 2px solid var(--tone, var(--color-magenta));
    border-radius: var(--radius);
    text-align: center;
}

.border-card__image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.border-card__title {
    margin: 0;
    color: var(--tone, var(--color-magenta));
    font-size: var(--text-sm);
    text-transform: uppercase;
}

.border-card__text {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.6;
}

/* Stat counter box */
.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 2rem 1.5rem;
    background: var(--tone, var(--color-purple));
    border-radius: var(--radius-sm);
    color: var(--color-white);
    text-align: center;
}

.stat__number {
    font-size: var(--text-stat);
    font-weight: 400;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stat__label {
    font-size: var(--text-sm);
    line-height: 1.25;
}

/* ---------- Coloured band (full-width section with wavy edges) ---------- */

.band {
    margin-block: 40px;
    padding-block: var(--section-space);
}

.band > :last-child { margin-bottom: 0; }

/* ---------- Rich text ---------- */

.text-center { text-align: center; }
.rich-text h2 { margin-top: 2.8rem; }
.rich-text h3 { margin-top: 1.8rem; }
.rich-text > :first-child { margin-top: 0; }
.rich-text > :last-child { margin-bottom: 0; }
.rich-text img { height: auto; }

/* ---------- Block streams ----------
 * Top-level blocks sit in the content column; sections choose their own width. Nested streams (inside sections and
 * columns) just stack.
 */

.stream > .block + .block {
    margin-top: var(--block-space, 3.5rem);
}

.stream:not(.stream--nested) {
    --block-space: clamp(2.5rem, 5vw, 4rem);
    margin-block: 2rem;
}

.stream:not(.stream--nested) > .block:not(.block--section) {
    width: 100%;
    max-width: calc(var(--container) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.stream--nested {
    --block-space: 1.75rem;
}

/* Text sizes — the "text size" option on blocks and sections (blocks.TEXT_SIZES). Steps of 15% of the type scale
 * (10% on phones, where the big sizes would crowd the screen). A block's own size replaces its section's. */
[data-text-size] {
    --text-step-size: 0.15;
    --text-scale: calc(1 + var(--text-step, 0) * var(--text-step-size));
    font-size: var(--text-md);
}

[data-text-size="small"] { --text-step: -1; }
[data-text-size="large"] { --text-step: 1; }
[data-text-size="x-large"] { --text-step: 2; }
[data-text-size="xx-large"] { --text-step: 3; }

@media (max-width: 600px) {
    [data-text-size] { --text-step-size: 0.1; }
}

/* Page titles with a size (pages.TitleSizeMixin): the scale above grows, the title stays on its own step of it */
.pill-heading[data-text-size],
.page-title[data-text-size] { font-size: var(--text-xl); }

@media (max-width: 600px) {
    .pill-heading[data-text-size] { font-size: min(var(--text-xl), 7.5vw); }
}

.block--heading + .block,
.stream > .block--heading + .block {
    margin-top: 0;
}

.bg-lavender { background: #ddd5f3; color: var(--color-text); --tone: #ddd5f3; }
.bg-gradient-magenta-orange,
.bg-gradient-purple-orange { --tone: var(--color-white); }

/* Section wrapper */
.section-block {
    margin-inline: auto;
    padding: var(--section-space) clamp(1.25rem, 5vw, 4rem);
}

.section-block--wide { max-width: var(--container); }
.section-block--narrow { max-width: var(--container-narrow); }
.section-block--full { padding-inline: var(--gutter); }
.section-block--full > .section-block__inner { max-width: var(--container); margin-inline: auto; }
.section-block.is-rounded { border-radius: 14px; }
.section-block.has-dividers { margin-block: 20px; }

@media (max-width: 1210px) {
    .section-block--wide,
    .section-block--narrow { margin-inline: var(--gutter); }
}

.section-block :where(h1, h2, h3, a) { color: inherit; }
.section-block[class*="bg-"]:not(.bg-lavender) .section-heading:not(.section-heading--box) { color: var(--color-white); }
.section-block .section-heading--box { color: var(--tone, var(--color-magenta)); }
.section-block .pill-heading { color: var(--color-white); }
.two-col .pill-heading { padding-inline: 1.4em; font-size: var(--text-lg); }

/* Two columns */
.two-col {
    display: grid;
    gap: clamp(2rem, 5vw, 4rem);
    grid-template-columns: 1fr 1fr;
    align-items: var(--two-col-align, start);
}

.two-col--2-1 { grid-template-columns: 2fr 1fr; }
.two-col--1-2 { grid-template-columns: 1fr 2fr; }
.two-col--align-center { --two-col-align: center; }

@media (max-width: 768px) {
    .two-col,
    .two-col--2-1,
    .two-col--1-2 { grid-template-columns: minmax(0, 1fr); }
    .two-col--reverse-mobile > :first-child { order: 2; }
}

/* ---------- Headings (block) ---------- */

.section-heading--left { text-align: left; }
.section-heading--plain { text-transform: none; }

.section-heading--box {
    display: table;
    margin: 0 auto;
    padding: 0.9em 1.6em;
    background: var(--color-white);
    border-radius: var(--radius);
    color: var(--tone, var(--color-magenta));
    font-size: var(--text-lg);
    text-align: center;
}

.page-title { margin-top: 2rem; }

.lead {
    max-width: 900px;
    margin: 0 auto 3rem;
    text-align: center;
}

.button-row {
    margin-top: 2rem;
    text-align: center;
}

/* ---------- Media ---------- */

.figure { margin: 0 auto; }
.figure img { display: block; width: 100%; height: auto; }
.figure--small { max-width: 200px; }
.figure--medium { max-width: 480px; }
.figure--large { max-width: 800px; }
.figure--left { margin-left: 0; }
.figure--right { margin-right: 0; }
.figure--frame-rounded img { border-radius: var(--radius); }
.figure--frame-shadow img { box-shadow: 0 10px 30px rgb(0 0 0 / 15%); }
.figure--frame-card img { padding: 1rem; background: var(--color-white); border-radius: 14px; }

/* "Text wraps around": the image floats out of its block and the text blocks after it flow beside it. Blocks
 * that aren't text start below it. On phones it's a normal (centred) image above the text. */
@media (min-width: 601px) {
    .figure--float-left,
    .figure--float-right { width: 50%; margin-block: 0.4rem 1.25rem; }
    .figure--float-left { float: left; margin-right: clamp(1.5rem, 3vw, 2.5rem); }
    .figure--float-right { float: right; margin-left: clamp(1.5rem, 3vw, 2.5rem); }
    .stream > .block:has(> .figure--float-left, > .figure--float-right) + .block { margin-top: 0; }
    .stream > .block:not(.block--rich_text, .block--centered_text, .block--heading, .block--image) { clear: both; }
    .stream::after { content: ""; display: table; clear: both; }
}
.figure figcaption { margin-top: 0.5rem; color: var(--color-text-muted); font-size: var(--text-sm); text-align: center; }

.gallery {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
}

.gallery__item { margin: 0; }
.gallery__item img { display: block; width: 100%; height: auto; border-radius: 4px; }
.gallery__link { display: block; transition: opacity 0.2s ease; }
.gallery__link:hover { opacity: 0.85; }
.gallery__item figcaption { margin-top: 0.4rem; font-size: var(--text-xs); }

/* Image shapes (blocks.IMAGE_SHAPES, core_tags.shaped_image). The server already cut the image to the shape;
 * the ratio here only matters for "Show whole image", which is letterboxed. */
.img-shape--landscape { aspect-ratio: 3 / 2; }
.img-shape--landscape-4-3 { aspect-ratio: 4 / 3; }
.img-shape--wide { aspect-ratio: 16 / 9; }
.img-shape--square,
.img-shape--circle { aspect-ratio: 1; }
.img-shape--portrait { aspect-ratio: 4 / 5; }
img[class*="img-shape--"] { height: auto; object-fit: cover; }
img.img-fit--contain { object-fit: contain; }
img.img-shape--circle { border-radius: 50%; }

.lightbox {
    max-width: min(95vw, 1400px);
    max-height: 95vh;
    padding: 0;
    background: transparent;
    border: 0;
    overflow: visible;
}

.lightbox::backdrop { background: rgb(0 0 0 / 88%); }
.lightbox img { display: block; max-width: min(95vw, 1400px); max-height: 85vh; width: auto; height: auto; margin: 0 auto; }
.lightbox__caption { margin: 0.75rem 0 0; color: var(--color-white); font-size: var(--text-sm); text-align: center; }

.lightbox__button {
    position: fixed;
    top: 50%;
    width: 48px;
    height: 48px;
    padding: 0;
    background: rgb(255 255 255 / 15%);
    border: 0;
    border-radius: 50%;
    color: var(--color-white);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}

.lightbox__button:hover { background: rgb(255 255 255 / 30%); }
.lightbox__button--prev { left: 1rem; }
.lightbox__button--next { right: 1rem; }
.lightbox__button--close { top: 1.5rem; right: 1rem; transform: none; }

.logo-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2rem 3rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.logo-row img { display: block; height: 120px; width: auto; } /* explicit height keeps lazy images from collapsing */

/* Partner marquee: two copies of the list scroll by half the track width, so the loop is seamless. */
.marquee {
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.marquee__track {
    display: flex;
    width: max-content;
    animation: marquee 35s linear infinite;
}

.marquee:hover .marquee__track,
.marquee:focus-within .marquee__track { animation-play-state: paused; }

.marquee__list {
    display: flex;
    align-items: center;
    gap: 4rem;
    margin: 0;
    padding: 0 2rem;
    list-style: none;
}

.marquee__list img { display: block; height: 70px; width: auto; max-width: 220px; object-fit: contain; }

@keyframes marquee {
    to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .marquee { mask-image: none; }
    .marquee__track { width: auto; animation: none; }
    .marquee__list { flex-wrap: wrap; justify-content: center; gap: 2rem 3rem; width: 100%; }
    .marquee__list[aria-hidden] { display: none; }
}

.map { position: relative; }
.map__canvas,
.map iframe { display: block; width: 100%; aspect-ratio: 1 / 1.07; border: 0; box-shadow: 0 10px 30px rgb(0 0 0 / 12%); }
.map__canvas { isolation: isolate; font: inherit; } /* keeps Leaflet's z-indexed panes under the sticky header */
.no-js .map__canvas { display: none; } /* Leaflet needs JS; the "larger map" link stays */
.map__canvas .leaflet-control-attribution { font-size: 11px; }
.map__pin { color: var(--color-magenta); filter: drop-shadow(0 2px 2px rgb(0 0 0 / 30%)); }
.map__pin svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.map__link { display: inline-block; margin-top: 0.5rem; font-size: var(--text-xs); }

/* ---------- Cards & lists ---------- */

.color-cards { align-items: start; }

/* "Last card tall": the others stack in the left column, the last one spans them on the right */
@media (min-width: 601px) {
    .color-cards--bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .color-cards--bento > * { grid-column: 1; }
    .color-cards--bento > :last-child { grid-column: 2; grid-row: 1 / span var(--rows); align-self: stretch; }
}

.outline-card {
    padding: 1.75rem 1.5rem;
    background: color-mix(in srgb, currentColor 9%, transparent);
    border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgb(0 0 0 / 10%);
    backdrop-filter: blur(6px);
}

.plain-card .color-card__title,
.outline-card .color-card__title,
.stacked-card .color-card__title { font-size: var(--text-lg); }

.rich-text p:last-child { margin-bottom: 0; }

.image-cards .border-card__image:not([class*="img-shape--"]) { aspect-ratio: auto; height: auto; }
.border-card__title { color: var(--tone, var(--color-magenta)); }

/* Whole card clickable via the title link */
.card-link { color: inherit; text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; }
.border-card,
.project-card,
.resource-card,
.meeting-tile { position: relative; }

.border-card:has(.card-link):hover,
.project-card:hover,
.resource-card:hover,
.meeting-tile:hover { box-shadow: 0 8px 24px rgb(0 0 0 / 10%); }

.stats { max-width: var(--container-narrow); margin-inline: auto; }

.project-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Sizes (editor's choice): on a full-width row 5 / 4 / 3 fit across; narrower rows wrap, centred */
.project-cards--small { --card-width: 220px; }
.project-cards--medium { --card-width: 270px; }
.project-cards--large { --card-width: 360px; }

.project-card {
    width: var(--card-width, 270px);
    max-width: 100%;
    overflow: hidden;
    background: var(--color-white);
    border: 3px solid var(--tone, var(--color-purple));
    border-radius: var(--radius);
    text-align: center;
    transition: box-shadow 0.2s ease;
}

.project-card img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }

.project-card__title {
    margin: 0;
    padding: 0.6rem 0.75rem;
    color: var(--tone, var(--color-purple));
    font-size: var(--text-sm);
    font-weight: 600;
}

.project-cards--large .project-card__title { padding: 0.8rem 1rem; font-size: var(--text-md); }

/* Phones: small cards two across, the others one across (large ones shrink to fit) */
@media (max-width: 600px) {
    .project-cards--small .project-card { width: calc((100% - 1.5rem) / 2); }
}

.testimonial {
    align-items: center;
    margin: 0;
    padding: 2rem 1.5rem;
}

.testimonial__photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; }

.testimonial__quote {
    flex: 1;
    margin: 0;
    font-size: var(--text-sm);
    font-style: italic;
    line-height: 1.75;
}

.testimonial figcaption { display: flex; flex-direction: column; gap: 1.5rem; }
.testimonial__name { color: var(--tone); font-weight: 700; font-size: var(--text-md); }
.testimonial__role { font-size: var(--text-sm); font-weight: 600; }

.team-member {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    align-items: start;
    gap: clamp(1.5rem, 4vw, 3.5rem);
    max-width: var(--container-narrow);
    margin-inline: auto;
}

.team-member__photo { width: 100%; height: auto; }
/* The photo column is the same width on either side, so every member's photo is the same size. */
.team-member--image-right { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.team-member--image-right .team-member__photo { order: 2; }
.team-member__name { margin-top: 0; }

@media (max-width: 768px) {
    .team-member { grid-template-columns: minmax(0, 1fr); }
    .team-member--image-right .team-member__photo { order: 0; }
}

.accordion { display: grid; gap: 0.75rem; }

.accordion__item {
    background: #f7f7f8;
    border: 1px solid rgb(0 0 0 / 10%);
}

.accordion__question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
    cursor: pointer;
    list-style: none;
}

.accordion__question::-webkit-details-marker { display: none; }

.accordion__question::after {
    content: "+";
    flex-shrink: 0;
    font-size: calc(1.6rem * var(--text-scale, 1));
    font-weight: 300;
    line-height: 1;
    transition: transform 0.2s ease;
}

.accordion__item[open] > .accordion__question::after { transform: rotate(45deg); }
.accordion__answer { padding: 0 1.1rem 1.1rem; font-size: var(--text-sm); }

.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; }

.icon-list {
    display: grid;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.icon-list li { display: flex; align-items: flex-start; gap: 0.75rem; }
.icon-list .icon { margin-top: 0.25em; width: 1em; height: 1em; }

.contact-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.contact-details--divided { padding-bottom: 1.5rem; border-bottom: 1px solid rgb(0 0 0 / 10%); }
.contact-details__row { display: flex; gap: 0.9rem; }
.contact-details__row .icon { margin-top: 0.2em; color: var(--color-magenta); }
.contact-details__label { margin: 0 0 0.3rem; font-size: var(--text-md); }
.contact-details__row p { margin: 0; color: #666; font-size: var(--text-sm); line-height: 1.4; }
.contact-details__row a { color: #666; }

@media (max-width: 480px) {
    .contact-details { grid-template-columns: minmax(0, 1fr); }
}

.cta-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    max-width: 860px;
    margin-inline: auto;
    padding: 2.5rem clamp(1.5rem, 5vw, 4rem);
    background: var(--tone);
    border-radius: 14px;
    color: var(--color-white);
}

.cta-box a { color: inherit; }
.cta-box__title { text-transform: uppercase; }
.cta-box__icon .icon { width: 64px; height: 64px; }

@media (max-width: 600px) { /* the icon goes above the text instead of squeezing it */
    .cta-box { flex-direction: column-reverse; align-items: flex-start; gap: 1rem; }
    .cta-box__icon .icon { width: 44px; height: 44px; }
}

/* Categories two to a row on wide screens, each file a card — as the old transparency block */
.documents {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
}

@media (min-width: 1024px) {
    .documents { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.documents__heading {
    margin: 0 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
    color: var(--color-text-muted);
    font-size: var(--text-lg);
    font-weight: 600;
}

.documents__list {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.documents__file,
.documents__empty {
    margin: 0;
    padding: 1rem;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.documents__file {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: inherit;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.documents__file:hover,
.documents__file:focus-visible {
    background: #f0f0f0;
    border-color: #ccc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.documents__file .icon { flex-shrink: 0; width: 1.5rem; height: 1.5rem; color: #8a9bb0; }
.documents__name { color: var(--color-text-muted); font-weight: 500; line-height: 1.4; }
.documents__meta { margin-left: auto; color: #666; font-size: var(--text-xs); }
.documents__empty { color: #666; font-style: italic; }

/* Resource database */
.resource-db__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    padding: 1.25rem 1rem;
    background: #f4f5f6;
    border: 1px solid rgb(0 0 0 / 10%);
    border-radius: 6px;
    font-size: var(--text-sm);
}

.resource-db__filters label { display: grid; gap: 0.4rem; font-weight: 600; }

.resource-db__filters select {
    min-width: 180px;
    max-width: 100%;
    padding: 0.55rem 0.7rem;
    background: var(--color-white);
    border: 1px solid #ccc;
    border-radius: 3px;
    font: inherit;
    font-weight: 400;
}

.resource-db__count { margin: 1.25rem 0; color: #666; font-size: var(--text-xs); }

.resource-db__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.resource-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    background: var(--color-white);
    border: 1px solid rgb(0 0 0 / 12%);
    border-radius: 6px;
    transition: box-shadow 0.2s ease;
}

.resource-card[hidden] { display: none; }
.resource-card__pills { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.75rem; }
.resource-card__description { flex: 1; margin: 0; font-size: var(--text-sm); line-height: 1.45; }

.resource-card__year {
    margin: 1rem 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid rgb(0 0 0 / 8%);
    color: #666;
    font-size: var(--text-xs);
}

.pill {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: calc(0.75rem * var(--text-scale, 1));
    font-weight: 600;
    line-height: 1.5;
}

.pill--type { background: #e3efff; color: #0b4fa8; }
.pill--who { background: #f3e3fa; color: #6a1b8a; }
.pill--language { background: #e2f4e6; color: #1d6b31; }

/* Meetings grid */
.meetings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.meeting-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    min-height: 160px;
    padding: 1.6rem 1.25rem 1.25rem;
    overflow: hidden;
    background: var(--color-white);
    border: 1px solid rgb(89 66 142 / 18%);
    border-radius: 16px;
    box-shadow: 0 4px 14px rgb(89 66 142 / 8%);
    color: var(--color-purple);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.meeting-tile::before { /* gradient top edge */
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(to right, var(--color-purple), var(--color-magenta), var(--color-orange));
}

.meeting-tile:hover,
.meeting-tile:focus-within {
    border-color: rgb(89 66 142 / 35%);
    box-shadow: 0 14px 32px rgb(89 66 142 / 18%);
    transform: translateY(-4px);
}

.meeting-tile:focus-within { outline: 2px solid var(--color-purple); outline-offset: 3px; }
.meeting-tile .card-link:focus-visible { outline: none; } /* the tile shows the focus ring */

.meeting-tile p { margin: 0; color: #5b5470; font-size: var(--text-sm); line-height: 1.4; }
.meeting-tile__title { margin: 0 0 0.35rem; color: var(--color-purple); font-size: var(--text-md); }
.meeting-tile__form { font-style: italic; }

.meeting-tile .meeting-tile__date {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: auto !important;
    padding: 0.25rem 0.8rem;
    background: #eee9f8;
    border-radius: 999px;
    color: var(--color-purple);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.03em;
}

.meeting-tile > :nth-last-child(2) { margin-bottom: 0.9rem; } /* room above the date chip */

.meeting-tile.is-upcoming {
    background: linear-gradient(135deg, var(--color-purple), var(--color-magenta));
    border-color: transparent;
    color: var(--color-white);
}

.meeting-tile.is-upcoming::before { display: none; }
.meeting-tile.is-upcoming p,
.meeting-tile.is-upcoming .meeting-tile__title { color: var(--color-white); }
.meeting-tile.is-upcoming .meeting-tile__date { background: rgb(255 255 255 / 18%); color: var(--color-white); }

.meeting-tile__badge {
    display: inline-block;
    padding: 0 0.5rem;
    background: var(--color-white);
    border-radius: 999px;
    color: var(--color-purple);
    font-size: calc(0.7rem * var(--text-scale, 1));
    text-transform: uppercase;
}

/* ---------- Meeting page (campaigns.MeetingPage) ----------
 * In the look of its campaign landing page: an opening card with waves, the report, then cards to the neighbouring
 * meetings.
 */

/* Opening card: purple into magenta top to bottom, so the magenta waves continue its bottom edge */
.meeting-hero {
    --tone: var(--color-magenta);
    max-width: var(--container);
    margin: 2rem auto 20px; /* 20px: room for the waves */
    padding: clamp(2.25rem, 6vw, 4.5rem) clamp(1.25rem, 5vw, 4rem) clamp(2rem, 5vw, 3.5rem);
    background:
        radial-gradient(circle at 92% 8%, rgb(255 255 255 / 16%), transparent 30%),
        radial-gradient(circle at 4% 40%, rgb(216 69 34 / 30%), transparent 32%),
        linear-gradient(to bottom, var(--color-purple), var(--color-magenta));
    border-radius: 18px 18px 0 0;
    color: var(--color-white);
}

@media (max-width: 1210px) {
    .meeting-hero { margin-inline: var(--gutter); }
}

.meeting-hero__inner { max-width: var(--container-text); margin-inline: auto; }

.meeting-hero__back {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    border: 1px solid rgb(255 255 255 / 40%);
    border-radius: 999px;
    color: inherit;
    font-size: var(--text-xs);
    text-decoration: none;
    transition: background 0.2s ease;
}

.meeting-hero__back:hover,
.meeting-hero__back:focus-visible { background: rgb(255 255 255 / 16%); }

.meeting-hero__title {
    margin: 1.1rem 0 1.6rem;
    color: inherit;
    font-size: clamp(2.1rem, 5.2vw, 3.6rem);
    line-height: 1.06;
    letter-spacing: -0.01em;
    overflow-wrap: break-word;
}

/* Date, topic and form as frosted chips */
.meeting-meta { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0; }

.meeting-meta > div {
    padding: 0.55rem 1rem;
    background: rgb(255 255 255 / 12%);
    border: 1px solid rgb(255 255 255 / 28%);
    border-radius: 14px;
    backdrop-filter: blur(6px);
}

.meeting-meta dt { opacity: 0.8; font-size: var(--text-xs); letter-spacing: 0.06em; text-transform: uppercase; }
.meeting-meta dd { margin: 0; font-weight: 600; }

.meeting-report { margin-top: clamp(2.5rem, 6vw, 4rem); }
.meeting-report .rich-text > p:first-child { font-size: var(--text-md); line-height: 1.6; }
.meeting-report .rich-text b { color: var(--color-purple); }

/* Neighbouring meetings: previous on the left, next on the right (stacked on phones) */
.meeting-nav { margin-block: clamp(3rem, 6vw, 4.5rem) clamp(3rem, 7vw, 5rem); }

.meeting-nav__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.meeting-nav__item--next { grid-column: 2; text-align: right; }

.meeting-nav__link {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    height: 100%;
    padding: 1.2rem 1.4rem 1.1rem;
    overflow: hidden;
    background: var(--color-white);
    border: 1px solid rgb(89 66 142 / 18%);
    border-radius: 16px;
    box-shadow: 0 4px 14px rgb(89 66 142 / 8%);
    color: var(--color-purple);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.meeting-nav__link::before { /* the meeting tiles' gradient top edge */
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(to right, var(--color-purple), var(--color-magenta), var(--color-orange));
}

.meeting-nav__link:hover,
.meeting-nav__link:focus-visible {
    border-color: rgb(89 66 142 / 35%);
    box-shadow: 0 14px 32px rgb(89 66 142 / 18%);
    transform: translateY(-4px);
}

.meeting-nav__label { color: #5b5470; font-size: var(--text-xs); letter-spacing: 0.06em; text-transform: uppercase; }
.meeting-nav__title { font-size: var(--text-md); font-weight: 700; }

@media (max-width: 600px) {
    .meeting-nav__list { grid-template-columns: minmax(0, 1fr); }
    .meeting-nav__item--next { grid-column: auto; }
}

/* Project article */
.project-header { padding-top: 2rem; text-align: center; }
.project-header__image { display: block; width: auto; max-height: 250px; margin: 0 auto; border-radius: 14px; }
.project-header .pill-heading { margin-top: 1rem; }
/* Subpages (products, news): the same pill and tabs as the project page, minus the photo, a little tighter */
.project-header--sub .pill-heading { margin-bottom: 50px; }

/* Project sections (the project page, its products, its news) right under the title, so nothing needs scrolling */
.project-nav { margin: -30px auto 40px; padding-inline: var(--gutter); }
.project-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.project-nav a {
    display: block;
    padding: 0.4em 1.1em;
    border: 2px solid var(--color-magenta);
    border-radius: 999px;
    color: var(--color-magenta);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.project-nav a:hover,
.project-nav a[aria-current] { background: var(--color-magenta); color: var(--color-white); }

/* News posts of a project (also the site-wide "Latest news" block) */
.project-news { padding-block: var(--section-space); }
.project-header + .project-news { padding-top: 0; } /* the archive: straight under the section nav */
.project-news__more { margin-top: 2rem; text-align: center; }

.news-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.news-card {
    position: relative;
    overflow: hidden;
    background: var(--color-white);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius);
    transition: box-shadow 0.2s ease;
}

.news-card:hover { box-shadow: 0 8px 24px rgb(0 0 0 / 10%); }
.news-card img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.news-card__text { padding: 1rem 1.2rem 1.3rem; }
.news-card__date,
.news-post__date { color: var(--color-text-muted); font-size: var(--text-xs); }
.news-card__title { margin: 0.3rem 0 0; color: var(--color-purple); font-size: var(--text-md); }
.news-card__excerpt { margin: 0.5rem 0 0; color: var(--color-text-muted); font-size: var(--text-sm); }

.news-post__header { margin-bottom: 2rem; text-align: center; }
.news-post__date { margin: 0 0 0.4rem; }
.news-post__title { margin: 0; font-size: var(--text-xl); line-height: 1.25; }
.news-post__image { display: block; width: 100%; height: auto; margin-bottom: 2rem; border-radius: var(--radius); }

/* "Latest news" block, compact layout: date + title per line */
.news-list { max-width: var(--container-text); margin: 0 auto; padding: 0; list-style: none; }
.news-list li { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--color-border-subtle); }
.news-list time { flex: 0 0 12em; color: var(--color-text-muted); font-size: var(--text-xs); line-height: 2; }
.news-list a { color: var(--color-purple); font-weight: 600; text-decoration: none; }
.news-list a:hover { text-decoration: underline; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 2.5rem; }
.article { margin-bottom: 2rem; }

/* ---------- Forms ---------- */

.form-block__heading { margin-top: 0; }
.form { display: grid; gap: 1.4rem; max-width: 560px; font-size: var(--text-sm); }
.form__field { display: grid; gap: 0.4rem; }
.form__field > label { font-weight: 700; }
.form__required { color: #d63638; }

.form input:not([type="checkbox"], [type="radio"]),
.form select,
.form textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: var(--color-white);
    border: 1px solid #b6b6b6;
    border-radius: 2px;
    color: var(--color-text);
    font: inherit;
}

.form textarea { min-height: 120px; resize: vertical; }
.form ::placeholder { color: #757575; opacity: 1; } /* 4.6:1 on white; Firefox dims placeholders by default */

.form input:focus,
.form textarea:focus,
.form select:focus {
    border-color: var(--color-magenta);
    outline: 2px solid var(--color-magenta);
    outline-offset: 0;
}

.form__field--checkbox { grid-template-columns: auto 1fr; align-items: start; column-gap: 0.6rem; }
.form__field--checkbox input { width: 1.1rem; height: 1.1rem; margin-top: 0.2rem; accent-color: var(--color-magenta); }
.form__field--checkbox label { font-weight: 400; }
.form__field--checkbox .form__error { grid-column: 1 / -1; }
.form__help { margin: 0; color: #666; font-size: var(--text-xs); }
.form__error,
.form__errors { color: #b3261e; font-size: var(--text-xs); font-weight: 600; }
.has-error input,
.has-error textarea { border-color: #b3261e; }
.form .button { justify-self: start; }

/* Honeypot: off-screen rather than display:none, so naive bots still fill it in */
.form__hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-thanks { padding-block: 2rem 4rem; text-align: center; }

/* ---------- Campaign landing page (SZPI) ----------
 * Stand-alone project pages (campaigns.CampaignLandingPage). Same blocks as everywhere, dressed up a little more.
 */

/* Opening section: soft light spots on the colour (kept off the bottom, where the waves continue it), the logo card
 * tilted beside a big title on wide screens */
.template-campaign .stream:not(.stream--nested) > .block--section:first-child .section-block {
    background:
        radial-gradient(circle at 6% 0%, rgb(255 255 255 / 14%), transparent 30%),
        radial-gradient(circle at 84% 45%, rgb(216 69 34 / 40%), transparent 34%),
        var(--tone);
    border-radius: 18px 18px 0 0;
}

.template-campaign .block--section:first-child .section-heading--left {
    margin-bottom: 0.5em;
    font-size: clamp(2rem, 4.6vw, 3.4rem);
    line-height: 1.08;
    letter-spacing: -0.01em;
}

.template-campaign .block--section:first-child .rich-text { max-width: 62ch; }
.template-campaign .block--section:first-child .rich-text > p:first-child { font-size: var(--text-md); }

.template-campaign .block--section:first-child .figure--frame-card img {
    box-shadow: 0 18px 40px rgb(0 0 0 / 22%);
    transform: rotate(4deg);
}

@media (max-width: 899px) {
    .template-campaign .block--section:first-child .figure { margin-inline: 0.5rem auto; } /* in line with the text */
    .template-campaign .block--section:first-child .figure img { width: 140px; }
}

@media (min-width: 900px) {
    .template-campaign .block--section:first-child .stream {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: clamp(2rem, 5vw, 5rem);
        align-items: center;
    }

    .template-campaign .block--section:first-child .stream > * { grid-column: 1; }
    .template-campaign .block--section:first-child .stream > .block--image { grid-column: 2; grid-row: 1 / span 3; }
    .template-campaign .block--section:first-child .stream > .block:nth-child(2) { margin-top: 0; }
}

/* Two columns with a lone heading beside text: the heading lines up with the text's first line and stays in view
 * while the text scrolls past */
.template-campaign .two-col { align-items: start; }
.template-campaign .two-col .pill-heading { margin: 0.75rem auto 0; }

@media (min-width: 769px) {
    .template-campaign .two-col__col:has(> .stream > .block--heading:only-child) {
        position: sticky;
        top: 2rem;
    }
}

/* White boxes on the gradient float a little, with room before the text under them */
.template-campaign .section-heading--box { box-shadow: 0 14px 34px rgb(0 0 0 / 16%); }
.template-campaign .stream > .block--heading:has(.section-heading--box) + .block { margin-top: 1.25rem; }
.template-campaign .stream--nested > .block--two_column + .block { margin-top: clamp(3rem, 6vw, 4.5rem); }

/* Plain section headings get a short gradient underline that draws itself in */
.template-campaign .section-heading--plain::after {
    content: "";
    display: block;
    width: 3.5rem;
    height: 4px;
    margin: 0.55em auto 0;
    background: linear-gradient(to right, var(--color-magenta), var(--color-orange));
    border-radius: 2px;
}

.template-campaign .section-block[class*="bg-"] .section-heading--plain::after { background: currentColor; }

.anim .template-campaign [data-animate].is-visible .section-heading--plain::after {
    animation: anim-grow-x 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s backwards;
}

@keyframes anim-grow-x { from { transform: scaleX(0); } }

/* Hearts in brand colour on white; on the coloured sections they stay white */
.template-campaign .icon-list { gap: 0.75rem; }
.template-campaign .section-block:not([class*="bg-"]) .icon-list .icon { color: var(--color-magenta); }

/* Contact box: the same light spots as the opening, and a heartbeat when it comes in or is hovered */
.template-campaign .cta-box {
    background:
        radial-gradient(circle at 90% 20%, rgb(255 255 255 / 16%), transparent 35%),
        radial-gradient(circle at 0% 100%, rgb(89 66 142 / 45%), transparent 50%),
        var(--tone);
    box-shadow: 0 20px 44px rgb(184 14 122 / 28%);
}

.template-campaign .cta-box a { font-weight: 600; text-underline-offset: 0.2em; }
.template-campaign .cta-box__icon .icon { transform-origin: center; }
.template-campaign .cta-box:hover .cta-box__icon .icon,
.anim .template-campaign [data-animate].is-visible .cta-box__icon .icon { animation: heartbeat 1.1s ease-in-out 0.5s; }

@keyframes heartbeat {
    0%, 60%, 100% { transform: scale(1); }
    15% { transform: scale(1.18); }
    30% { transform: scale(1); }
    45% { transform: scale(1.12); }
}

/* ---------- Motion ---------- */

/* Scroll animations — the "Animation" setting on blocks (off site-wide via Site settings → scroll animations).
 * Only under html.anim (set in <head> when fundacja.js can play them and the visitor hasn't asked for reduced
 * motion) do animated blocks start hidden; the script adds .is-visible as each scrolls into view. A staggered block
 * stays hidden as a whole until the script has marked its items ([data-anim-item] + --anim-index), then each item
 * plays in turn. Keyframes only fill backwards, so a played element is back to its own styles (hover lifts etc.).
 */
[data-animate] {
    --anim-name: anim-fade;
    --anim-duration: 0.7s;
    --anim-step: 0.1s; /* delay between staggered items */
}

[data-animate="fade-up"] { --anim-name: anim-fade-up; }
[data-animate="fade-left"] { --anim-name: anim-fade-left; }
[data-animate="fade-right"] { --anim-name: anim-fade-right; }
[data-animate="zoom"] { --anim-name: anim-zoom; }

.anim main { overflow-x: clip; } /* sideways slides must not widen the page on phones */

@media screen {
    .anim [data-animate]:not([data-stagger], .is-visible),
    .anim [data-stagger]:not(.anim-ready),
    .anim [data-anim-item]:not(.is-visible) { opacity: 0; }
}

.anim [data-animate]:not([data-stagger]).is-visible,
.anim [data-anim-item].is-visible {
    animation: var(--anim-name) var(--anim-duration) cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
    animation-delay: calc(var(--anim-index, 0) * var(--anim-step));
}

/* Shape dividers inside an animated block unfold outward from the box, front layer first. Scaled in the shape's own
 * coordinates, where the edge touching the box is always the anchor side (dividers' flips are on the <svg>). */
.anim [data-animate] .divider path {
    transform-box: view-box;
    transform-origin: 50% 0; /* waves: anchored at the top */
}

.anim [data-animate] .divider--tabs path { transform-origin: 50% 100%; }

@media screen {
    .anim [data-animate] .divider:not(.is-visible) path { transform: scaleY(0); }
}

.anim .divider.is-visible path {
    --layer-delay: 0s;
    animation: anim-unfold 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
    animation-delay: calc(var(--anim-index, 0) * var(--anim-step) + var(--unfold-delay, 0.2s) + var(--layer-delay));
}

.anim .pill-heading { --unfold-delay: 0.05s; } /* the tabs follow the zoom almost at once */

.anim .divider.is-visible path:nth-last-child(2) { --layer-delay: 0.12s; }
.anim .divider.is-visible path:nth-last-child(3) { --layer-delay: 0.24s; }

@keyframes anim-unfold { from { transform: scaleY(0); } }

@keyframes anim-fade { from { opacity: 0; } }
@keyframes anim-fade-up { from { opacity: 0; transform: translateY(2rem); } }
@keyframes anim-fade-left { from { opacity: 0; transform: translateX(-2.5rem); } }
@keyframes anim-fade-right { from { opacity: 0; transform: translateX(2.5rem); } }
@keyframes anim-zoom { from { opacity: 0; transform: scale(0.92); } }

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
