/**
 * K77 page shell (P3.3).
 *
 * Desktop (≥ 768 px): frameset `index.htm` — 300 px left column (`navili`)
 * plus scrolling content (`allesre`). Phone: top bar + menu button, content
 * full width. The column holds the native Flash menu (P4.8d); the P4.8b
 * HTML tree is the no-JS fallback.
 */

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

html,
body {
  overflow-x: hidden;
}

img,
video,
iframe {
  max-width: 100%;
  height: auto;
}

.skip-links {
  margin: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: var(--space-2);
  z-index: 100;
  padding: var(--space-1) var(--space-2);
  background: var(--color-bg);
  color: var(--color-link);
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus,
.skip-link:focus-visible {
  clip: auto;
  clip-path: none;
  width: auto;
  height: auto;
  overflow: visible;
  white-space: normal;
}

.skip-link:nth-child(2):focus,
.skip-link:nth-child(2):focus-visible {
  top: calc(var(--space-2) + 2.2em);
}

.site-banner {
  display: none;
}

.site-banner-colophon {
  margin-left: auto;
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-body);
  font-size: var(--font-size-1);
  color: var(--color-gray-66);
  text-decoration: none;
}

.site-banner-colophon:visited {
  color: var(--color-gray-66);
}

.site-banner-colophon:hover,
.site-banner-colophon:focus-visible,
.site-banner-colophon[aria-current="page"] {
  text-decoration: underline;
}

.nav-toggle {
  font-family: var(--font-heading);
  font-size: var(--font-size-heading);
  font-weight: normal;
  color: var(--color-text);
  background: transparent;
  border: 0;
  padding: var(--space-1) var(--space-2);
  cursor: pointer;
}

.nav-toggle[aria-expanded="false"] .nav-toggle-close,
.nav-toggle[aria-expanded="true"] .nav-toggle-open {
  display: none;
}

.site {
  display: grid;
  grid-template-columns: var(--nav-width) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--color-bg);
}

.site-nav {
  min-width: 0;
  height: 100vh;
  overflow: auto;
  padding: 0 var(--nav-margin);
  background: var(--color-bg);
}

/* Native menu fills the 300 px column (original OBJECT WIDTH/HEIGHT 100%).
   html.js hides the HTML tree from first paint; .is-html restores it if
   the movie fails to load. */
html.js .site-nav:not(.is-html) {
  position: relative;
  padding: 0;
}

html.js .site-nav:not(.is-html) .site-nav-tree-wrap {
  display: none;
}

html.js .site-nav:not(.is-html) .site-nav-movie {
  display: block;
}

@media (min-width: 768px) {
  html.js .site-nav:not(.is-html) .site-nav-movie {
    width: 100%;
    height: 100%;
    margin: 0;
  }
}

.site-main {
  min-width: 0;
  height: 100vh;
  overflow: auto;
  padding: 0 var(--content-margin);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
}

/* Fill the allesre pane so room pages can valign-middle (Raum Vorlage). */
#inhalt {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Phone: original had no top bar; this is the collapsed-frameset chrome. */
@media (max-width: 767px) {
  .site-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: 44px;
    padding: var(--space-1) var(--space-2);
    background: var(--color-bg);
  }

  .site {
    display: block;
    min-height: 0;
  }

  .site-nav {
    height: auto;
    padding: var(--nav-margin);
  }

  .site-main {
    height: auto;
    overflow: visible;
    padding: var(--space-2) var(--content-margin);
  }

  html.js .site-nav {
    display: none;
    position: fixed;
    top: 44px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    overflow: auto;
  }

  html.js .site-nav.is-open {
    display: block;
  }

  html.js body:has(.site-nav.is-open) {
    overflow: hidden;
  }

  html.js .site-nav:not(.is-html) {
    padding: var(--nav-margin);
  }
}
