/* CSS-reset */

html {
  box-sizing: border-box;
  font-size: 18px;
}

*, *:before, *:after {
  box-sizing: inherit;
}

body, h1, h2, h3, h4, h5, h6, p, ol, ul {
  margin: 0;
  padding: 0;
}

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

details summary {
    cursor: pointer;
}

/******************/

:root {
  /* If updating the header, measure and write here afterwards */
  --header-height: 6.566rem;
  --logo-height: 3.33rem;
}

body {
  font-family: Source Serif, Georgia,Times,"Times New Roman",serif;
  color: #313130;
}

code, pre {
  font-family: Source Code Pro, monospace;
}

html .hl.lean code, html .hl.lean pre {
  font-family: Source Code Pro, monospace;
}

header .inner-wrap {
  min-height: 3.33rem;
  max-width: 68rem;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  gap: 1.5rem;
}

header, .main {
  padding: 1.618rem;
}

.logo {
  display: block;
  height: var(--logo-height);
}

.logo img {
  height: 100%;
}

nav a {
  text-decoration: none;
}

nav.top {
  flex: 1;
}

nav.top ol {
  list-style: none;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
}

nav.top ol li a, .mobile-menu-button {
  font-weight: 700;
  font-size: 1rem;
  /* Need to be same height as the logo, so they align vertically. */
  line-height: var(--logo-height);
  color: #000;
  text-transform: uppercase;
}

nav.top .home {
  display: none;
}

nav ol li a, .mobile-menu-button {
  position: relative;
  display: block;
  padding: 0 .75rem;
  font-family: "Helvetica Neue","Segoe UI",Arial,sans-serif;
}

/* Hide mobile menu by default (desktop first) */
.mobile-menu-checkbox, .mobile-menu-button {
  display: none;
}

.mobile-menu-checkbox {
  appearance: none;
}

/* Hide the menu on smaller screens and enable the menu toggle */
@media only screen and (max-width: 900px) {
  header .inner-wrap {
    justify-content: space-between;
  }
  
  /* Fix the header when the menu is shown. If the user clicks
     the menu when they have scrolled a little, it looks sensible. */
  header:has(.mobile-menu-checkbox:checked) {
    position: fixed;
    inset: 0;
    background-color: #fff;
  }

  .mobile-menu-button {
    display: block;
    cursor: pointer;
  }

  nav.top {
    display: none;
    position: fixed;
    inset: 0;
    top: calc(var(--header-height) - 1.618rem);
    padding: 1.618rem;
    padding-top: 0;
    overflow-y: auto;
  }

  nav.top ol {
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: flex-end;
  }

  .mobile-menu-checkbox:checked ~ nav.top {
    display: block;
  }

  body:has(.mobile-menu-checkbox:checked) {
    overflow: hidden;
  }
}

.main {
  padding-top: 0;
}

.main .wrap {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

.main ul, .main ol {
  padding-left: 1.5em;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Helvetica Neue","Segoe UI",Arial,sans-serif;
  text-rendering: optimizeLegibility;
  margin-top: 1.5rem;
}

h1 {
  font-size: 3.0em;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

h1:has(+.metadata) {
  margin-bottom: .1rem;
}

h2 {
  font-size: 1.8rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.4rem;
  line-height: 1.5;
  margin-bottom: 0.2rem;
}

h4 {
  font-size: 1.2rem;
  line-height: 1.25;
  margin-bottom: 0.2rem;
}

h5 {
  font-size: 1rem;
  line-height: 1.25;
  margin-bottom: 0.2rem;
}

h6 {
  font-size: 1rem;
  line-height: 1.15;
  margin-bottom: 0rem;
}

.main li {
  line-height: 1.3333333333;
  margin-bottom: 14px;
  margin-bottom: .875rem;
}

.main p a, .main li a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted #a2a2a2;
}

.main p a:hover, .main li a:hover {
  border-bottom-style: solid;
}

.main p {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.main dt {
  font-weight: 600;
}

.main dd {
  margin-left: 0.5em;
}

/*************/

ul.post-list {
  padding-left: 0;
}

ul.post-list > li {
  list-style-type: none;
  margin-bottom: 1.8rem;
}

.post-list .title {
  font-family: "Helvetica Neue","Segoe UI",Arial,sans-serif;
  font-weight: bold;
  text-rendering: optimizeLegibility;
  font-size: 150%;
}

.post-list a.title, .post-list .title a {
  text-decoration: none;
  border: none;
}

.post-list .read-more {
  display: block;
  width: fit-content;
}

.post-list .read-more::after {
  content: " ⟶";
}

/*************/

.metadata {
  font-family: "Helvetica Neue","Segoe UI",Arial,sans-serif;
  font-style: italic;
  margin-bottom: 1.5rem;
}

.metadata .authors {
  display: inline;
}

.metadata .authors::after {
  content: " | "
}

.metadata .authors .author::after {
  content: ", ";
}

.metadata .authors .author:last-child::after {
  content: "";
}


.metadata .date {
  display: inline;
}


.metadata ul.categories {
  padding: 0;
  display: none; /* Pending revamp to show the category list on the blog archive page */
}

.metadata ul.categories li {
  display: inline;
  margin: 0;
  padding: 0;
  list-style-type: none;
}

.metadata ul.categories li:first-child::before {
  content: "In: ";
  font-style: normal;
}


.metadata ul.categories li:has( + li)::after {
  content: ", ";
}

/*************/

.frontpage img {
  width: 100%;
}

.frontpage h1 {
  text-align: center;
  font-size: 3rem;
  margin: 0;
}

/*************/

.publication .title::before {
  content: "“";
}
.publication .title::after {
  content: "”";
}
.publication .links::after, .publication .authors::after {
  content: '\A';
  white-space: pre;
}
.publication ol.authors {
  margin: 0;
  padding: 0;
}
.publication ol.authors li {
  display: inline;
  list-style: none;
}
.publication ol.authors li:after, .publication ul.links li:after {
  content: ", ";
}
.publication ol.authors li:last-child:after, .publication ul.links li:last-child:after {
  content: ".";
}
.publication ul.links {
  margin: 0;
  padding: 0;
  display: inline;
}
.publication ul.links li {
  display: inline;
  list-style: none;
}

/*************/

.person {
  display: inline-block;
  width: 260px;
  text-align: center;
  vertical-align: top;
  margin-bottom: 40px;
}

.person img {
  width: 180px;
  clip-path: circle();
}

.person .name {
  font-weight: bold;
}

.person .name a {
  text-decoration: none;
  border: none;
  color: #000;
}

/*************/

.diff-view {
    background-color: #f6f8fa;
    padding: 0.25em;
    overflow-x: auto;
}
.diff-view pre {
    margin: 0;
    padding: 0;
}
.diff-view .plain pre::before {
    content: " ";
}
.diff-view .del pre {
    color: #82071e;
    background-color: #ffebe9;
}
.diff-view .del pre::before {
    content: "-";
}
.diff-view .ins pre {
    color: #116329;
    background-color: #dafbe1;
}
.diff-view .ins pre::before {
    content: "+";
}

/**************/

.toml > pre {
    margin: 0.5em .75em;
    padding: 0 0;
}

.toml .bool, .toml .table-header {
    font-weight: 600;
}

.toml .table-header .key {
    color: #3030c0;
}

.toml .bool {
    color: #107090;
}

.toml .string {
    color: #0a5020;
}

.toml .string a, .toml .string a:link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted #a2a2a2;
}

.toml .string a:hover {
    border-bottom-style: solid;
}

/**************/

.TODO {
    margin: auto;
    border: 2px solid red;
    padding: 1em;
    width: 80%
}

.TODO h3 {
    color: red;
    margin-top: 0;
    text-align: center;
}

/**************/
.error pre, .information pre, .warning pre,
.error code, .information code, .warning code {
    overflow-x: auto;
    margin: 0px;
}

/*
  This would be prettier, but gets ugly if the line gets too long.
  And we cannot use overflow-x: scroll, as that would also keep the
  hovers within the scrolled arear, which is really bad

.hl.lean.block,
.information pre, .error pre, .warning pre,
.information code, .error code, .warning code {
  background-color: rgba(42, 52, 57, 0.05);
  border: 1px solid rgba(42, 52, 57, 0.25);
  border-radius: 4px;
}
  */

/*
  Code is indented 0.75em, and output additional 0.75em,
  with a border within this additional indent.
  The total indent of output blocks matches that of a <li>
*/
.hl.lean.block {
  margin: 0.5em .75em;
  padding: 0 0;
}
.information pre, .error pre, .warning pre,
.information code, .error code, .warning code {
  margin: 0.5em .85em;
  border-left: 0.2em solid red;
  padding: 0 0.45em;
}

/* Different color for information */
.information pre, .information code
{
    border-color: #0000c0;
}

/* Different color for warning */
.warning pre, .warning code
{
    border-color: #efd871;
}


.hl.lean {
    width: 100%;
}

.hl.lean .token.keyword {
    font-weight: 600;
}

details.error summary::before, details.warning summary::before, details.information summary::before {
    content: "Show all";
    color: red;
    font-family: "Helvetica Neue","Segoe UI",Arial,sans-serif;
}

details.error summary::before, details.warning summary::before, details.information summary::before {
    content: "Show details";
    color: red;
    font-family: "Helvetica Neue","Segoe UI",Arial,sans-serif;
    cursor: pointer;
}

details[open].error summary::before, details[open].warning summary::before, details[open].information summary::before {
    content: "Hide details";
}

details[open].error::after, details[open].warning::after, details[open].information::after {
    content: "";
}

details.error::after, details.warning::after, details.information::after {
    content: "...";
    display: block;
}

details.error::after {
    color: red;
}

details.warning::after {
    color: yellow;
}

details.information::after {
    color: #0000c0;
}

details.error summary code, details.warning summary code, details.information summary code {
    white-space: pre;
    cursor: text;
}

details.error summary code {
    color: red;
}

details.error pre, details.warning pre, details.information pre {
    margin: 0;
}


details.error summary code, details.information summary code, details.warning summary code {
    display: block;
}

/*
  On machines with hover-capable input (mouse, stylus, etc), don't cut off
  hovers at the border of the highlighted code.
 */
@media (hover: hover) {
    .hl.lean {
        overflow: visible;
    }
}

/*
  On machines without hover-capable input (mouse, stylus, etc),
  prevent overflow and ugly whole-page scroll bars by making the code
  block itself draggable/scrollable.
 */
@media (hover: none) {
    .hl.lean {
        overflow-x: auto;
    }
}


.hl.lean .has-info .hover-container .hover-info.messages > code.message.info {
    border-left: 0.4em solid #0000c0;
    border-top: 1px solid #0000c0;
    border-right: 1px solid #0000c0;
    border-bottom: 1px solid #0000c0;
    color: #0000c0;
    background-color: #eee;
}

html .tippy-box {
    font-size: 18px;
}

/* Allow line breaks in inline code */
.hl.lean.inline {
    text-wrap-mode: wrap;
}
