/* Scroll-Test: Navigation bleibt, Kopfzeile gleitet weg, Footer bleibt erreichbar. */

/* Header */
.site-header {
  overflow: visible;
}

.header-wrap {
  position: relative;
  overflow: clip;
}

/*
 * Im kompakten Zustand wird die Navigation aus dem Header herausgelöst.
 * Damit bleibt sie auch in Browsern sichtbar, in denen ein sticky-Element
 * durch overflow-x am Dokument nicht zuverlässig festgehalten wird.
 */
.site-header.shell-nav-only {
  box-shadow: none;
}

.site-header.shell-nav-only .header-wrap {
  padding-bottom: var(--shell-nav-height, 51px);
}

.top-row {
  max-height: 150px;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  transition:
    max-height .58s cubic-bezier(.22,.61,.36,1),
    padding-top .58s cubic-bezier(.22,.61,.36,1),
    padding-bottom .58s cubic-bezier(.22,.61,.36,1),
    opacity .34s ease,
    transform .58s cubic-bezier(.22,.61,.36,1);
  will-change: max-height, transform, opacity;
}

.site-header.shell-nav-only .top-row {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  transform: translateY(-22px);
  pointer-events: none;
}

.nav-row {
  position: relative;
  z-index: 3;
  background: var(--surface);
}

.site-header.shell-nav-only .nav-row {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  width: 100%;
  background: var(--surface);
  border-top: 0;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 5px 16px rgba(55,35,25,.10);
}

html[data-theme="dark"] .site-header.shell-nav-only .nav-row {
  box-shadow: 0 5px 18px rgba(0,0,0,.28);
}

/* Footer: die schmale untere Leiste bleibt immer sichtbar. */
:root {
  --shell-footer-rest: 58px;
}

body {
  padding-bottom: var(--shell-footer-rest);
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  margin-top: 0 !important;
  max-height: min(78vh, 720px);
  background: var(--surface2);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(55,35,25,.10);
}

.shell-footer-toggle-wrap {
  position: absolute;
  left: 50%;
  top: -18px;
  z-index: 2;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  transform: translateX(-50%);
}

.shell-footer-toggle {
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface2);
  color: var(--muted);
  box-shadow: 0 3px 10px rgba(55,35,25,.14);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, transform .2s ease;
}

.shell-footer-toggle:hover,
.shell-footer-toggle:focus-visible {
  color: var(--red);
  border-color: var(--red);
  outline: none;
}

.shell-footer-toggle svg {
  width: 19px;
  height: 19px;
  transition: transform .32s ease;
}

.site-footer.shell-footer-open .shell-footer-toggle svg {
  transform: rotate(180deg);
}

.js-shell .footer-main {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px);
  visibility: hidden;
  transition:
    max-height .48s cubic-bezier(.22,.61,.36,1),
    padding-top .48s cubic-bezier(.22,.61,.36,1),
    padding-bottom .48s cubic-bezier(.22,.61,.36,1),
    opacity .26s ease,
    transform .48s cubic-bezier(.22,.61,.36,1),
    visibility 0s linear .48s;
}

.js-shell .site-footer.shell-footer-open .footer-main {
  max-height: min(66vh, 620px);
  padding-top: 34px;
  padding-bottom: 26px;
  overflow-y: auto;
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  transition-delay: 0s;
}

.footer-bottom {
  position: relative;
  z-index: 1;
  background: var(--surface2);
}

.footer-bottom-inner {
  min-height: var(--shell-footer-rest);
  padding-top: 8px;
  padding-bottom: 8px;
  justify-content: center;
  text-align: center;
  font-size: 12px;
}

@media (max-width: 1240px) {
  .nav-row {
    min-height: 50px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  .nav-row > .menu-btn {
    display: grid;
    flex: 0 0 auto;
  }

  .nav.open {
    top: 100%;
  }
}

@media (max-width: 650px) {
  :root {
    --shell-footer-rest: 54px;
  }

  .top-row {
    max-height: 110px;
  }

  .js-shell .site-footer.shell-footer-open .footer-main {
    max-height: min(70vh, 620px);
    padding-top: 28px;
    padding-bottom: 22px;
  }

  .footer-bottom-inner {
    display: block;
    padding-left: 34px;
    padding-right: 34px;
    line-height: 1.35;
  }

  .footer-credit {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .top-row,
  .js-shell .footer-main,
  .shell-footer-toggle svg {
    transition: none !important;
  }
}
