.post-shell {
  width: 100%;
}

.post-main {
  width: min(100%, 48rem);
  margin: 0 auto;
  min-width: 0;
}

.post-toc-shell {
  margin: 0 auto 1.5rem;
  width: min(100%, 48rem);
  padding: 1rem 1rem 1.125rem;
  border: 1px solid rgba(16, 17, 18, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 38px rgba(16, 17, 18, 0.05);
  backdrop-filter: blur(10px);
}

.post-toc-shell[hidden] {
  display: none !important;
}

.post-toc-title {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  margin: 0 0 0.75rem;
  font-family: var(--app-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(16, 17, 18, 0.58);
}

.post-toc-title[aria-expanded="false"] {
  margin-bottom: 0;
}

.post-toc-title::after {
  content: "−";
  float: right;
}

.post-toc-title[aria-expanded="false"]::after {
  content: "+";
}

.post-toc-nav[hidden] {
  display: none;
}

.post-toc-nav,
.post-toc-shell #markdown-toc,
.post-toc-shell .post-toc-list {
  margin: 0;
  padding: 0;
}

.post-toc-shell #markdown-toc,
.post-toc-shell .post-toc-list,
.post-toc-shell ul {
  list-style: none;
}

.post-toc-shell li + li {
  margin-top: 0.4rem;
}

.post-toc-shell ul ul {
  margin-top: 0.25rem;
  margin-left: 0.45rem;
  padding-left: 0.65rem;
  border-left: 2px solid rgba(148, 91, 33, 0.14);
}

.post-toc-shell ul ul li + li {
  margin-top: 0.1rem;
}

.post-toc-shell a {
  display: block;
  padding: 0.35rem 0.55rem;
  border-radius: 12px;
  color: rgba(16, 17, 18, 0.72);
  text-decoration: none;
  line-height: 1.35;
  transition:
    background 160ms var(--app-ease),
    color 160ms var(--app-ease),
    transform 160ms var(--app-ease);
}

.post-toc-shell > .post-toc-nav > ul > li > a {
  color: rgba(16, 17, 18, 0.86);
  font-weight: 600;
}

.post-toc-shell ul ul a {
  color: rgba(16, 17, 18, 0.68);
  font-size: 0.85em;
  font-weight: 400;
}

.post-toc-shell ul ul ul {
  border-left-color: rgba(16, 17, 18, 0.09);
}

.post-toc-shell ul ul ul a {
  color: rgba(16, 17, 18, 0.58);
  font-size: 0.94em;
}

.post-toc-shell a:hover,
.post-toc-shell a:focus-visible {
  background: rgba(16, 17, 18, 0.05);
  color: var(--app-ink);
  outline: none;
}

.post-toc-shell a.is-active {
  background: rgba(148, 91, 33, 0.12);
  color: var(--app-ink);
  font-weight: 600;
}

.blog-post :is(h2, h3, h4).is-toc-target-pulsing {
  animation: post-toc-target-pulse 1.1s var(--app-ease);
}

@keyframes post-toc-target-pulse {
  0%,
  100% {
    background-color: transparent;
  }

  18% {
    background-color: rgba(148, 91, 33, 0.16);
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-post :is(h2, h3, h4).is-toc-target-pulsing {
    animation: none;
  }
}

@media (min-width: 1200px) {
  .post-shell--has-toc {
    display: grid;
    grid-template-columns: minmax(14rem, 17rem) minmax(0, 1fr);
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: start;
  }

  .post-shell--has-toc .post-toc-shell {
    position: sticky;
    top: 5.5rem;
    width: 100%;
    margin: 0;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
  }

  .post-shell--has-toc .post-main {
    width: 100%;
    margin: 0;
  }
}

@media (max-width: 767.98px) {
  .post-toc-shell {
    padding: 0.9rem 0.85rem 1rem;
    border-radius: 16px;
  }

  .post-toc-shell a {
    padding-inline: 0.45rem;
  }
}

.articleHeaderToc .post-toc-shell {
  margin: 20px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.articleHeaderToc .post-toc-title {
  font-family: var(--app-sans);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}

.articleHeaderToc .post-toc-title::after {
  float: none;
  margin-left: 10px;
}
