/* ============================================================
   BASIS: Reset, Typografie, Layout-Grundlagen, Buttons
   Farben, Schrift und Maße kommen aus den CSS-Variablen, die aus
   src/_data/theme.yaml erzeugt werden. Hier steht keine feste
   Farbe – bitte auch keine hinzufügen.

   Maße und Typo-Skala folgen globalshapers.org (gemessen an der
   Desktop-Ansicht mit 1728 px Breite).
   ============================================================ */

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, picture, svg, video { max-width: 100%; height: auto; display: block; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

/* --- Typo-Skala (Desktop-Werte von globalshapers.org, auf
       kleinen Bildschirmen fließend kleiner) --- */
:root {
  --fs-display: clamp(2.5rem, 1.6rem + 2.6vw, 4rem);      /* 64 px  Hero-Titel */
  --fs-h2:      clamp(1.875rem, 1.5rem + 1.1vw, 2.5rem);  /* 40 px  Abschnitts-Titel */
  --fs-h2-s:    clamp(1.625rem, 1.4rem + .7vw, 2rem);     /* 32 px  kleinere Abschnitts-Titel */
  --fs-h3:      clamp(1.25rem, 1.15rem + .35vw, 1.5rem);  /* 24 px  Karten-Titel */
  --fs-h4:      1.25rem;                                   /* 20 px */
  --fs-lead:    clamp(1.0625rem, 1rem + .25vw, 1.25rem);  /* 20 px  Fließtext groß */
  --fs-body:    1.125rem;                                  /* 18 px */
  --fs-base:    1rem;                                      /* 16 px */
  --fs-small:   .875rem;                                   /* 14 px */
  --fs-xs:      .75rem;                                    /* 12 px */
  --fs-tag:     .6875rem;                                  /* 11 px  Kategorie-Etikett */

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;
  --space-9: 64px;
  --space-10: 80px;
  --space-11: 96px;

  --section-space: clamp(56px, 4vw + 32px, 96px);
  --shadow-card: 0 4px 12px 0 rgba(0, 0, 0, .08), 0 1px 2px 0 rgba(0, 0, 0, .04);
  --shadow-raised: 0 8px 24px 0 rgba(0, 0, 0, .08), 0 2px 4px 0 rgba(0, 0, 0, .04);
  --radius-pill: 9999px;
}

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .005em;
  margin: 0 0 var(--space-4);
  text-wrap: balance;
  /* Lange deutsche Wörter auf schmalen Bildschirmen trennen */
  overflow-wrap: break-word;
  hyphens: auto;
}
h1 { font-size: var(--fs-display); line-height: 1.125; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.33; }
h4 { font-size: var(--fs-h4); line-height: 1.4; }
p, ul, ol { margin: 0 0 var(--space-4); }
p { text-wrap: pretty; }

a { color: var(--color-blue); text-underline-offset: .18em; }
a:hover { color: var(--color-blue-hover); }

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

/* `hidden` muss immer gewinnen, auch gegen display-Regeln von Bausteinen */
[hidden] { display: none !important; }

/* Sichtbar nur für Screenreader */
.visually-hidden {
  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: var(--space-4); top: -100%;
  z-index: 100; padding: var(--space-2) var(--space-4);
  background: var(--color-blue); color: var(--color-text-inverse);
  text-decoration: none;
}
.skip-link:focus { top: var(--space-4); color: var(--color-text-inverse); }

/* --- Layout-Grundlagen --- */
.container {
  width: min(100% - 2 * var(--layout-gutter), var(--layout-max-width));
  margin-inline: auto;
}

.section { padding-block: var(--section-space); }
.section--flush-top { padding-top: 0; }
.section--mist { background: var(--color-mist); }
.section--sand { background: var(--color-sand); }
.section--blue { background: var(--color-blue); color: var(--color-text-inverse); }
.section--navy { background: var(--color-navy); color: var(--color-text-inverse); }

/* Abschnitts-Kopf: Titel + Einleitung */
.section-head { max-width: 864px; margin-bottom: var(--space-9); }
.section-head h2 { margin-bottom: var(--space-5); }
.section-head p { font-size: var(--fs-lead); line-height: 1.4; margin: 0; }
.section-head--small h2 { font-size: var(--fs-h2-s); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--tight { margin-bottom: var(--space-7); }
.section-head__row {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-5);
}

.lead { font-size: var(--fs-lead); line-height: 1.4; }

/* Raster */
.grid { display: grid; gap: var(--space-5); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--wide-gap { column-gap: var(--space-5); row-gap: var(--space-9); }
@media (max-width: 1100px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

/* Liste ohne Aufzählungszeichen */
.plain-list { list-style: none; padding: 0; margin: 0; }

/* --- Buttons (Pillenform, 48 px hoch) --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px;
  padding: 0 26px;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--color-blue); color: var(--color-text-inverse); }
.btn--primary:hover { background: var(--color-blue-hover); color: var(--color-text-inverse); }
.btn--outline { border-color: var(--color-blue); color: var(--color-blue); background: transparent; }
.btn--outline:hover { background: var(--color-blue); color: var(--color-text-inverse); }
/* Auf dunklem Grund (Footer-Band, Datenband) */
.btn--sky { background: var(--color-sky); color: var(--color-navy); }
.btn--sky:hover { background: var(--color-sky-hover); color: var(--color-navy); }
.btn--small { min-height: 40px; padding: 0 20px; font-size: var(--fs-small); }

/* Textlink in Fett, wie „Read“ / „Visit …“ auf globalshapers.org */
.text-link {
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--color-blue);
  text-decoration: none;
}
.text-link:hover { text-decoration: underline; }
.on-dark .text-link, .text-link--sky { color: var(--color-sky); }

/* Kategorie-Etikett („FORUM STORIES“, „LEADERSHIP“) */
.tag {
  display: inline-block;
  font-size: var(--fs-tag);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-blue);
}
