/* grid and layout */

site-header {
  position: sticky;
  top: 0px;
  z-index: 3;
}

site-header > header {
  display: grid;
  grid-template-columns: var(--header-grid);
  align-items: center;
}

site-header .site-title {
  grid-column: name-start / theme-start;
}

site-header theme-switcher {
  grid-column: theme-start / nav-start;
  justify-self: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-right: var(--gap);
}

site-header #hamburger-menu-button {
  justify-self: flex-end;
}

site-header #hamburger-menu-button,
site-header > header > nav {
  grid-column: nav-start / nav-end;
}

/* styles */

site-header > header {
  height: var(--height-site-header);
  border-style: none none solid none;
  border-color: #afafaf;
  border-width: 1px;
  background-color: var(--color-bg-blank);
}

site-header .site-title {
  font-family: var(--font-site-title), serif;
  font-size: var(--font-site-title-size);
  font-weight: normal;
  margin: 0;
  color: var(--color-text-primary-on-blank);
}

site-header .site-title a {
  text-decoration: none;
  color: var(--color-text-primary-on-blank);
}

site-header #hamburger-menu-button,
site-header .ide-tab__close {
  cursor: pointer;
  border-style: none;
  background-color: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: var(--font-menu-close-button-size);
}

site-header #hamburger-menu-button svg {
  width: 2em;
}

site-header .ide-tab__close svg {
  width: 1.5em;
}

site-header #hamburger-menu-button path,
site-header .ide-tab__close path {
  fill: var(--color-text-quaternary-on-blank);
}

site-header #hamburger-menu-button div,
site-header .ide-tab__close div {
  font-size: var(--font-menu-close-text-size);
  line-height: 0.8em;
  font-family: var(--font-body-primary);
  color: var(--color-text-primary-on-blank);
}

site-header .menu-panel {
  width: 0;
  overflow: hidden;
  position: absolute;
  top: 0;
  right: 0em;
  height: 100vh;
  background-color: var(--color-bg-blank);
  color: var(--color-text-quaternary-on-blank);
  border-style: none none none none;
  border-color: var(--color-secondary);
  transition: width 0.3s;
  z-index: 6;
}

site-header .menu-panel.active {
  width: 20em;
  transition: width 0.3s;
  border-style: none none none solid;
  border-width: 3px;
}

site-header .ide-header {
  display: flex;
  flex-direction: row;
}

site-header .ide-tab {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  width: auto;
  height: var(--height-site-header);
  padding-left: 1em;
  padding-right: 1em;
  background-color: var(--color-bg-blank);
}

site-header .ide-tab span {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: auto;
  padding-left: 1em;
  padding-right: 1em;
}

site-header .menu-panel .ide-header {
  background-color: var(--color-bg-primary);
}

site-header .menu-panel pre {
  margin-top: 1em;
}

.ide-tab {
  display: inline-block;
  height: 2em;
}

site-header > header > nav {
  display: none;
}

site-header > header > nav a {
  text-decoration: none;
  color: var(--color-text-on-blank);
}

site-header > header > nav a:hover {
  text-decoration: underline;
  text-decoration-color: var(--color-text-primary-on-blank);
}

site-header .menu-panel nav ul {
  display: flex;
  list-style: none;
  flex-direction: column;
  padding: 0;
  margin: 0;
}

@media (min-width: calc(60rem + 80px)) {
  site-header > header > nav {
    display: block;
  }

  site-header > header > nav ul {
    display: flex;
    flex-direction: row;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: flex-end;
    gap: var(--gap);
  }

  site-header #hamburger-menu-button,
  site-header .menu-panel {
    display: none;
  }
}

site-header .menu-panel nav a {
  text-decoration: none;
  color: var(--color-text-primary-on-blank);
  display: inline-block;
  padding-left: 1em;
  border-style: solid;
  border-width: 1px;
  border-color: var(--color-bg-blank);
  flex-grow: 1;
}

site-header .menu-panel nav a:hover {
  border-style: dotted;
  border-width: 1px;
  border-color: var(--color-text-deemphasized-on-blank);
}

site-header .menu-panel nav span.code-line {
  display: flex;
}
site-header .menu-panel nav span.token {
  display: flex;
  flex-grow: 1;
}
site-header code .code-line.line-number::before {
  margin-right: 0;
}

site-header code .code-line.line-number::before {
  margin-right: 0;
  background-color: transparent;
}

site-header code .code-line.line-number:last-child::before {
  padding-bottom: 0;
}
site-header code .code-line.line-number:first-child::before {
  padding-top: 0;
}
