.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 {
  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-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.15rem;
}

.post-toc-shell ul ul {
  margin-top: 0.3rem;
  margin-left: 0.8rem;
  padding-left: 0.75rem;
  border-left: 1px solid rgba(16, 17, 18, 0.08);
}

.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 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;
}

@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;
  }
}
