* {
  box-sizing: border-box;
  margin: 0;
}

:root {
  --max-width: calc(100vw - 2rem);
}

@media (min-width: 576px) {
  :root {
    --max-width: 540px;
  }
}

@media (min-width: 768px) {
  :root {
    --max-width: 720px;
  }
}

@media (min-width: 992px) {
  :root {
    --max-width: 930px;
  }
}

@media (min-width: 1200px) {
  :root {
    --max-width: 1170px;
  }
}

@media (min-width: 1300px) {
  :root {
    --max-width: 1270px;
  }
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--font-sans-serif);
  font-size: 16px;
  line-height: 1.6;
}

nav ul {
  list-style: none;
  padding: 0;
}

:where(ol:not(.list-inline)),
:where(ul:not(.list-inline)),
:where(dl:not(.list-inline)) {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

/* Supporting Content */

hr {
  margin: 1.5rem 0;
  border: 0;
  border-top: 1px solid var(--theme-divider);
}

.badge {
  display: inline-block;
  color: white;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  border-radius: 10rem;
  background-color: var(--theme-button);
  padding: 4px 8px;
}

.badge-info {
  color: var(--theme-text-dim);
}

.badge-accent {
  color: #fff;
  background-color: var(--theme-accent);
}

.uppercase {
  text-transform: uppercase;
}

table,
th,
td {
  border: 1px solid var(--theme-table-border);
  border-collapse: collapse;
  padding: 10px;
  margin-top: 20px;
  margin-bottom: 20px;
}

table {
  display: block;
  max-width: fit-content;
  overflow-x: auto;
  padding: 0;
  border: none;
}

th {
  background-color: var(--theme-th-bg);
}

td {
  white-space: nowrap;
}

.blog-image {
  object-fit: cover;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

/** TODO: move back to layout.scss once https://github.com/withastro/compiler/pull/738 is fixed */
.height-600 {
  width: auto;
  max-width: 100%;
  max-height: 600px;
}

/* Screenreader Only Text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;

  /** show the sr-only item if it manages to be focused */
  &:focus,
  &:focus-visible {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }
}

:target {
  scroll-margin: calc(var(--theme-sidebar-offset, 5rem) + 2rem) 0 2rem;
}
