/* Reset and Global Styles */
*,
::after,
::before {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Archivo, sans-serif;
  font-weight: 400;
}

:root {
  /* Define CSS variables for consistent theming */
  --font-size: clamp(15px, 1.15vw, 20px);
  --bkg-col: #010409;
  --bkg-mid: rgba(219, 220, 221, 0.09);
  --bkg-lighter: #dbdcdd59;
  --text-col: #dbdcdd;
  --secondary-color: #dbdcddbf;
  --border-color: #dbdcdd54;
  --link-col: #1ea3e6;
  --spacing-xsmall: 0.25rem;
  --spacing-small: 0.5rem;
  --spacing-medium: 1rem;
  --spacing-large: clamp(1rem, 2vw, 4rem);
}

body {
  /* Set global body styles */
  background: var(--bkg-col);
  font-size: var(--font-size);
  line-height: 1.6;
  color: var(--text-col);
}

/* Typography */
b,
h1,
h2,
h3 {
  font-size: var(--font-size);
  font-weight: 700;
}

h3 {
  padding-top: var(--spacing-medium);
}

h2,
h3,
li,
p {
  margin-top: 0;
  margin-bottom: var(--spacing-medium);
}

header > h1,
header > h1 > a {
  font-weight: revert;
  color: inherit;
}

header p,
section div > small {
  color: var(--secondary-color);
}

/* Links */
a {
  font-weight: inherit;
  text-decoration: none;
  position: relative;
  color: var(--link-col);
}

a:hover {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--secondary-color);
}

a:visited {
  text-decoration-color: inherit;
  outline-color: var(--visited-col);
}

a:focus {
  outline: 0.0625rem solid var(--link-col);
  outline-offset: 0.125rem;
}

.external-link::after {
  content: url(assets/external-link.svg);
  opacity: 0.75;
  margin-right: 0.05rem;
  display: inline-block;
  width: 0.6rem;
  height: auto;
  margin-left: var(--spacing-xsmall);
  vertical-align: middle;
}

/* Header */
header {
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xsmall);
  overflow-y: hidden;
  margin-bottom: var(--spacing-large);
  padding-bottom: var(--spacing-medium);
}

/* Layout and Utility */
ul {
  list-style: none;
}

.limit-width {
  max-width: 60ch;
}

.dist-from-edges {
  margin: var(--spacing-small);
  padding: var(--spacing-large);
}

.links {
  padding-top: var(--spacing-large);
  display: -ms-grid;
  display: grid;
  -ms-grid-columns: (1fr) [auto-fit];
  grid-template-columns: repeat(auto-fit, minmax(20ch, 1fr));
  gap: var(--spacing-small);
}

.links > a {
  z-index: 2;
  text-decoration: none;
  background-color: var(--bkg-col);
  outline: 0.0625rem solid var(--bkg-lighter);
  padding: var(--spacing-medium);
  align-self: flex-start;
}

.links > a:hover {
  background-color: var(--bkg-mid);
  outline: 0.125rem solid var(--text-col);
  outline-offset: -0.125rem;
  transition: all 0.2s ease-in-out;
}

.links > a:focus {
  outline: 0.0625rem solid var(--link-col);
}

.links > a > div {
  min-height: 4rem;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  flex-direction: column;
}

/* Footer */
footer {
  padding-top: var(--spacing-large);
}

/* Tables */
table {
  border-collapse: collapse;
  overflow: hidden;
  width: 100%;
}

tr td:first-of-type {
  min-width: clamp(10vw, 33vw, 50vw);
}

td > h3 {
  padding: 0 var(--spacing-large) 0 0;
}

td:last-of-type {
  max-width: 100%;
}

td:last-of-type > p,
td:last-of-type > ul {
  max-width: 60ch;
}

table td {
  padding: var(--spacing-medium) var(--spacing-medium) var(--spacing-small) 0;
  vertical-align: top;
}

table tr:not(:last-child) {
  border-bottom: 0.0625rem solid var(--border-color);
}

/* Responsive Tables */
@media only screen and (max-width: 42.09em) {
  tr {
    display: block;
  }
  table td {
    display: -ms-grid;
    display: grid;
    grid-template-columns: 1fr;
    padding: 0;
    border-top-width: 0;
    text-align: left !important;
  }
  td:first-of-type {
    padding-top: 2rem;
  }
  td:last-of-type {
    padding-bottom: var(--spacing-large);
  }
  table {
    border-width: 0;
  }
  tbody tr {
    padding: 0;
  }
  tbody td {
    padding: 0;
  }
  tr:last-child td:last-child {
    border-bottom-width: 0;
  }
}
