/* Wagenheim – base layout & theme */

:root {
  --orange: #f16522;
  --orange-light: #fff4ed;
  --accent-brown: #a64d2f;
  --text: #1a1a1a;
  --text-muted: #444;
  --bg: #E8A800;
  --highlight-bg: #fddd8a;
  --section-bg: #ffffff;
  --radius: 1rem;
  --rim: 2px;
  --gap: clamp(0.75rem, 2vw, 1.25rem);
  --max-width: 72rem;
  --row-top-height: clamp(4.25rem, 11vw, 5.5rem);
  --row-third-height: clamp(10.5rem, 23vw, 13rem);
  --caps-heading: clamp(0.78rem, 1.45vw, 0.92rem);
  --meta-font: clamp(0.62rem, 1.05vw, 0.76rem);
  --slideshow-height: clamp(15rem, 42vh, 24rem);
  --gallery-row-height: calc(var(--slideshow-height) / 2);
  --font-body: "Segoe UI", system-ui, -apple-system, sans-serif;
  --sticky-header-offset: 7rem;
}

@media (min-width: 640px) {
  :root {
    --slideshow-height: clamp(18rem, 48vh, 28rem);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--sticky-header-offset) + var(--gap));
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

.page {
  width: min(var(--max-width), 100% - 2 * var(--gap));
  margin: 0 auto;
  padding: var(--gap) 0 calc(var(--gap) * 2);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  flex: 1;
}

/* Shared section styling – rounded edges + orange rim */
.section {
  background: var(--section-bg);
  border: var(--rim) solid var(--orange);
  border-radius: var(--radius);
  overflow: hidden;
}

.section--padded {
  padding: clamp(1rem, 3vw, 1.5rem);
}

/* Unified section titles (matches Aktuelles bar) */
.section-title {
  margin: 0;
  padding: 0.45rem 0.75rem;
  font-size: var(--caps-heading);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--orange);
  background: var(--orange-light);
  border-bottom: var(--rim) solid var(--orange);
  flex-shrink: 0;
}

.section--stacked {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.section__body {
  flex: 1 1 auto;
  min-height: 0;
}

.section__body--padded {
  padding: clamp(1rem, 3vw, 1.5rem);
}

/* Two-column rows */
.row-two-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  align-items: stretch;
}

@media (min-width: 640px) {
  .row-two-cols {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 639px) {
  .row-two-cols--compact .aktuelles-section {
    order: -1;
  }
}

/* Row 1: logo + navigation */
.site-header-sticky {
  position: sticky;
  top: 0;
  z-index: 100;
  margin-top: calc(-1 * var(--gap));
  padding: var(--gap) 0 0;
  background: transparent;
  isolation: isolate;
  transition: padding 0.25s ease;
}

/* Condensed state while scrolled (toggled in js/site-header.js) */
.site-header-sticky.is-condensed {
  --row-top-height: clamp(2.75rem, 7vw, 3.5rem);
  padding-bottom: calc(var(--gap) + var(--radius));
}

.site-header-sticky::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: var(--radius);
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: var(--bg);
}

.site-header-sticky__inner {
  position: relative;
  z-index: 2;
}

.site-header-sticky .section {
  box-shadow: 0 0.15rem 0.55rem rgba(0, 0, 0, 0.1);
}

/*
 * Bottom strip of the sticky header: transparent in the middle so content
 * shows through, with concave orange fillets at the content edges. Scrolled
 * content therefore appears to have rounded top corners.
 */
.site-header-sticky__frame {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--radius);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.site-header-sticky.is-condensed .site-header-sticky__frame {
  opacity: 1;
}

.site-header-sticky__frame::before,
.site-header-sticky__frame::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50vw;
}

.site-header-sticky__frame::before {
  right: calc(100% - var(--radius));
  background: radial-gradient(
    circle at 100% 100%,
    rgba(232, 168, 0, 0) calc(var(--radius) - 1px),
    var(--bg) var(--radius)
  );
}

.site-header-sticky__frame::after {
  left: calc(100% - var(--radius));
  background: radial-gradient(
    circle at 0% 100%,
    rgba(232, 168, 0, 0) calc(var(--radius) - 1px),
    var(--bg) var(--radius)
  );
}

.row-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}

.header-nav-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(0.15rem, 0.45vw, 0.25rem);
  min-width: 0;
}

@media (min-width: 768px) {
  .row-top {
    grid-template-columns: minmax(9rem, 13rem) minmax(0, 1fr);
    align-items: stretch;
  }
}

.logo-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.35rem, 1.2vw, 0.55rem) clamp(0.5rem, 1.5vw, 0.75rem);
  min-height: var(--row-top-height);
  transition: min-height 0.25s ease, padding 0.25s ease;
}

.site-header-sticky.is-condensed .logo-section {
  padding: clamp(0.2rem, 0.8vw, 0.35rem) clamp(0.5rem, 1.5vw, 0.75rem);
}

.logo-section__link {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.logo-section img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 100%);
  max-height: calc(var(--row-top-height) - 0.75rem);
  object-fit: contain;
  transition: max-height 0.25s ease;
}

.site-header-sticky.is-condensed .logo-section img {
  max-height: calc(var(--row-top-height) - 0.2rem);
}

.nav-section {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  padding: clamp(0.3rem, 1vw, 0.5rem) clamp(1rem, 2vw, 1.25rem);
  min-height: var(--row-top-height);
  transition: min-height 0.25s ease, padding 0.25s ease;
}

.site-header-sticky.is-condensed .nav-section {
  padding: clamp(0.15rem, 0.6vw, 0.3rem) clamp(0.5rem, 1.5vw, 0.75rem);
}

.site-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  justify-items: stretch;
  gap: 0.2rem 0.35rem;
  width: 100%;
  height: 100%;
}

.site-nav__group {
  list-style: none;
  margin: 0;
  padding: 0;
  display: contents;
}

.site-nav li {
  min-width: 0;
}

.site-nav a {
  display: block;
  padding: 0.15rem 0.2rem;
  color: var(--orange);
  text-decoration: none;
  font-size: clamp(0.75rem, 2.8vw, 0.86rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.15;
  white-space: normal;
  text-align: center;
  border-radius: calc(var(--radius) - 0.35rem);
  transition: color 0.15s, background 0.15s;
}

@media (min-width: 768px) {
  .site-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.1rem 0.2rem;
  }

  .site-nav a {
    font-size: clamp(0.7rem, 1.2vw, 0.86rem);
    letter-spacing: 0.015em;
    padding: 0.1rem 0.12rem;
  }

  .nav-section {
    padding-left: clamp(0.65rem, 1.4vw, 1rem);
    padding-right: clamp(0.65rem, 1.4vw, 1rem);
  }
}

.site-nav__link--stacked {
  white-space: normal;
  text-align: center;
  line-height: 1.1;
}

.site-nav__line {
  display: block;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
  background: var(--orange-light);
  outline: none;
}

.site-nav a.site-nav__link--current {
  color: var(--text);
  background: var(--orange-light);
}

/* Row 3: compact two columns — left 2/3, right 1/3 */
@media (min-width: 640px) {
  .row-two-cols--compact {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }
}

.row-two-cols--compact .aktuelles-section {
  height: var(--row-third-height);
  min-height: var(--row-third-height);
  max-height: var(--row-third-height);
}

.row-two-cols--compact .description-section {
  min-height: var(--row-third-height);
}

.row-two-cols--compact .section__body {
  padding: clamp(0.45rem, 1.4vw, 0.6rem) clamp(0.65rem, 1.8vw, 0.85rem);
  overflow-y: auto;
}

.row-two-cols--compact .description-section p {
  margin: 0 0 0.4rem;
  font-size: clamp(0.85rem, 1.45vw, 0.95rem);
  line-height: 1.45;
}

.row-two-cols--compact .description-section p:last-child {
  margin-bottom: 0;
}

/* Row 3: Aktuelles */
.aktuelles-section {
  overflow: hidden;
}

.aktuelles-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.aktuelles-item__date {
  display: block;
  font-size: 0.82em;
  color: var(--text-muted);
  margin-bottom: 0.1rem;
}

.aktuelles-item__title {
  display: block;
  font-weight: 700;
  line-height: 1.25;
  font-size: clamp(0.82rem, 1.4vw, 0.92rem);
}

.aktuelles-item__body {
  margin-top: 0.45rem;
  color: var(--text-muted);
}

.aktuelles-item__static .aktuelles-item__body {
  margin-top: 0.25rem;
}

.aktuelles-item__details {
  border: 0;
}

.aktuelles-item__summary {
  cursor: pointer;
  list-style: none;
}

.aktuelles-item__summary::-webkit-details-marker {
  display: none;
}

.aktuelles-item__hint {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.85em;
  font-weight: 600;
  color: var(--orange);
}

.aktuelles-item__teaser {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.92em;
  color: var(--text-muted);
  line-height: 1.45;
}

.aktuelles-item__details[open] .aktuelles-item__teaser,
.aktuelles-item__details[open] .aktuelles-item__hint {
  display: none;
}

.aktuelles-item__details[open] .aktuelles-item__body {
  color: var(--text);
}

.aktuelles-empty {
  margin: 0;
  color: var(--text-muted);
}

.aktuelles-item__permalink {
  color: inherit;
  text-decoration: none;
}

.aktuelles-item__permalink:hover,
.aktuelles-item__permalink:focus-visible {
  color: var(--orange);
  outline: none;
}

.aktuelles-more {
  margin: 0.75rem 0 0;
  font-size: 0.88em;
  font-weight: 700;
}

.aktuelles-more a {
  color: var(--orange);
  text-decoration: none;
}

.aktuelles-more a:hover,
.aktuelles-more a:focus-visible {
  color: var(--text);
  outline: none;
}

/* Row 2: slideshow */
.slideshow-section {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: var(--slideshow-height);
  background: #111;
}

@media (min-width: 640px) {
  .slideshow-section {
    aspect-ratio: 16 / 10;
  }
}

.slideshow-section__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: bottom center;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.slideshow-section__slide.is-active {
  opacity: 1;
}

.slideshow-section__empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 0.95rem;
  text-align: center;
  padding: 1rem;
}

/* Content sections */
.content-section p,
.description-section p {
  margin: 0 0 0.75rem;
}

.initiative-tagline {
  font-weight: 700;
  color: var(--accent-brown);
}

.content-section p:last-child,
.description-section p:last-child {
  margin-bottom: 0;
}

/* Spaces Of Opportunity: logo left, title + text right */
.spaces-section {
  scroll-margin-top: var(--gap);
}

.spaces-section__grid {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
}

@media (min-width: 640px) {
  .spaces-section__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
    align-items: stretch;
  }
}

.spaces-section__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  border-bottom: var(--rim) solid var(--orange);
}

@media (min-width: 640px) {
  .spaces-section__logo {
    border-bottom: none;
    border-right: var(--rim) solid var(--orange);
  }
}

.spaces-section__logo img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.spaces-section__content {
  min-width: 0;
}

.content-section__figure {
  margin: 0.75rem 0;
}

.content-section__figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius) - 0.35rem);
}

/* Highlight strip: Instagram + Spenden (directly below menu) */
.highlight-links {
  --highlight-links-color: var(--accent-brown);
  background: var(--highlight-bg);
  border-color: var(--orange);
  scroll-margin-top: var(--gap);
  flex: 0 0 auto;
  border-radius: 0.45rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding-right: clamp(1rem, 2vw, 1.25rem);
  min-width: 0;
}

.highlight-links__list {
  list-style: none;
  margin: 0;
  padding: clamp(0.35rem, 1vw, 0.5rem) clamp(0.45rem, 1.4vw, 0.85rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(0.3rem, 1.2vw, 0.7rem) clamp(0.7rem, 3vw, 1.75rem);
  color: var(--highlight-links-color);
  font-size: var(--meta-font);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
}

.lang-switch {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
  color: var(--orange);
  font-size: var(--meta-font);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
}

.lang-switch__sep {
  opacity: 0.7;
}

.lang-switch__link {
  color: var(--orange);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.lang-switch__link.is-current {
  border-bottom-color: rgba(241, 101, 34, 0.55);
}

.lang-switch__link:hover,
.lang-switch__link:focus-visible {
  color: #fff;
  border-bottom-color: #fff;
  outline: none;
}

.highlight-links__list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
}

.highlight-links__list a {
  color: var(--highlight-links-color);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(166, 77, 47, 0.45);
  transition: color 0.15s, border-color 0.15s;
}

.highlight-links__list a:hover,
.highlight-links__list a:focus-visible {
  color: var(--orange);
  border-bottom-color: var(--orange);
  outline: none;
}

/* Contact */
.contact-section {
  scroll-margin-top: var(--gap);
}

.row-gallery {
  scroll-margin-top: var(--gap);
  min-height: var(--gallery-row-height);
  background: #F9CF60;
}

@media (min-width: 640px) {
  :root {
    --gallery-row-height: calc(var(--slideshow-height) * 0.58);
  }
}

@media (min-width: 960px) {
  :root {
    --gallery-row-height: calc(var(--slideshow-height) * 0.75);
  }
}

.section__body--compact {
  padding: clamp(0.65rem, 2vw, 0.85rem) clamp(0.75rem, 2vw, 1rem);
}

.contact-section__intro {
  margin: 0 0 0.55rem;
  color: var(--text-muted);
  font-size: 0.88em;
}

.contact-form {
  display: grid;
  gap: 0.85rem;
  max-width: 28rem;
}

.contact-form--compact {
  gap: 0.5rem;
}

.contact-form__field {
  display: grid;
  gap: 0.3rem;
}

.contact-form--compact .contact-form__field {
  gap: 0.15rem;
}

.contact-form__field label {
  font-weight: 600;
  font-size: 0.92em;
}

.contact-form--compact .contact-form__field label {
  font-size: 0.85em;
}

.contact-form__field input,
.contact-form__field textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 2px solid #ddd;
  border-radius: calc(var(--radius) - 0.25rem);
  font: inherit;
  color: var(--text);
  background: #fff;
}

.contact-form--compact .contact-form__field input,
.contact-form--compact .contact-form__field textarea {
  padding: 0.45rem 0.55rem;
  font-size: 0.92em;
}

.contact-form--compact .contact-form__field textarea {
  min-height: 4.5rem;
  resize: vertical;
}

.contact-form__field input:focus-visible,
.contact-form__field textarea:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 1px;
  border-color: var(--orange);
}

.contact-form__submit {
  justify-self: start;
  padding: 0.65rem 1.1rem;
  border: 2px solid var(--orange);
  border-radius: calc(var(--radius) - 0.25rem);
  background: var(--orange);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.contact-form--compact .contact-form__submit {
  padding: 0.45rem 0.85rem;
  font-size: 0.92em;
}

.contact-form__submit:hover,
.contact-form__submit:focus-visible {
  background: #d8561a;
  border-color: #d8561a;
  outline: none;
}

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

.contact-form__message {
  margin: 0 0 0.55rem;
  padding: 0.5rem 0.65rem;
  border-radius: calc(var(--radius) - 0.25rem);
  font-weight: 600;
  font-size: 0.88em;
}

.contact-form__message--success {
  background: #edf7ed;
  color: #1b5e20;
  border: 1px solid #a5d6a7;
}

.contact-form__message--error {
  background: #fdecea;
  color: #b71c1c;
  border: 1px solid #ef9a9a;
}

.content-section {
  scroll-margin-top: var(--gap);
}

.supporter-section__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 3vw, 1.5rem);
  padding: clamp(1rem, 3vw, 1.5rem);
}

@media (min-width: 640px) {
  .supporter-section__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (min-width: 900px) {
  .supporter-section__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  }
}

.row-kontakt-film {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  scroll-margin-top: var(--gap);
}

@media (min-width: 640px) {
  .row-kontakt-film {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
  }
}

.supporter-section__title {
  margin: 0 0 0.65rem;
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  font-weight: 700;
  line-height: 1.3;
}

.supporter-section__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.supporter-section__list li {
  margin: 0 0 0.35rem;
  line-height: 1.45;
}

.supporter-section__list li:last-child {
  margin-bottom: 0;
}

.supporter-section__link {
  color: var(--orange);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(241, 101, 34, 0.35);
}

.supporter-section__link:hover,
.supporter-section__link:focus-visible {
  color: var(--text);
  border-bottom-color: var(--text);
  outline: none;
}

#film-ndr {
  background: #FDE6A9;
}

#film-youtube {
  background: #F9CF60;
}

.film-section__body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(10rem, 22vw, var(--gallery-row-height));
  height: 100%;
  padding: 0.12rem 0.2rem;
}

.film-section__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: clamp(9rem, 20vw, calc(var(--gallery-row-height) - 0.5rem));
  text-decoration: none;
  color: inherit;
}

.film-section__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.25rem, 0.8vw, 0.45rem);
  max-width: 100%;
  transition: transform 0.2s ease;
}

.film-section__label {
  color: #a64d2f;
  font-size: var(--meta-font);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.25;
}

.film-section__label--bottom {
  letter-spacing: 0.04em;
}

.film-section__link:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 0.2rem;
}

.film-section__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: clamp(6rem, 16vw, calc(var(--gallery-row-height) - 3.25rem));
  object-fit: contain;
  border-radius: 0.2rem;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 0 0 1px rgba(0, 0, 0, 0.14),
    0 10px 22px rgba(0, 0, 0, 0.22);
  transition: box-shadow 0.2s ease;
}

.film-section__link:hover .film-section__img,
.film-section__link:focus-visible .film-section__img {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 0 0 1px rgba(241, 101, 34, 0.35),
    0 12px 26px rgba(0, 0, 0, 0.28);
}

.film-section__link:hover .film-section__card,
.film-section__link:focus-visible .film-section__card {
  transform: scale(1.01);
}

.film-section__placeholder {
  display: grid;
  place-items: center;
  width: min(100%, 14rem);
  aspect-ratio: 16 / 9;
  padding: 1rem;
  border-radius: 0.2rem;
  background: rgba(255, 255, 255, 0.35);
  border: 1px dashed rgba(166, 77, 47, 0.45);
  color: #a64d2f;
  font-size: clamp(0.82rem, 1.35vw, 0.92rem);
  font-weight: 700;
  text-align: center;
  line-height: 1.35;
}

/* Projekt row: text left, Baupläne right */
.row-projekt {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  scroll-margin-top: var(--gap);
}

.projekt-section p {
  margin: 0 0 0.4rem;
  font-size: clamp(0.85rem, 1.45vw, 0.95rem);
  line-height: 1.45;
}

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

@media (min-width: 640px) {
  .row-projekt {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: start;
  }

  .bauplaene-section {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
  }

  .bauplaene-section .section__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
  }
}

.bauplaene-section {
  background: #FDE6A9;
}

.bauplaene-intro {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.bauplaene-intro__pictogram {
  display: block;
  width: clamp(5rem, 16vw, 6.5rem);
  max-width: 6.5rem;
  max-height: 6.5rem;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.bauplaene-intro__title {
  margin: 0;
  font-size: var(--caps-heading);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-brown);
  line-height: 1.2;
}

.bauplaene-section p {
  margin: 0 0 0.65rem;
  font-size: clamp(0.85rem, 1.45vw, 0.95rem);
  color: var(--accent-brown);
}

.bauplaene-section p:last-child {
  margin-bottom: 0;
}

.bauplaene-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.bauplaene-downloads {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.bauplaene-downloads-more {
  margin-top: 0.45rem;
}

.bauplaene-downloads__toggle {
  margin-top: auto;
  flex-shrink: 0;
  padding: 0.35rem 0 0;
  border: 0;
  background: none;
  color: var(--accent-brown);
  font: inherit;
  font-size: clamp(0.78rem, 1.25vw, 0.86rem);
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.bauplaene-downloads__toggle:hover,
.bauplaene-downloads__toggle:focus-visible {
  color: var(--text);
  outline: none;
}

.bauplaene-downloads__link {
  display: block;
  color: var(--accent-brown);
  font-size: clamp(0.82rem, 1.35vw, 0.92rem);
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  border-bottom: 1px solid rgba(166, 77, 47, 0.35);
  padding-bottom: 0.1rem;
  transition: color 0.15s, border-color 0.15s;
}

.bauplaene-downloads__link:hover,
.bauplaene-downloads__link:focus-visible {
  color: var(--text);
  border-bottom-color: var(--text);
  outline: none;
}

.bauplaene-empty {
  margin: 0;
  font-size: clamp(0.85rem, 1.45vw, 0.95rem);
  color: var(--accent-brown);
}

.gallery-block .section__body {
  padding: 0.12rem 0.2rem;
}

/* Gallery – stacked album carousel */
.gallery-section {
  background: transparent;
}

.row-gallery .gallery-stack {
  --gallery-perspective: min(1600px, calc(var(--gallery-row-height) * 12));
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
}

.gallery-stack--wide .gallery-stack__stage {
  perspective: min(2200px, calc(var(--gallery-row-height) * 16));
}

.row-gallery .gallery-stack__stage {
  height: var(--gallery-row-height);
  min-height: var(--gallery-row-height);
}

.gallery-block.row-gallery .section__body {
  min-height: var(--gallery-row-height);
  display: flex;
  align-items: stretch;
}

.gallery-block.row-gallery .gallery-stack {
  align-self: stretch;
  align-items: center;
}

.gallery-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88em;
}

.gallery-stack {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: 1fr;
  align-items: center;
  gap: 0.1rem 0.15rem;
  max-width: 100%;
}

.gallery-stack__stage {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  height: var(--gallery-stage-height, clamp(6.75rem, 17vw, 8.5rem));
  overflow: hidden;
  perspective: var(--gallery-perspective, 560px);
  touch-action: pan-y pinch-zoom;
}

.gallery-stack__list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  width: 100%;
  height: 100%;
}

.gallery-stack__slide {
  --cover-size: var(--gallery-cover-size, clamp(4.5rem, 12vw, 5.75rem));
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--cover-size);
  height: var(--cover-size);
  margin-left: calc(var(--cover-size) / -2);
  margin-top: calc(var(--cover-size) / -2);
  transition:
    transform 0.4s ease,
    opacity 0.35s ease,
    filter 0.35s ease;
  transform-origin: center center;
}

.gallery-stack__slide[data-offset="0"] {
  transform: translateX(0) scale(1) rotateY(0deg);
  z-index: 5;
  opacity: 1;
  filter: brightness(1);
}

.gallery-stack--compact .gallery-stack__slide[data-offset="-1"] {
  transform: translateX(-46%) scale(0.78) rotateY(44deg);
  z-index: 4;
  opacity: 0.85;
  filter: brightness(0.9);
}

.gallery-stack--compact .gallery-stack__slide[data-offset="-2"] {
  transform: translateX(-72%) scale(0.62) rotateY(58deg);
  z-index: 3;
  opacity: 0.72;
  filter: brightness(0.84);
}

.gallery-stack--compact .gallery-stack__slide[data-offset="1"] {
  transform: translateX(46%) scale(0.78) rotateY(-44deg);
  z-index: 4;
  opacity: 0.85;
  filter: brightness(0.9);
}

.gallery-stack--compact .gallery-stack__slide[data-offset="2"] {
  transform: translateX(72%) scale(0.62) rotateY(-58deg);
  z-index: 3;
  opacity: 0.72;
  filter: brightness(0.84);
}

.gallery-stack--wide .gallery-stack__slide[data-offset="0"] {
  transform: translateX(0) scale(1) rotateY(0deg);
}

.gallery-stack__slide[hidden] {
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.gallery-cover {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 0.2rem;
}

.gallery-cover:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

.gallery-cover__frame {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 0.2rem;
  padding: 0.18rem;
  background: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 0 0 1px rgba(0, 0, 0, 0.12),
    0 3px 8px rgba(0, 0, 0, 0.22),
    0 10px 18px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.25s ease;
}

.gallery-cover__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.28) 0%,
    rgba(255, 255, 255, 0.04) 28%,
    rgba(0, 0, 0, 0) 45%,
    rgba(0, 0, 0, 0.08) 100%
  );
  pointer-events: none;
}

.gallery-cover__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.12rem;
}

.gallery-stack__slide[data-offset="0"] .gallery-cover__frame {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 0 0 1px rgba(0, 0, 0, 0.14),
    0 10px 22px rgba(0, 0, 0, 0.28),
    0 18px 32px rgba(0, 0, 0, 0.16);
}

.gallery-stack__slide[data-offset="0"] .gallery-cover:hover .gallery-cover__frame,
.gallery-stack__slide[data-offset="0"] .gallery-cover:focus-visible .gallery-cover__frame {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 0 0 1px rgba(241, 101, 34, 0.35),
    0 12px 26px rgba(0, 0, 0, 0.32),
    0 20px 36px rgba(0, 0, 0, 0.18);
}

.gallery-stack__nav {
  grid-row: 1;
  align-self: center;
  border: 0;
  background: rgba(255, 255, 255, 0.75);
  color: var(--orange);
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: background 0.15s, transform 0.15s;
}
.gallery-stack__nav--prev {
  grid-column: 1;
}

.gallery-stack__nav--next {
  grid-column: 3;
}

.gallery-stack__nav:hover,
.gallery-stack__nav:focus-visible {
  background: #fff;
  transform: scale(1.05);
  outline: none;
}

.gallery-stack__nav:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

.gallery-stack__caption,
.gallery-lightbox__caption {
  display: none;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 3vw, 2rem);
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 12, 0.82);
  backdrop-filter: blur(4px);
}

.gallery-lightbox__panel {
  position: relative;
  z-index: 1;
  width: min(54rem, 100%);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
}

.gallery-lightbox__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.gallery-lightbox__img {
  display: block;
  width: min(100%, 42rem);
  max-height: min(72vh, 42rem);
  object-fit: contain;
  border-radius: 0.25rem;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 12px 40px rgba(0, 0, 0, 0.45);
  background: #111;
}

.gallery-lightbox__close {
  position: absolute;
  top: -2.4rem;
  right: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
}

.gallery-lightbox__nav {
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}

.gallery-lightbox__nav:hover,
.gallery-lightbox__nav:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}

body.gallery-lightbox-open {
  overflow: hidden;
}

@media (max-width: 639px) {
  .gallery-stack--compact {
    --gallery-cover-size: min(calc(var(--gallery-row-height) * 0.9), 38vw);
    --gallery-perspective: min(900px, calc(var(--gallery-row-height) * 8));
  }

  .row-gallery .gallery-stack__stage,
  .gallery-stack__stage {
    height: var(--gallery-row-height);
    min-height: var(--gallery-row-height);
  }

  .gallery-stack--compact .gallery-stack__slide {
    --cover-size: var(--gallery-cover-size, clamp(4.25rem, 22vw, 5.25rem));
  }

  .gallery-stack__nav {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 1rem;
  }

  .gallery-lightbox__panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    justify-items: center;
  }

  .gallery-lightbox__nav--prev,
  .gallery-lightbox__nav--next {
    display: none;
  }
}

/* Footer */
.site-footer {
  border-top: var(--rim) solid var(--orange);
  background: var(--section-bg);
  margin-top: auto;
}

.site-footer__inner {
  width: min(var(--max-width), 100% - 2 * var(--gap));
  margin: 0 auto;
  padding: clamp(0.65rem, 2vw, 0.85rem) var(--gap);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  font-size: 0.88em;
  color: var(--text-muted);
}

.site-footer__link {
  color: var(--orange);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}

.site-footer__link:hover,
.site-footer__link:focus-visible {
  color: var(--text);
  outline: none;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.legal-section__heading {
  margin: 1.35rem 0 0.55rem;
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  font-weight: 700;
  line-height: 1.35;
}

.legal-section__heading:first-child {
  margin-top: 0;
}

.legal-section__list {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
}

.legal-section__list li {
  margin-bottom: 0.25rem;
}

.legal-section__nav {
  margin-top: 1.35rem;
  margin-bottom: 0;
}

.site-footer__place {
  margin: 0;
  flex-basis: 100%;
  font-size: 0.92em;
}

.site-footer__copy {
  margin: 0;
}

.site-footer__credit {
  color: #b0b0b0;
}

.site-footer__credit a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(176, 176, 176, 0.45);
}

.site-footer__credit a:hover,
.site-footer__credit a:focus-visible {
  color: var(--text-muted);
  border-bottom-color: var(--text-muted);
  outline: none;
}

/* Almende Gelände petition page */
.almende-intro-section,
.almende-discussion-section {
  scroll-margin-top: var(--gap);
}

.almende-intro {
  margin: 0;
  line-height: 1.55;
}

.row-almende {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  align-items: start;
}

@media (min-width: 960px) {
  .row-almende {
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  }
}

.almende-current {
  scroll-margin-top: var(--gap);
  height: auto;
}

.almende-archive-section {
  scroll-margin-top: var(--gap);
  min-height: 0;
}

.almende-archive-section__body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.almende-archive-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.almende-archive-section:not(.is-expanded) .almende-archive-panel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5rem;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--section-bg));
  pointer-events: none;
}

.almende-archive-section.is-expanded {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

.almende-archive-section.is-expanded .almende-archive-panel {
  overflow: visible;
}

.almende-archive-section.is-expanded .almende-archive-panel::after {
  display: none;
}

.almende-archive-toggle {
  flex-shrink: 0;
  margin-top: 0.65rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--orange);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.almende-archive-toggle:hover,
.almende-archive-toggle:focus-visible {
  color: var(--text);
  outline: none;
}

.almende-petition {
  margin: 0;
}

.almende-message {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: calc(var(--radius) - 0.25rem);
  font-weight: 600;
}

.almende-message--success {
  background: #e8f5e9;
  color: #1b5e20;
}

.almende-message--error {
  background: #ffebee;
  color: #b71c1c;
}

.almende-petition__title {
  margin: 0 0 1rem;
  font-size: clamp(1.15rem, 2.2vw, 1.38rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.almende-petition__body {
  line-height: 1.55;
}

.almende-petition__paragraph {
  margin: 0 0 0.9rem;
}

.almende-petition__paragraph:last-child {
  margin-bottom: 0;
}

.almende-petition__label {
  margin: 0.95rem 0 0.3rem;
  font-size: inherit;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.3;
  color: var(--text);
}

.almende-petition__body > .almende-petition__label:first-child,
.almende-archive__body > .almende-petition__label:first-child {
  margin-top: 0;
}

.almende-petition__label-inline {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.almende-petition__list {
  margin: 0 0 1.1rem;
  padding-left: 1.5rem;
  list-style: disc;
}

.almende-petition__list li {
  margin: 0 0 0.55rem;
  padding-left: 0.35rem;
  line-height: 1.5;
}

.almende-petition__list li:last-child {
  margin-bottom: 0;
}

.almende-petition__label + .almende-petition__list {
  margin-top: 0;
}

.almende-archive__body .almende-petition__list {
  padding-left: 1.35rem;
}

.almende-discussion__intro,
.almende-editor__hint {
  margin: 0 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.92em;
  line-height: 1.45;
}

.almende-edit-form,
.almende-comment-form,
.almende-editor__login {
  display: grid;
  gap: 0.85rem;
  max-width: 100%;
  margin-bottom: 1.25rem;
}

.almende-edit-form__field,
.almende-comment-form__field {
  display: grid;
  gap: 0.3rem;
}

.almende-edit-form__field label,
.almende-comment-form__field label {
  font-weight: 600;
  font-size: 0.92em;
}

.almende-edit-form__field input,
.almende-edit-form__field textarea,
.almende-comment-form__field input,
.almende-comment-form__field textarea,
.almende-editor__login input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 2px solid #ddd;
  border-radius: calc(var(--radius) - 0.25rem);
  font: inherit;
  color: var(--text);
  background: #fff;
}

.almende-edit-form__field textarea,
.almende-comment-form__field textarea {
  resize: vertical;
  min-height: 8rem;
  overflow: hidden;
}

.almende-edit-form__field textarea#petition-body {
  resize: none;
}

.almende-edit-form__submit,
.almende-comment-form__submit,
.almende-editor__button {
  justify-self: start;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: calc(var(--radius) - 0.25rem);
  background: var(--orange);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.almende-edit-form__submit:hover,
.almende-comment-form__submit:hover,
.almende-editor__button:hover,
.almende-edit-form__submit:focus-visible,
.almende-comment-form__submit:focus-visible,
.almende-editor__button:focus-visible {
  background: #d4561e;
  outline: none;
}

.almende-delete-form {
  margin-top: 0.55rem;
}

.almende-delete-button {
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(183, 28, 28, 0.35);
  border-radius: calc(var(--radius) - 0.25rem);
  background: #fff;
  color: #b71c1c;
  font: inherit;
  font-size: 0.88em;
  font-weight: 700;
  cursor: pointer;
}

.almende-delete-button:hover,
.almende-delete-button:focus-visible {
  background: #ffebee;
  outline: none;
}

.almende-comment-form__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.almende-comments__empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92em;
}

.almende-comments__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.almende-comments__item {
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.55);
  border-radius: calc(var(--radius) - 0.35rem);
}

.almende-comments__item:last-child {
  margin-bottom: 0;
}

.almende-comments__meta {
  margin: 0 0 0.35rem;
  font-size: 0.88em;
  color: var(--text-muted);
}

.almende-comments__body {
  line-height: 1.5;
}

.almende-editor {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 2px solid rgba(0, 0, 0, 0.08);
}

.almende-editor__heading {
  margin: 0 0 0.75rem;
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  font-weight: 700;
  line-height: 1.3;
}

.almende-moderation {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.almende-moderation__title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.almende-moderation__status {
  font-weight: 400;
  color: var(--text-muted);
}

.almende-moderation__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.almende-moderation__item {
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.85rem;
  background: #fff8e1;
  border-radius: calc(var(--radius) - 0.35rem);
}

.almende-archive {
  margin-bottom: 1.35rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.almende-sidebar__empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92em;
}

.almende-archive:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.almende-archive__title {
  margin: 0 0 0.45rem;
  font-size: clamp(1.05rem, 1.9vw, 1.22rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.almende-archive__date {
  margin: 0 0 0.65rem;
  font-size: 0.82em;
  color: var(--text-muted);
}

.almende-archive__body {
  font-size: 0.92em;
  line-height: 1.5;
}

.faq-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item dt {
  margin: 0 0 0.35rem;
  font-weight: 700;
  line-height: 1.35;
}

.faq-item dd {
  margin: 0;
  color: var(--text-muted);
}

.news-article__date,
.news-archive__date {
  display: block;
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.88em;
}

.news-article__body {
  margin-bottom: 1.25rem;
}

.news-article__nav {
  margin: 1.25rem 0 0;
}

.news-article__nav a {
  color: var(--orange);
  font-weight: 700;
  text-decoration: none;
}

.news-article__nav a:hover,
.news-article__nav a:focus-visible {
  color: var(--text);
  outline: none;
}

.news-archive__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.news-archive__list a {
  color: inherit;
  text-decoration: none;
}

.news-archive__list a:hover strong,
.news-archive__list a:focus-visible strong {
  color: var(--orange);
}

.news-archive__list p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}
