body {
  background-color: var(--bg-color);
}

strong {
  color: var(--strong-color);
}

blockquote {
  font-style: italic;
}

/* Banner */

.banner {
  margin-top: 2.5em;
  text-align: center;
}

.banner a {
  color: var(--text-color);
  text-decoration: none;
}
.banner a:hover,
.banner a:focus,
.banner a:active {
  text-decoration: none;
  color: var(--primary-color);
}

.banner p {
  letter-spacing: 4px;
  color: var(--text-secondary-color);
  font-size: 90%;
}

/* Sticky Navbar */

.navbar {
  display: block;
  width: 100%;
  background-color: var(--bg-navbar-color);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  z-index: 99;
}
.navbar-list {
  padding-top: 1rem;
  list-style: none;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
}
.navbar-item {
  position: relative;
  float: left;
}
.navbar-item > button {
  margin-bottom: 0;
}
.navbar-link {
  text-transform: uppercase;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.2rem;
  margin-right: 4em;
  text-decoration: none;
  color: var(--text-color);
}

.expander {
  flex-grow: 1;
}

.navbar-link.active {
  color: var(--primary-button);
}
.has-docked-nav .navbar {
  position: fixed;
  top: 0;
  left: 0;
}
.has-docked-nav {
  display: block;
}

.icon-button {
  color: black;
  transition: color 0.2s ease;
}

.icon-button:hover {
  color: var(--primary-color);
}

.footnotes {
  margin-top: 1em;
}

#sandwich-button {
  padding: 1px 6px !important;
}

#sandwich-button > svg {
  margin-top: 1px;
}

#sandwich-li {
  display: none;
}

#theme-li {
  display: flex;
}

/*  Narrow / Mobile Styles
    assuming 7 navbar items + 1 .expander
    each about 7.5em wide.
    each row of the navbar is about 6em high
*/

@media (max-width: 75em) {
  .expander {
    flex-grow: 0;
  }
  .navbar-list {
    justify-content: space-between;
  }

  .navbar-item {
    flex-basis: 25%;
  }

  .content {
    margin-top: 6.5em;
  }

  figure {
    margin-left: 0;
    margin-right: 0;
  }

  figure {
    width: 90% !important;
  }
}

@media (max-width: 50em), (pointer: none), (pointer: coarse) {
  .navbar-item {
    flex-basis: 100%;
  }

  .content {
    margin-top: 0;
  }

  .nav-toggle,
  #theme-li {
    display: none;
  }

  .nav-toggle.show {
    display: list-item;
  }

  #sandwich-li,
  #theme-li.show {
    display: flex;
  }

  figure {
    width: 95% !important;
  }
}

/* When autogenerated .md headers (h3) or footnote blocks (sup) are linked to by an <a> tag, once it's clicked,
    scroll 80x so it isn't covered by the navbar*/
.footnote-definition,
h3 {
  scroll-margin-top: 80px;
}

/* Theme Switching */

#button-toggle-dark-mode {
  padding: 0 0.5rem;
  display: flex;
  align-items: center;
}

html.dark #moon-icon {
  display: none;
}
html:not(.dark) #sun-icon {
  display: none;
}

html:not(.user-theme-preference) #button-revert-to-os-theme-preference {
  display: none;
}

#button-revert-to-os-theme-preference {
  margin-left: 1em;
}

/* Titles */

.tagline {
  font-weight: normal;
  color: var(--text-secondary-color);
  font-style: italic;
}

/* Tags */

span.tags {
  width: 100%;
  text-align: left;
}

.tags a {
  margin-right: 0.5em;
}

ul.all-tags {
  display: flex;
  list-style: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

li.all-tags {
  flex-shrink: 0;
  width: 30%;
  text-align: center;
}

/* Post Body */

#post-date {
  margin-bottom: 1rem;
}

.content {
  padding-top: 5rem;
}

.content p,
.content pre,
.content iframe {
  margin-bottom: 1em;
}

.content p {
  width: 100%;
}

.content blockquote,
.content ul {
  margin-top: 0em;
  margin-bottom: 0em;
}

div:has(+ blockquote) {
  margin-bottom: 0.5em !important;
}

.centered {
  display: flex;
  align-items: center;
  flex-direction: column;
}

.content li {
  margin-left: 2rem;
}

code {
  max-height: 70vh;
  background-color: var(--bg-secondary-color) !important;
}

figure {
  display: flex;
  flex-direction: column;
  align-content: center;
  justify-content: center;
  align-items: center;

  border-width: 1px;
  border-color: var(--text-secondary-color);
  border-style: solid;
  border-radius: 1rem;
  padding: 1rem;
}

figure,
figure img,
figure svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

figcaption {
  text-align: center;
  font-style: italic;
  margin-top: 1rem;
}

figure iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
}

ol,
ul {
  margin-bottom: 0.5em !important;
  width: 100%;
}

/* Code Blocks and Footnotes*/

.html-preview {
  padding-left: 20px;
  zoom: 0.75;
  border-style: solid;
  border-color: var(--primary-color);
  padding: 20px 30px;
  margin-bottom: 20px;
  margin-top: 10px;
  max-width: 100%;
}

p code {
  text-wrap: auto;
}

div.sourceCode,
pre,
.footnotes,
.comments {
  width: 100%;
}

/* Footnotes */

.footnote-definition sup {
  margin-top: 1em;
  margin-left: -1.5em;
  float: left;
}

.footnote-body {
  margin: 1em 0;
  padding: 0.5em 1em;
  background-color: var(--bg-secondary-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
}
.footnote-definition .footnote-body p:only-child {
  margin: 0.2em 0;
}

.dummy-a {
  color: var(--primary-color);
}

/* Comments */

.comment {
  margin: 1em 0;
  padding: 0.5em 1em;
  background-color: var(--bg-secondary-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.comment-info {
  margin-top: 1.5rem;
}

.comment-divider {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.comment figure {
  width: auto;
}

.comments > form {
  display: flex;
  justify-content: center;
}

/* Post List */

.posts {
  list-style: none;
}

.post {
  /*top right bottom left*/
  margin: 0em 0em 2em 0em;
}

.posts .post a {
  display: flex;
  padding: 0.5em 0;
  color: var(--text-color);
  text-decoration: none;
  font-size: 1.75rem;
}
.posts .post a:hover,
.posts .post a:focus,
.posts .post a:active {
  text-decoration: none;
  color: var(--primary-color);
}
.post-time {
  font-family: monospace, monospace;
  font-size: 1.25rem;
  vertical-align: middle;
  padding-right: 2rem;
  color: var(--text-secondary-color);
}
