/***************************************************
                  GENERAL
 ***************************************************/

@import url(fonts.css);
@import url(definitions.css);

html {
  font-size: 100%;
  scroll-behavior: smooth;
}
body {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  line-height: 1.65;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
}
html,
body {
  width: 100%;
  height: 100%;
  color: var(--light-text);
  background: var(--light-background);
  scrollbar-color: var(--light-text) var(--light-background);
}
body::-webkit-scrollbar {
  width: 0.7rem;
  height: 0.7rem;
  background-color: transparent;
}
body::-webkit-scrollbar-thumb {
  background-color: var(--light-text);
  border: 0.125rem solid var(--light-background);
  border-radius: 10px;
}
img.light-mode {
  display: block;
}
img.dark-mode {
  display: none;
}
@media (prefers-color-scheme: dark) {
  html,
  body {
    color: var(--dark-text);
    background: var(--dark-background);
    scrollbar-color: var(--dark-text) var(--dark-background);
  }
  body::-webkit-scrollbar-track {
    background-color: transparent;
  }
  body::-webkit-scrollbar-thumb {
    background-color: var(--dark-text);
    border: 0.125rem solid var(--dark-background);
  }
}

.light-theme {
  display: block;
}
.dark-theme {
  display: none;
}
@media (prefers-color-scheme: dark) {
  .light-theme {
    display: none;
  }
  .dark-theme {
    display: block;
  }
}

.d-none {
  display: none;
}
.break-word {
  word-break: break-word;
}

/***************************************************
                  LOGO & MENU
 ***************************************************/

nav.logo-button,
nav.site-menu {
  position: fixed;
  top: 3rem;
  z-index: 10;
}
nav.logo-button {
  left: 3rem;
  margin-top: calc((1.65 * 4 * 1rem / 2) - 3rem);
}
nav.site-menu {
  /* right: 3rem; */
  left: 100vw;
  transform: translateX(calc(-100% - 3rem));
}
nav.logo-button > a > img {
  width: 6rem;
}
nav.site-menu a {
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  font-weight: bold;
  line-height: 2.1rem;
  text-align: right;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
@media only screen and (max-width: 1024px) {
  nav.logo-button,
  nav.site-menu {
    top: 2rem;
  }
  nav.logo-button {
    left: 1rem;
    margin-top: calc((1.65 * 4rem / 2) - 2.1rem);
  }
  nav.site-menu {
    /* right: 1rem; */
    left: 100vw;
    transform: translateX(calc(-100% - 1rem));
  }
  nav.logo-button > a {
    line-height: 4rem;
  }
  nav.logo-button > a > img {
    width: 4rem;
  }
}
nav.site-menu a {
  color: var(--light-text) !important;
}
nav.site-menu a:hover,
nav.site-menu a:focus,
nav.site-menu a:active {
  color: var(--light-accent) !important;
}
@media (prefers-color-scheme: dark) {
  nav.site-menu a {
    color: var(--dark-text) !important;
  }
  nav.site-menu a:hover,
  nav.site-menu a:focus,
  nav.site-menu a:active {
    color: var(--dark-accent) !important;
  }
}

/***************************************************
                  FOOTER
 ***************************************************/

.page-footer {
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  text-align: center;
  box-sizing: border-box;
  z-index: 1;
}
.fullscreen-footer .page-footer {
  position: fixed;
  bottom: 0;
  /* left: 50%;
  transform: translateX(-50%); */
}

/***************************************************
                  GRAPH
 ***************************************************/

.note-graph {
  height: 31.25rem;
  margin-top: 2rem;
}
.fullscreen-graph .note-graph {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  margin-top: 0;
}
.force-graph-container .graph-tooltip {
  visibility: hidden !important;
}

/***************************************************
                  MAIN DOCUMENT
 ***************************************************/

main {
  flex-grow: 1;
  width: 100vw;
  max-width: min(43.75rem, 100vw);
  margin: 0 auto;
  margin-top: 10rem;
  padding: 1.5rem;
  font-size: 1.25rem;
  box-sizing: border-box;
}
@media only screen and (max-width: 1024px) {
  main {
    margin-top: 8rem;
  }
}

a[href] {
  text-decoration: none;
  color: var(--light-accent);
}
a[href]:hover {
  text-decoration: underline;
  text-decoration-thickness: 1.5pt;
}
a[href]:focus {
  outline-offset: 4px;
  outline: 2px solid var(--light-accent);
}
a.external::after {
  content: "➶";
  padding-left: 0.2rem;
  line-height: 1;
  font-size: 1rem;
  vertical-align: super;
  color: var(--light-text);
}
@media (prefers-color-scheme: dark) {
  a[href] {
    color: var(--dark-accent);
  }
  a[href]:focus {
    outline: 2px solid var(--dark-accent);
  }
  a.external::after {
    color: var(--dark-text);
  }
}

p {
  margin-bottom: 1.15rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 2.75rem 0 1.05rem;
  font-family: var(--font-family-headings);
  font-weight: bold;
  line-height: 1.15;
}
h1 {
  font-size: 3.052rem;
}
h2 {
  font-size: 2.441rem;
}
h3 {
  font-size: 1.953rem;
}
h4 {
  font-size: 1.563rem;
}

small {
  font-size: 0.8rem;
}

article img {
  max-width: 100%;
}

pre {
  padding: 2rem;
}
code {
  font-family: var(--font-family-mono);
  white-space: break-spaces;
}

hr {
  border-bottom: 1px solid var(--light-text);
}
@media (prefers-color-scheme: dark) {
  hr {
    border-bottom: 1px solid var(--dark-text);
  }
}

table {
  width: 100%;
  margin: 1.15rem auto;
  border: 0;
  border-spacing: 0;
}
table thead.headerless {
  display: none;
}
table thead tr th {
  font-weight: bold;
  text-align: left;
  border-bottom: 1px solid var(--light-text);
}
table thead tr th,
table tbody tr td {
  padding: 0.5rem 0.5rem;
}
table thead tr th:first-child,
table tbody tr td:first-child {
  padding-left: 0rem;
}
table.archive thead tr th:first-child,
table.archive tbody tr td:first-child {
  min-width: 8rem;
  vertical-align: top;
}
table thead tr th:last-child,
table tbody tr td:last-child {
  padding-right: 0rem;
}
@media (prefers-color-scheme: dark) {
  table thead tr th {
    border-bottom: 1px solid var(--dark-text);
  }
}

.post-date {
  margin-top: 1rem;
  margin-bottom: 2rem;
}
