/* =========================================================================
   IBD Resources Hub — design 1b "Soft Cards" (warm, rounded, human).
   Single consolidated stylesheet. Fonts, icons and flags are self-hosted
   (docs/ASSETS.md); nothing is pulled in via @import. Keep one definition
   per component; do not re-split into multiple files.
   ========================================================================= */

/*! Font: Hanken Grotesk, (c) The Hanken Grotesk Project Authors, SIL OFL 1.1
    (static/fonts/hanken-grotesk/v12/OFL.txt). Self-hosted variable font; see docs/ASSETS.md. */
/* One variable file per subset covers weights 400-800. unicode-range means a
   browser downloads latin-ext only if a page contains those characters. The
   latin file is preloaded in baseof.html. */
@font-face {
    font-family: "Hanken Grotesk";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url(/fonts/hanken-grotesk/v12/latin-ext.woff2) format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Hanken Grotesk";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url(/fonts/hanken-grotesk/v12/latin.woff2) format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* Colour tokens (design handoff, final) */
    --purple-700: #6B3AA0;      /* primary: buttons, links, tags, gradient start */
    --purple-900: #3B2350;      /* headings, dark text on light */
    --purple-500: #8A56C0;      /* hero gradient end */
    --purple-100: #F0E7F8;      /* tag pill background */
    --purple-50:  #F6F1FB;      /* callout background */
    --bg-page:    #F4EEFA;      /* page background (lavender tint) */
    --bg-card:    #FFFFFF;      /* cards, header bar */
    --text-body:  #34303A;
    --text-secondary: #54505C;  /* card body copy */
    --text-muted: #6C6572;      /* meta lines (darker than mockup for AA) */

    /* On-purple text */
    --on-purple-intro: #F1E6FA;
    --on-purple-caption: #E0CDF0;
    --on-purple-pill: #E7D8F5;

    /* Semantic tokens — these flip in dark mode; the raw purple fills above
       (brand mark, filled pills, hero gradient) stay the same in both themes. */
    --color-heading: #3B2350;
    --color-link: #6B3AA0;
    --callout-text: #5A4A68;
    --border-soft: #EFE8F5;
    --row-alt: #FBF9FD;

    color-scheme: light;

    /* Shape & elevation */
    --radius-card: 20px;
    --radius-hero: 22px;
    --radius-callout: 12px;
    --shadow-card: 0 12px 30px -18px rgba(60, 35, 80, .4);
    --shadow-card-hover: 0 16px 34px -16px rgba(60, 35, 80, .5);

    /* Layout */
    --container: 1200px;
    --gutter: 20px;

    --font-sans: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Dark theme. Applied by theme.js as <html data-theme="dark"> (stored
   preference, falling back to the system setting); toggled from the header. */
[data-theme="dark"] {
    --bg-page: #171221;
    --bg-card: #231A32;
    --text-body: #E8E2F0;
    --text-secondary: #C6BDD2;
    --text-muted: #9F95AD;
    --purple-100: #3B2C54;      /* pill / tag backgrounds */
    --purple-50: #2E2343;       /* callout background */
    --color-heading: #EDE4F8;
    --color-link: #C9A9F0;
    --callout-text: #D3C4E6;
    --border-soft: #3A2E50;
    --row-alt: #281F39;
    --shadow-card: 0 12px 30px -18px rgba(0, 0, 0, .75);
    --shadow-card-hover: 0 16px 34px -16px rgba(0, 0, 0, .85);

    color-scheme: dark;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-body);
    background-color: var(--bg-page);
}

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

/* Utilities */
.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;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    background: var(--purple-700);
    color: #fff;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 0 0 12px 0;
}
.skip-link:focus {
    left: 0;
}

/* Visible focus everywhere; white ring on purple surfaces */
:focus-visible {
    outline: 2px solid var(--color-link);
    outline-offset: 2px;
}
.hero__panel :focus-visible,
.nav-pill--primary:focus-visible,
.skip-link:focus-visible {
    outline-color: #fff;
}

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

/* =========================================================================
   Header — white bar, brand mark, pill nav
   ========================================================================= */
.site-header {
    background: var(--bg-card);
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-block: 22px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.brand__mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--purple-700);
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}
.brand__name {
    font-weight: 800;
    font-size: 19px;
    color: var(--color-heading);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}
.nav-pill {
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: 999px;
    text-decoration: none;
    transition: background-color .15s ease-out, color .15s ease-out;
}
/* Primary destinations (What is IBD? / Global): filled, most prominent */
.nav-pill--primary {
    background: var(--purple-700);
    color: #fff;
    padding: 8px 16px;
}
.nav-pill--primary:hover {
    background: #5C3189;
    color: #fff;
}
.nav-pill--primary.is-active {
    background: #5C3189;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
}
.nav-pill--primary .icon--globe {
    margin-right: 4px;
}
/* Secondary action (Submit Content): soft pastel */
.nav-pill--soft {
    background: var(--purple-100);
    color: var(--color-link);
}
.nav-pill--soft:hover {
    background: #E5D6F3;
    color: var(--color-link);
}
[data-theme="dark"] .nav-pill--soft:hover {
    background: #493866;
}

/* Rotating "What is IBD?/Crohn's?/Colitis?" term: all candidates stacked as
   hidden bold ghosts in one grid cell so the pill never changes width. */
.ibd-term {
    display: inline-grid;
    align-items: baseline;
    justify-items: start;
    margin-left: .35em;
}
.ibd-term > * {
    grid-area: 1 / 1;
    white-space: nowrap;
}
.ibd-term__ghost {
    visibility: hidden;
    font-weight: 800;
    pointer-events: none;
    user-select: none;
}
.ibd-term__value {
    transition: opacity .5s ease-in-out, font-weight .2s ease-in-out;
}

.site-header__tools {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Dark-mode toggle */
.theme-toggle {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .15s ease-out, color .15s ease-out;
}
.theme-toggle:hover {
    background: var(--purple-100);
    color: var(--color-heading);
}
.theme-toggle__light {
    display: none;
}
[data-theme="dark"] .theme-toggle__dark {
    display: none;
}
[data-theme="dark"] .theme-toggle__light {
    display: inline-block;
}

/* Mobile disclosure (shown <720px) */
.nav-disclosure {
    display: none;
    position: relative;
}
.nav-disclosure__button {
    list-style: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-heading);
    font-size: 18px;
}
.nav-disclosure__button::-webkit-details-marker {
    display: none;
}
.nav-disclosure[open] .nav-disclosure__button {
    background: var(--purple-100);
}
.nav-disclosure__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 50;
    min-width: 210px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nav-disclosure__panel a {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
}
.nav-disclosure__panel a:hover {
    background: var(--purple-100);
    color: var(--color-heading);
}
.nav-disclosure__panel a.is-primary {
    color: var(--color-link);
    font-weight: 700;
}
.nav-disclosure__panel a[aria-current="page"] {
    color: var(--color-link);
}

/* =========================================================================
   Hero — rounded gradient panel
   ========================================================================= */
.hero {
    width: 100%;
    max-width: calc(var(--container) + 2 * var(--gutter));
    margin-inline: auto;
    padding: 28px var(--gutter) 8px;
}
.hero__panel {
    background: linear-gradient(135deg, var(--purple-700), var(--purple-500));
    border-radius: var(--radius-hero);
    padding: 40px;
    color: #fff;
}

.hero__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}
.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--on-purple-pill);
    background: rgba(255, 255, 255, .14);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    text-decoration: none;
    transition: background-color .15s ease-out, color .15s ease-out;
}
.hero-pill .fi {
    width: 1.25em;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
/* Label steps down with viewport width: full name -> ISO-3 -> ISO-2.
   The flag is always shown; the accessible name (aria-label) stays full. */
.hero-pill__a3,
.hero-pill__a2 {
    display: none;
}
@media (max-width: 767.98px) {
    .hero-pill__name { display: none; }
    .hero-pill__a3   { display: inline; }
}
@media (max-width: 479.98px) {
    .hero-pill__a3 { display: none; }
    .hero-pill__a2 { display: inline; }
}
.hero-pill:hover {
    background: rgba(255, 255, 255, .26);
    color: #fff;
}
.hero-pill.is-active {
    background: #fff;
    color: #3B2350;   /* literal: white pill in both themes */
    font-weight: 700;
    padding: 6px 16px;
}

.hero__title {
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0 0 20px;
    /* no width cap: let the title use the panel (the mockup's 20ch cap left
       the right half of the hero empty at desktop widths) */
    color: #fff;
}
.hero__intro {
    font-size: 17px;
    line-height: 1.65;
    margin: 0;
    color: var(--on-purple-intro);
    max-width: 80ch;
}
.hero__intro a {
    color: #fff;
    text-decoration: underline;
}

.hero__stats {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 16px 40px;
    margin: 28px 0 0;
    padding: 0;
}
.hero__stat {
    display: flex;
    flex-direction: column;
}
.hero__stat-number {
    font-size: 34px;
    font-weight: 800;
}
.hero__stat-caption {
    font-size: 13px;
    color: var(--on-purple-caption);
}


/* =========================================================================
   Resource pages — section headings + card grid
   Direct children of .content-grid span the full row; org cards flow into
   the responsive columns.
   ========================================================================= */
.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 8px 0 52px;
}
.content-grid > * {
    grid-column: 1 / -1;
    min-width: 0;
}
.content-grid > .entity {
    grid-column: auto;
}
.content-grid > h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-heading);
    margin-top: 14px;
}
.content-grid > h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--color-heading);
}
/* Prose paragraphs become soft cards that sit in the SAME grid track as the org
   cards, so a section's text blocks wrap across the columns exactly as the org
   cards do (AU's two intro paragraphs sit side by side at >=768px) and every card
   on the page shares one width. Text is not split into newspaper columns: the
   card is already a comfortable measure, and column-splitting inside a card made
   short paragraphs leave half the card empty. */
.content-grid > p {
    grid-column: auto;
    background: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 26px 30px;
    line-height: 1.7;
}
/* Prose card with a content icon ({{< card >}} shortcode): same card surface and
   grid track as a plain prose paragraph. The icon tile floats left so the text wraps beside it and then underneath,
   rather than the tile taking a row of its own; flow-root contains the float. */
.content-grid > .info-card {
    grid-column: auto;
    /* Size to its own text instead of stretching to the tallest card in the
       row (a two-line intro next to a long org card became a mostly empty box). */
    align-self: start;
    display: flow-root;
    background: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 24px;
    line-height: 1.7;
}
.info-card__icon {
    float: left;
    width: 96px;
    height: 96px;
    border-radius: 14px;
    margin: 4px 14px 4px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--purple-100);
    color: var(--color-link);
    /* Glyph fills most of the tile (~18px of tint around it), so the icon
       reads at a similar visual weight to an org logo without a wide empty
       margin inside the tile. */
    font-size: 60px;
}
/* Full-row variant for one-line lead-ins (card shortcode `wide="true"`): the
   tile and text sit in one compact band instead of a half-empty grid cell. */
.content-grid > .info-card--wide {
    grid-column: 1 / -1;
}
.info-card--wide .info-card__body {
    min-height: 96px;
    display: flex;
    align-items: center;
}
.info-card__body > p + p {
    margin-top: 1em;
}
.info-card__body a {
    text-decoration: underline;
}
.content-grid > ul,
.content-grid > ol {
    line-height: 1.65;
}
.content-grid > p a,
.content-grid > ul a,
.content-grid > ol a {
    text-decoration: underline;
}
.content-grid > ul {
    padding-left: 22px;
}
.content-grid > hr {
    border: 0;
    border-top: 1px solid var(--border-soft);
}

/*! Icons: Font Awesome Free 6.4.0 by @fontawesome, https://fontawesome.com
    License: CC BY 4.0 (icons). Self-hosted as inline SVG; see docs/ASSETS.md. */
/* Inline SVG icons (partials/icon.html). 1em tall like the old icon font, width
   from each icon's viewBox, coloured by the surrounding text. */
.icon {
    /* No `display` here: components toggle icons with display:none (e.g. the
       theme toggle), and a later display rule would override them. */
    height: 1em;
    width: auto;
    vertical-align: -0.125em;
    fill: currentColor;
    overflow: visible;
}

/*! Flags: flag-icons 7.3.2 by lipis, https://github.com/lipis/flag-icons (MIT).
    Self-hosted; only the flags the site uses are shipped (docs/ASSETS.md). */
/* Country flags: <span class="fi fi-xx">. The image is a CSS background, so a
   browser only downloads the flags present on the page it is viewing. To add
   a flag: copy flags/4x3/<code>.svg to static/flags/<version>/ and add one
   .fi-<code> line below. */
.fi {
    position: relative;
    display: inline-block;
    width: 1.333333em;
    line-height: 1em;
    background-size: contain;
    background-position: 50%;
    background-repeat: no-repeat;
}
.fi::before {
    content: "\00a0";  /* non-breaking space gives the empty span its 1em height */
}
.fi-au { background-image: url(/flags/7.3.2/au.svg); }
.fi-ca { background-image: url(/flags/7.3.2/ca.svg); }
.fi-eu { background-image: url(/flags/7.3.2/eu.svg); }
.fi-gb { background-image: url(/flags/7.3.2/gb.svg); }
.fi-mx { background-image: url(/flags/7.3.2/mx.svg); }
.fi-nz { background-image: url(/flags/7.3.2/nz.svg); }
.fi-us { background-image: url(/flags/7.3.2/us.svg); }

/* Flags / icons inside content headings */
h1 .fi, h2 .fi, h3 .fi {
    width: 1.1em;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
    margin-right: 6px;
}
h2 .icon--globe, h1 .icon--globe {
    color: var(--color-link);
    margin-right: 6px;
}

/* =========================================================================
   Org card ("Soft Card")
   ========================================================================= */
.entity {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 28px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    transition: transform .15s ease-out, box-shadow .15s ease-out;
}
.entity:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

.entity__head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.entity__logo {
    width: 112px;
    height: 112px;
    border-radius: 14px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* no background: several logos have a baked-in white background that
       clashed with the old pastel slot */
}
.entity__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
/* Theme-specific logo variants (entity `logo_dark` param) */
.logo--dark {
    display: none;
}
[data-theme="dark"] .logo--light {
    display: none;
}
[data-theme="dark"] .logo--dark {
    display: block;
}
/* Logos without a dark variant sit on a light chip in dark mode, so
   white-background artwork doesn't glare and dark artwork stays legible.
   Logos that supply a logo_dark variant are made for dark and keep the bare
   slot. Degrades safely: browsers without :has() just show the bare logo. */
[data-theme="dark"] .entity__logo:not(:has(.logo--dark)) {
    background: #EFEAF5;
    padding: 8px;
}
.entity__name {
    font-size: 18px;
    line-height: 1.2;
    font-weight: 800;
    color: var(--color-heading);
    margin: 0;
}
.entity__name a {
    color: inherit;
    text-decoration: none;
}
.entity__name a:hover,
.entity__name a:focus {
    color: var(--color-link);
    text-decoration: underline;
}
.entity__meta {
    font-size: 13px;
    color: var(--text-muted);
    margin: 3px 0 0;
}
.entity__scope + .entity__location::before {
    content: " · ";
}
.entity__meta .fi {
    width: 1.1em;
    border-radius: 2px;
    margin-right: 2px;
}
.entity__meta .icon--globe {
    color: var(--color-link);
}

.entity__tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
    padding: 0;
}
.entity-tag {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-link);
    background: var(--purple-100);
    padding: 4px 11px;
    border-radius: 999px;
}

.entity__callout {
    background: var(--purple-50);
    border-radius: var(--radius-callout);
    padding: 12px 14px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--callout-text);
    margin-bottom: 14px;
}
.entity__callout a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
    text-underline-offset: 2px;
}
.entity__callout a:hover,
.entity__callout a:focus-visible {
    text-decoration-color: currentColor;
}

.entity__body {
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text-secondary);
}
.entity__body p {
    margin: 0 0 12px;
}
.entity__body ul,
.entity__body ol {
    margin: 0 0 12px;
    padding-left: 20px;
}
.entity__body li {
    margin-bottom: 4px;
}
.entity__body a {
    color: var(--color-link);
    text-decoration: underline;
}
.entity__body > :last-child {
    margin-bottom: 0;
}

.entity__more {
    margin-top: auto;
    padding-top: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-link);
    text-decoration: none;
    align-self: flex-start;
}
.entity__more:hover,
.entity__more:focus {
    text-decoration: underline;
}

/* =========================================================================
   Educational prose page ("What is IBD?") — white rounded card
   ========================================================================= */
.prose-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 44px;
    margin: 8px auto 52px;
    max-width: calc(72ch + 88px);
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-secondary);
}
.prose-card h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-heading);
    margin: 36px 0 14px;
}
.prose-card h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--color-heading);
    margin: 28px 0 12px;
}
.prose-card > :first-child {
    margin-top: 0;
}
.prose-card p {
    margin: 0 0 16px;
}
.prose-card ul,
.prose-card ol {
    margin: 0 0 16px;
    padding-left: 24px;
}
.prose-card li {
    margin-bottom: 6px;
}
.prose-card a {
    text-decoration: underline;
}
.prose-card strong {
    color: var(--text-body);
}
.prose-card hr {
    border: 0;
    border-top: 1px solid var(--border-soft);
    margin: 32px 0;
}

/* =========================================================================
   Donate page (/<country>/donate/) — priority picker + reorderable org cards
   ========================================================================= */
.donate-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 8px 0 52px;
}
.donate-page .donate-intro,
.donate-page .prose-card {
    margin: 0;
    max-width: none;
}
.donate-page .content-grid {
    padding: 0;
}

.priority-picker {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 26px 30px;
}
.priority-picker h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--color-heading);
    margin: 0 0 6px;
}
.priority-picker__hint {
    color: var(--text-secondary);
    margin: 0 0 18px;
    font-size: 14.5px;
}
.priority-picker__noscript {
    color: var(--text-muted);
    font-size: 13px;
    margin: 14px 0 0;
}
.priority-picker__options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.priority-option {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-callout);
    background: var(--purple-50);
    cursor: pointer;
    transition: border-color .15s ease-out, background-color .15s ease-out;
}
.priority-option:has(input:checked) {
    border-color: var(--purple-700);
    background: var(--purple-100);
}
.priority-option__row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14.5px;
    color: var(--color-heading);
}
.priority-option input[type="checkbox"] {
    accent-color: var(--purple-700);
    width: 16px;
    height: 16px;
    flex: none;
}
.priority-option__description {
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--text-muted);
}

.donate-card {
    transition: opacity .15s ease-out, transform .15s ease-out, box-shadow .15s ease-out;
}
.donate-card--nomatch {
    opacity: .55;
}
.entity-tag.is-selected {
    outline: 2px solid var(--color-link);
    outline-offset: -1px;
    font-weight: 800;
}
.donate-card__match {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-link);
    margin: 0 0 14px;
}
.donate-cta {
    margin-top: auto;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--purple-700);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: 999px;
    text-decoration: none;
    transition: transform .15s ease-out, box-shadow .15s ease-out, background-color .15s ease-out;
}
.donate-cta:hover,
.donate-cta:focus-visible {
    background: #5C3189;
    transform: translateY(-1px);
    box-shadow: var(--shadow-card-hover);
}

@media (max-width: 719.98px) {
    .priority-picker {
        padding: 20px 22px;
    }
}

/* Comparison table */
.custom-table {
    width: 100%;
    border-collapse: collapse;
    margin: 22px 0;
    font-size: 15px;
    border-radius: var(--radius-callout);
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--border-soft);
}
.custom-table th {
    background: var(--purple-100);
    color: var(--color-heading);
    font-weight: 700;
    text-align: left;
    padding: 12px 14px;
}
.custom-table td {
    padding: 12px 14px;
    border-top: 1px solid var(--border-soft);
}
.custom-table tr:nth-child(even) td {
    background: var(--row-alt);
}

/* References */
ol.references {
    padding-left: 20px;
    margin-top: 22px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text-muted);
}
ol.references li {
    margin-bottom: 8px;
}
.reference-link {
    color: var(--color-link);
    text-decoration: none;
}
.reference-link:hover {
    text-decoration: underline;
}

/* =========================================================================
   Homepage — hero + country cards
   ========================================================================= */
.error-actions {
    padding: 8px 0 52px;
    font-size: 17px;
    font-weight: 700;
}
.error-actions a {
    text-decoration: underline;
}
.home-picker__title {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-heading);
    margin: 28px 0 20px;
}
.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding-bottom: 52px;
}
.country-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 20px 24px;
    box-shadow: var(--shadow-card);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-heading);
    text-decoration: none;
    transition: transform .15s ease-out, box-shadow .15s ease-out, color .15s ease-out;
}
.country-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    color: var(--color-link);
}
.country-card .fi {
    font-size: 22px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
}
.country-card--global {
    grid-column: 1 / -1;
    justify-content: center;
    background: var(--purple-50);
}
.country-card--global .icon {
    color: var(--color-link);
    font-size: 18px;
}

/* List/taxonomy pages (rare) */
.list-content,
.terms-content,
.taxonomy-content {
    width: 100%;
    max-width: calc(var(--container) + 2 * var(--gutter));
    margin-inline: auto;
    padding: 28px var(--gutter) 52px;
}
.list-content h1,
.terms-content h1,
.taxonomy-content h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-heading);
    margin-bottom: 16px;
}
.list-content ul,
.terms-content ul,
.taxonomy-content ul {
    padding-left: 22px;
    line-height: 1.8;
}

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
    padding: 20px 0 44px;
    color: var(--color-heading);
}
.site-footer__inner {
    text-align: center;
    display: grid;
    gap: 8px;
}
.site-footer__global {
    font-size: 15px;
}
.site-footer__global a {
    font-weight: 700;
    text-decoration: underline;
}
.site-footer__meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (min-width: 720px) {
    :root {
        --gutter: 44px;
    }
}

@media (max-width: 719.98px) {
    .site-header__inner {
        padding-block: 16px;
    }
    .site-nav {
        display: none;   /* replaced by the disclosure; also hidden from AT */
    }
    .nav-disclosure {
        display: block;
    }
    .hero__panel {
        padding: 28px 22px;
    }
    .hero__stats {
        gap: 14px 28px;
    }
    .prose-card {
        padding: 26px 20px;
    }
    .entity {
        padding: 22px;
    }
    .entity__logo {
        width: 88px;
        height: 88px;
    }
    /* Smaller than the mobile logo slot: floated beside text on a ~350px card,
       a 64px tile keeps a readable text column next to it. */
    .info-card__icon {
        width: 64px;
        height: 64px;
        border-radius: 12px;
        margin: 4px 12px 2px 0;
        font-size: 40px;
    }
    .content-grid > .info-card {
        padding: 18px 20px;
    }
    .info-card--wide .info-card__body {
        min-height: 64px;
    }
    .content-grid > p {
        padding: 20px 22px;
    }
}

@media (min-width: 768px) {
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1600px) {
    :root {
        --container: 1500px;
    }
    .content-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Very narrow phones: stack the card header */
@media (max-width: 360px) {
    .entity__head {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
    .entity:hover,
    .country-card:hover {
        transform: none;
    }
}
