/* Wider content area */
.post {
  max-width: 1000px;
}

/* Override Prism.js ugly shadows and styling */
pre[class*="language-"],
code[class*="language-"] {
  text-shadow: none !important;
  box-shadow: none !important;
  font-size: 0.85rem !important;
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
}

pre[class*="language-"] {
  border: none !important;
  border-radius: 8px !important;
  padding: 1rem !important;
  margin: 1.5rem 0 !important;
}

/* Light theme code blocks */
[data-theme=light] pre[class*="language-"],
[data-theme=light] code[class*="language-"] {
  background: #f5f5f5 !important;
  color: #333 !important;
  text-shadow: none !important;
}

[data-theme=light] .token.comment,
[data-theme=light] .token.prolog,
[data-theme=light] .token.doctype,
[data-theme=light] .token.cdata {
  color: #6a737d !important;
}

[data-theme=light] .token.punctuation {
  color: #333 !important;
  opacity: 1 !important;
}

[data-theme=light] .token.property,
[data-theme=light] .token.tag,
[data-theme=light] .token.boolean,
[data-theme=light] .token.number,
[data-theme=light] .token.constant,
[data-theme=light] .token.symbol,
[data-theme=light] .token.deleted {
  color: #d73a49 !important;
}

[data-theme=light] .token.selector,
[data-theme=light] .token.attr-name,
[data-theme=light] .token.string,
[data-theme=light] .token.char,
[data-theme=light] .token.builtin,
[data-theme=light] .token.inserted {
  color: #22863a !important;
}

[data-theme=light] .token.operator,
[data-theme=light] .token.entity,
[data-theme=light] .token.url,
[data-theme=light] .language-css .token.string,
[data-theme=light] .style .token.string {
  color: #333 !important;
}

[data-theme=light] .token.atrule,
[data-theme=light] .token.attr-value,
[data-theme=light] .token.keyword {
  color: #d73a49 !important;
}

[data-theme=light] .token.function,
[data-theme=light] .token.class-name {
  color: #6f42c1 !important;
}

[data-theme=light] .token.regex,
[data-theme=light] .token.important,
[data-theme=light] .token.variable {
  color: #e36209 !important;
}

/* Dark theme code blocks - cleaner look */
[data-theme=dark] pre[class*="language-"],
[data-theme=dark] code[class*="language-"] {
  background: #2d2d2d !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

/* Dark theme ONLY - better paragraph text readability */
[data-theme=dark] .post-content,
[data-theme=dark] .post-content p,
[data-theme=dark] .post-content li,
[data-theme=dark] .post-content td,
[data-theme=dark] .post-content th {
  color: #e0e0e0 !important;
}

[data-theme=dark] .post-content h1,
[data-theme=dark] .post-content h2,
[data-theme=dark] .post-content h3,
[data-theme=dark] .post-content h4,
[data-theme=dark] .post-content h5,
[data-theme=dark] .post-content h6 {
  color: #fff !important;
}

/* Light theme ONLY - ensure proper dark text */
[data-theme=light] .post-content,
[data-theme=light] .post-content p,
[data-theme=light] .post-content li,
[data-theme=light] .post-content td,
[data-theme=light] .post-content th {
  color: #222 !important;
}

[data-theme=light] .post-content h1,
[data-theme=light] .post-content h2,
[data-theme=light] .post-content h3,
[data-theme=light] .post-content h4,
[data-theme=light] .post-content h5,
[data-theme=light] .post-content h6 {
  color: #000 !important;
}

/* Table of contents - Light theme */
[data-theme=light] #toc {
  background: #f5f5f5 !important;
  color: #333 !important;
}

[data-theme=light] #toc a {
  color: #333 !important;
}

[data-theme=light] #toc a:hover {
  color: #0066cc !important;
}

/* Table of contents - Dark theme */
[data-theme=dark] #toc {
  background: #3b3d42 !important;
  color: #e0e0e0 !important;
}

[data-theme=dark] #toc a {
  color: #e0e0e0 !important;
}

/* General ToC styling */
#toc {
  padding: 1.5rem;
  border-radius: 8px;
  margin: 1.5rem 0;
}

#toc .toc-title {
  font-weight: bold;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

#toc nav ul {
  margin: 0;
  padding-left: 1.5rem;
}

#toc nav ul li {
  margin: 0.5rem 0;
}

#toc nav ul li a {
  text-decoration: none;
}

#toc nav ul li a:hover {
  text-decoration: underline;
}

/* Better image display */
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
}

/* Better table styling */
.post-content table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
}

.post-content table th,
.post-content table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #dcdcdc;
}

[data-theme=dark] .post-content table th,
[data-theme=dark] .post-content table td {
  border-bottom-color: #4e4e57;
}
