/* WordPress adjustments that the prototype does not need. Hand-written, kept small.
   site.css stays a 1:1 copy of the prototype (wordpress/src/theme_daten.py). */

/* Admin bar for logged-in editors (32 px, 46 px up to 782 px): the fixed header starts below it, and so does
   everything site.css places below the header. Without these, the open mega menu covered the lower 32 px of the
   header row (Boris 19.10.2026). Visitors never see the admin bar; for them nothing here applies. */
body.admin-bar { --tj-wpbar: 32px; }
@media (max-width: 782px) {
  body.admin-bar { --tj-wpbar: 46px; }
}
body.admin-bar .site-header { top: var(--tj-wpbar); }

/* Mega menu: site.css sets its top per state (full header, compact header, phone); margin-top adds the admin bar
   to each of them, max-height keeps the panel inside the window. */
body.admin-bar .megamenu {
  margin-top: var(--tj-wpbar);
  max-height: calc(100dvh - var(--tj-header-h) - var(--tj-util-h) - var(--tj-wpbar));
}
/* Scrolled, the header carries a backdrop-filter (site.css) and so becomes the containing block of the fixed menu:
   its top already counts from the header, which sits below the admin bar. No margin there, or a gap opens. */
html.is-scrolled body.admin-bar .megamenu {
  margin-top: 0;
  max-height: calc(100dvh - var(--tj-header-compact) - var(--tj-wpbar));
}
@media (max-width: 767px) {
  body.admin-bar .megamenu { max-height: calc(100dvh - var(--tj-header-h) - var(--tj-wpbar)); }
}

/* Heads that stay in view while their section scrolls start below the header. */
body.admin-bar :is(.tj-sec--achse .tj-faq__head, .tj-duo__head, .tj-faq--duo .tj-faq__head) {
  top: calc(var(--tj-header-h) + var(--tj-util-h) + 20px + var(--tj-wpbar));
}
