/* Blog layout and navigation; article typography and code styling come from the theme. */
.post-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.post-header {
  margin-bottom: 2rem;
}

.post-file-details {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  border: 1px solid rgba(181, 232, 83, 0.25);
  border-radius: 4px;
  padding: 1rem;
}

.post-file-details > div {
  min-width: 0;
}

.post-file-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.post-main,
.post-toc-sidebar {
  min-width: 0;
}

.post-content {
  overflow-wrap: anywhere;
}

.post-toc {
  margin-bottom: 2rem;
  border: 1px solid rgba(181, 232, 83, 0.25);
  border-radius: 4px;
  background: #151515;
  font-size: 0.85rem;
}

.post-toc__title {
  padding: 1rem;
  color: #b5e853;
  font-weight: bold;
  cursor: pointer;
}

.post-toc__links {
  padding: 0 0.5rem 0.75rem;
}

.post-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-toc ol ol {
  margin-left: 0.75rem;
  padding-left: 0.5rem;
  border-left: 1px solid rgba(181, 232, 83, 0.2);
}

.post-toc a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-left: 2px solid transparent;
  border-radius: 2px;
  color: #bbb;
  text-decoration: none;
  text-shadow: none;
  overflow-wrap: anywhere;
}

.post-toc a:hover {
  background: rgba(181, 232, 83, 0.06);
  color: #eee;
}

.post-toc a[aria-current="location"] {
  border-left-color: #b5e853;
  background: rgba(181, 232, 83, 0.09);
  color: #b5e853;
}

.post-toc a:focus-visible,
.post-toc__title:focus-visible {
  outline: 2px solid #b5e853;
  outline-offset: -2px;
}

@media (min-width: 1100px) {
  .container:has(.blog-post--with-toc) {
    max-width: 1280px;
  }

  .blog-post--with-toc .post-breadcrumb,
  .blog-post--with-toc .post-header {
    margin-left: 17rem;
  }

  .blog-post--with-toc .post-body {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 2rem;
  }

  .post-toc {
    position: sticky;
    top: 1.5rem;
    margin-bottom: 0;
  }

  .post-toc__links {
    max-height: calc(100vh - 8rem);
    max-height: calc(100dvh - 8rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #555 #151515;
    scroll-padding-block: 0.5rem;
  }
}

.post-content h2,
.post-content h3 {
  scroll-margin-top: 1.5rem;
}

.post-content pre {
  max-width: 100%;
  box-sizing: border-box;
  overflow: auto;
}

.post-content .blog-note {
  background: rgba(181, 232, 83, 0.045);
  border: 1px solid rgba(181, 232, 83, 0.25);
  border-left: 3px solid #b5e853;
  border-radius: 0 4px 4px 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.blog-note .blog-note__title {
  color: #b5e853;
  font-weight: bold;
  margin: 0 0 0.75rem;
}

.blog-note > :last-child {
  margin-bottom: 0;
}

.post-content .image-source {
  text-align: center;
  overflow-wrap: anywhere;
  margin: -0.5rem 0 2rem;
}

.image-source > span {
  margin-right: 0.5rem;
}

.post-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.post-content th,
.post-content td {
  min-width: 7rem;
}

.post-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px dashed rgba(181, 232, 83, 0.35);
  margin-top: 2rem;
  padding-top: 1rem;
}

@media (max-width: 600px) {
  .post-content .blog-note { padding: 1rem; }
}

/* Copy button for code blocks: a small tab set into the block's top-right corner */
.post-content .code-block {
  position: relative;
}

.code-copy {
  position: absolute;
  top: var(--code-border-width, 1px);
  right: var(--code-border-width, 1px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 1.75rem;
  padding: 0;
  margin: 0;
  color: #777;
  background: var(--code-bg, #181818);
  border: 0;
  border-left: var(--code-border-width, 1px) solid var(--code-border, #393939);
  border-bottom: var(--code-border-width, 1px) solid var(--code-border, #393939);
  border-radius: 0 var(--code-radius, 0) 0 6px;
  box-shadow: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.code-copy svg {
  display: block;
}

.code-copy:hover,
.code-copy:focus-visible,
.code-copy.is-copied {
  color: #b5e853;
}

.code-copy:focus-visible {
  outline: 1px solid #b5e853;
  outline-offset: -3px;
}
