html,
body {
  box-sizing: border-box;
  height: 100%;
  width: 100%;
}

body {
  --sidebarWidth: 300px;
  --sidebarMinWidth: 300px;
  --sidebarTransitionDuration: 0.3s;
  background-color: var(--background);
  color: var(--textBody);
  font-size: var(--text-md);
  line-height: 1.6875em;
  /* swup.js adds tabindex=-1 on Chrome,
     which then adds an outline when clicked */
  outline: none !important;
}

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

.body-wrapper {
  display: flex;
  height: 100%;
}

/* Sidebar is closed by default and opened with body.sidebar-opened. */
.sidebar {
  display: none;
  flex-direction: column;
  width: var(--sidebarWidth);
  min-width: var(--sidebarMinWidth);
  max-width: 50vw;
  height: 100%;
  position: fixed;
  top: 0;
  left: calc(-1 * var(--sidebarWidth));
  z-index: 100;
  resize: horizontal;
}

.sidebar-button {
  padding: 20px 12px 18px 19px;
  position: fixed;
  z-index: 200;
  top: 0;
  left: 0;
  will-change: transform;
  transform: translateX(0);
}

.content {
  left: 0;
  width: 100%;
  height: 100%;
  position: absolute;
}

.content .content-inner {
  container: content / inline-size;
  max-width: var(--content-width);
  min-height: 100%;
  margin: 0 auto;
  padding: 0 var(--content-gutter) 10px;
}

.content-inner:focus {
  outline: none;
}

.sidebar-transition .sidebar,
.sidebar-transition .sidebar-button,
.sidebar-transition .content {
  transition: all var(--sidebarTransitionDuration) ease-in-out allow-discrete;
}

.sidebar-open .sidebar,
.sidebar-transition .sidebar {
  display: flex;
}

.sidebar-open .sidebar {
  left: 0;
}

.sidebar-open .sidebar-button {
  transform: translateX(calc(var(--sidebarWidth) - 100%));
}

.sidebar-open .content {
  width: calc(100% - var(--sidebarWidth));
  left: var(--sidebarWidth);
}

@media screen and (max-width: 768px) {
  .sidebar-open .content {
    left: 0;
    width: 100%;
  }

  .sidebar {
    max-width: 90vw;
  }

  body:not(.sidebar-open) .sidebar-button {
    position: absolute;
  }
}

.swup-progress-bar {
  height: 2px;
  background-color: var(--progressBarColor);
}
