/* Bold elements */
h1, h2, h3, h4, h5, h6,
b, strong,
th,
button {
  font-weight: 600;
}

/* Lists with dashes */
ul {
  list-style: none;
}

ul li {
  position: relative;
}

ul li:not(:empty)::before {
  content: "-";
  position: absolute;
  left: -20px;
  color: var(--accent);
}

/* Nested lists */
ul ul {
  margin-left: 20px;
}

ul,
ol {
  margin-left: 4ch;
  padding: 0;
}

ul ul,
ul ol,
ol ul,
ol ol {
  margin-top: 0;
}

li::marker {
  color: var(--accent);
}

ul li,
ol li {
  position: relative;
}

code,
kbd {
  font-family:
    "Fira Code",
    "JetBrains Mono",
    Monaco,
    Consolas,
    Ubuntu Mono,
    monospace !important;
  font-feature-settings: normal;
  background: color-mix(in srgb, var(--foreground) 5%, transparent);
  color: color-mix(in srgb, var(--foreground) 5%, var(--accent));
  padding: 0 6px;
  margin: 0 2px;
  font-size: 0.95em;
}

code {
  border: 1px solid color-mix(in srgb, var(--foreground) 25%, transparent);
}

kbd {
  border-top: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-left: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  border-bottom: 4px solid var(--accent);
  border-radius: 4px;
}

code code {
  background: transparent;
  padding: 0;
  margin: 0;
}

pre {
  tab-size: 4;
  background: color-mix(in srgb, var(--foreground) 5%, transparent) !important;
  color: color-mix(in srgb, var(--foreground) 5%, var(--accent));
  padding: 20px 10px;
  font-size: 0.95em !important;
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--foreground) 25%, transparent);
}

pre code {
  background: none !important;
  margin: 0;
  padding: 0;
  font-size: inherit;
  border: none;
}

sup {
  line-height: 0;
}

abbr {
  position: relative;
  text-decoration-style: wavy;
  text-decoration-color: var(--accent);
  cursor: help;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.25em;
}

mark {
  background: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--foreground);
}

blockquote {
  position: relative;
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  margin: 0;
  padding: 25px;
}

blockquote:before {
  content: ">";
  display: block;
  position: absolute;
  left: 0;
  color: var(--accent);
}

blockquote p:first-child {
  margin-top: 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

table {
  table-layout: auto;
  border-collapse: collapse;
}

table,
th,
td {
  border: 2px solid var(--foreground);
  padding: 10px;
}

th {
  border-style: solid;
  color: var(--foreground);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

hr {
  width: 100%;
  border: none;
  background: var(--accent);
  height: 2px;
}

.log-header {
  margin-bottom: 2rem;
}

/* Code blocks functionality */
.highlight {
  position: relative;
  margin: 20px 0;
  border: 1px solid var(--code-border);
}

.code-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in srgb, var(--foreground) 5%, transparent);
  border-bottom: 1px solid var(--code-border);
  color: var(--comment);
  text-transform: uppercase;
  font-size: calc(var(--font-size) * .8);
  padding: 6px 10px;
  line-height: 1;
}

.copy-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  text-decoration: none;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent);
  appearance: none;
  cursor: pointer;
  outline: none;
  background: transparent;
  color: var(--accent);
  transition: all .15s linear;
}

.copy-button:hover {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
}

/* Collapsible code blocks */
.collapsible {
  position: relative;
  margin: 40px 0;
}

.collapsible-title {
  position: relative;
  padding: 10px;
  background: color-mix(in srgb, var(--foreground) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--foreground) 10%, transparent);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
}

.collapsible-title::after {
  content: '▶';
  position: absolute;
  right: 10px;
  transition: transform .2s;
}

.collapsible.open .collapsible-title::after {
  transform: rotate(90deg);
}

.collapsible-content {
  display: none;
  margin-top: -1px;
  border: 1px solid color-mix(in srgb, var(--foreground) 10%, transparent);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}

.collapsible.open .collapsible-content {
  display: block;
}

/* Line numbers */
.line-numbers {
  position: relative;
  padding-left: 3.8em !important;
  counter-reset: linenumber;
}

.line-numbers > code {
  position: relative;
  white-space: inherit;
}

.line-numbers .line-numbers-rows {
  position: absolute;
  pointer-events: none;
  top: 0;
  font-size: 100%;
  left: -3.8em;
  width: 3em;
  letter-spacing: -1px;
  border-right: 1px solid color-mix(in srgb, var(--foreground) 10%, transparent);
  user-select: none;
}

.line-numbers-rows > span {
  display: block;
  counter-increment: linenumber;
}

.line-numbers-rows > span:before {
  content: counter(linenumber);
  color: color-mix(in srgb, var(--foreground) 50%, transparent);
  display: block;
  padding-right: 0.8em;
  text-align: right;
}

/* Footnotes */
.footnotes {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 2px solid var(--accent);
}

.footnotes h2 {
  /* Hide the screen reader only heading visually */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.footnotes ol {
  margin-left: 0;
  padding-left: 3ch;
  list-style-type: decimal;
}

.footnotes li {
  margin-bottom: 10px;
  color: var(--foreground);
}

.footnotes li::marker {
  color: var(--accent);
  font-weight: 600;
}

.footnotes li p {
  margin: 0;
  display: inline;
}

/* Footnote references in text */
sup[data-footnote-ref] {
  font-weight: 600;
}

sup[data-footnote-ref] a {
  text-decoration: none;
  color: var(--accent);
  padding: 0 2px;
}

sup[data-footnote-ref] a:hover {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
}

/* Footnote back references */
.data-footnote-backref {
  text-decoration: none;
  margin-left: 5px;
  font-size: 0.9em;
}