/* Base styles and content styles */

@import "variables.css";

* {
  box-sizing: border-box;
  background-repeat: no-repeat;
  border-width: 0;
  border-style: solid;
  border-color: #e5e7eb;
  margin: 0;
  padding: 0;
}

*:before,
*:after,
::backdrop,
::file-selector-button {
  box-sizing: inherit;
  background-repeat: inherit;
  border-width: 0;
  border-style: solid;
  border-color: #e5e7eb;
  margin: 0;
  padding: 0;
}

html {
  -moz-tab-size: 4;
  -o-tab-size: 4;
  tab-size: 4;
  line-height: 1.5;
}

html:focus-within {
  scroll-behavior: smooth;
}

body {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif,
    "Apple Color Emoji",
    "Segoe UI Emoji";
  margin: 0;
  padding: 0;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  line-height: inherit;
}

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
}

hr {
  height: 0;
  color: inherit;
  border-top-width: 1px;
  border-color: #4b5563;
}

ul[role="list"],
ol[role="list"],
menu[role="list"] {
  list-style: none;
}

/* removes spacing between cells in tables */
table {
  border-collapse: collapse;
  border-spacing: 0;
  text-indent: 0;
  border-color: inherit;
}

/* For images to not be able to exceed their container */
audio,
canvas,
embed,
iframe,
img,
object,
svg,
picture,
video {
  display: block;
  border-width: 0;
  border-style: solid;
}

audio,
canvas,
embed,
iframe,
img,
object,
svg,
picture,
video {
  /* ignore this warning */
  vertical-align: middle;
}

audio,
video {
  max-inline-size: 100%;
}

svg:not(:root) {
  overflow: hidden;
}

img,
picture,
video {
  max-width: 100%;
  height: auto;
}

progress {
  vertical-align: baseline;
}

textarea {
  resize: vertical;
}

button,
[role="button"] {
  cursor: pointer;
}

button,
select {
  text-transform: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
  background-color: transparent;
  background-image: none;
}

[type="search"] {
  -webkit-appearance: textfield;
  outline-offset: -2px;
}

:-moz-ui-invalid {
  box-shadow: none;
}

:-moz-focusring {
  outline: auto;
}

::-moz-focus-inner {
  border: 0;
  padding: 0;
}

::-webkit-search-decoration {
  -webkit-appearance: none;
}

::-webkit-file-upload-button {
  -webkit-appearance: button;
  font: inherit;
}

/* ::-webkit-outer-spin-button,
::-webkit-inner-spin-button {
  height: auto;
  -webkit-appearance: none;
} */

::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

::-webkit-date-and-time-value {
  min-height: 1.5em;
}

:root {
  --placeholder-opacity: 0.7;
  --placeholder-color: #bae6fd;
}

::placeholder {
  opacity: var(--placeholder-opacity);
  color: var(--placeholder-color);
}

::-moz-placeholder {
  opacity: var(--placeholder-opacity);
  color: var(--placeholder-color);
}

input::placeholder,
textarea::placeholder {
  opacity: var(--placeholder-opacity);
  color: var(--placeholder-color);
}

input::webkit-input-placeholder,
textarea::webkit-input-placeholder {
  opacity: var(--placeholder-opacity);
  color: var(--placeholder-color);
}

input::-moz-placeholder,
textarea::-moz-placeholder {
  opacity: var(--placeholder-opacity);
  color: var(--placeholder-color);
}

input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
  opacity: var(--placeholder-opacity);
  color: var(--placeholder-color);
}

input::-ms-input-placeholder,
textarea::-ms-input-placeholder {
  opacity: var(--placeholder-opacity);
  color: var(--placeholder-color);
}

::selection {
  background-color: #0057c0 !important;
  -webkit-text-fill-color: #ffffff !important;
  color: #ffffff !important;
}
::-moz-selection {
  background-color: #0057c0 !important;
  -webkit-text-fill-color: #ffffff !important;
  color: #ffffff !important;
}

input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
  background-color: #484d00 !important;
  color: #ffffff !important;
}

button:focus:not(:focus-visible) {
  outline: none;
}

:disabled {
  cursor: default;
}

button:disabled {
  cursor: default;
}

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}

button,
input:where([type="button"], [type="reset"], [type="submit"]),
::file-selector-button {
  appearance: button;
}

textarea {
  resize: vertical;
  overflow: auto;
}

audio,
canvas,
video,
progress {
  vertical-align: baseline;
}

legend {
  box-sizing: border-box;
  color: inherit;
  display: table;
  max-width: 100%;
  white-space: normal;
}

main,
details {
  display: block;
}

summary {
  display: list-item;
}

details summary {
  cursor: pointer;
}

abbr {
  border: 0;
}

abbr:where([title]) {
  -webkit-text-decoration: underline dotted;
  text-decoration: underline dotted;
}

a,
.link {
  /* background-color: inherit; */
  letter-spacing: inherit;
}

a:link,
a:visited,
.link:link,
.link:visited {
  text-decoration: none;
}

a:hover,
.link:hover {
  text-decoration: underline;
}

.link[href^="#"]:hover a[href^="#"]:hover {
  text-decoration-style: dashed;
}

a:active,
.link:active {
  text-decoration: none;
}

a:disabled,
.link:disabled {
  opacity: 0.32;
}

a[role="button"],
a[role="button"]:link,
a[role="button"]:visited,
a[role="button"]:hover {
  text-decoration: none;
}

a,
span {
  line-height: inherit;
  letter-spacing: inherit;
}

template {
  display: none;
}

[hidden] {
  display: none !important;
}

[hidden] [hidden] {
  display: none !important;
}

blockquote:before,
blockquote:after,
q:before,
q:after {
  content: "";
  content: none;
}

sup,
sub {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sup {
  top: -0.5em;
}

sub {
  bottom: -0.25em;
}

small {
  font-size: 88%;
}

code,
kbd,
samp,
q,
tt {
  font-family:
    SF Mono,
    SFMono-Regular,
    ui-monospace,
    Menlo,
    Monaco,
    Consolas,
    Liberation Mono,
    Courier New,
    monospace;
  font-size: 1em;
}

b,
strong {
  font-weight: bolder;
}

em,
i,
cite,
dfn {
  font-style: italic;
}

q {
  display: inline;
  white-space: pre-wrap;
}

q:before,
q:after {
  content: "";
}

:disabled {
  pointer-events: none;
  cursor: default;
}

* {
  transition-property: color, background, background-color, border, border-color, opacity,
    box-shadow, outline, outline-color, fill, fill-opacity, stroke, stroke-opacity, stroke-width,
    accent-color, filter, background-filter, text-decoration, visibility, backdrop-filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 0.1s;
}

.safari svg * {
  transition-duration: 0.1s;
}

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after,
  *:hover::before,
  *:hover::after,
  *:focus::before,
  *:focus::after,
  *:invalid::before,
  *:invalid::after,
  *:active::before,
  *:active::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

:root {
  /* Browser default font-size is 16px, this way 1 rem = 10px */
  font-size: 62.5%;
  color-scheme: var(--color-scheme);
}

html {
  font-family: var(--font);
  color: var(--fg);
  background-color: var(--bg);
  text-size-adjust: none;
  -webkit-text-size-adjust: none;

  text-rendering: geometricPrecision !important;
  -webkit-font-smoothing: antialiased !important;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.005);
}

body {
  margin: 0;
  font-size: 1.6rem;
  overflow-x: hidden;
}

html {
  /* 1em = 16px */
  /* font-size: 16px; */
  /* line-height: 1.5rem; */
  font-style: normal;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  /* overscroll-behavior: none; */
  /* color-scheme: dark !important; */
  tab-size: 4;
}

body {
  font-family:
    var(--ff-sans-serif),
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Ubuntu,
    Cantarell,
    Noto Sans,
    sans-serif,
    BlinkMacSystemFont,
    Helvetica Neue,
    Arial,
    Apple Color Emoji,
    Segoe UI Emoji,
    Segoe UI Symbol,
    Noto Color Emoji;
  font-weight: var(--text-default-weight);
  font-kerning: var(--ff-sans-serif-kerning);
  -webkit-font-kerning: var(--ff-sans-serif-kerning);
  -ms-font-kerning: var(--ff-sans-serif-kerning);
  -moz-font-kerning: var(--ff-sans-serif-kerning);
  -o-font-kerning: var(--ff-sans-serif-kerning);
  font-variant-ligatures: var(--ff-sans-serif-ligatures);
  -webkit-font-variant-ligatures: var(--ff-sans-serif-ligatures);
  -ms-font-variant-ligatures: var(--ff-sans-serif-ligatures);
  -moz-font-variant-ligatures: var(--ff-sans-serif-ligatures);
  -o-font-variant-ligatures: var(--ff-sans-serif-ligatures);
  -webkit-font-feature-settings: var(--ff-sans-serif-features);
  -moz-font-feature-settings: var(--ff-sans-serif-features);
  -ms-font-feature-settings: var(--ff-sans-serif-features);
  font-feature-settings: var(--ff-sans-serif-features);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--fg-default);
  background-color: var(--bg-default);
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: inherit;
}

body.sidebar-visible {
  background-image: radial-gradient(
    49.63% 57.02% at 62% -7.2%,
    rgba(var(--rgb-slate-300), 0.02) 0%,
    rgba(0, 0, 0, 0) 450%
  );
}

body.sidebar-hidden {
  background-image: radial-gradient(
    49.63% 57.02% at 50% -7.2%,
    rgba(var(--rgb-slate-300), 0.02) 0%,
    rgba(0, 0, 0, 0) 450%
  );
}

kbd,
samp,
code,
.code-block {
  font-family:
    var(--ff-mono),
    SF Mono,
    SFMono-Regular,
    ui-monospace,
    Menlo,
    Monaco,
    Consolas,
    Liberation Mono,
    Courier New,
    monospace !important;
  font-weight: var(--weight-normal-mono);
  -webkit-font-feature-settings: var(--ff-mono-features);
  -moz-font-feature-settings: var(--ff-mono-features);
  -ms-font-feature-settings: var(--ff-mono-features);
  font-feature-settings: var(--ff-mono-features);
  font-variant-ligatures: var(--ff-mono-ligatures);
}

code {
  font-size: var(--code-font-size);
  direction: ltr !important;
}

/* make long words/inline code not x overflow */
main {
  overflow-wrap: break-word;
}

/* make wide tables scroll if they overflow */
.table-wrapper {
  overflow-x: auto;
}

h1 {
  font-family: var(--title-font);
  font-weight: 500;
  color: rgba(var(--rgb-orange-50), 0.88);
}

h2,
h3,
h4,
h5,
h6 {
  font-family: var(--title-font);
  font-weight: 500;
  color: var(--title-color);
}

.content :not(.l-doc) h1,
.content :not(.l-doc) h2,
.content :not(.l-doc) h3,
.content :not(.l-doc) h4,
.content :not(.l-doc) h5,
.content :not(.l-doc) h6 {
  font-weight: 600;
}

/* Don't change font size in headers. */
h1 code,
h2 code,
h3 code,
h4 code,
h5 code,
h6 code {
  font-size: unset;
  font-weight: unset;
}

.left {
  float: left;
}
.right {
  float: right;
}
.boring {
  opacity: 0.6;
}
.hide-boring .boring {
  display: none;
}
.hidden {
  display: none !important;
}

h2,
h3 {
  margin-block-start: 1.5em;
  margin-block-end: 0;
}
h4,
h5 {
  margin-block-start: 2em;
}

.header + .header h3,
.header + .header h4,
.header + .header h5 {
  margin-block-start: 1em;
}

h1:target::before,
h2:target::before,
h3:target::before,
h4:target::before,
h5:target::before,
h6:target::before {
  display: inline-block;
  content: "»";
  margin-inline-start: -46px;
  width: 46px;
  padding-inline-start: 6px;
  border-radius: var(--round-full);
  padding-bottom: 2px;
  font-size: inherit;
  line-height: 0.9;
}

/* This is broken on Safari as of version 14, but is fixed
   in Safari Technology Preview 117 which I think will be Safari 14.2.
   https://bugs.webkit.org/show_bug.cgi?id=218076
*/
:target {
  /* Safari does not support logical properties */
  scroll-margin-top: calc(var(--menu-bar-height) + 2rem);
}

.page {
  outline: 0;
  padding: 0 var(--page-padding) 30px;
  margin-block-start: calc(
    0px - var(--menu-bar-height)
  ); /* Compensate for the #menu-bar-hover-placeholder */
  min-height: 100%;
  min-width: 100%;
  position: relative; /* fix for footer width 100% */
}
.page-wrapper {
  box-sizing: border-box;
  background-color: var(--bg);
  min-height: 100vh;
  display: flex;
  background-color: transparent;
}
.no-js .page-wrapper,
.js:not(.sidebar-resizing) .page-wrapper {
  transition:
    margin-left 0.3s ease,
    transform 0.3s ease; /* Animation: slide away */
}
[dir="rtl"] .js:not(.sidebar-resizing) .page-wrapper {
  transition:
    margin-right 0.3s ease,
    transform 0.3s ease; /* Animation: slide away */
}

.content {
  overflow-y: auto;
  padding: 48px 0 128px;
}
.content main {
  margin-inline-start: auto;
  margin-inline-end: auto;
  max-width: var(--content-max-width);
}
.content p {
  line-height: 1.625em;
}
.content div.video {
  margin-top: 1rem;
  border: 1px solid;
  border-color: var(--border);
  border-radius: 8px;
  overflow: clip;
}
.content div.video iframe {
  margin: 0;
}
.content ol {
  line-height: 1.7;
  padding-left: 1.8em;
}
.content ul {
  line-height: 1.7;
  padding-left: 1.8em;
}
/* .content li {
  padding-left: 0.5em;
} */
.content a {
  text-decoration: underline;
  text-decoration-color: var(--link-line-decoration);
}
.content a:hover {
  text-decoration-color: var(--link-line-decoration-hover);
}
.content img,
.content video {
  max-width: 100%;
  background-color: var(--media-bg);
  border: 1px solid;
  border-color: var(--border);
  border-radius: 8px;
  overflow: clip;
}
.content h1 .header:link,
.content h1 .header:visited {
  color: rgba(var(--rgb-orange-100), 0.94);
}
.content .header:link,
.content .header:visited {
  color: var(--title-color);
}
.content .header:link,
.content .header:visited:hover {
  text-decoration: none;
}

.content h1 > a.header:link {
  line-height: 1.5;
}

iframe {
  margin-top: 1rem;
  margin-bottom: 10rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.4rem;
}
table td {
  padding: var(--sp-1-5) var(--sp-3);
  border: 1px var(--table-border-color) solid;
  color: var(--blue-200);
  font-weight: 500;
  /* font-size: 1.25rem; */
}
table thead {
  background: var(--bg-4);
}
table thead td {
  font-weight: 600;
  border: none;
}
table thead th {
  font-weight: 500;
  padding: var(--sp-1-5);
  color: rgba(var(--rgb-violet-300), 1);
  text-align: left;
  border: 1px var(--table-border-color) solid;
}
table thead tr {
  border: 1px var(--table-border-color) solid;
}
/* Alternate background colors for rows */
table tbody tr:nth-child(2n) {
  background: var(--table-alternate-bg);
}

blockquote {
  margin: auto;
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  color: var(--full-contrast);
  background-color: var(--quote-bg);
  border: 1px solid var(--quote-border);
}

blockquote > p {
  margin: 0;
  padding-left: 2.6rem;
  font-size: 1.4rem;
}

blockquote:before {
  position: absolute;
  content: "ⓘ";
  /* content: "💡"; */
  margin: 0.3rem 0;
  width: 1.6rem;
  height: 2rem;
  font-size: 2rem;
  font-weight: bold;
  color: var(--slate-400);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.7em;
}

blockquote .warning:before {
  background-color: var(--quote-bg);
}

.warning {
  margin: auto;
  padding: 1rem 1.25rem;
  color: var(--full-contrast);
  background-color: var(--warning-bg);
  border: 1px solid var(--warning-border);
}

.warning > p {
  margin: 0;
  padding-left: 2.6rem;
  font-size: 1.4rem;
}

.warning:before {
  position: absolute;
  /* content: "ⓘ"; */
  content: "⚠️";
  margin: 0.3rem 0;
  width: 1.6rem;
  height: 1.6rem;
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--warning-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.625em;
}

kbd {
  background-color: rgba(8, 76, 207, 0.1);
  border-radius: 4px;
  border: solid 1px var(--theme-popup-border);
  box-shadow: inset 0 -1px 0 var(--theme-hover);
  display: inline-block;
  font-size: var(--code-font-size);
  font-family: var(--mono-font);
  line-height: 10px;
  padding: 4px 5px;
  vertical-align: middle;
}

:not(.footnote-definition) + .footnote-definition,
.footnote-definition + :not(.footnote-definition) {
  margin-block-start: 2em;
}
.footnote-definition {
  font-size: 1.4rem;
  margin: 0.5em 0;
  border-bottom: 1px solid;
  border-color: var(--divider);
}
.footnote-definition p {
  display: inline;
}

.tooltiptext {
  position: absolute;
  visibility: hidden;
  color: #fff;
  background-color: #333;
  transform: translateX(-50%); /* Center by moving tooltip 50% of its width left */
  left: -8px; /* Half of the width of the icon */
  top: -35px;
  font-size: 0.8em;
  text-align: center;
  border-radius: 6px;
  padding: 5px 8px;
  margin: 5px;
  z-index: 1000;
}
.tooltipped .tooltiptext {
  visibility: visible;
}

.chapter li.part-title {
  font-size: 18px;
  font-family: var(--title-font);
  font-weight: 520;
  color: var(--title-color);
  margin: 5px 0;
  margin-top: 2rem;
}

.result-no-output {
  font-style: italic;
}

code:not(pre code).hljs {
  color: var(--code-text) !important;
  background-color: var(--code-bg) !important;
}

#body-container {
  min-height: 100vh;
  /* -webkit-backdrop-filter: blur(30px);
  backdrop-filter: blur(30px); */
}

.menu-title a {
  text-decoration: none !important;
}

.menu-title a:hover {
  text-decoration: none !important;
}

.content p {
  padding: var(--sp-3) 0 var(--sp-1);
  line-height: 1.75em;
}

li::marker,
ol::marker {
  color: var(--slate-500);
}

/* .l-doc ul > li::marker {
  color: var(--slate-500);
}

.l-doc ol > li::marker {
  color: var(--slate-500);
} */

.content p,
.content ul,
.content ol,
.content li {
  font-size: 15px;
}
