/* Global Component Styles */
@import '~@hashicorp/mktg-global-styles/style.css';

:root {
  --highlight-color: var(--packer-link);
}

/* Local Components */
@import '../components/footer/style.css';
@import '../components/search-bar/style.css';

/* Print Styles */
@import './print.css';

/* 404 page styles */
#p-404 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 64px auto;
  max-width: 784px;
  min-height: calc(90vh - 260px);
  padding-inline: 32px;
  text-align: center;

  @media (--large) {
    padding-inline: 24px;
  }

  & h1 {
    font-size: 1.5rem;
    letter-spacing: -0.004em;
    line-height: 1.375em;

    @media (--medium-up) {
      font-size: 1.75rem;
      line-height: 1.321em;
    }

    @media (--large) {
      font-size: 2rem;
      letter-spacing: -0.006em;
      line-height: 1.313em;
    }
  }

  & a {
    color: var(--highlight-color);
  }
}

/*
 * About this selector:
 * `.g-subnav ~ *` finds all elements after the navigation.
 * `:target` finds the active permalink on the page.
 *
 * About this style:
 * `scroll-margin-top` adjusts the vertical scroll of a permalink.
 * `64px` adjusts the scroll to account for the navigation.
 * `0.5em` further adjusts the scroll to give the permalink breathing room.
 *
 * See: https://developer.mozilla.org/en-US/docs/Web/CSS/:target
 * See: https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-margin-top
 */
.g-subnav ~ * :target {
  scroll-margin-top: calc(64px + 0.5em);
}
