/* =============================================================
   Sidebar-Menü (Burger + Off-Canvas-Drawer von rechts)
   Übernommen aus dem JanMaxLive-Muster: fixierter Burger oben rechts,
   Drawer schiebt sich rein, der Seiteninhalt gleitet mit zur Seite.

   Unterschied zu JanMaxLive: dort ist es Mobile-only (Desktop hat eine
   Nav-Pill). FBC hat keine Desktop-Navigation, deshalb gilt es hier auf
   allen Größen. Der Theme-Umschalter sitzt unten im Drawer.
   ============================================================= */

:root {
  --drawer-w: min(340px, 86vw);
  --drawer-shift: calc(var(--drawer-w) * 0.58);
}

/* ---------- Burger ---------- */
.m-burger {
  position: fixed; top: 18px; right: 18px; z-index: 110;
  width: 52px; height: 52px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  cursor: pointer;
  background: rgba(255, 255, 255, .07);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform .2s ease, background .4s ease;
}
html[data-theme="light"] .m-burger { background: rgba(0, 0, 0, .05); }
/* Beim Scrollen kontrastreicher, damit der Burger ueber Bildern sichtbar bleibt. */
.m-burger.is-scrolled { background: rgba(11, 13, 22, .82); }
html[data-theme="light"] .m-burger.is-scrolled { background: rgba(255, 255, 255, .9); box-shadow: 0 6px 20px -10px rgba(0,0,0,.35); }
.m-burger.is-scrolled .m-burger-bars span { background: #f4f4f8; }
html[data-theme="light"] .m-burger.is-scrolled .m-burger-bars span { background: #1c1c20; }
.m-burger:active { transform: scale(.94); }
.m-burger-bars { position: relative; width: 22px; height: 14px; display: block; }
.m-burger-bars span {
  position: absolute; left: 0; width: 100%; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform .32s cubic-bezier(.22,1,.36,1), opacity .2s ease, top .32s cubic-bezier(.22,1,.36,1), background .4s ease;
}
.m-burger-bars span:nth-child(1) { top: 0; }
.m-burger-bars span:nth-child(2) { top: 6px; }
.m-burger-bars span:nth-child(3) { top: 12px; }
/* Offen: Kreuz. Der Drawer ist immer dunkel, deshalb helle Balken. */
body.m-drawer-open .m-burger { background: transparent; }
body.m-drawer-open .m-burger-bars span { background: #f4f4f8; }
body.m-drawer-open .m-burger-bars span:nth-child(1) { top: 6px; transform: rotate(45deg); }
body.m-drawer-open .m-burger-bars span:nth-child(2) { opacity: 0; }
body.m-drawer-open .m-burger-bars span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

/* ---------- Drawer ---------- */
.m-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: var(--drawer-w); z-index: 105;
  background: #0b0d16;
  /* Geschlossen KEIN Schatten: er wuerde sonst als dunkler Streifen am
     rechten Rand stehenbleiben, obwohl der Drawer draussen ist. */
  box-shadow: none;
  transform: translateX(100%);
  transition: transform .5s cubic-bezier(.16, 1, .3, 1), box-shadow .4s ease;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column;
}
html[data-theme="light"] .m-drawer { background: #17171a; }
body.m-drawer-open .m-drawer {
  transform: translateX(0);
  box-shadow: -24px 0 70px rgba(0, 0, 0, .35);
}

.m-drawer-nav {
  padding: 104px 40px 24px;
  display: flex; flex-direction: column; gap: 2px;
  flex: 1;
}
.m-drawer-nav a {
  display: block; padding: 13px 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.5vw, 1.85rem); font-weight: 300; line-height: 1.15;
  color: #f4f4f8; letter-spacing: -.01em;
  text-decoration: none;
  transition: opacity .2s ease, color .2s ease;
}
.m-drawer-nav a:hover { opacity: .68; }
.m-drawer-nav a.is-current { color: var(--gold-300); }

/* Fußzeile im Drawer: Theme-Umschalter + Rechtliches */
.m-drawer-foot {
  padding: 20px 40px 34px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  display: flex; flex-direction: column; gap: 16px;
}
.m-drawer-legal {
  display: flex; flex-wrap: wrap; gap: .3rem .9rem;
  font-size: .74rem; font-weight: 300;
}
.m-drawer-legal a { color: rgba(255, 255, 255, .45); text-decoration: none; }
.m-drawer-legal a:hover { color: rgba(255, 255, 255, .8); }

/* ---------- Overlay + Seiten-Shift ---------- */
.m-overlay {
  position: fixed; inset: 0; z-index: 104;
  background: rgba(0, 0, 0, .45);
  opacity: 0; pointer-events: none;
  transition: opacity .45s ease;
}
body.m-drawer-open .m-overlay { opacity: 1; pointer-events: auto; }
.page-wrap { transition: transform .6s cubic-bezier(.16, 1, .3, 1); will-change: transform; }
body.m-drawer-open .page-wrap { transform: translateX(calc(0px - var(--drawer-shift))); }
body.m-drawer-open { overflow: hidden; }

/* ---------- Theme-Umschalter im Drawer ---------- */
.theme-toggle {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .5rem .95rem .5rem .7rem;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  color: rgba(255, 255, 255, .82);
  font-family: var(--font-body); font-size: .82rem; font-weight: 400;
  cursor: pointer;
  align-self: flex-start;
  transition: border-color 200ms ease, background 200ms ease, color 200ms ease;
}
.theme-toggle:hover { border-color: rgba(255, 255, 255, .34); background: rgba(255, 255, 255, .1); color: #fff; }
.theme-toggle svg { width: 1rem; height: 1rem; display: block; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: block; }
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }
/* Beschriftung nennt das Ziel, nicht den Zustand. */
.theme-toggle .label-light { display: inline; }
.theme-toggle .label-dark { display: none; }
html[data-theme="light"] .theme-toggle .label-light { display: none; }
html[data-theme="light"] .theme-toggle .label-dark { display: inline; }

@media (max-width: 600px) {
  .m-drawer-nav { padding: 96px 30px 20px; }
  .m-drawer-foot { padding: 18px 30px 28px; }
}
