/* ===========================================================
   wibfin – Institut Website
   Mobile-first Stylesheet
   =========================================================== */

:root {
  --color-teal:       #2e6c6b;
  --color-teal-dark:  #1f4d4c;
  --color-teal-light: #e8f1f1;
  --color-text:       #222222;
  --color-text-soft:  #555555;
  --color-bg:         #ffffff;
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Verdana, Arial, sans-serif;
  --header-height: 64px;
  --max-width: 1100px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

a { color: var(--color-teal); text-decoration: none; }
a:hover { color: var(--color-teal-dark); }

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

/* -----------------------------------------------------------
   Header / Navigation
   ----------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-teal-light);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand__mark {
  height: 40px;
  width: auto;
}

.brand__tagline {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-teal-dark);
  line-height: 1.2;
  max-width: 180px;
}

/* Burger-Button, nur auf kleinen Screens sichtbar */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 3px;
  background: var(--color-teal-dark);
  border-radius: 2px;
}

.main-nav {
  display: none;
  position: absolute;
  top: 100%;
  right: 16px;
  flex-direction: column;
  width: auto;
  min-width: 200px;
  background: var(--color-teal-light);
  border: 1px solid var(--color-teal);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
  overflow: hidden;
  margin-top: 8px;
}
.main-nav.is-open { display: flex; }

.main-nav a {
  padding: 12px 16px;
  font-size: 15px;
  color: var(--color-text);
  border-bottom: 1px solid rgba(0,0,0,.08);
  text-align: right;
}
.main-nav a:last-child { border-bottom: none; }
.main-nav a.is-active,
.main-nav a:hover {
  color: var(--color-teal);
  font-weight: 600;
}

/* -----------------------------------------------------------
   Sub-Nav (zweite Ebene innerhalb eines Leistungsfelds)
   ----------------------------------------------------------- */
.sub-nav {
  background: #fff;
  border-bottom: 1px solid #eee;
}
.sub-nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 8px;
}
.sub-nav a {
  padding: 10px 6px;
  font-size: 14px;
  color: var(--color-text-soft);
  border-bottom: 2px solid transparent;
}
.sub-nav a:hover {
  color: var(--color-teal);
}
.sub-nav a.is-active {
  color: var(--color-teal-dark);
  font-weight: 600;
  border-bottom-color: var(--color-teal);
}

/* -----------------------------------------------------------
   Content
   ----------------------------------------------------------- */
.site-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.site-content h1 {
  font-size: 24px;
  color: var(--color-teal-dark);
  margin: 0 0 16px;
}
.site-content h2 {
  font-size: 19px;
  color: var(--color-teal-dark);
  margin: 24px 0 10px;
}
.site-content p { color: var(--color-text-soft); }
.site-content img.img-left,
.site-content img.img-right {
  max-width: 100%;
  margin: 0 0 16px;
  border-radius: 12px;
}

.site-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 20px;
  font-size: 13px;
}
.site-content th,
.site-content td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}
.site-content th {
  color: var(--color-teal-dark);
  font-weight: 600;
}

@media (min-width: 640px) {
  .site-content img.img-left {
    float: left;
    max-width: 38%;
    margin: 4px 24px 16px 0;
  }
  .site-content img.img-right {
    float: right;
    max-width: 38%;
    margin: 4px 0 16px 24px;
  }
  /* Zusatzklasse fuer einzelne Bilder, die kleiner sein sollen als die
     Standardgroesse (38%). Einfach "img-small" zusaetzlich zu img-left/
     img-right auf das <img>-Tag setzen. 30% = 80% von 38%, bei Bedarf hier
     direkt anpassen. */
  .site-content img.img-small {
    max-width: 30%;
  }
}

/* Hero-Bild auf Startseite */
.hero {
  position: relative;
  width: 100%;
  height: 42vh;
  min-height: 220px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--color-teal-light);
}
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.12);
  will-change: transform;
  animation: heroKenBurns 18s linear infinite alternate;
}

@keyframes heroKenBurns {
  from { transform: scale(1.12) translate(0%, 0%); }
  to   { transform: scale(1.22) translate(-6%, -4%); }
}

@media (prefers-reduced-motion: reduce) {
  .hero img { animation: none; }
}
.hero__text {
  position: absolute;
  left: 5%;
  bottom: 8%;
  z-index: 2;
  color: #fff;
  font-size: 1.3em;
  font-weight: 600;
  text-shadow: 0 2px 6px rgba(0,0,0,.45);
  max-width: 80%;
}

/* -----------------------------------------------------------
   Profilkarten (Über uns)
   ----------------------------------------------------------- */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 16px;
}

@media (min-width: 720px) {
  .profile-grid { grid-template-columns: repeat(3, 1fr); }
}

.profile-card {
  background: var(--color-teal-light);
  border-radius: 16px;
  padding: 20px;
}

.profile-card__photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
}

.profile-card h3 {
  font-size: 16px;
  color: var(--color-teal-dark);
  margin: 0 0 4px;
  text-align: center;
}

.profile-card__role {
  text-align: center;
  font-weight: 600;
  color: var(--color-teal-dark);
  margin: 0 0 2px;
}

.profile-card__title {
  text-align: center;
  font-size: 13px;
  color: var(--color-text-soft);
  margin: 0 0 14px;
}

.profile-card p {
  font-size: 13px;
}

/* -----------------------------------------------------------
   Themen-Boxen (Beratung / Forschung / Training)
   ----------------------------------------------------------- */
.topic-boxes {
  max-width: var(--max-width);
  margin: 8px auto 0;
  padding: 8px 16px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid #eee;
}

.topic-box {
  flex: 1 1 220px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--color-teal-light);
  color: var(--color-teal-dark);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(46, 108, 107, 0.15);
  transition: background .2s ease, border-color .2s ease;
}
.topic-box span { white-space: nowrap; }
.topic-box:hover {
  background: #d8ece9;
  border-color: rgba(46, 108, 107, 0.35);
  color: var(--color-teal-dark);
}

/* -----------------------------------------------------------
   Footer
   ----------------------------------------------------------- */
.site-footer {
  border-top: 1px solid #eee;
  padding: 16px;
  font-size: 13px;
  color: var(--color-text-soft);
}
.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}
.footer-nav a { margin-right: 16px; color: var(--color-text-soft); }
.footer-nav a:hover { color: var(--color-teal); }

/* -----------------------------------------------------------
   Desktop: Nav horizontal statt Burger
   ----------------------------------------------------------- */
@media (min-width: 860px) {
  .nav-toggle { display: none; }

  .main-nav {
    display: flex !important;
    position: static;
    flex-direction: row;
    width: auto;
    min-width: 0;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin-top: 0;
    gap: 4px;
  }
  .main-nav a {
    border-bottom: none;
    padding: 10px 12px;
    font-size: 14px;
    text-align: left;
    white-space: nowrap;
  }
}
