/* table of content when active  */
.toc a.active,
#TableOfContents a.active {
  color: var(--TheamColor);
  text-decoration: underline;
}

.content {
  max-width: 900px;
  margin: 2em auto;
  padding: 0 1em;
}



/* card styling */
/* .card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 3em;
  justify-content: space-between;
} */

.blog-card {
  display: grid;
  border-bottom: 2px solid var(--BorderColor);
  overflow: hidden;
  min-width: 200px;
  margin-bottom: 3em;
  background-color: var(--2ndBackgroundColor);
  border-radius: var(--BrRadius);
  padding: 12px;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.blog-card h2 {
  margin: 0;
}

.blog-card h2 a {
  display: block;
}

.post-meta {
  filter: contrast(0.2);
  font-size: 0.8em;
  margin-bottom: 0.5em;
  display: inline-flex;
  gap: 20px;
}

.post-container {
  display: flex;
  gap: 2em;
}

.post-content {
  flex: 1;
  min-width: 300px;
}



/* tags  */
.tags {
  margin: 0;
  cursor: default;
}

.tags a {
  color: var(--TheamColor);
  padding: 0.3em 0.6em 0.3em 0;
  border-radius: var(--BrRadius);
  font-size: 0.8em;
}

.tags a:hover {
  text-decoration: underline;
  color: var(--FontColor);
}

/* Layout with sticky TOC */
.toc {
  flex: 2;
  position: sticky;
  top: 1em;
  align-self: flex-start;
  max-height: 95vh;
  min-width: 150px;
  max-width: 256px;
  overflow-y: auto;
  font-size: 0.9em;
  background: none;
}

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

/* TOC hierarchical numbering */
.toc h3 {
  padding: 4px 8px;
  margin: 0;
}

#TableOfContents {
  padding: 10px;
}

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

#TableOfContents li {
  counter-increment: toc-level1;
  position: relative;
}

#TableOfContents li::before {
  content: counters(toc-level1, ".") ". ";
  font-weight: 600;
}

#TableOfContents li ul {
  counter-reset: toc-level1;
  margin-left: 1.2em;
}


/* copy button for code block  */
.code-block-wrapper {
  position: relative;
  overflow: hidden;
  margin: 1.5em 0;
  border-radius: var(--BrRadius);
}

.code-block-wrapper pre {
  margin: 0;
  padding: 1em;
  overflow-x: auto;
  color: var(--FontColor);
}

.copy-btn {
  position: absolute;
  top: 0.4em;
  right: 0.4em;
  padding: 0.3em 0.6em;
  border: none;
  cursor: pointer;
  color: var(--AtagColor);
  background: var(--BackgroundColor);
  border-radius: var(--BrRadius);
}

/* pagination style  */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6em;
  margin-top: 2em;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  padding: 0.2em 0.8em;
}

.pagination a:hover,
.pagination .active {
  background: var(--HoverOrangeColor);
  text-decoration: underline;
  opacity: 0.5;
}

.pagination .disabled {
  opacity: 0.5;
  cursor: default;
}

.page-info {
  text-align: center;
  margin: 1em 0;
  opacity: 0.8;
  font-size: 0.9em;
}



/* CSS rules for screens smaller than 768px */
@media (max-width: 768px) {
  .post-container {
    flex-direction: column-reverse;
  }

  .toc {
    position: inherit;
    max-width: fit-content;
  }
}