.post-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.toc-container {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  width: 250px;
  flex-shrink: 0;
  padding: 1rem;
  border-left: 3px solid #eee;
  font-size: 0.9em;
  background: #fafafa;
}

.toc-container ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-container li {
  margin-bottom: 0.5rem;
}

.toc-container a {
  text-decoration: none;
  color: #555;
  transition: color 0.2s;
}

.toc-container a.active {
  font-weight: bold;
  color: #000;
}

.layout-wrapper {
  display: flex;
  gap: 2rem;
  padding: 2rem;
  align-items: flex-start;
}

/* Sticky Sidebar ToC */
.toc-container {
  position: sticky;
  top: 100px;
  width: 250px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  background: #f9f9f9;
  padding: 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.95rem;
  flex-shrink: 0;
}

#toc ul {
  list-style: none;
  padding-left: 0;
}

#toc li {
  margin-bottom: 0.5rem;
}

#toc a {
  color: #555;
  text-decoration: none;
}

#toc a.active {
  font-weight: bold;
  color: #000;
  position: relative;
}

#toc a.active::before {
  content: "▶";
  position: absolute;
  left: -1rem;
  color: #333;
}

.layout-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  gap: 2rem;
}

#main {
  flex: 1;
  max-width: 800px;
}

.content-wrapper {
  display: flex;
  align-items: flex-start;
  justify-content: left;
  gap: 4rem; /* spacing between ToC and content */
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.toc-container {
  flex: 0 0 250px;
  position: sticky;
  top: 100px;
  background-color: #f9f9f9;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.4;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.toc-container h3 {
  text-transform: uppercase;
  font-weight: bold;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

#toc ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

#toc li {
  margin-bottom: 0.5rem;
}

#toc a {
  text-decoration: none;
  color: #333;
  transition: color 0.2s ease;
}

#toc a:hover {
  color: #007bff;
}

#main {
  flex: 1;
  max-width: 800px;
}

#main .inner {
  padding: 0;
}

/* Wrapper layout */
.content-layout {
  display: flex;
  align-items: flex-start;
  max-width: 100%;
  padding: 3rem 2rem;
  gap: 3rem;
}

/* TOC aligned with logo edge */
.toc-container {
  position: sticky;
  top: 6rem;
  min-width: 250px;
  max-width: 280px;
  background: #f9f9f9;
  border-radius: 6px;
  padding: 1.5rem;
  font-size: 0.9rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* TOC internals */
.toc-container h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1em;
}

.toc-container ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-container li {
  padding-left: 1em;
  margin: 0.4em 0;
  position: relative;
  line-height: 1.5;
}

.toc-container li::before {
  content: "▶";
  position: absolute;
  left: 0;
  top: 0.1em;
  font-size: 0.6em;
  color: #888;
}

.toc-container a {
  text-decoration: none;
  color: #444;
}

.toc-container a:hover {
  color: #007acc;
}

.toc-container .active > a {
  font-weight: bold;
  color: #007acc;
}

/* Main blog content */
.post-main {
  flex: 1;
  max-width: 900px;
}

@media (max-width: 1030px) {
  .toc-container {
    display: none;
  }
}