body {
  margin: 0;
  font: 16px/1.6 system-ui, sans-serif;
}

a {
  color: #000;
  text-decoration: underline;
}

a:visited {
  color: #444;
}

a:hover {
    color: #222
  text-decoration: underline;
}

.site-header {
  padding: 1.5rem 1rem 0;
}

.site-header-inner {
  max-width: 72rem;
  margin: 0 auto;
}

.site-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}

.site-nav-avatar-link {
  display: inline-flex;
  align-items: center;
}

.site-nav-avatar {
  display: block;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  object-fit: cover;
}

main {
  max-width: 72rem;
  margin: 3rem auto;
  padding: 0 1rem;
}

.home {
  max-width: 42rem;
  margin: 0 auto;
  text-align: center;
}

.home-avatar {
  display: block;
  width: 260px;
  height: 300px;
  margin: 0 auto 1.5rem;
  border-radius: 16px;
  object-fit: cover;
}

.home-description {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #000;
}

.home-posts h2 {
  margin-bottom: 0.75rem;
}

.home-posts ul,
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.home-posts .post-list-item h2 {
  text-align: left;
}

.home-posts li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16rem;
  gap: 2rem;
  align-items: start;
}

.post-main {
  min-width: 0;
}

.post-main > header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #000;
}

.post-toc {
  min-width: 0;
  align-self: start;
}

.post-toc-inner {
  box-sizing: border-box;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 1.25rem;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.post-toc-inner h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  overflow-wrap: break-word;
}

.post-toc-inner nav,
.post-toc-inner ul,
.post-toc-inner ol,
.post-toc-inner li {
  min-width: 0;
}

.post-toc-inner a {
  overflow-wrap: break-word;
  word-break: break-word;
}

.post-toc-mobile {
  display: none;
}

.post-toc-desktop {
  display: block;
}

.meta,
.post-date {
  margin: 0;
  opacity: 0.7;
}

.post-date {
  white-space: nowrap;
}

.post-tags {
  margin: 0;
  text-align: right;
  font-size: 0.85rem;
  line-height: 1.3;
}

.post-tag {
  margin-left: 0.4rem;
  text-decoration: none;
}

.post-tag:first-child {
  margin-left: 0;
}

.post-list li {
  padding: 1rem 0;
}

.post-list-item h2 {
  margin: 0 0 0.35rem;
}

.post-list-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.post-summary {
  margin-top: 0.75rem;
}

.post-summary > :first-child {
  margin-top: 0;
}

.post-summary > :last-child {
  margin-bottom: 0;
}

.blog-image {
  margin: 2rem 0;
  text-align: center;
}

.blog-image a {
  display: inline-block;
}

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

.blog-image figcaption {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  opacity: 0.8;
}

.post-content pre {
  box-sizing: border-box;
  overflow-x: auto;
  max-width: 100%;
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.post-content pre code {
  white-space: pre;
}

.post-content code {
  word-break: normal;
}

@media (min-width: 901px) {
  .post-toc {
    position: sticky;
    top: 1.5rem;
  }
}

@media (max-width: 900px) {
  .post-layout {
    grid-template-columns: 1fr;
  }

  .post-toc {
    position: static;
    top: auto;
    margin-top: 1.5rem;
  }

  .post-toc-inner {
    position: static;
    max-height: none;
    overflow-y: visible;
  }

  .post-toc-mobile {
    display: block;
  }

  .post-toc-desktop {
    display: none;
  }
}

@media (max-width: 600px) {
  .site-nav {
    flex-wrap: wrap;
  }

  .home-posts li {
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
  }

  .post-date {
    white-space: normal;
  }

  .post-list-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .post-tags {
    text-align: left;
  }

  .post-tag {
    margin-left: 0;
    margin-right: 0.4rem;
  }
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  max-width: 72rem;
  width: 100%;
  margin: 3rem auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

.site-footer {
  margin: 4rem 0 2rem;
  padding: 1rem;
}

.site-footer-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
}

.social-link svg {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
}
