/* =========================================================
   Entangle Base — base styles
   Type: Source Sans 3 (body) + Source Serif 4 (display) — neutral defaults;
   a child theme rebrands via theme.json presets (palette, fontFamilies).
   ========================================================= */

/* Fonts are self-hosted — see assets/css/fonts.css (enqueued in functions.php). */

:root {
  /* ----- Color tokens -----
     Hooked into the WP presets from theme.json: rebrand = change the palette in theme.json,
     base recolors itself. Fallback = the default value (in case the preset is missing). */
  --color-bg: var(--wp--preset--color--bg, #ffffff);             /* page background */
  --color-bg-alt: var(--wp--preset--color--surface, #f4f4f5);
  --color-ink: var(--wp--preset--color--ink, #18181b);           /* primary text */
  --color-ink-soft: var(--wp--preset--color--ink-soft, #52525b); /* muted derivative */
  --color-brand: var(--wp--preset--color--brand, #2563eb);       /* brand accent */
  --color-brand-deep: var(--wp--preset--color--brand-deep, #1d4ed8);
  --color-brand-soft: var(--wp--preset--color--brand-soft, #dbeafe);
  --color-status-running: hsl(140, 60%, 28%); /* outside palette — WCAG AA on a light background (~5.6:1) */
  --color-status-done: #525252;               /* outside palette — "Done" */
  --color-rule: var(--wp--preset--color--rule, rgba(24, 24, 27, 0.12));

  /* Accent palette — use sparingly, as an accent */
  --accent-orange: var(--wp--preset--color--accent-orange, #ea580c);
  --accent-yellow: var(--wp--preset--color--accent-yellow, #ca8a04);
  --accent-indigo: var(--wp--preset--color--accent-indigo, #4f46e5);
  --accent-blue:   var(--wp--preset--color--accent-blue, #2563eb);
  --accent-teal:   var(--wp--preset--color--accent-teal, #0d9488);
  --accent-green:  var(--wp--preset--color--accent-green, #16a34a);

  /* ----- Type ----- (hooked into theme.json fontFamilies) */
  --font-sans: var(--wp--preset--font-family--sans, "Source Sans 3", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif);
  --font-serif: var(--wp--preset--font-family--serif, "Source Serif 4", Georgia, "Times New Roman", serif);

  /* ----- Spacing scale ----- (rem — scales with the user font; root = 16px, values identical) */
  --space-1: 0.25rem;  /* 4px  */
  --space-2: 0.5rem;   /* 8px  */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.5rem;   /* 24px */
  --space-6: 2rem;     /* 32px */
  --space-7: 3rem;     /* 48px */
  --space-8: 4rem;     /* 64px */
  --space-9: 6rem;     /* 96px */
  --space-10: 8rem;    /* 128px */

  /* ----- Layout ----- (hooked into theme.json → settings.custom) */
  --container: var(--wp--custom--container, 1920px);
  --gutter: var(--wp--custom--gutter, 40px);
  --grid-gap: var(--wp--custom--grid-gap, 24px); /* column/row gap of every block grid (posts, cards, projects, team, ...): 0 = cells touch (Agora vgrid look), up to ~64px airy */
  --color-placeholder: var(--color-bg-alt); /* neutral media placeholder */
  --color-card: #ffffff; /* card / cell surface (cards, donors, timeline, report list) — white by default regardless of page tone; a child may point it at a palette color */

  /* ----- Header / logo (per-web knob) ----- */
  --logo-h: 96px;
  --logo-h-stuck: 52px;

  /* ----- Misc design tokens (per-web knobs) ----- */
  --color-on-brand: #fff;
  --color-rule-solid: #d9d9dc;
  /* Corner radius scale — BRAND knob, default square (0). A child sets
     theme.json custom.radius (panels/cards/media, e.g. 12px) and optionally
     custom.radius-sm (small chrome: chips, inputs, dropdown items; defaults
     to half of --radius). --radius-pill / --radius-full stay geometric
     (pills, circles) - not part of the brand scale. */
  --radius: var(--wp--custom--radius, 0px);
  --radius-sm: var(--wp--custom--radius-sm, calc(var(--radius) / 2));
  --radius-media: var(--radius);
  --radius-pill: 999px;
  --radius-full: 50%;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
  --ease-emphasized: cubic-bezier(.2, .7, .2, 1);
}

@media (max-width: 768px) {
  :root { --gutter: 20px; }
}
@media (max-width: 980px) {
  :root { --logo-h: 62px; --logo-h-stuck: 44px; }
}
@media (max-width: 600px) {
  :root { --logo-h: 56px; --logo-h-stuck: 38px; }
}

* { box-sizing: border-box; }

/* Root stays at 16px so rem values match the designed px (otherwise all
   rem would be computed from the body size ~19px and the text would be inflated).
   The body text size is set separately on <body> below. */
html { font-size: 100%; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-size: var(--wp--preset--font-size--body, clamp(0.9375rem, 0.83125rem + 0.45vw, 1.1875rem));
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---- Accessibility: skip-link + visible focus ---- */
.skip-link {
  position: absolute;
  left: 8px;
  top: -64px;
  z-index: 1000;
  background: var(--color-brand);
  color: var(--color-on-brand);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 0; }
:is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
  border-radius: var(--radius-media);
}
#main-content:focus { outline: none; }

/* Links in paragraphs (content text): brand color, underline, on hover
   a subtle brand-color glow (linear transition). */
p a {
  color: var(--color-brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  border-radius: var(--radius-sm);
  transition: background-color 0.18s linear;
}
p a:hover,
p a:focus-visible {
  background-color: color-mix(in srgb, var(--color-brand) 10%, transparent);
}

img, svg { display: block; max-width: 100%; }

/* ---------- Typography ---------- */
.display {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.75rem, 6.2vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--color-ink); /* headings are ink; brand is an inline accent only (THEME-STANDARD). A child may repaint. */
  margin: 0;
  text-wrap: balance;
}

.h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2rem, 3.4vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--color-ink); /* see .display — ink by default, child repaints */
  margin: 0;
}

.h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
}

.h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.375rem;
  line-height: 1.25;
  letter-spacing: -0.005em;
  margin: 0;
}

.h5 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.3;
  margin: 0;
}

.h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.4;
  letter-spacing: 0.01em;
  margin: 0;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-brand);
}

.body-lg {
  font-size: 1.125rem;
  line-height: 1.55;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* .wrap = the deployment-playbook alias of .container (hero-cta and per-site
   page compositions use it). Defined here so section blocks using it work
   out of the box on a bare base; a child redefining it with the same tokens
   is a harmless no-op. */
.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  box-sizing: border-box;
}

/* ---------- Root chrome: no block gap between header / main / footer ----------
   theme.json's root blockGap (24px) applies to every direct child of
   .wp-site-blocks — i.e. between the header, <main> and the footer. Chrome is
   not content: those touch. Vertical rhythm under the header belongs to the
   CONTENT (hero top padding, the page-title hero, section rhythm), so a
   front-page hero can sit flush against the header. Applied at all widths
   (used to be mobile-only). */
.wp-site-blocks > * + * { margin-block-start: 0; }

/* ---------- Content-area layout convention ----------
   SECTIONS OWN THEIR LAYOUT: a block rendering a <section> root (hero, cards,
   posts, …), any .alignfull/.alignwide, and .sec/.container groups span the
   full width and wrap their own inner .container — backgrounds may run edge
   to edge.

   LOOSE BLOCKS dropped directly into a FLOW content area (front-page style
   compositions) get the container treatment automatically: aligned with the
   header (logo/menu), width follows --container, side gutter always kept —
   both knobs per site via theme.json custom.container/gutter. The allowlist
   below names them explicitly (core loose blocks + the content-width entangle
   blocks) because tags/classes are identical on the frontend AND in the
   editor canvas — a tag-based exclusion would lie in the editor, where
   dynamic section blocks render inside a <div> wrapper.

   Applies ONLY to post-content sitting DIRECTLY in main.site-main (front-page
   style compositions) - templates that wrap post-content in a .container
   section (page.html) or constrain it (page-with-title, single) are left alone — they already center and were tuned per
   template. */
.site-main > .wp-block-post-content:not(.is-layout-constrained) > :where(p, h1, h2, h3, h4, h5, h6, ul, ol, blockquote,
  .wp-block-columns, .wp-block-buttons, .wp-block-image, .wp-block-table, .wp-block-gallery,
  .wp-block-embed, .wp-block-quote, .wp-block-pullquote, .wp-block-separator, .wp-block-details,
  .wp-block-entangle-timeline, .wp-block-entangle-icon-grid, .wp-block-entangle-people,
  .wp-block-entangle-tabs, .wp-block-entangle-faq, .wp-block-entangle-enhanced-table,
  .wp-block-entangle-media, .wp-block-entangle-media-and-text, .wp-block-entangle-button,
  .wp-block-entangle-cards-with-icon, .wp-block-entangle-headline,
  .wp-block-entangle-cards, .wp-block-entangle-download-list, .wp-block-entangle-cover):where(:not(.alignfull):not(.alignwide)),
.is-root-container.is-layout-flow > :where(p, h1, h2, h3, h4, h5, h6, ul, ol, blockquote,
  .wp-block-columns, .wp-block-buttons, .wp-block-image, .wp-block-table, .wp-block-gallery,
  .wp-block-embed, .wp-block-quote, .wp-block-pullquote, .wp-block-separator, .wp-block-details,
  .wp-block-entangle-timeline, .wp-block-entangle-icon-grid, .wp-block-entangle-people,
  .wp-block-entangle-tabs, .wp-block-entangle-faq, .wp-block-entangle-enhanced-table,
  .wp-block-entangle-media, .wp-block-entangle-media-and-text, .wp-block-entangle-button,
  .wp-block-entangle-cards-with-icon, .wp-block-entangle-headline,
  .wp-block-entangle-cards, .wp-block-entangle-download-list, .wp-block-entangle-cover):where(:not(.alignfull):not(.alignwide)) {
  box-sizing: border-box;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Touch targets on small screens ----------
   Buttons keep a comfortable tap size on phones regardless of their skin.
   48px is the WCAG target-size floor; desktop paddings often fall short of
   it once a child theme restyles them, so it is enforced here for every site. */
@media (max-width: 600px) {
  .btn,
  .wp-block-button__link,
  .wp-element-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding-block: 12px;
    font-size: 1rem;
  }
}

/* ---------- Prose lists ----------
   Content lists get breathing room between items; a run of links with no
   spacing reads as one block of text. Scoped to core list blocks and prose
   containers so navigation/footer/social lists (own layout) stay untouched. */
.wp-block-list li + li,
.entry-content :where(ul, ol) li + li,
.wp-block-post-content :where(ul, ol) li + li {
  margin-top: 0.5em;
}

.wp-block-list :where(ul, ol),
.entry-content :where(ul, ol) :where(ul, ol),
.wp-block-post-content :where(ul, ol) :where(ul, ol) {
  margin-top: 0.5em;
}

.wp-block-list li,
.entry-content :where(ul, ol) li,
.wp-block-post-content :where(ul, ol) li {
  padding-left: 0.15em;
}

/* ---------- Buttons (.btn family - used by hero-cta; neutral defaults,
   a child reskins). ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-accent {
  background: var(--color-brand);
  color: var(--color-on-brand);
}
.btn-accent:hover,
.btn-accent:focus-visible {
  background: var(--color-brand-deep);
  color: var(--color-on-brand);
}
.btn-ghost {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-rule-solid);
}
.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--color-ink);
}
.btn-lg {
  padding: 14px 28px;
  font-size: 1.0625rem;
}

/* Full-bleed band recipe: Group → Align full (keeps its default constrained
   layout). Background edge to edge; inner content centers on the global
   content size (= --container via theme.json) and keeps the side gutter. */
.wp-block-post-content .alignfull.is-layout-constrained,
.is-root-container .alignfull.is-layout-constrained {
  padding-inline: var(--gutter);
}

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--color-bg);
  padding-block: var(--space-5);
  transition: padding-block 220ms ease;
}

.site-header.is-stuck {
  padding-block: 14px;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-7);
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  height: var(--logo-h);
  width: auto;
  transition: height 220ms ease;
}
/* Text brand (no logo uploaded): same accent as the menu items. */
.brand__name {
  font-weight: 500;
  color: var(--color-brand);
}

.site-header.is-stuck .brand img {
  height: var(--logo-h-stuck);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.4vw, 40px);
}

.nav__link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-brand);
  position: relative;
  padding-block: 6px;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--color-brand);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .35s var(--ease-emphasized);
}
.nav__link:hover::after,
.nav__link[aria-current="page"]::after { transform: scaleX(1); }

.nav__lang {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-brand);
  letter-spacing: 0.04em;
}

.nav__search {
  width: 22px;
  height: 22px;
  color: var(--color-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-full);
  width: 44px;
  height: 44px;
  cursor: pointer;
  color: var(--color-brand);
  transition: background-color .15s ease, border-color .15s ease;
}
.nav__toggle:hover,
.nav__toggle:focus-visible {
  background: color-mix(in srgb, currentColor 12%, transparent);
  border-color: color-mix(in srgb, currentColor 45%, transparent);
}

.nav__toggle svg { width: 24px; height: 24px; stroke-width: 2; stroke-linecap: butt; }

@media (max-width: 980px) {
  .nav { display: none; }
  .nav__toggle { display: inline-flex; align-items: center; justify-content: center; }
  .site-header { padding-block: 14px; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  /* Section padding = the block's spacing preset (0 top / 70 bottom by default,
     editable on the sliders). The fluid "viewport air" above the heading is
     INNER: --hero-air on the content wrapper, not on the section, so the
     block's outer box starts flush under the header. */
  --hero-air: clamp(48px, 8vw, 120px);
  padding-top: 0;
  padding-bottom: var(--wp--preset--spacing--70);
}
/* Inner air above the hero content (hero: .container, hero-cta: .wrap). */
.hero > .container,
.hero > .wrap { padding-top: var(--hero-air); }

.hero__title {
  margin: 0;
  max-width: none;
}

.hero__lower {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
  margin-top: clamp(40px, 5vw, 72px);
}

.hero__intro {
  padding-top: 8px;
}

.hero__sub {
  margin: 0;
  max-width: 360px;
  font-size: 1rem;
  line-height: 1.55; /* color inherits ink; the brand-tinted lead is an Agora choice (child CSS) */
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: clamp(28px, 3vw, 48px);
  padding-bottom: 4px;
  font-weight: 500;
  font-size: 1rem;
  color: var(--color-brand);
  border-bottom: 1.5px solid var(--color-brand);
  transition: gap .2s ease;
}

.hero__cta:hover { gap: 14px; }

.hero__media {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #e9e6e2;
  overflow: hidden;
  position: relative;
}

.hero__media img {
  width: 100%;
  /* slightly taller than container so we have room to translate */
  height: 120%;
  object-fit: cover;
  display: block;
  /* parallax offset is set via custom property on the section */
  transform: translateY(var(--parallax, -10%));
  transition: transform 60ms linear;
  will-change: transform;
}

/* Placeholder pattern when no image set */
.hero__media--placeholder {
  background:
    var(--color-placeholder);
  display: flex; align-items: center; justify-content: center;
}
.hero__media--placeholder span {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: #6b665d;
  letter-spacing: .04em;
  background: rgba(255,255,255,.7);
  padding: 6px 10px;
}

@media (max-width: 880px) {
  .hero__lower {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero__media { aspect-ratio: 4 / 3; }
}

/* ============================================================
   STATS
   ============================================================ */
.stats {
  padding-block: var(--wp--preset--spacing--70);
}
.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--color-rule);
}
.stats__item {
  padding: 32px 24px 28px;
  border-right: 1px solid var(--color-rule);
}
.stats__item:last-child { border-right: 0; }
.stats__num {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(4rem, 7vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--color-ink); /* numbers in ink; brand-colored numbers were an Agora choice (child) */
  margin: 0 0 20px;
}
.stats__label {
  font-size: inherit;
  line-height: 1.45;
  color: var(--color-ink);
  margin: 0;
  max-width: 200px;
}
/* first breakpoint → 3 columns (the whole first row has a bottom rule) */
@media (min-width: 1025px) and (max-width: 1500px) {
  .stats__grid { grid-template-columns: repeat(3, 1fr); }
  .stats__item:nth-child(3n) { border-right: 0; }
  .stats__item:nth-child(-n+3) { border-bottom: 1px solid var(--color-rule); }
}
/* then → 2 columns (on mobile, a border on all sides + inner rules) */
@media (max-width: 1024px) {
  .stats__grid { grid-template-columns: repeat(2, 1fr); border: 1px solid var(--color-rule); }
  .stats__item { border: 0; }
  .stats__item:nth-child(even) { border-left: 1px solid var(--color-rule); }
  .stats__item:nth-child(n+3) { border-top: 1px solid var(--color-rule); }
}

/* ============================================================
   PARTNERS / LOGO STRIP
   ============================================================ */
.logo-carousel {
  padding-block: var(--wp--preset--spacing--70);
}
.logo-carousel__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(140px, 1fr);
  align-items: center;
  gap: 32px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-block: 8px;
}
.logo-carousel__track::-webkit-scrollbar { display: none; }
.partner {
  height: 64px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-rule);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #8a6168;
  letter-spacing: .04em;
  padding-inline: 16px;
  white-space: nowrap;
}

/* ============================================================
   PROJECTS — minimalist
   ============================================================ */
.projects {
  padding-block: clamp(48px, 6vw, 96px);
  position: relative;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(32px, 4vw, 56px);
  flex-wrap: wrap;
}
.section-head__actions { display: inline-flex; align-items: center; gap: clamp(16px, 2vw, 28px); }
.section-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--wp--preset--font-size--section-title, clamp(2.25rem, 3.8vw, 3.75rem));
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--color-ink);
}
.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1px solid var(--color-brand);
  color: var(--color-brand);
  border-radius: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: background .15s ease, color .15s ease;
  background: var(--color-bg);
  cursor: pointer;
}
.pill-link::after {
  content: "→";
  font-size: 0.875rem;
  transition: transform .2s ease;
}
.pill-link:hover { background: var(--color-brand); color: var(--color-on-brand); }
.pill-link:hover::after { transform: translateX(4px); }
.pill-link--solid {
  background: var(--color-brand);
  color: var(--color-on-brand);
}
.pill-link--solid:hover { background: var(--color-brand-deep); border-color: var(--color-brand-deep); }

.projects__carousel {
  position: relative;
}
.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
@media (max-width: 980px) { .projects__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .projects__grid { grid-template-columns: 1fr; } }

.project-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.project-card__media {
  aspect-ratio: 4 / 3;
  background:
    var(--color-placeholder);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.project-card__media img { width:100%; height:100%; object-fit: cover; display:block; }
.project-card__media span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #6b665d;
  background: rgba(255,255,255,.75);
  padding: 4px 8px;
}
.project-card__body {
  border-top: 1px solid var(--color-rule);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.project-card__tag {
  font-size: 0.6875rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-brand);
}
.project-card__title {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--color-ink);
  margin: 0;
}

/* shared arrow group (carousels) */
.arrow-group { display: inline-flex; gap: 12px; }
.arrow-btn {
  width: 48px; height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-brand);
  color: var(--color-on-brand);
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, opacity .15s ease;
}
.arrow-btn:hover { background: var(--color-brand-deep); }
/* When there's nowhere to scroll, don't show the arrow at all (not just transparent) */
.arrow-btn:disabled { display: none; }
.arrow-btn svg { width: 20px; height: 20px; }
/* Mobile: arrows much smaller (at the edge of good clickability) */
@media (max-width: 640px) {
  .arrow-group { gap: 8px; }
  .arrow-btn { width: 32px; height: 32px; }
  .arrow-btn svg { width: 16px; height: 16px; }
}

/* projects edge arrows (left/right of grid) */
.projects__nav {
  position: absolute;
  top: 38%;
  left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  transform: translateY(-50%);
}
.projects__nav .arrow-btn { pointer-events: auto; margin: 0 -24px; background: var(--color-brand-soft); color: var(--color-brand); }
.projects__nav .arrow-btn:hover { background: var(--color-brand); color: var(--color-on-brand); }
@media (max-width: 640px) { .projects__nav .arrow-btn { margin: 0; } }

/* ============================================================
   SERVICE BLOCK (Participation, Education)
   ============================================================ */
.service {
  padding-block: clamp(64px, 7vw, 112px);
  border-top: 1px solid var(--color-rule);
}
.service__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(40px, 5vw, 80px);
  align-items: start;
  margin-bottom: clamp(48px, 6vw, 80px);
}
.service__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(3rem, 5vw, 4.75rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 0 0 28px;
  color: var(--color-ink);
}
.service__copy {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-ink);
  margin: 0;
  max-width: 540px;
}
.service__media-wrap { display: flex; flex-direction: column; gap: 14px; }
.service__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #ddd;
  cursor: pointer;
}
.service__media img { width:100%; height:100%; object-fit: cover; display:block; }
.service__media--placeholder {
  background:
    var(--color-placeholder);
  display:flex; align-items:center; justify-content:center;
}
.service__media--placeholder span {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: #6b665d;
  background: rgba(255,255,255,.7);
  padding: 6px 10px;
}
.service__play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px;
  border-radius: var(--radius-full);
  background: var(--color-brand);
  color: var(--color-on-brand);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.service__play svg { width: 22px; height: 22px; margin-left: 3px; }
.service__caption {
  font-size: 0.875rem;
  color: var(--color-ink);
  line-height: 1.45;
}

.service__offer-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 2.4vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 24px;
  color: var(--color-ink);
}
.service__offer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-bottom: clamp(40px, 4vw, 56px);
}
.offer-col { display: flex; flex-direction: column; }
.offer-col__item {
  padding: 16px 0;
  border-top: 1px solid var(--color-rule);
  font-size: 0.9375rem;
  color: var(--color-ink);
}
.offer-col__item:last-child { border-bottom: 1px solid var(--color-rule); }
.service__ctas { display: flex; flex-wrap: wrap; gap: 12px; }

@media (max-width: 880px) {
  .service__head { grid-template-columns: 1fr; }
  .service__offer-grid { grid-template-columns: 1fr; gap: 0; }
}

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.testimonials {
  padding-block: clamp(64px, 7vw, 112px);
  border-top: 1px solid var(--color-rule);
  position: relative;
  overflow: hidden;
}
.testimonials__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 50%;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 8px;
}
.testimonials__track::-webkit-scrollbar { display: none; }
@media (max-width: 880px) {
  .testimonials__track { grid-auto-columns: 88%; gap: clamp(16px, 4vw, 24px); }
}
.testimonial {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  border-top: 1px solid var(--color-rule);
  padding: 24px 0 0;
  background: transparent;
  display: flex; flex-direction: column; gap: 28px;
}
.testimonial__quote {
  font-family: inherit;
  font-weight: 400;
  font-size: inherit; /* matches the paragraph body font (17px) */
  line-height: 1.6;
  letter-spacing: 0;
  color: var(--color-ink);
  margin: 0;
  text-wrap: pretty;
}
/* desktop (two side by side): larger right padding */
@media (min-width: 881px) {
  .testimonial { padding-right: clamp(32px, 5vw, 96px); }
}
.testimonial__author { display: flex; align-items: center; gap: 14px; }
.testimonial__avatar {
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  background: var(--color-brand-soft);
  flex: 0 0 auto;
  background-size: cover; background-position: center;
}
.testimonial__name { font-weight: 600; font-size: 0.9375rem; color: var(--color-ink); }
.testimonial__role { font-size: 0.875rem; color: var(--color-ink); }

/* ============================================================
   BLOG
   ============================================================ */
.blog {
  padding-block: var(--wp--preset--spacing--70);
  border-top: 1px solid var(--color-rule);
}
.blog__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
@media (max-width: 980px) { .blog__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .blog__grid { grid-template-columns: 1fr; } }
.blog-card { display: flex; flex-direction: column; gap: 0; }
.blog-card__media {
  aspect-ratio: 4 / 3;
  background:
    var(--color-placeholder);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  margin-bottom: 16px;
}
.blog-card__media img { width:100%; height:100%; object-fit: cover; display:block; }
.blog-card__media span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #6b665d;
  background: rgba(255,255,255,.75);
  padding: 4px 8px;
}
.blog-card__title {
  border-top: 1px solid var(--color-rule);
  padding-top: 16px;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-ink);
  margin: 0;
  text-wrap: pretty;
}

/* ============================================================
   TEAM (people) — flat minimalist
   ============================================================ */
.team {
  padding-block: clamp(64px, 7vw, 112px);
  border-top: 1px solid var(--color-rule);
}
.team__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(40px, 5vw, 64px);
  flex-wrap: wrap;
}
.team__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--wp--preset--font-size--section-title, clamp(2.25rem, 3.8vw, 3.75rem));
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--color-ink);
}
.team__carousel { position: relative; }
.team__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 56px;
}
@media (max-width: 880px) { .team__grid { grid-template-columns: 1fr; gap: 56px; } }
.member { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 0; }
.member__avatar {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--color-brand-soft);
  background-size: cover; background-position: center;
  margin-bottom: 20px;
  border-radius: 0;
}
.member__name { font-weight: 700; font-size: 1.125rem; color: var(--color-ink); margin: 0 0 4px; }
.member__role { font-size: inherit; color: var(--color-ink); margin: 0 0 12px; }
.member__contact {
  border-top: 1px solid var(--color-rule);
  padding-top: 14px;
  font-size: inherit;
  color: var(--color-ink);
  line-height: 1.5;
  margin: 0;
}
.member__content { display: none; }
.member__more {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-brand);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--color-brand);
  padding: 0 0 4px;
  cursor: pointer;
  transition: gap .15s ease;
}
.member__more::after { content: "→"; font-size: 0.875rem; transition: transform .2s ease; }
.member__more:hover::after { transform: translateX(4px); }

/* ===== off-canvas member drawer ===== */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}
.drawer__backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--color-ink) 35%, transparent);
  opacity: 0;
  transition: opacity .25s ease;
}
.drawer__panel {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: min(1040px, 96vw);
  background: var(--color-bg);
  transform: translateX(-100%);
  transition: transform .35s var(--ease-emphasized);
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.drawer__bar {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 0;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}
.drawer__body {
  padding: clamp(28px, 4vw, 64px);
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
.drawer__content { display: flex; flex-direction: column; gap: clamp(8px, 1.2vw, 14px); }
@media (max-width: 768px) {
  .drawer__body { grid-template-columns: 1fr; gap: clamp(20px, 5vw, 32px); }
}
.drawer.is-open { pointer-events: auto; }
.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer.is-open .drawer__panel { transform: translateX(0); }

.drawer__close {
  pointer-events: auto;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 48px; height: 48px;
  padding: 0;
  border: 0;
  background: var(--color-brand);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-on-brand);
  transition: background .15s ease;
}
.drawer__close:hover { background: var(--color-brand-deep); }
.drawer__close svg { width: 20px; height: 20px; }

.drawer__avatar {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--color-brand-soft);
  background-size: cover; background-position: center;
}
.drawer__name {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.25rem, 3.4vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 8px 0 0;
  color: var(--color-ink);
}
.drawer__role { font-size: 0.9375rem; color: var(--color-ink); margin: 4px 0 0; }
.drawer__contact {
  font-size: 0.875rem;
  color: var(--color-ink);
  line-height: 1.5;
  padding: 16px 0;
  border-top: 1px solid var(--color-rule);
  border-bottom: 1px solid var(--color-rule);
  margin: 0;
}
/* without filled-in contacts → don't show an empty block or its border rules */
.drawer__contact:empty { display: none; }
.member__contact a,
.drawer__contact a { color: inherit; text-decoration: none; background: none; transition: color 0.15s ease; }
.member__contact a:hover,
.drawer__contact a:hover { color: var(--color-brand); background: none; }
.drawer__bio {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--color-ink);
  margin: clamp(20px, 3vw, 28px) 0 0;
}
.drawer__bio > * { margin: 0 0 1em; }
.drawer__bio > :last-child { margin-bottom: 0; }
.drawer__bio h2, .drawer__bio h3, .drawer__bio h4 {
  font-weight: 600;
  margin-top: 1.2em;
}

/* ============================================================
   FOOTER — Contact + colophon
   ============================================================ */
.site-footer {
  background: var(--color-brand);
  color: var(--color-on-brand);
  padding: 0;
  border: 0;
  position: relative;
  overflow: hidden;
}
.footer-cta {
  padding: clamp(72px, 8vw, 128px) 0 clamp(56px, 6vw, 96px);
  position: relative;
}
.footer-cta__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(48px, 6vw, 96px);
  align-items: start;
}
.footer-cta__text { max-width: none; }
.footer-cta__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 4.8vw, 4.75rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--color-on-brand);
  margin: 0 0 24px;
  text-wrap: balance;
}
.footer-cta__lead {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-on-brand);
  margin: 0;
  max-width: none;
}
.footer-cta__lead a {
  color: var(--color-on-brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  text-align: left;
}
.contact-form__field {
  border-bottom: 1px solid rgba(255,255,255,0.45);
  padding: 18px 0 14px;
}
.contact-form label {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-on-brand);
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 4px 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-on-brand);
  outline: none;
  caret-color: var(--color-on-brand);
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: rgba(255,255,255,0.55); }
.contact-form textarea {
  resize: vertical;
  min-height: 64px;
  line-height: 1.5;
  font-family: var(--font-sans);
}
.contact-form__submit {
  margin-top: 32px;
  align-self: flex-start;
  padding: 14px 24px;
  background: transparent;
  border: 1px solid #fff;
  border-radius: 0;
  color: var(--color-on-brand);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background .15s ease, color .15s ease;
}
.contact-form__submit::after {
  content: "→";
  font-size: 0.875rem;
  transition: transform .2s ease;
}
.contact-form__submit:hover { background: #fff; color: var(--color-brand); }
.contact-form__submit:hover::after { transform: translateX(4px); }

/* ----- Colophon strip ----- */
.footer-colophon {
  border-top: 1px solid rgba(255,255,255,0.18);
  color: var(--color-on-brand);
  font-size: 0.8125rem;
  padding: 28px 0;
}
.footer-colophon__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}
/* Dimming via color (not opacity) so links can be fully white = AA contrast. */
.footer-colophon__left { max-width: 340px; line-height: 1.5; color: rgba(255, 255, 255, 0.95); }
.footer-colophon__left a { color: var(--color-on-brand); text-decoration: underline; text-underline-offset: 2px; }
.footer-colophon__center {
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.footer-logo {
  display: inline-flex;
  align-items: center;
  padding: 4px 0;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.04em;
  white-space: nowrap;
  border: 0;
}
.footer-colophon__right {
  text-align: right;
  color: rgba(255, 255, 255, 0.95);
}
.footer-colophon__right a {
  color: var(--color-on-brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Social band — full-width row above colophon */
.footer-social {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding: 26px 0;
}

/* Menu in the footer (instead of "Follow us") */
.footer-nav {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding: 22px 0;
}
.footer-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(20px, 2.4vw, 40px);
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-nav__list li { margin: 0; }
.footer-nav__list a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-on-brand);
  text-decoration: none;
  padding-block: 4px;
  display: inline-block;
  transition: opacity .15s ease;
}
.footer-nav__list a:hover { opacity: 0.75; }
.footer-nav__nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.4vw, 40px);
  flex-wrap: wrap;
}
.footer-nav__social {
  display: flex;
  align-items: center;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
}
.footer-nav__social li { margin: 0; }
.footer-nav__social a {
  color: var(--color-on-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.14);
  transition: background .15s ease;
}
.footer-nav__social a:hover { background: rgba(255, 255, 255, 0.28); }
.footer-nav__social svg { width: 20px; height: 20px; display: block; }
.footer-nav__search {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-on-brand);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity .15s ease;
}
.footer-nav__search svg { width: 20px; height: 20px; }
.footer-nav__search:hover { opacity: 0.75; }
@media (max-width: 600px) {
  .footer-nav__inner { flex-direction: column; align-items: flex-start; gap: 16px; }
}
.footer-social__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.footer-social__label {
  font-size: 0.6875rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-on-brand);
}
.social-list {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.social-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.10);
  color: var(--color-on-brand);
  text-decoration: none;
  transition: background .2s ease, transform .2s ease;
}
.social-list a:hover { background: #fff; color: var(--color-brand); transform: translateY(-1px); }
.social-list svg { width: 18px; height: 18px; display: block; }
@media (max-width: 720px) {
  .footer-social__inner { flex-direction: column; align-items: flex-start; gap: 16px; }
}
@media (max-width: 880px) {
  .footer-cta__inner { grid-template-columns: 1fr; gap: clamp(24px, 5vw, 36px); }
  .footer-colophon__grid {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .footer-colophon__center { justify-content: flex-start; }
  .footer-colophon__right { text-align: left; }
}

/* ============================================================
   Desktop typography bump — make body, header, footer & homepage
   UI text feel a touch larger on wider screens
   ============================================================ */
@media (min-width: 1024px) {
  /* header navigation */
  .nav { gap: 32px; }
  .nav__link,
  .nav__lang { font-size: 1.0625rem; }

  /* hero */
  .hero__sub { font-size: 1.125rem; max-width: 420px; }

  /* stats */
  .stats__label { font-size: inherit; }

  /* projects */
  .project-card__title { font-size: 1.25rem; }
  .project-card__tag { font-size: 0.75rem; }

  /* service blocks (Participation / Education) */
  .service__copy { font-size: 1.125rem; }
  .service__caption { font-size: 0.9375rem; }
  .offer-col__item { font-size: 1rem; }

  /* testimonials */
  .testimonial__name { font-size: 1.0625rem; }
  .testimonial__role { font-size: 0.9375rem; }

  /* blog */
  .blog-card__title { font-size: 1.1875rem; }

  /* team */
  .member__role { font-size: inherit; }
  .member__contact { font-size: inherit; }
  .member__more { font-size: 0.875rem; }

  /* pills & buttons */
  .pill-link { font-size: 0.875rem; }

  /* footer */
  .footer-cta__lead { font-size: 1.125rem; }
  .contact-form label { font-size: 0.8125rem; }
  .contact-form input,
  .contact-form textarea { font-size: 1.125rem; }
  .footer-colophon { font-size: 0.9375rem; padding: 32px 0; }
  .footer-logo { font-size: 0.8125rem; }
  .footer-social__label { font-size: 0.8125rem; }
}

/* ============================================================
   FULL-PAGE OVERLAYS — search + mobile menu
   ============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--color-bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility 0s linear .35s;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 4vw, 56px);
  overflow-y: auto;
}
.overlay.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity .35s ease;
}
.overlay__close {
  position: absolute;
  top: clamp(20px, 3vw, 36px);
  right: clamp(20px, 3vw, 36px);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-rule);
  background: transparent;
  color: var(--color-brand);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.overlay__close svg { width: 18px; height: 18px; }
.overlay__close:hover {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: var(--color-on-brand);
  transform: rotate(90deg);
}

/* --- Search overlay --- */
.search-overlay {
  align-items: center;
  justify-content: center;
}
.search-overlay__inner {
  width: 100%;
  max-width: 760px;
  transform: translateY(28px);
  opacity: 0;
  transition: transform .4s var(--ease-emphasized), opacity .35s ease;
  transition-delay: 0s;
}
.search-overlay.is-open .search-overlay__inner {
  transform: translateY(0);
  opacity: 1;
  transition-delay: .08s;
}
.search-overlay__label {
  display: block;
  font-size: 0.6875rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-ink);
  margin-bottom: 18px;
}
.search-overlay__form {
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 2px solid var(--color-brand);
  padding-bottom: 16px;
}
.search-overlay__input {
  flex: 1 1 auto;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 5vw, 3.25rem);
  font-weight: 400;
  color: var(--color-brand);
  background: transparent;
  border: 0;
  outline: 0;
  padding: 0;
  line-height: 1.1;
  letter-spacing: -0.015em;
  min-width: 0;
}
.search-overlay__input::placeholder {
  /* Muted TEXT, not a tint: brand-soft is a background token, so as a text
     color it is unreadable in any palette (even the default #dbeafe sits at
     1.2:1 on white). */
  color: var(--color-ink-soft);
}
.search-overlay__btn {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--color-brand);
  color: var(--color-on-brand);
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.search-overlay__btn:hover { background: var(--color-brand-deep); transform: translateX(2px); }
.search-overlay__btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.search-overlay__hint {
  margin-top: 22px;
  font-size: 0.8125rem;
  color: var(--color-ink);
}
.search-overlay__hint kbd {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: color-mix(in srgb, var(--color-ink) 7%, transparent);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-rule);
  margin: 0 2px;
}

/* --- Menu overlay (fully inverted: brand background, everything white) --- */
.menu-overlay {
  background: var(--color-brand);
  /* padding = same position as header: gutter on the left, 14px on top
     (the overlay only opens ≤980px, where .site-header has padding-block 14px) */
  padding: 14px var(--gutter) clamp(24px, 4vw, 56px);
}
.menu-overlay__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* logo: same size and position as in the header (--logo-h tracks the breakpoints), white */
.menu-overlay__top .custom-logo-link,
.menu-overlay__top .brand { display: inline-flex; align-items: center; }
.menu-overlay__top .custom-logo,
.menu-overlay__top .brand img {
  height: var(--logo-h);
  width: auto;
  transition: none;
  filter: brightness(0) invert(1);
}
.menu-overlay__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* close + search in flow (same size and spot as the hamburger in the header), white */
.menu-overlay .overlay__close,
.menu-overlay .overlay__search {
  position: static;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: transparent;
  color: var(--color-on-brand);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.menu-overlay .overlay__search svg { width: 20px; height: 20px; }
.menu-overlay .overlay__close:hover,
.menu-overlay .overlay__search:hover {
  background: #fff;
  border-color: var(--color-on-brand);
  color: var(--color-brand);
}
.menu-overlay__nav {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(4px, 1vw, 12px);
  margin-block: clamp(32px, 5vw, 64px);
}
.menu-overlay__nav a {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 9vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--color-on-brand);
  display: inline-block;
  padding-block: 6px;
  align-self: flex-start;
  position: relative;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .4s ease, transform .5s var(--ease-emphasized), color .2s ease;
}
.menu-overlay.is-open .menu-overlay__nav a {
  opacity: 1;
  transform: translateY(0);
}
.menu-overlay.is-open .menu-overlay__nav a:nth-child(1) { transition-delay: .08s, .08s, 0s; }
.menu-overlay.is-open .menu-overlay__nav a:nth-child(2) { transition-delay: .14s, .14s, 0s; }
.menu-overlay.is-open .menu-overlay__nav a:nth-child(3) { transition-delay: .20s, .20s, 0s; }
.menu-overlay.is-open .menu-overlay__nav a:nth-child(4) { transition-delay: .26s, .26s, 0s; }
.menu-overlay.is-open .menu-overlay__nav a:nth-child(5) { transition-delay: .32s, .32s, 0s; }
.menu-overlay__nav a:hover { color: rgba(255, 255, 255, 0.75); }
.menu-overlay__nav a::before {
  content: "→";
  position: absolute;
  left: -1.2em;
  top: 50%;
  transform: translateY(-50%) translateX(-12px);
  opacity: 0;
  transition: opacity .2s ease, transform .25s ease;
  color: var(--color-on-brand);
}
.menu-overlay__nav a:hover::before {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.menu-overlay__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  flex-wrap: wrap;
}
.menu-overlay__foot .nav__lang { font-size: 1.125rem; color: var(--color-on-brand); }
.menu-overlay__foot .social-list a {
  background: rgba(255, 255, 255, 0.15);
  color: var(--color-on-brand);
}
.menu-overlay__foot .social-list a:hover {
  background: #fff;
  color: var(--color-brand);
  transform: translateY(-1px);
}

/* ============================================================
   Page-to-page transition — native View Transitions (crossfade)
   Doesn't block loading or render; in browsers without support
   a light content fade-in is used. Respects reduced-motion.
   ============================================================ */
@view-transition { navigation: auto; }

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 240ms;
    animation-timing-function: ease;
  }
}

/* Fallback: browsers without View Transitions — quick content fade-in */
@supports not (view-transition-name: none) {
  @media (prefers-reduced-motion: no-preference) {
    .site-main {
      animation: entangle-page-in 280ms var(--ease-emphasized) both;
    }
  }
}
@keyframes entangle-page-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* Inline text-color format ("Zvýraznění"/Highlight) uses <mark>; strip the default
   yellow background so a brand-colored accent shows as colored text, not a highlight. */
mark.has-inline-color,
.has-inline-color { background-color: transparent; }

/* ---- site-header: brand mark, dropdown submenu, CTA (neutral; children reskin) ---- */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand__mark { display: inline-flex; }
.brand__mark svg { display: block; }
.nav__list { list-style: none; display: flex; align-items: center; gap: 26px; margin: 0; padding: 0; }
.nav__list .menu-item { position: relative; }
.nav__list .sub-menu {
	list-style: none;
	margin: 0;
	padding: 8px;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	background: var(--color-bg-alt);
	border: 1px solid var(--color-rule);
	border-radius: var(--radius);
	box-shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.35);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
	z-index: 60;
}
.nav__list .menu-item-has-children:hover > .sub-menu,
.nav__list .menu-item-has-children:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.nav__list .sub-menu a { display: block; padding: 10px 14px; border-radius: var(--radius-sm); }
.site-header__cta { white-space: nowrap; }

/* Dropdown chevron (inline SVG emitted by the site-header block) — flips 180° when open. */
.nav__chevron { flex: none; transition: transform .28s ease; }
.menu-item-has-children:hover > a .nav__chevron,
.menu-item-has-children:focus-within > a .nav__chevron,
.menu-item-has-children.is-open > a .nav__chevron { transform: rotate(180deg); }

/* ============================================================
   Legacy-token bridge for entangle-core / entangle-events components.
   Those components (e.g. the [entangle_subscribe] form) key their CSS on
   the old Tailwind-era variable names; alias them to the base tokens so
   they render on-brand and at the theme's body size everywhere.
   ============================================================ */
:root {
  --color-primary: var(--color-brand);
  --color-primary-deep: var(--color-brand-deep);
  --color-neutral-100: var(--color-bg-alt);
  --color-neutral-200: var(--color-rule);
  --color-neutral-300: var(--color-rule);
  --color-neutral-500: var(--color-ink-soft);
  --color-base: var(--color-ink);
  --color-contrast: var(--color-card);
  --font-base: var(--wp--preset--font-size--body);
  --font-sm: var(--wp--preset--font-size--small);
  --border-radius: var(--radius);
  --space-2: var(--wp--preset--spacing--20);
  --space-3: 0.75rem;
  --space-4: var(--wp--preset--spacing--30);
  --space-5: var(--wp--preset--spacing--50);
  --space-6: var(--wp--preset--spacing--60);
}
