/* Local light/dark color trial. Typography and layout remain in the base theme. */

.masthead .container {
  position: relative;
}

.color-theme-toggle {
  position: absolute;
  top: 50%;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: #505050;
  background: transparent;
  border: 1px solid #c8c8c8;
  border-radius: .25rem;
  cursor: pointer;
  transform: translateY(-50%);
}

.color-theme-icon {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

.color-theme-icon-sun {
  display: none;
}

html.dark-theme .color-theme-icon-moon {
  display: none;
}

html.dark-theme .color-theme-icon-sun {
  display: block;
}

.color-theme-toggle:hover,
.color-theme-toggle:focus {
  border-color: #268bd2;
}

.color-theme-toggle:focus-visible {
  outline: 2px solid #268bd2;
  outline-offset: 2px;
}

@media (max-width: 48em) {
  .masthead-title {
    padding-right: 4.75rem;
    padding-left: 4.75rem;
  }

  .color-theme-toggle {
    right: 1rem;
  }
}

@media (max-width: 24em) {
  .masthead-title {
    padding-right: 4.25rem;
    padding-left: 4.25rem;
    font-size: .9rem;
  }

  .color-theme-toggle {
    right: .5rem;
  }
}

@media print {
  .color-theme-toggle {
    display: none;
  }
}

html.dark-theme body,
html.dark-theme .wrap {
  color: #deddd9;
  background-color: #191a1b;
}

html.dark-theme a {
  color: #69afe0;
}

html.dark-theme h1,
html.dark-theme h2,
html.dark-theme h3,
html.dark-theme h4,
html.dark-theme h5,
html.dark-theme h6,
html.dark-theme strong,
html.dark-theme .page-title,
html.dark-theme .post-title,
html.dark-theme .post-title a,
html.dark-theme .masthead-title,
html.dark-theme .masthead-title a {
  color: #f0efeb;
}

html.dark-theme .masthead {
  border-bottom-color: #383a3d;
}

html.dark-theme .masthead-title small,
html.dark-theme .post-date,
html.dark-theme .related-posts li small {
  color: #aaa9a5;
}

html.dark-theme .color-theme-toggle {
  color: #deddd9;
  border-color: #62656a;
}

html.dark-theme .color-theme-toggle:hover,
html.dark-theme .color-theme-toggle:focus,
html.dark-theme .color-theme-toggle:focus-visible {
  border-color: #69afe0;
  outline-color: #69afe0;
}

html.dark-theme .sidebar-toggle {
  color: #deddd9;
  background-color: #191a1b;
}

html.dark-theme .sidebar-toggle::before {
  background-image: linear-gradient(to bottom, #deddd9, #deddd9 20%, #191a1b 20%, #191a1b 40%, #deddd9 40%, #deddd9 60%, #191a1b 60%, #191a1b 80%, #deddd9 80%, #deddd9 100%);
}

html.dark-theme .sidebar-overlay #sidebar-checkbox:checked ~ .sidebar-toggle {
  box-shadow: 0 0 0 .25rem #191a1b;
}

html.dark-theme hr,
html.dark-theme .related-posts,
html.dark-theme .pagination-item,
html.dark-theme td,
html.dark-theme th {
  border-color: #3b3d40;
}

html.dark-theme code,
html.dark-theme pre,
html.dark-theme .message,
html.dark-theme tbody tr:nth-child(odd) td,
html.dark-theme tbody tr:nth-child(odd) th {
  color: #deddd9;
  background-color: #242629;
}

html.dark-theme blockquote,
html.dark-theme .message,
html.dark-theme .sidenote {
  color: #b9b8b4;
}

html.dark-theme blockquote,
html.dark-theme .sidenote {
  border-left-color: #45484c;
}

html.dark-theme a[href^="#fn:"]::after,
html.dark-theme .sidenote::before {
  color: #e56aa8;
}

html.dark-theme .highlight .c,
html.dark-theme .highlight .cm,
html.dark-theme .highlight .c1,
html.dark-theme .highlight .cs,
html.dark-theme .highlight .go,
html.dark-theme .highlight .w {
  color: #aaa9a5;
}

html.dark-theme .highlight .k,
html.dark-theme .highlight .kc,
html.dark-theme .highlight .kd,
html.dark-theme .highlight .kn,
html.dark-theme .highlight .kp,
html.dark-theme .highlight .kr,
html.dark-theme .highlight .kt,
html.dark-theme .highlight .nt {
  color: #78b7df;
}

html.dark-theme .highlight .m,
html.dark-theme .highlight .mf,
html.dark-theme .highlight .mh,
html.dark-theme .highlight .mi,
html.dark-theme .highlight .mo,
html.dark-theme .highlight .s,
html.dark-theme .highlight .s1,
html.dark-theme .highlight .s2,
html.dark-theme .highlight .sb,
html.dark-theme .highlight .sc,
html.dark-theme .highlight .sd,
html.dark-theme .highlight .se,
html.dark-theme .highlight .sh,
html.dark-theme .highlight .si,
html.dark-theme .highlight .sx {
  color: #e49a77;
}

html:not(.dark-theme) .comments-section,
html:not(.dark-theme) .comment-container,
html:not(.dark-theme) .child-comments {
  border-color: #eee;
}

html.dark-theme .comments-section,
html.dark-theme .comment-container,
html.dark-theme .child-comments {
  border-color: #45484c;
}

html.dark-theme .comment-handle,
html.dark-theme .comment-timestamp {
  color: #aaa9a5;
}
