/* ==========================================================================
   Stiftung Dialog und Bildung — Relaunch
   Editorial-clean design system. Native CSS, OKLCH tokens, one accent.
   Design read: institutional foundation redesign, trust-first editorial
   language. DESIGN_VARIANCE 6 / MOTION_INTENSITY 4 / VISUAL_DENSITY 3.
   ========================================================================== */

/* The Stiftung's own brand font (Melbourne), self-hosted from the live
   sdub.de theme — same font as the original site, not an invented pairing. */
@font-face {
  font-family: "Melbourne";
  src: url("../fonts/melbourne-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Melbourne";
  src: url("../fonts/melbourne-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  /* Neutrals — the Stiftung's own cool blue-gray scale (from the live
     Blocksy theme palette), not an invented warm tone. */
  --bg: #FAFBFC;
  --bg-raised: #ffffff;
  --bg-sunken: #f2f5f7;
  --text: #192a3d;
  --text-muted: #3b4868;
  --text-faint: #647186;
  --border: #e1e8ed;
  --border-strong: #c7d1d9;

  /* Accent — the Stiftung's real brand color, taken directly from their
     logo (rgb(174,47,124)) and theme palette (#b22874). One accent only. */
  --accent: #b22874;
  --accent-hover: color-mix(in srgb, #b22874 82%, black);
  --accent-tint: color-mix(in srgb, #b22874 10%, white);
  --accent-tint-strong: color-mix(in srgb, #b22874 20%, white);
  --on-accent: #ffffff;

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 20px;
  --radius-pill: 999px;

  --font-display: "Melbourne", -apple-system, "Segoe UI", sans-serif;
  --font-sans: "Melbourne", -apple-system, "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-1: 0 1px 2px rgba(25, 42, 61, 0.06), 0 1px 1px rgba(25, 42, 61, 0.04);
  --shadow-2: 0 8px 24px rgba(25, 42, 61, 0.1), 0 2px 6px rgba(25, 42, 61, 0.05);
  --max: 1240px;
  color-scheme: light;
}

/* Always light — matches the original site, which has no dark mode.
   No prefers-color-scheme override, so it never surprises a visitor
   whose system is set to dark. */

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, figure { margin: 0; }

.container {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 24px;
}
@media (min-width: 768px) { .container { padding-inline: 40px; } }

.display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.08;
}
.eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.lede {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 62ch;
  line-height: 1.65;
}
.prose { max-width: 68ch; }
.prose p + p { margin-top: 1.15em; }
.prose h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; margin-top: 2.2em; margin-bottom: 0.6em; }
.prose h3 { font-family: var(--font-sans); font-size: 1.05rem; font-weight: 700; margin-top: 1.8em; margin-bottom: 0.5em; }
.prose blockquote {
  margin: 1.8em 0; padding-left: 1.2em; border-left: 3px solid var(--accent);
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--text);
}

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--accent); color: var(--on-accent);
  padding: 12px 18px; border-radius: var(--radius-s);
}
.skip-link:focus { left: 24px; top: 12px; }

/* ---- Header / navigation ---- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; flex-shrink: 0; }
.brand-mark { width: 38px; height: 38px; flex-shrink: 0; }
.brand-name { line-height: 1.15; }
.brand-name small { display: block; font-family: var(--font-sans); font-weight: 500; font-size: 0.62rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-faint); }

.primary-nav { display: none; }
@media (min-width: 1024px) {
  .primary-nav { display: flex; align-items: center; gap: 2px; height: 100%; }
  .nav-item { position: relative; height: 100%; display: flex; align-items: center; }
  .nav-link {
    padding: 8px 14px; border-radius: var(--radius-pill); font-size: 0.92rem; font-weight: 500;
    color: var(--text-muted); transition: background 0.15s var(--ease), color 0.15s var(--ease);
  }
  .nav-item:hover .nav-link, .nav-link:focus-visible { color: var(--text); background: var(--bg-sunken); }
  .mega {
    position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
    width: min(760px, 82vw);
    background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-m);
    box-shadow: var(--shadow-2); padding: 22px;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 28px;
    opacity: 0; visibility: hidden; translate: 0 6px;
    transition: opacity 0.16s var(--ease), translate 0.16s var(--ease), visibility 0.16s;
  }
  .nav-item:hover .mega, .nav-item:focus-within .mega { opacity: 1; visibility: visible; translate: 0 0; }
  .mega-group-title { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 10px; }
  .mega-group a { display: block; padding: 5px 0; font-size: 0.92rem; color: var(--text-muted); border-radius: var(--radius-s); }
  .mega-group a:hover { color: var(--accent); }
}
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: var(--radius-s); border: 1px solid var(--border);
  background: var(--bg-raised);
}
@media (min-width: 1024px) { .nav-toggle { display: none; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-pill); font-weight: 600; font-size: 0.92rem;
  white-space: nowrap; border: 1px solid transparent; cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg-sunken); }

/* Mobile nav drawer */
.mobile-nav {
  position: fixed; inset: 0; z-index: 150; background: var(--bg);
  padding: 20px 24px 40px; overflow-y: auto;
  transform: translateY(-8px); opacity: 0; visibility: hidden;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s;
}
.mobile-nav.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.mobile-nav-head { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.mobile-group summary { display: flex; align-items: center; justify-content: space-between; padding: 16px 2px; font-weight: 600; font-size: 1.02rem; cursor: pointer; border-bottom: 1px solid var(--border); list-style: none; }
.mobile-group summary::-webkit-details-marker { display: none; }
.mobile-group[open] summary::after { transform: rotate(45deg); }
.mobile-group summary::after { content: "+"; font-size: 1.3rem; color: var(--text-faint); transition: transform 0.15s var(--ease); }
.mobile-group ul { padding: 6px 2px 14px 10px; }
.mobile-group li a { display: block; padding: 9px 0; color: var(--text-muted); font-size: 0.96rem; }

/* ---- Hero ---- */
.hero { padding: 56px 0 64px; }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: 56px; } }
.hero h1 { font-size: clamp(2.1rem, 4vw, 3.1rem); max-width: 16ch; }
.hero .lede { margin-top: 18px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-media { border-radius: var(--radius-l); overflow: hidden; aspect-ratio: 4/3; box-shadow: var(--shadow-2); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Sections ---- */
.section { padding: 64px 0; }
.section-tight { padding: 40px 0; }
.section-head { margin-bottom: 32px; }
.section-head h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); max-width: 22ch; }
.section-alt { background: var(--bg-sunken); }
.section-inverse { background: var(--accent); color: var(--on-accent); }
.section-inverse .eyebrow { color: var(--on-accent); opacity: 0.75; }
.section-inverse a { color: var(--on-accent); }

.reveal { opacity: 0; translate: 0 18px; transition: opacity 0.6s var(--ease), translate 0.6s var(--ease); }
.reveal.is-visible { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; translate: 0 0; transition: none; } }

/* Card grid - news */
.grid-cards { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-cards { grid-template-columns: repeat(4, 1fr); } }
.grid-cards.featured-first { grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-cards.featured-first { grid-template-columns: 1.3fr 1fr 1fr; } }

.card {
  display: flex; flex-direction: column; border-radius: var(--radius-m);
  overflow: hidden; background: var(--bg-raised); border: 1px solid var(--border);
  transition: box-shadow 0.2s var(--ease), translate 0.2s var(--ease);
}
.card:hover { box-shadow: var(--shadow-2); translate: 0 -2px; }
.card-media { aspect-ratio: 16/10; overflow: hidden; background: var(--bg-sunken); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-date { font-size: 0.76rem; font-weight: 600; letter-spacing: 0.04em; color: var(--text-faint); }
.card-title { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; line-height: 1.3; }
.card-excerpt { font-size: 0.92rem; color: var(--text-muted); line-height: 1.55; }
.card.card-featured .card-title { font-size: 1.4rem; }

/* Topic tiles */
.tile-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .tile-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .tile-grid { grid-template-columns: repeat(3, 1fr); } }
.tile {
  padding: 26px; border-radius: var(--radius-m); border: 1px solid var(--border);
  background: var(--bg-raised); transition: border-color 0.18s var(--ease), translate 0.18s var(--ease);
}
.tile:hover { border-color: var(--border-strong); translate: 0 -2px; }
.tile-icon { width: 40px; height: 40px; border-radius: var(--radius-s); background: var(--accent-tint); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.tile h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; margin-bottom: 8px; }
.tile p { font-size: 0.9rem; color: var(--text-muted); }
.tile-links { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.tile-links a { font-size: 0.82rem; padding: 5px 12px; border-radius: var(--radius-pill); background: var(--bg-sunken); color: var(--text-muted); }
.tile-links a:hover { background: var(--accent-tint); color: var(--accent); }

/* Plain feature columns — no card chrome, used instead of repeated bordered
   tiles when 3+ items would otherwise read as an identical-card grid. */
.plain-cols { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .plain-cols { grid-template-columns: repeat(3, 1fr); gap: 40px; } }
.plain-col .tile-icon { margin-bottom: 14px; }
.plain-col h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; margin-bottom: 8px; }
.plain-col p { font-size: 0.92rem; color: var(--text-muted); }

/* Featured + list split (breaks up uniform card grids) */
.feature-split { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .feature-split { grid-template-columns: 1.1fr 1fr; gap: 40px; } }
.feature-lead { padding: 32px; border-radius: var(--radius-l); background: var(--bg-raised); border: 1px solid var(--border); }
.feature-lead .tile-icon { width: 46px; height: 46px; margin-bottom: 18px; }
.feature-lead h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; margin-bottom: 10px; }
.feature-lead p { color: var(--text-muted); font-size: 0.98rem; max-width: 42ch; }
.feature-list-row { display: flex; align-items: flex-start; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.feature-list-row:first-child { border-top: 1px solid var(--border); }
.feature-list-row .tile-icon { width: 34px; height: 34px; flex-shrink: 0; margin-bottom: 0; }
.feature-list-row h3 { font-size: 0.98rem; font-weight: 700; margin-bottom: 3px; }
.feature-list-row p { font-size: 0.86rem; color: var(--text-muted); }

/* Quote / values */
.pull-quote { max-width: 44ch; }
.pull-quote p { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.3rem, 2.4vw, 1.7rem); line-height: 1.3; letter-spacing: -0.01em; }
.pull-quote cite { display: block; margin-top: 18px; font-style: normal; font-size: 0.86rem; color: var(--text-faint); }

/* Split layout */
.split { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 64px; } }
.split-media { border-radius: var(--radius-l); overflow: hidden; aspect-ratio: 4/3; }
.split-media img { width: 100%; height: 100%; object-fit: cover; }

/* List rows (grouped, sparse dividers) */
.row-group { border-top: 1px solid var(--border); }
.row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.row-label { font-weight: 600; }
.row-meta { color: var(--text-faint); font-size: 0.85rem; }

/* Logo wall */
.logo-wall { display: flex; flex-wrap: wrap; align-items: center; gap: 36px 48px; }
.logo-wall img, .logo-wall svg { height: 30px; width: auto; opacity: 0.72; filter: grayscale(1); transition: opacity 0.15s var(--ease); }
.logo-wall a:hover img, .logo-wall a:hover svg { opacity: 1; }

/* Newsletter */
.newsletter-box { border-radius: var(--radius-l); background: var(--bg-sunken); border: 1px solid var(--border); padding: 36px; }
@media (min-width: 900px) { .newsletter-box { padding: 48px; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.82rem; font-weight: 600; }
.field input {
  padding: 12px 14px; border-radius: var(--radius-s); border: 1px solid var(--border-strong);
  background: var(--bg-raised); color: var(--text); font: inherit; font-size: 0.94rem;
}
.field input::placeholder { color: var(--text-faint); }
.field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-grid .field-wide { grid-column: 1 / -1; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; font-size: 0.86rem; color: var(--text-muted); }
.checkbox-row input { margin-top: 3px; }

/* Breadcrumb */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.82rem; color: var(--text-faint); padding: 22px 0 0; }
.breadcrumb a { color: var(--text-faint); }
.breadcrumb a:hover { color: var(--accent); }

/* Placeholder page */
.placeholder-box {
  border: 1px dashed var(--border-strong); border-radius: var(--radius-l);
  padding: 56px 32px; text-align: center; max-width: 620px; margin-inline: auto;
}
.placeholder-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--accent-tint); color: var(--accent); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }

/* Article header */
.article-head { max-width: 68ch; }
.article-head .eyebrow { margin-bottom: 14px; }
.article-head h1 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); }
.article-meta { display: flex; gap: 14px; margin-top: 18px; font-size: 0.85rem; color: var(--text-faint); }
.article-cover { border-radius: var(--radius-l); overflow: hidden; margin: 32px 0; aspect-ratio: 16/9; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-sunken); padding: 56px 0 28px; }
.footer-grid { display: grid; gap: 36px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; } }
.footer-col-title { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 14px; }
.footer-col a { display: block; padding: 5px 0; font-size: 0.9rem; color: var(--text-muted); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; font-size: 0.82rem; color: var(--text-faint); }
.footer-legal { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-legal a { color: var(--text-faint); }
.footer-legal a:hover { color: var(--accent); }
.footer-social { display: flex; gap: 10px; }
.footer-social a { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-strong); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.footer-social a:hover { color: var(--accent); border-color: var(--accent); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--radius-pill); background: var(--accent-tint); color: var(--accent); font-size: 0.78rem; font-weight: 600; }

.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; }
