/*
Author: C0Eight
story.css (clean fixed)
*/

/* =========================
   Design-Variablen
========================= */
:root {
  --primary: #5555ff;
  --primary-dark: #3333cc;
  --primary-soft: #eef0ff;
  --accent: #ffb347;
  --bg-page: #f5f7ff;

  --text: #111111;
  --text-muted: #555555;

  --radius-lg: 16px;
  --radius-md: 12px;

  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.12);
  --shadow-strong: 0 14px 34px rgba(15, 23, 42, 0.18);
}

/* =========================
   Global
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  font-family: "Poppins", sans-serif;
  background: radial-gradient(circle at top left, #ffffff, var(--bg-page));
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

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

/* =========================
   Header
========================= */
header {
  position: sticky;
  top: 0;
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 18px 28px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  color: white;

  border-bottom: 3px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22);
}

/* linke / rechte Bereiche */
.header-left,
.header-center,
.header-right {
  display: flex;
  align-items: center;
}

.header-left { gap: 10px; }
.header-right { margin-left: auto; }

/* Center (Logo + Titel) */
.header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  gap: 10px;
  pointer-events: none; /* verhindert “komisches” klicken */
}

.header-center .logo {
  height: 64px;
  width: auto;
}

.header-center h1 {
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* =========================
   Language Items
========================= */
.lang-item,
.lang-item2 {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1;
  transition: background 0.2s ease, transform 0.1s ease;
}

.lang-item .flag,
.lang-item2 .flag {
  width: 20px;
  height: 15px;
  border-radius: 2px;
  object-fit: cover;
}

.lang-item:hover,
.lang-item2:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.lang-item.active,
.lang-item2.active {
  background: #fff;
  color: var(--primary-dark);
}

/* Desktop zeigt lang-item, mobile zeigt lang-item2 */
.lang-item2 { display: none; }

/* =========================
   Navigation (Desktop)
========================= */
.header-right ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 22px;
}

.header-right li { position: relative; }

.header-right a {
  position: relative;
  font-weight: 500;
  padding: 6px 2px;
  border-radius: 4px;
  font-size: 0.95rem;
}

/* Underline */
.header-right a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  background: #ffffff;
  transition: width 0.2s ease;
}

.header-right a:hover::after { width: 100%; }
.header-right a.active { font-weight: 700; }
.header-right a.active::after { width: 100%; }

/* =========================
   Hamburger
========================= */
.nav-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  color: white;
  font-size: 1.2rem;
  padding: 6px 12px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: 0.2s ease;
}
.nav-toggle:hover { background: rgba(255, 255, 255, 0.18); }

/* =========================
   Sections
========================= */
.section {
  max-width: 1100px;
  margin: 70px auto;
  padding: 0 24px;
}

.section-title {
  display: inline-block;
  position: relative;
  margin-bottom: 28px;
  font-size: 2rem;
  color: var(--primary-dark);
  font-weight: 700;
  padding-bottom: 6px;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), transparent);
}

/* =========================
   Hero / Carousel
========================= */
.hero {
  margin-top: 10px;
  position: relative;
  width: 100%;
}

.carousel {
  margin-top: -16px;
  position: relative;
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

.carousel-slide.active {
  opacity: 1;
  position: relative;
}

.carousel-slide img {
  width: 100%;
  height: 62vh;
  max-height: 780px;
  min-height: 320px;
  object-fit: cover;
}

.carousel-controls {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 14px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.carousel-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid #ffffff;
  background: transparent;
  cursor: pointer;
  padding: 0;
  outline: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.carousel-dot.active {
  background: #ffffff;
  transform: scale(1.15);
}

/* =========================
   Story (Weiterlesen)  ✅ FIXED
========================= */
.story-text {
  max-width: 820px;
  font-size: 0.98rem;
  color: var(--text-muted);
}

.story-text p + p { margin-top: 12px; }

.story-text strong { color: var(--primary-dark); }

.story-signature {
  margin-top: 20px;
  font-weight: 700;
  color: var(--primary-dark);
}

/* Der versteckte Teil (Animation per max-height) */
.story-more {
  display: block;
  margin-top: 12px;
  overflow: hidden;

  max-height: 0;
  opacity: 0;
  transform: translateY(4px);
  transition: max-height 0.5s ease, opacity 0.5s ease, transform 0.4s ease;
}

.story-more.expanded {
  max-height: 5000px;
  opacity: 1;
  transform: translateY(0);
}

/* Button */
.story-read-more {
  margin-top: 18px;
  border: none;
  background: none;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0;
  position: relative;
}

.story-read-more::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--primary);
  transition: transform 0.2s ease;
  transform-origin: left;
}

.story-read-more:hover::after {
  transform: scaleX(0.7);
}

/* =========================
   Timeline
========================= */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.timeline-item {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(85, 85, 255, 0.10);
  padding: 18px 18px 16px;
  overflow: hidden;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), transparent);
  opacity: 0.25;
}

.timeline-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-left: 22px;
}

.timeline-date {
  font-weight: 800;
  color: var(--primary-dark);
  font-size: 1.05rem;
}

.timeline-badge {
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(85, 85, 255, 0.12);
  color: var(--primary-dark);
  font-weight: 700;
  white-space: nowrap;
}

.timeline-body {
  margin-top: 10px;
  margin-left: 22px;
  color: var(--text-muted);
  font-size: 0.96rem;
}

.timeline-body p + p { margin-top: 10px; }

.timeline-body ul {
  margin: 10px 0 0 18px;
}

.timeline-body li { margin: 6px 0; }

/* Timeline Weiterlesen (display none -> show) */
.timeline-more {
  margin-top: 10px;
  display: none;
}

.timeline-more.show { display: block; }

.timeline-toggle {
  margin-top: 12px;
  border: none;
  background: none;
  color: var(--primary);
  font-weight: 800;
  cursor: pointer;
  padding: 0;
  font-size: 0.95rem;
}

.timeline-toggle:hover { text-decoration: underline; }

/* Media Galerie */
.timeline-media {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.timeline-media img {
  height: 160px;
  width: auto;
  border-radius: 12px;
  border: 1px solid rgba(85, 85, 255, 0.12);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.10);
  flex: 0 0 auto;
  cursor: zoom-in;
}

/* =========================
   Lightbox
========================= */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 22px;
}

.lightbox.open { display: flex; }

.lightbox-content {
  position: relative;
  max-width: min(1200px, 96vw);
  max-height: 92vh;
}

.lightbox img {
  width: 100%;
  height: auto;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
  background: #111;
}

.lightbox-caption {
  margin-top: 10px;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.92rem;
}

.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  background: white;
  color: #111;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

/* =========================
   Footer
========================= */
footer {
  background: #ffffff;
  text-align: center;
  padding: 25px;
  margin-top: 40px;
  color: var(--text-muted);
  font-weight: 600;
  border-top: 2px solid var(--primary-soft);
}

/* =========================
   Responsive ✅ sauber / ohne Konflikte
========================= */

/* Header hide animation (für JS .header-hidden) */
header {
  transition: transform 0.28s ease;
  will-change: transform;
}
header.header-hidden {
  transform: translateY(-110%);
}

/* Tablet / kleiner Desktop */
@media (max-width: 1100px) {
  header { padding: 16px 18px; }
  .section { padding: 0 16px; }
  .header-center h1 { font-size: 1.35rem; }
  .header-center .logo { height: 56px; }
}

/* Mobile Nav + Titel neben Hamburger */
@media (max-width: 1250px) {

  /* ✅ Grid: links Titel/Logo, rechts Hamburger; darunter Menü & Sprachen */
  header{
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto; /* ✅ 3 Zeilen: Top, Menü, Sprachen */
    align-items: center;
    gap: 10px;
    padding: 14px 14px;
  }

  /* ✅ Center (Logo + Titel) links oben, NEBEN dem Hamburger */
  .header-center {
    position: static !important;
    transform: none !important;
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    justify-content: flex-start;
    width: auto;
    pointer-events: auto;
    order: 0;
  }

  /* ✅ Hamburger rechts oben */
  .nav-toggle {
    display: inline-flex;
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    justify-self: end;
    align-self: center;
    margin-left: 0 !important;
    order: 0;
  }

  /* ✅ Sprache: Desktop aus, mobile an */
  .lang-item { display: none; }
  .lang-item2 { display: flex; }

  /* Navigation kommt in Zeile 2 */
  .header-right {
    grid-column: 1 / -1;
    grid-row: 2 / 3;
    width: 100%;
    margin-left: 0;
    justify-content: center;
    order: 0;
  }

  /* ✅ Sprachen (mobile) IMMER unter dem Menü (Zeile 3) */
  .header-left:last-of-type {
    grid-column: 1 / -1;
    grid-row: 3 / 4;
    width: 100%;
    justify-content: center;
    margin-top: 10px;
    order: 0;
  }

  /* Menü als Dropdown-Card */
  .header-right ul {
    display: none;
    flex-direction: column;
    gap: 10px;

    background: var(--primary-dark);
    border-radius: 14px;
    box-shadow: var(--shadow-strong);
    padding: 14px;

    width: min(360px, 92vw);
    margin: 10px auto 0;
  }

  /* ✅ passt zu deinem JS: headerRight.classList.toggle('open') */
  .header-right.open ul { display: flex; }

  /* ✅ wenn Menü offen ist: Sprachen bekommen etwas mehr Abstand */
  .header-right.open + .header-left:last-of-type {
    margin-top: 14px;
  }

  .header-right a {
    display: block;
    padding: 12px 14px;
    text-align: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
  }

  .header-right a:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  .carousel-slide img { height: 42vh; min-height: 260px; }
  .section { margin: 55px auto; }
  .section-title { font-size: 1.55rem; }
  .timeline-media img { height: 130px; }
  .timeline-item::before { left: 14px; }
  .timeline-head, .timeline-body { margin-left: 18px; }
}

/* sehr klein */
@media (max-width: 480px) {
  .header-center h1 { font-size: 1.2rem; }
  .header-center .logo { height: 50px; }
  .section { padding: 0 12px; }
  .carousel-controls { bottom: 10px; padding: 4px 10px; }
  .carousel-dot { width: 8px; height: 8px; }
}

