/* ==========================================================================
   LAYOUT – Container, Grid, Flex, Section, Split, Hero
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

/* --- Section --- */
.section {
  padding: var(--section-py-desktop) 0;
}

@media (max-width: 768px) {
  .section {
    padding: var(--section-py-mobile) 0;
  }
}

.section--light {
  background-color: var(--color-bg-light);
}

.section--warm {
  background-color: var(--color-bg-warm);
}

.section--action {
  background-color: var(--color-cta-primary);
  color: #fff;
}

.section--action h2,
.section--action h3,
.section--action h4 {
  color: #fff;
}

.section--action p {
  color: rgba(255, 255, 255, 0.9);
}

/* Vollflächige Digitaltreff-Sektion (Teal) */
.section--dibo {
  background-color: var(--dibo-teal);
}

.section--dark {
  background-color: var(--color-dunkel);
  color: #fff;
}

.section--dark h2,
.section--dark h3,
.section--dark p {
  color: #fff;
}

.section--stripe-top {
  border-top: var(--stripe-height) solid var(--color-primaer);
}

/* --- Section Header --- */
.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3rem;
}

.section-header__eyebrow {
  display: inline-block;
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-akzent-text);
  margin-bottom: var(--space-xs);
}

.section--action .section-header__eyebrow {
  color: rgba(255, 255, 255, 0.7);
}

.section--warm .section-header__eyebrow {
  color: #fff;
}

/* --- Grid --- */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1023px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* --- Split (Text + Bild) --- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.split--reverse {
  direction: rtl;
}

.split--reverse > * {
  direction: ltr;
}

@media (max-width: 768px) {
  .split {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .split--reverse {
    direction: ltr;
  }
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  top: -8vh;
  height: calc(100% + 8vh);
}

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

/* Hero-Slideshow (Crossfade) */
.hero__slides {
  position: absolute;
  inset: 0;
}

.hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.hero__slide.is-active {
  opacity: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  padding-bottom: var(--space-2xl);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* Bücherei-Grün – nur unten kräftig, damit das Bild (inkl. „Mein Buch")
     oben/mittig sichtbar bleibt; unten nahtloser Übergang in die grüne Sektion */
  background: linear-gradient(
    to bottom,
    transparent 42%,
    rgba(188, 207, 3, 0.4) 64%,
    rgba(188, 207, 3, 0.9) 86%,
    var(--color-primaer) 100%
  );
}

.hero__content h1 {
  font-size: clamp(2rem, 5vw, var(--fs-4xl));
  max-width: 640px;
  color: #fff;
  /* dunkler Schatten, damit Weiß auch über hellen Bildstellen lesbar bleibt */
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
}

.hero__content p {
  font-size: var(--fs-lg);
  max-width: 540px;
  color: #fff;
  margin-bottom: var(--space-lg);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
  .hero__content {
    padding-bottom: var(--space-lg);
  }
  .hero__content h1 {
    font-size: 2.25rem !important;
  }
}

/* --- Page-Hero (Unterseiten) --- */
.page-hero {
  /* Bücherei-Grün als Header-Hintergrund (überschreibt section--light) */
  background-color: var(--color-primaer);
  padding-top: calc(var(--section-py-desktop) + 5rem);
  padding-bottom: var(--section-py-desktop);
}

@media (max-width: 768px) {
  .page-hero {
    padding-top: calc(var(--section-py-mobile) + 5.5rem) !important;
    padding-bottom: var(--section-py-mobile);
  }
}

.page-hero__title {
  margin-bottom: var(--space-sm);
}

.page-hero__subtitle {
  font-size: var(--fs-lg);
  color: var(--color-text-muted);
  max-width: 640px;
}

/* --- Breadcrumb --- */
.breadcrumb {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.breadcrumb a {
  color: var(--color-text-muted);
}

.breadcrumb a:hover {
  color: var(--color-cta-primary);
}

.breadcrumb__sep {
  margin: 0 0.5rem;
}

/* --- Page Transition --- */
/* Nur Deckkraft animieren – KEIN transform am <body>, da ein transform am
   Body-Element die fixe Navigation zum mitscrollen bringen würde. */
.page-transition {
  animation: pageIn 0.3s ease-out both;
}

@keyframes pageIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
