.md-grid {
  max-width: var(--nh-column);
}

.md-sidebar--primary,
.md-tabs,
.md-search,
label[for="__search"],
label[for="__drawer"] {
  display: none !important;
}

.md-content {
  margin: 0 auto;
}

.md-content__inner {
  /* The theme sets wider margins on large screens with a more specific selector. */
  margin-inline: var(--nh-inset) !important;
}

.md-main__inner {
  margin-top: var(--nh-space-2);
}

::selection {
  background: var(--nh-accent-light);
  color: var(--nh-text);
}

.md-typeset {
  font-size: var(--nh-text-base);
  line-height: 1.75;

  h1, h2, h3, h4 {
    font-weight: 700;
    color: var(--nh-text);
    border: 0;
  }

  h1 {
    margin-bottom: var(--nh-space-3);
  }

  h2 {
    margin-top: var(--nh-space-5);
    font-size: var(--nh-text-xl);
  }

  a {
    text-decoration: underline;
    text-decoration-color: var(--nh-accent-light);
    text-underline-offset: 0.2em;
    transition: color 0.15s, text-decoration-color 0.15s;

    &:hover {
      color: var(--nh-accent-hover);
      text-decoration-color: currentColor;
    }
  }

  img {
    border-radius: var(--nh-radius);
  }

  blockquote {
    border-left: 2px solid var(--nh-border);
    color: var(--nh-text-muted);
    padding-left: var(--nh-space-3);
  }

  hr {
    border-bottom: 1px solid var(--nh-border);
  }

  .footnote-ref {
    color: var(--nh-accent);
  }

  code {
    color: var(--nh-accent-hover);
    font-family: var(--nh-mono);
    font-size: var(--nh-text-md);
  }

  pre > code {
    background: var(--md-code-bg-color);
    border: 1px solid var(--nh-border);
    border-radius: var(--nh-radius);
  }

  .highlight {
    pre > code {
      line-height: 1.65;
    }

    .filename {
      display: block;
      padding: var(--nh-space-2) var(--nh-space-3);
      font-family: var(--nh-mono);
      font-size: var(--nh-text-sm);
      color: var(--nh-text-muted);
      background: var(--nh-surface);
      border: 1px solid var(--nh-border);
      border-bottom: 0;
      border-radius: var(--nh-radius) var(--nh-radius) 0 0;

      + pre > code {
        border-radius: 0 0 var(--nh-radius) var(--nh-radius);
      }
    }

    .md-clipboard {
      color: var(--nh-text-muted);

      &:hover {
        color: var(--nh-accent);
      }
    }
  }
}
