/* Page layout. Keep max-width and padding in sync with .has-footnotes below. */
.site {
  margin-left: auto;
  margin-right: auto;
  max-width: 42rem;
  padding: 2.625rem 1.3125rem;
}

.site-header {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  width: 100%;
}

.site-title {
  font-size: 3.95285rem;
  line-height: 4.375rem;
  margin-bottom: 0.875rem;
  margin-top: 0;
}

.site-title-small {
  font-family: Montserrat, sans-serif;
  margin-top: 0;
}

.home-link {
  box-shadow: none;
  color: inherit;
}

.post-header-meta {
  margin-bottom: 0;
  margin-left: auto;
  margin-top: 0;
  text-align: right;
}

/* Post images are capped at the old Gatsby image width and link to the
   full-size original. */
a.post-image {
  box-shadow: none;
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 590px;
}

a.post-image img {
  display: block;
  height: auto;
  margin: 0 auto;
  max-width: 100%;
}

h3 {
  margin-top: 1.5rem;
}

h2 {
  margin-top: 1.5rem;
}

article .heading-anchor {
  box-shadow: none;
  display: inline-flex;
  margin-left: 0.35em;
  vertical-align: middle;
}

article .heading-anchor svg {
  fill: currentColor;
  height: 0.75em;
  opacity: 0;
  transition: opacity 120ms ease-in-out;
  width: 0.75em;
}

article h2:hover .heading-anchor svg,
article h3:hover .heading-anchor svg,
article h4:hover .heading-anchor svg,
article h5:hover .heading-anchor svg,
article h6:hover .heading-anchor svg,
article .heading-anchor:focus svg {
  opacity: 0.65;
}

@media (prefers-color-scheme: dark) {
  a {
    color: lightblue;
  }
  
  body {
    background-color: #222222;
    color: lightgrey
  }
  
  blockquote {
    color: grey;
  }

  pre {
    background: #1e1e1e;
    border-color: #3a3a3a;
    color: #f5f5f5;
  }

  code {
    background: #1e1e1e;
    border-color: #3a3a3a;
    color: #f5f5f5;
  }
}

@media (prefers-color-scheme: light) {

  body {
    background-color: #f0efef;
    color: black
  }
  
  blockquote {
    color: darkslategrey;
  }
}

blockquote {
  font-size: 1rem;
  font-style: normal;
  margin-left: 0;
  margin-right: 0;
}

pre {
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  color: #1f2933;
  font-size: 0.95rem;
  line-height: 1.55;
  overflow-x: auto;
  padding: 0.85rem 1.1rem;
}

pre,
article pre[class*="language-"] {
  margin-bottom: 1.75rem;
  padding-bottom: 1.1rem;
}

pre code {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
}

code {
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  color: #1f2933;
  font-size: 0.95em;
  padding: 0.15em 0.4em;
}

details {
  margin-bottom: 20px;
}

.post-meta {
  color: rgba(0, 0, 0, 0.6);
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.4;
  margin: 0 0 0.5rem;
}

.post-header-meta .post-meta {
  margin-bottom: 0;
}

.discussion-links {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0 0 0 0.5rem;
  padding: 0;
  vertical-align: middle;
}

.discussion-links li {
  margin: 0;
  padding: 0;
}

.discussion-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  box-shadow: none;
}

.discussion-links svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.discussion-links a:hover,
.discussion-links a:focus {
  outline: 1px solid currentColor;
  outline-offset: 2px;
  border-radius: 2px;
}

@media (prefers-color-scheme: dark) {
  .post-meta {
    color: rgba(255, 255, 255, 0.7);
  }
}

ol li {
  margin-left: 20px;
  padding-left: 10px;
}

ul li {
  margin-left: 20px;
  padding-left: 10px;
}

/* Site search styling */
.search-container {
  margin: 3.5rem 0 2.5rem;
  padding: 0.75rem 0 0;
}

.site-search {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.site-search input {
  flex: 1;
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #bdbdbd;
  border-radius: 5px;
  font-family: inherit;
  background: #ffffff;
}

.site-search button {
  padding: 0.55rem 1.1rem;
  font-size: 0.95rem;
  background: #1a73e8;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 120ms ease-in-out;
}

.site-search button:hover,
.site-search button:focus {
  background: #1558b0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-search input:focus,
.site-search button:focus {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
  .site-search input {
    background: #1e1e1e;
    border-color: #3d3d3d;
    color: lightgrey;
  }

  .site-search button {
    background: #3d7bf6;
  }

  .site-search button:hover,
  .site-search button:focus {
    background: #2f64c4;
  }

  .site-search input:focus,
  .site-search button:focus {
    outline-color: #3d7bf6;
  }
}

@media (prefers-color-scheme: light) {
  .site-search input {
    background: #ffffff;
    border-color: #bdbdbd;
    color: #000000;
  }

  .site-search button {
    background: #1a73e8;
  }

  .site-search button:hover,
  .site-search button:focus {
    background: #1558b0;
  }

  .site-search input:focus,
  .site-search button:focus {
    outline-color: #1a73e8;
  }
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 1rem 0 2rem;
  align-items: center;
}

.tag-cloud__link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  text-decoration: none;
  line-height: 1.1;
  font-weight: 600;
  transition: transform 120ms ease-in-out, color 120ms ease-in-out;
}

.tag-cloud__link:hover,
.tag-cloud__link:focus {
  transform: translateY(-1px);
}

.tag-cloud__count {
  font-size: 0.7em;
  color: rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  .tag-cloud__count {
    color: rgba(255, 255, 255, 0.7);
  }
}

/* Sidenotes: footnotes shown beside the text on screens wider than a phone in
   portrait. Keep the 640px breakpoint in sync with WIDE_QUERY in
   assets/sidenotes.js. */
.post-body {
  position: relative;
}

.sidenotes {
  display: none;
}

/* Below desktop width there's no room in the page margin, so on posts with
   footnotes narrow the text column and reserve a right gutter for the notes.
   This covers phones in landscape and tablets. */
@media (min-width: 640px) and (max-width: 1149.98px) {
  .has-footnotes {
    --sidenote-gap: 1.25rem;
    --sidenote-width: clamp(9rem, 26vw, 15rem);
    /* Widen .site to make room for the notes. */
    max-width: calc(
      42rem + var(--sidenote-gap) + var(--sidenote-width)
    );
    padding-right: calc(
      1.3125rem + var(--sidenote-gap) + var(--sidenote-width)
    );
  }

  .sidenotes {
    left: calc(100% + var(--sidenote-gap));
    width: var(--sidenote-width);
  }

  .has-footnotes .sidenote {
    font-size: 0.8rem;
    line-height: 1.5;
  }
}

@media (min-width: 1150px) {
  .sidenotes {
    left: calc(100% + 2.5rem);
    /* Fill the right margin, leaving 1.5rem before the viewport edge. */
    width: min(15rem, calc(50vw - 50% - 4rem));
  }
}

@media (min-width: 640px) {
  .sidenotes {
    display: block;
    position: absolute;
    top: 0;
  }

  /* Visually hide the end-of-post list but keep it for screen readers. */
  .has-sidenotes .footnotes {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

.sidenote {
  position: absolute;
  left: 0;
  right: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: rgba(0, 0, 0, 0.62);
  border-left: 2px solid transparent;
  padding-left: 0.6rem;
  margin-left: -0.6rem;
  transition: border-color 120ms ease-in-out, color 120ms ease-in-out;
}

.sidenote p {
  margin: 0 0 0.5em;
}

.sidenote p:last-child {
  margin-bottom: 0;
}

.sidenote__label {
  float: left;
  font-weight: 600;
  margin-right: 0.4em;
}

.sidenote__label::after {
  content: ".";
}

.sidenote.is-active {
  border-left-color: #1a73e8;
  color: rgba(0, 0, 0, 0.9);
}

.has-sidenotes .footnote-ref {
  transition: background-color 120ms ease-in-out;
  border-radius: 2px;
}

.has-sidenotes .footnote-ref.is-active {
  background-color: rgba(26, 115, 232, 0.15);
}

@media (prefers-color-scheme: dark) {
  .sidenote {
    color: rgba(255, 255, 255, 0.55);
  }

  .sidenote.is-active {
    border-left-color: lightblue;
    color: rgba(255, 255, 255, 0.85);
  }

  .has-sidenotes .footnote-ref.is-active {
    background-color: rgba(173, 216, 230, 0.2);
  }
}

/* Heading permalinks (previously injected by gatsby-remark-autolink-headers). */
.heading-anchor.after {
  display: inline-block;
  padding-left: 4px;
}

h2 .heading-anchor svg,
h3 .heading-anchor svg,
h4 .heading-anchor svg,
h5 .heading-anchor svg,
h6 .heading-anchor svg {
  visibility: hidden;
}

h2:hover .heading-anchor svg,
h3:hover .heading-anchor svg,
h4:hover .heading-anchor svg,
h5:hover .heading-anchor svg,
h6:hover .heading-anchor svg,
.heading-anchor:focus svg {
  visibility: visible;
}
