/* Colors */
:root {
  --tag-color: Canvas;
  --tag-background-color: CanvasText;
  --instruction-arrow-color: Field; /*color-mix(in srgb, CanvasText 10%, Canvas);*/

  --min-view-margin: 10px;
  --view-margin: max(var(--min-view-margin), 5vw);
  --view-width: min(1024px, 100vw - var(--view-margin));
  --font-size-regular: max(14px, calc(var(--view-width)/45));
  --font-size-small: max(12px, calc(0.8 * var(--font-size-regular)));
  --font-size-extra-small: max(10px, calc(0.75 * var(--font-size-regular)));
}

html {
  color-scheme: light dark;
}

/* Typography */

body {
  font-family: system-ui;
  font-size: var(--font-size-regular);
  line-height: 1.5;
}

blockquote {
  border-left: calc(max(2px, 0.34em)) solid Mark;
  margin: 0;
  padding: 0 0 0 1em;

}

code {
  font-weight: bold;
}
:not(pre) > code {
  color: Mark;
}

pre {
  font-size: 0.9em;
  padding: 1em;
  margin: 0.5em 0;
  max-width: calc(var(--view-width));
  overflow: auto;
  line-height: 1em;
}
.highlight {
  border-radius: 0.5em;
}

h1 {
  font-size: 1.5em;
  line-height: 1.2em;
}
header h1 {
  font-size: 1.8em;
}
.main-header h1 {
  font-size: 1em;
  font-weight: 100;
}

article header time {
  font-weight: 100;
  margin-bottom: 1em;
  display: inline-block;
}

a {
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-decoration-thickness: 20%;
}

ul {
  padding: 0 0.9em
}

/* Layout */

body {
  height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

main, header, footer {
  width: 100%;
  max-width: var(--view-width);
  margin-inline: auto;
}

img,
svg,
video {
  max-width: 100%;
  display: block;
}

article footer, article header {
  margin: 0;
}

body > footer {
  font-size: 0.7em;
  margin-top: 2em;
  padding: 1em 0;
  filter: opacity(50%);
}

article footer {
  font-size: var(--font-size-small);
  margin-top: 4em;
}

/* Widgets */

header.main-header {
}

.tag {
  font-size: var(--font-size-extra-small);
  text-decoration: none;
  color: var(--tag-color);
  background-color: var(--tag-background-color);
  font-family: monospace;
  letter-spacing: 0.125em;
  border-radius: 0.5em;
  padding: 0.25em;
}

article header h1 {
  margin-bottom: 0.1em;
}
header h1 a {
  text-decoration: none;
  color: CanvasText;
}

nav {
  xmargin-top: -1.5em;
}
nav ul {
  margin: 0;
  padding: 0;
}
nav ul li {
  display: inline;
  margin-right: 1.5em;
}

.copyable {
  position: relative;
  cursor: pointer;
}
.copy-btn {
  position: absolute;
  top: .5rem;
  right: .3rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: .75rem;
  padding: .25rem .5rem;
  border-radius: .375rem;
  cursor: pointer;
}
.copy-btn[aria-disabled="true"] { opacity: .6; cursor: default; }
.copy-toast {
  position: absolute;
  right: .5rem;
  bottom: .5rem;
  font-size: .75rem;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
.copyable[data-copied="true"] .copy-toast { opacity: 1; }
.copy-btn::after {
  content: "📄";
  position: absolute;
  left: 10px;
  top: 2px;
}
.highlight:has(> pre:focus) {
  outline: 2px solid Mark;
}

.list-item {
  margin-bottom: 1.5em;
}
.list-item * {
  margin: 0;
}
.list-item h2 {
  font-size: 1em;
}
.list-item section > p {
  font-size: var(--font-size-small);
}
.list-item time {
  font-size: var(--font-size-small);
}

.instruction-list {
  padding: 0;
  margin: 3em 0;
}
.instruction-list li {
  color: FieldText;
  background-color: Field;
  border: 2px solid var(--instruction-arrow-color);
  border-radius: 0.5em;
  list-style-type: none;
  margin: 1.75em 0;
  padding: 1em;
}
.instruction-list li:after {
  position: relative;
  top: calc(2em + 1em + 0.75em);
  content: "";
  display: block;
  margin: calc(-1 * 2em) auto 0 auto;
  width: 0;
  height: 0;
  border: 1em solid var(--instruction-arrow-color);
  border-bottom-color: transparent;
  border-left-color: transparent;
  border-right-color: transparent;
}
.instruction-list li:before {
  position: relative;
  top: calc(-1.75em - 2px);
  content: "";
  display: block;
  margin: -1em auto 0 auto;
  width: 0;
  height: 0.75em;
  border-color: var(--instruction-arrow-color);
  border-style: solid;
  border-width: 0.3em;
  border: 0 1 0 0;
}


.instruction-list li:last-child:after {
  content: none;
}
.instruction-list li:first-child:before {
  content: none;
}
