/* stylelint-disable selector-max-compound-selectors, selector-max-specificity, no-descending-specificity, selector-id-pattern, a11y/content-property-no-static-value */

/**
 * NOTE: All styles must be tightly scoped to avoid this stylesheet's styles
 * leaking into the "test" elements.
 */

/**
 * Page container.
 */

.page {
  padding: 2rem;
}

/**
 * Grouped styles.
 */

.page > nav a,
.page > main > section > article > footer a,
#forms > form > fieldset + p a {
  color: royalblue;
}

/**
 * Header.
 */

.page > header {
  margin-bottom: 2rem;
}

.page > header h1 {
  font-size: 2.4rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

/**
 * Navigation.
 */

.page > nav {
  margin-bottom: 4rem;
}

.page > nav > ul > li > a {
  font-size: 1.4rem;
  font-weight: bold;
}

.page > nav ul ul {
  background-color: rgb(000 000 000 / 0.02);
  border: 1px solid gainsboro;
  border-radius: 4px;
  display: flex;
  flex-wrap: wrap;
  line-height: 1.8;
  margin-bottom: 1.2rem;
  margin-top: 0.5rem;
  padding: 1rem;
}

.page > nav ul > li:last-child ul {
  margin-bottom: 0;
}

.page > nav ul ul li:not(:last-child) {
  margin-right: 0.4rem;
}

.page > nav ul ul li:not(:last-child)::after {
  color: gray;
  content: '/';
  display: inline-block;
  padding-left: 0.5rem;
}

/**
 * Main content sections.
 */

.page > main > section:not(:last-child) {
  margin-bottom: 3rem;
}

/**
 * Main content headings.
 */

.page > main > section > header h1 {
  border-bottom: 1px solid;
  font-size: 2rem;
  margin-bottom: 1.8rem;
  padding-bottom: 0.2rem;
}

.page > main > section > article > header h1,
.page > main > section > article > header h2,
#forms > form > fieldset > legend {
  color: #e80000;
  font-size: 1.2rem;
  font-variant-caps: all-small-caps;
  margin-bottom: 1rem;
}

#embedded__images h3 {
  margin-bottom: 0.5rem;
  margin-top: 1rem;
}

#embedded__images h3:first-of-type {
  margin-top: 0;
}

/**
 * Form field spacing.
 */

#forms > form > fieldset > p:not(:last-child),
#forms > form > fieldset .list li:not(:last-child) {
  margin-bottom: 1rem;
}

/**
 * Back to top anchor.
 */

.page > main > section > article > footer,
#forms > form > fieldset + p {
  margin-bottom: 1rem;
  margin-top: 1rem;
  text-align: right;
}

.page > main > section > article:last-child > footer,
#forms > form > fieldset:last-of-type + p {
  margin-bottom: 0;
}

/**
 * Root footer.
 */

.page > footer {
  border-top: 1px solid gainsboro;
  margin-top: 6rem;
  padding-top: 1rem;
}
