/* ── FOUC-Schutz: Transitions erst nach JS-Init ── */
.no-js .mobile-sidebar,
.no-js .nav-overlay {
  transition: none !important;
}
.no-js .mobile-sidebar {
  visibility: hidden !important;
}

/* ═══════════════════════════════════════════════════
   HEADER / NAV / SIDEBAR / FOOTER
   ═══════════════════════════════════════════════════ */

/* ── Sticky Header ── */
.site-header {
  background: var(--gruen);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--sh-md);
  padding-left:  env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: .75rem 1.25rem;
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ── Logo ── */
.logo-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  flex-shrink: 0;
  min-height: 44px;
}

.logo-img {
  height: 40px;
  width: auto;
  background: rgba(255,255,255,.13);
  border-radius: 6px;
  padding: 5px;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-name {
  font-family: var(--ff-ui);
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  white-space: nowrap;
  line-height: 1.3;
}

.logo-name em { color: var(--mint); font-style: normal; }

.logo-sub {
  font-family: var(--ff-ui);
  font-size: .68rem;
  color: var(--mint);
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ── Desktop Nav (scrollt mit = sticky header) ── */
.primary-nav { margin-left: auto; }

.primary-nav ul {
  display: flex;
  flex-wrap: nowrap;
  gap: .1rem;
}

.primary-nav a {
  font-family: var(--ff-ui);
  font-weight: 600;
  font-size: .84rem;
  color: var(--mint);
  text-decoration: none;
  padding: .4em .65em;
  border-radius: 6px;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  background: rgba(255,255,255,.15);
  color: #fff;
}

.primary-nav a[aria-current="page"] {
  border-bottom: 2px solid var(--rot);
  border-radius: 6px 6px 0 0;
}

/* ── Hamburger Button ── */
.nav-toggle {
  display: none;
  background: none;
  border: 2px solid rgba(193,209,199,.55);
  border-radius: var(--r);
  color: #fff;
  font-family: var(--ff-ui);
  font-size: .85rem;
  font-weight: 700;
  padding: 0 .9rem;
  height: 44px;
  cursor: pointer;
  margin-left: auto;
  transition: border-color var(--t-fast), background var(--t-fast);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  align-items: center;
  gap: .4rem;
}

.nav-toggle:hover,
.nav-toggle[aria-expanded="true"] {
  border-color: #fff;
  background: rgba(255,255,255,.1);
}

/* ── Overlay (hinter Sidebar) ── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 299;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .3s ease;
}

.nav-overlay.is-visible {
  display: block;
  opacity: 1;
}

/* ── Mobile Sidebar ── */
.mobile-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: min(320px, 85vw);
  height: 100dvh;
  height: 100vh;
  background: var(--gruen);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  /* visibility:hidden verhindert FOUC — wird erst bei is-open sichtbar */
  visibility: hidden;
  transition: transform .32s cubic-bezier(.4,0,.2,1),
              visibility 0s linear .32s;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
}

.mobile-sidebar.is-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform .32s cubic-bezier(.4,0,.2,1),
              visibility 0s linear 0s;
  box-shadow: 4px 0 32px rgba(0,0,0,.35);
}

/* Sidebar-Header */
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(193,209,199,.2);
  flex-shrink: 0;
}

.sidebar-logo {
  font-family: var(--ff-ui);
  font-weight: 800;
  font-size: .95rem;
  color: #fff;
  text-decoration: none;
  line-height: 1.3;
}

.sidebar-logo em { color: var(--mint); font-style: normal; }

.sidebar-close {
  background: none;
  border: 2px solid rgba(193,209,199,.4);
  border-radius: var(--r);
  color: var(--mint);
  font-size: 1.1rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--t-fast), color var(--t-fast);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-close:hover {
  border-color: #fff;
  color: #fff;
}

/* Sidebar-Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: .75rem 0;
}

.sidebar-nav ul {
  list-style: none;
  margin: 0; padding: 0;
}

.sidebar-section-label {
  font-family: var(--ff-ui);
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(193,209,199,.55);
  padding: 1rem 1.25rem .35rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .7rem 1.25rem;
  font-family: var(--ff-ui);
  font-weight: 600;
  font-size: .95rem;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
  min-height: 48px;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a[aria-current="page"] {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-left-color: var(--rot);
}

.sidebar-nav .nav-icon {
  font-size: 1rem;
  flex-shrink: 0;
  width: 1.4rem;
  text-align: center;
}

/* Sidebar-Footer */
.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(193,209,199,.2);
  flex-shrink: 0;
}

.sidebar-footer p {
  font-family: var(--ff-ui);
  font-size: .78rem;
  color: rgba(193,209,199,.6);
  line-height: 1.6;
}

.sidebar-footer a {
  color: var(--mint);
  text-decoration: none;
}

/* ── Footer ── */
.site-footer {
  background: var(--gruen);
  color: var(--mint);
  padding: 2.5rem 1.25rem;
  padding-bottom: calc(2.5rem + env(safe-area-inset-bottom));
}

.footer-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.site-footer h4 {
  font-family: var(--ff-ui);
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #fff;
  margin-bottom: .85rem;
}

.site-footer p,
.site-footer li { font-size: .88rem; line-height: 1.8; color: rgba(193,209,199,.8); }

.site-footer a { color: var(--mint); text-decoration: none; padding: 2px 0; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

.footer-bottom {
  max-width: var(--max-w);
  margin: 1.75rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(193,209,199,.22);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  font-family: var(--ff-ui);
  font-size: .74rem;
  color: rgba(193,209,199,.5);
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .primary-nav { display: none; }
  .nav-toggle  { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 540px) {
  .logo-sub { display: none; }
  .logo-name { font-size: .9rem; white-space: normal; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 360px) {
  .logo-img { height: 32px; }
  .logo-name { font-size: .8rem; }
  .nav-toggle { padding: 0 .65rem; font-size: .8rem; }
}
