/* ===========================
   Grundlegendes Design
   =========================== */
:root {
  --brand: #FFC03A;
  --brand-dark: #e0a82e;
  --bg: #fdfdfb;
  --text: #222;
  --muted: #666;
  --card: #ffffff;
  --shadow: 0 2px 2px rgba(0,0,0,.06);
  --radius: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ===========================
   Header & Navigation
   =========================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  box-shadow: var(--shadow);
}

.nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: var(--radius);
}
.brand:hover { background: rgba(255,192,58,0.15); }

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: var(--shadow);
}
.brand span {
  font-weight: 800;
  color: var(--brand-dark);
  font-size: 1rem;
}

.spacer { flex: 1; }

.nav-right {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.nav-right a {
  text-decoration: none;
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius);
  font-weight: 600;
}
.nav-right a:hover {
  background: rgba(255,192,58,0.15);
  color: var(--brand-dark);
}

/* ===========================
   Layout & Sektionen
   =========================== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 16px;
}

.hero, .split {
  display: grid;
  gap: 28px;
  align-items: center;
  grid-template-columns: 1.1fr 0.9fr;
}

/* make .split columns align from the top and
   let the image stay within the column height --- */
.split {
  display: grid;
  gap: 20px;
  grid-template-columns: 50% 50%;
  align-items: start;                 /* top-align both columns */
}

.split .media {
  display: flex;                      /* gives us a height context */
  align-items: flex-start;            /* top align image */
}

.hero .media img,
.split .media img {
  /* max-width: 450px; */                 /* keep your visual cap */
  width: 100%;                      /* preserve aspect ratio */
  /* height: 100%; */                      /* fill available column height */
  /* max-height: 450px; */                  /* don't exceed column */
  object-fit: cover;                /*if contain: shrink to fit if needed */
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

h1, h2, h3, h4 {
  color: var(--brand-dark);
  margin: 12px 0 12px;
}
h1 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.8rem); }

p { margin: 0 0 12px; }
.muted { color: var(--muted); }

.btn {
  display: inline-block;
  background: var(--brand);
  color: #000;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: background .2s, color .2s;
}
.btn:hover {
  background: var(--brand-dark);
  color: #fff;
}

/* Vollbreites Hero mit Hintergrundbild */
.hero-bg {
  position: relative;
  display: flex;
  justify-content: flex-end;   /* Textblock nach links */
  align-items: center;
  min-height: 400px;           /* Mindesthöhe */
  background: url("bildprojekt.jpg?text=Pumptrack+Visualisierung") no-repeat center center;
  background-size: cover;      /* Bild skaliert auf volle Breite/Höhe */
  color: #000;                 /* Textfarbe Standard */
}

/* Transparenter Hintergrund für den Textblock */
.overlay-text {
  background: rgba(255, 255, 255, 0.85); /* weiß, 80 % Deckkraft */
  padding: 24px;
  max-width: 500px;             /* Textbereich begrenzen */
  border-radius: 12px;
  margin: 16px;
}

figcaption {
  font-size: 0.8rem;
  color: #666;
  margin-top: 6px;
}

/* ===========================
   Abschnitt 2: Karten (horizontales Scrollen)
   =========================== */
.cards {
  display: flex;                 /* statt grid */
  gap: 16px;
  overflow-x: auto;              /* horizontal scrollen */
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity; /* sanftes Einrasten */
  padding-bottom: 6px;
  
  /* scrollbar unsichtbar machen */
  -ms-overflow-style: none;   /* IE & Edge Legacy */
  scrollbar-width: none;      /* Firefox */
}
.cards::-webkit-scrollbar {
  display: none;              /* Chrome, Safari, Edge (WebKit) */
}

.cards > .card {
  flex: 0 0 330px;
  scroll-snap-align: start;
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);

  max-height: 260px;
  overflow-y: auto;

  /* hide vertical scrollbar but keep scroll */
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.cards > .card::-webkit-scrollbar {
  display: none;
}

.card .sub {
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 10px;
  font-size: .9rem;
}

/* ======================================
Abschnitt 3: Spende, Kontakt, Sponsoring 
=========================================*/
.image-with-caption {
  position: relative;
  display: inline-block;
}

.image-with-caption img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Hide caption by default */
.image-with-caption figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 6px 10px;
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  opacity: 0;                 /* hidden */
  visibility: hidden;
  transition: opacity 0.3s ease;
}
.image-with-caption figcaption a {
  color: #fff;
  text-decoration: underline;
}

/* Show caption on hover/focus */
.image-with-caption:hover figcaption,
.image-with-caption:focus-within figcaption {
  opacity: 1;
  visibility: visible;
}


/* ===========================
   Abschnitt 5: max. 5 Spalten + Scroll (scrollbar hidden)
   =========================== */

.grid5 {
  display: flex;
  gap: 14px;
  overflow-x: auto;              /* horizontales Scrollen */
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding-bottom: 6px;           /* Platz für Scrollbar */

  /* scrollbar unsichtbar */
  -ms-overflow-style: none;      /* IE & Edge Legacy */
  scrollbar-width: none;         /* Firefox */
}
.grid5::-webkit-scrollbar {
  display: none;                 /* Chrome, Safari, Edge (WebKit) */
}

.grid5 > .tile {
  flex: 0 0 calc((100% - 4*14px) / 5); /* exakt 5 Spalten sichtbar */
  scroll-snap-align: start;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  text-align: center;
}

.tile img {
  width: 240px;
  height: 160px;
  object-fit: cover;          /* Bild wird gefüllt, ggf. beschnitten */
  object-position: top;       /* Bildmittelpunkt bleibt sichtbar */
  display: block;
  border-radius: 10px;
  margin: 0 auto 8px auto;
}

.tile h4 {
  margin: 4px 0 6px;
  font-size: .95rem;
  color: var(--brand-dark);
}

.tile p {
  margin: 0;
  font-size: .85rem;
  color: var(--muted);
}


/* ============= Projektseite ============*/
.projektuebersicht .media {
  float: right;
  width: 66%;
  margin: 0 0 16px 24px;
  border-radius: 12px;
  shape-outside: inset(0 round 12px);
}

.projektuebersicht .media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.projektuebersicht::after {
  content: "";
  display: table;
  clear: both;
}

@media (max-width: 900px) {
  .projektuebersicht .media {
    float: none;
    width: 100%;
    margin: 0 0 16px 0;
    shape-outside: none;
  }
}

/* ===========================
   Footer
   =========================== */
footer {
  margin-top: 32px;
  background: #fff;
  box-shadow: var(--shadow);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-inner a {
  color: var(--brand-dark);
  text-decoration: none;
  font-weight: 600;
}
.footer-inner a:hover { color: var(--brand); }

/* Works in Chrome, Edge, Safari */
.scroll-container::-webkit-scrollbar {
  display: none; /* hides scrollbar */
}

/* Works in Firefox */
.scroll-container {
  scrollbar-width: none; /* hides scrollbar */
}

/* Works in IE/Edge Legacy */
.scroll-container {
  -ms-overflow-style: none;
}

/* ===========================
   Responsiv
   =========================== */

/* Kleine Bildschirme: vertikales Menü */
@media (max-width: 860px) {
  .spacer { display: none; }              /* Logo bleibt oben/links */

  .nav {
    max-width: 1120px;
    margin: 0 auto;
    padding: 12px 18px;
    display: flex;
    flex-wrap: wrap;               /* untereinander anordnen */
    align-items: stretch;
    gap: 10px;
  }

  .brand {
    align-self: flex-start;               /* Logo/Name oben */
  }

  .nav-right {
    display: flex;
    flex: 1 1 auto;
    min-width: 120 px;
    /*flex-direction: column;*/               /* vertikal */
    gap: 8px;
    overflow: visible;                    /* kein Horizontal-Scrollen */
    white-space: normal;                  /* Zeilenumbruch erlauben */
  }

  .nav-right a {
    /*display: block;*/
    padding: 12px 12px;
    border-radius: 10px;
    background: #fff;                     /* Karte-Optik (optional) */
    box-shadow: var(--shadow);            /* optional */
  }
  .nav-right a:hover {
    background: rgba(255,192,58,0.15);
  }
}

@media (max-width: 900px) {
  /* Abschnitt 3: Text oben, Bild unten */
  .hero, .split {
    grid-template-columns: 1fr;
  }

  .hero .text, .split .text { order: 1; }
  .hero .media, .split .media { order: 2; }
  
  /* On small screens let the image size itself naturally */
  .split .media img {
    width: 100%;
    /* max-width: 520px; */
    /* max-height: 520px; */
    height: auto;
    /* object-fit: cover; */               /* optional: can keep 'contain' if preferred */
  }
}