/* ==========================================================================
   Dieter-Neumann-Stiftung — Design Tokens
   ========================================================================== */

:root {
  color-scheme: light only;
  --bg: #F5F5F5;
  --text: #1A1A1A;
  --text-secondary: #5A5A5A;
  --logo-gray: #7F7F7F;
  --border: #DCDCDC;
  --dark: #1A1A1A;
  --dark-text: #EDEDED;

  --font-serif: 'Times New Roman', Times, 'Liberation Serif', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --measure: 66ch;
  --transition: 180ms ease;
}

@media (prefers-reduced-motion: reduce) {
  :root { --transition: 0ms; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 7rem;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

button, input, textarea { font-family: inherit; }

a {
  color: var(--text);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition);
}
a:hover { color: var(--text-secondary); }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.25;
  margin: 0;
}

h2 {
  font-size: 1.89rem;
  color: var(--text);
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.measure { max-width: var(--measure); }

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

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: 1080px;
  margin: 0 auto;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-header .logo,
.site-header img {
  display: block;
  aspect-ratio: 311 / 41;
  width: 300px;
  max-width: 100%;
  height: auto;
}

@media (min-width: 720px) {
  .site-header .logo,
.site-header img { width: 340px; }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.95rem;
}

@media (max-width: 719px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 1.5rem;
    gap: 0.5rem;
  }
  .site-header .logo,
.site-header img { width: 300px; }
  .site-nav {
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
  }
}

.site-nav a {
  position: relative;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), color var(--transition);
}

.site-nav a::after {
  content: "";
  position: absolute;
  inset: -10px -6px;
}
.site-nav a.instagram-link::after { inset: -12px; }

.site-nav a:hover {
  color: var(--text-secondary);
  border-bottom-color: var(--text);
}

.instagram-link {
  display: inline-flex;
  align-items: center;
  color: var(--text-secondary);
}
.instagram-link:hover { color: var(--text); }
.instagram-link svg { width: 20px; height: 20px; }

/* ---- Hero ---- */

.hero {
  padding: 3.5rem 1.5rem 4.5rem;
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  gap: 2.5rem;
}

.hero h1 {
  font-size: 2.54rem;
  max-width: 22ch;
  text-wrap: balance;
  margin-bottom: 1.5rem;
}

.hero h1 .akzent { color: var(--logo-gray); }

.hero p {
  color: var(--text-secondary);
  max-width: var(--measure);
  font-size: 1.125rem;
}

/* Slideshow: ein Foto pro Projekt, Name im Bild, 4 s pro Foto, 5 Fotos = 20 s */
.hero-bild { max-width: 30rem; }

.slideshow {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 2px;
  background: #E6E6E6;
}

.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  animation: slide-wechsel 20s infinite;
  animation-delay: calc(var(--i) * 4s - 0.8s);
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4rem 1.25rem 1.1rem;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.2;
  color: #FFFFFF;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0));
}

@keyframes slide-wechsel {
  0%   { opacity: 0; }
  4%   { opacity: 1; }
  20%  { opacity: 1; }
  24%  { opacity: 0; }
  100% { opacity: 0; }
}

@media (hover: hover) {
  .slideshow:hover .slide { animation-play-state: paused; }
}

@media (prefers-reduced-motion: reduce) {
  .slide { animation: none; }
  .slide:first-child { opacity: 1; }
}

@media (min-width: 860px) {
  .hero {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 4rem;
    align-items: center;
    padding-top: 5rem;
    padding-bottom: 6rem;
  }
  .hero h1 { font-size: 3.24rem; }
  .hero-bild { max-width: none; }
}

/* ---- Projekte ---- */

.projekte {
  border-top: 1px solid var(--border);
  padding: 4rem 0;
}

.projekt-eintrag {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding: 2.5rem 0;
}

.projekt-eintrag + .projekt-eintrag {
  border-top: 1px solid var(--border);
}

.projekt-text {
  max-width: var(--measure);
}

.projekt-text h3 {
  font-weight: 700;
  font-size: 1.51rem;
  margin-bottom: 0.75rem;
}

.projekt-text h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.19rem;
  line-height: 1.3;
  color: var(--text);
  margin: 1.75rem 0 0.4rem;
}

.projekt-text p {
  color: var(--text-secondary);
  margin: 0 0 0.75rem;
}

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

.projekt-orte {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
}

.projekt-bild img {
  width: 100%;
  height: auto;
  border-radius: 2px;
}

.projekt-bild-raster {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.projekt-bild-raster img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 2px;
}

@media (min-width: 720px) {
  .projekt-bild-raster {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
  }
}

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

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 0.98rem;
  text-decoration: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.btn-primary {
  background: var(--text);
  color: #FFFFFF;
  border: 1px solid var(--text);
}
.btn-primary:hover {
  background: #000000;
  color: #FFFFFF;
}

/* ---- Spenden ---- */

.spenden {
  border-top: 1px solid var(--border);
  padding: 4rem 0;
}

.spenden h2 { margin-bottom: 1rem; }

.spenden p {
  color: var(--text-secondary);
  max-width: var(--measure);
  margin: 0 0 1rem;
}

.bankdaten {
  margin-top: 2rem;
  border: 1px solid var(--border);
  padding: 1.75rem 2rem;
  max-width: 30rem;
  font-size: 0.98rem;
}

.bankdaten dt {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 1rem;
}
.bankdaten dt:first-child { margin-top: 0; }

.bankdaten dd.iban {
  white-space: nowrap;
  user-select: all;
  letter-spacing: 0.02em;
}

.bankdaten dd {
  margin: 0.15rem 0 0;
  font-family: var(--font-serif);
  font-size: 1.19rem;
}

.kontakt {
  border-top: 1px solid var(--border);
  padding: 4rem 0;
}

.kontakt h2 { margin-bottom: 1rem; }

.kontakt p {
  color: var(--text-secondary);
  max-width: var(--measure);
  margin-bottom: 1.5rem;
}

.kontakt-email {
  font-family: var(--font-serif);
  font-size: 1.51rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--text);
}

.kontakt-email:hover { color: var(--text-secondary); }

.kontaktdaten {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 3rem;
}

.kontaktdaten li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.kontaktdaten strong {
  font-family: var(--font-serif);
  font-size: 1.19rem;
}

.kontaktdaten span { color: var(--text-secondary); }
.kontaktdaten a { color: var(--text); }

/* ---- Kontaktformular ---- */

.kontakt-formular {
  max-width: 30rem;
  margin-top: 2rem;
}

.formular-feld {
  margin-bottom: 1.25rem;
}

.formular-feld label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.formular-feld input,
.formular-feld textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text);
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.65rem 0.8rem;
  transition: border-color var(--transition);
}

.formular-feld input:focus,
.formular-feld textarea:focus {
  outline: none;
  border-color: var(--text);
}

.formular-feld textarea {
  resize: vertical;
  min-height: 7rem;
}

.website-feld {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.kontakt-formular .formular-hinweis {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.formular-trenner {
  margin: 2rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

footer.site-footer {
  background: var(--dark);
  color: var(--dark-text);
  padding: 2rem 0;
  margin-top: 2rem;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--dark-text);
  opacity: 0.85;
}
.site-footer a:hover { color: #fff; opacity: 1; }

.footer-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-zusatz {
  text-wrap: balance;
  font-size: 0.85rem;
  opacity: 0.7;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

/* ---- Legal pages (Impressum / Datenschutz) ---- */

.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.legal-page h1 {
  font-size: 2.16rem;
  margin-bottom: 2rem;
}

.legal-page h2 {
  font-size: 1.3rem;
  margin: 2.5rem 0 0.75rem;
}

.legal-page p { margin: 0 0 1rem; }

.legal-page h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.4rem;
}

.legal-page ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.legal-page li { margin-bottom: 0.4rem; }

.legal-page .stand {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: -1rem 0 1.5rem;
}

.legal-page .zurueck {
  display: inline-block;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--text-secondary);
}
.legal-page .zurueck:hover { color: var(--text); }

.legal-page .quelle {
  margin-top: 2.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.todo {
  background: #F2F2F2;
  border: 1px dashed var(--text-secondary);
  padding: 0.15rem 0.5rem;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.95em;
}

/* ---- Nach-oben-Button ---- */

.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--transition), transform var(--transition), border-color var(--transition), visibility 0s linear 180ms;
}

.back-to-top.ist-sichtbar {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity var(--transition), transform var(--transition), border-color var(--transition);
}

.back-to-top:hover {
  border-color: var(--text);
  color: var(--text);
}

.back-to-top svg {
  width: 18px;
  height: 18px;
}


/* Variante: leicht graue Seitenfläche (Header, Eingabefelder und Bankdaten bleiben weiß) */
.bankdaten { background: #FFFFFF; }
.todo { background: #E6E6E6; }

/* ---- Desktop-Header: großes Logo, bündig mit der linken Kante der Hero-Fotos ----
   Header und Hero nutzen dasselbe Raster (1,15 : 0,85, Abstand 4 rem). Das Logo reicht
   über die linke Spalte plus Abstand. Der Header ist fixiert, das Logo bleibt immer groß. */
@media (min-width: 860px) {
  :root {
    --logo-gross: calc((min(100vw, 1080px) - 3rem - 4rem) * 0.575 + 4rem);
  }
  body { padding-top: calc(var(--logo-gross) * 41 / 311 + 2rem + 1px); }

  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
  }
  .header-inner {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    column-gap: 4rem;
    align-items: center;
  }
  .header-inner > a {
    display: block;
    width: calc(100% + 4rem);
  }
  .site-header .logo,
.site-header img { width: 100%; }
  .site-nav { justify-self: end; }
  html { scroll-padding-top: 8.5rem; }
}

/* ---- Handy: Abstände straffen, Bankdaten-Kasten schmaler gepolstert ---- */
@media (max-width: 719px) {
  .hero { padding: 2.5rem 1.5rem 3rem; gap: 2rem; }
  .projekte { padding: 2.5rem 0; }
  .projekt-eintrag { padding: 2rem 0; }
  .spenden, .kontakt { padding: 3rem 0; }
  .bankdaten { padding: 1.25rem; }
  footer.site-footer { padding-bottom: 4.75rem; }
}

/* ---- Niedrige Bildschirme (Handy quer): Header nicht festhalten ---- */
@media (max-height: 560px) {
  .site-header { position: static; }
  body { padding-top: 0; }
}
