button,
a[class*="hover:bg-black"] {
  transition: none;
}

button:hover,
a[class*="hover:bg-black"]:hover {
  transition: background-color 0.3s ease-in, color 0.3s ease-in, border-color 0.3s ease-in;
}

/* Post Content — Markdown rendered HTML */
.post-content {
  line-height: 1.75;
  color: #000;
}

.post-content > *:first-child {
  margin-top: 0;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  line-height: 1.3;
  margin-bottom: 0.5em;
  color: #000;
}

.post-content h1 { font-size: 1.875rem; margin-top: 2rem; }
.post-content h2 { font-size: 1.5rem; margin-top: 1.75rem; }
.post-content h3 { font-size: 1.25rem; margin-top: 1.5rem; }
.post-content h4 { font-size: 1.1rem; margin-top: 1.25rem; }
.post-content h5 { font-size: 1rem; margin-top: 1.25rem; }
.post-content h6 { font-size: 0.875rem; margin-top: 1.25rem; }

.post-content p {
  margin-bottom: 1rem;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.post-content li {
  margin-bottom: 0.25rem;
}

.post-content blockquote {
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  border-left: 3px solid #000;
  background-color: transparent;
  color: rgba(0, 0, 0, 0.7);
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

.post-content code {
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.875em;
  padding: 0.15em 0.35em;
  background-color: #f5f5f5;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0;
}

.post-content pre {
  margin: 1rem 0;
  padding: 2.1rem 1rem 1rem;
  overflow-x: auto;
  background-color: #fafafa;
  border-radius: 0;
  border: 1px solid #000;
  position: relative;
}

.post-content pre code {
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  font-size: 0.98rem;
  line-height: 1.68;
}

/* Code block — language label */
.post-content pre[data-language]::before,
.post-content pre .language-label {
  content: attr(data-language);
  position: absolute;
  top: 0.45rem;
  left: 0.65rem;
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  color: rgba(86, 88, 105, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

/* Snazzy Light — Syntax highlighting tokens */
.post-content pre .hljs-comment,
.post-content pre .hljs-quote {
  color: #ADB1C2;
  font-style: italic;
}

.post-content pre .hljs-keyword,
.post-content pre .hljs-selector-tag {
  color: #F767BB;
}

.post-content pre .hljs-type,
.post-content pre .hljs-literal,
.post-content pre .hljs-constant {
  color: #2DAE58;
}

.post-content pre .hljs-title,
.post-content pre .hljs-title.function_ {
  color: #09A1ED;
}

.post-content pre .hljs-string,
.post-content pre .hljs-symbol,
.post-content pre .hljs-bullet {
  color: #CF9C00;
}

.post-content pre .hljs-number {
  color: #FF5C57;
}

.post-content pre .hljs-variable,
.post-content pre .hljs-template-variable,
.post-content pre .hljs-params {
  color: #565869;
}

.post-content pre .hljs-built_in {
  color: #11658F;
}

.post-content pre .hljs-attr,
.post-content pre .hljs-attribute {
  color: #FF8380;
}

.post-content pre .hljs-tag {
  color: #13BBB7;
}

.post-content pre .hljs-name {
  color: #13BBB7;
}

.post-content pre .hljs-selector-class {
  color: #F767BB;
}

.post-content pre .hljs-selector-id {
  color: #F767BB;
}

.post-content pre .hljs-regexp {
  color: #13BBB7;
}

.post-content pre .hljs-meta {
  color: #ADB1C2;
}

.post-content pre .hljs-deletion {
  color: #FF5C56;
}

.post-content pre .hljs-addition {
  color: #2DAE58;
}

.post-content pre .hljs-emphasis {
  font-style: italic;
}

.post-content pre .hljs-strong {
  font-weight: bold;
}

.post-content pre .code-copy-btn {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.34rem 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.post-content pre .code-copy-btn:hover {
  background: #000;
  color: #fff;
}

.post-content pre .code-copy-btn.is-copied {
  background: #2DAE58;
  color: #fff;
  border-color: #2DAE58;
}

.post-content pre .code-copy-btn.is-failed {
  background: #FF5C56;
  color: #fff;
  border-color: #FF5C56;
}

.post-content hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.2);
  margin: 2rem 0;
}

.post-content table {
  width: 100%;
  margin-bottom: 1rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(0, 0, 0, 0.2);
}

.post-content th,
.post-content td {
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.2);
  text-align: left;
}

.post-content th {
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  font-weight: 600;
  background: #f6f7f9;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.post-content figure {
  margin: 1.5rem 0;
}

.post-content figcaption {
  font-size: 0.875rem;
  color: rgba(0, 0, 0, 0.5);
  text-align: center;
  margin-top: 0.5rem;
}

.post-content a {
  color: #000;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
}

.post-content a:hover,
.post-content a:focus {
  border-bottom: 1px solid #000;
}

/* KaTeX overrides */
.katex-display {
  margin: 1rem 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.latex-error {
  color: #c00;
  background: #fef2f2;
  padding: 0.2em 0.4em;
  font-size: 0.875em;
}

/* Mermaid diagram containers */
.post-content .mermaid-pre-rendered,
.post-content .mermaid-source {
  margin: 1rem 0;
  position: relative;
  border: 1.5px dashed #94a3b8;
  border-radius: 12px;
  background: #fafafa;
  padding: 2.1rem 1rem 1rem;
}

.post-content .mermaid-pre-rendered::before {
  content: "Mermaid";
  position: absolute;
  top: 0.45rem;
  left: 0.65rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(0, 0, 0, 0.35);
}

.post-content .mermaid-source pre {
  margin: 0;
  border: none;
  background: transparent;
}

.post-content .mermaid-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 2.5rem 1rem;
}

.post-content .mermaid-loading-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  animation: mermaid-bounce 1.2s ease-in-out infinite;
}

.post-content .mermaid-loading-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.post-content .mermaid-loading-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes mermaid-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

.post-content .mermaid-diagram {
  padding: 1rem;
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

.post-content .mermaid-diagram svg {
  max-width: 100%;
}

.post-content .mermaid-diagram svg .label {
  font-family: "Nunito", sans-serif !important;
}

.post-content .mermaid-diagram svg .edgeLabel {
  font-size: 0.82rem;
}

.post-content .mermaid-diagram svg .cluster-label {
  font-weight: 700;
}

.post-content .mermaid-source[data-language]::before,
.post-content .mermaid-source .language-label {
  content: attr(data-language);
  position: absolute;
  top: 0.45rem;
  left: 0.65rem;
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  color: rgba(86, 88, 105, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

/* Responsive adjustments for post content */
@media (max-width: 768px) {
  .post-content h1 { font-size: 1.625rem; }
  .post-content h2 { font-size: 1.375rem; }
  .post-content h3 { font-size: 1.125rem; }
  .post-content h4 { font-size: 1rem; }
  .post-content h5 { font-size: 0.9375rem; }
  .post-content h6 { font-size: 0.875rem; }

  .post-content pre {
    padding: 2rem 0.75rem 0.75rem;
    font-size: 0.92rem;
  }
}

@media (max-width: 480px) {
  .post-content table {
    font-size: 0.875rem;
  }

  .post-content th,
  .post-content td {
    padding: 0.375rem 0.5rem;
  }
}

/* Mobile navigation */
.mobile-menu-btn {
  background: none;
  border: 1.5px solid #000;
  width: 36px;
  height: 36px;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  line-height: 0;
  flex: none;
}

.mobile-menu-btn:hover,
.mobile-menu-btn-active {
  background: #000;
  color: #fff;
}

.mobile-menu-btn svg {
  display: block;
}

.mobile-menu-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.5rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mobile-menu-link {
  display: block;
  padding: 0.75rem 0.5rem;
  font-size: 0.9375rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-decoration: none;
  color: #000;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mobile-menu-link:hover {
  background: rgba(0, 0, 0, 0.03);
}

.mobile-menu-link:last-child {
  border-bottom: none;
}

/* Post content table overflow on mobile */
@media (max-width: 640px) {
  .post-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Mobile responsive tweaks */
@media (max-width: 640px) {
  .post-content ul,
  .post-content ol {
    padding-left: 1.25rem;
  }

  .post-content blockquote {
    padding: 0.5rem 0.75rem;
  }
}

/* Coffee theme — mobile nav */
[data-theme="coffee"] .mobile-menu-btn {
  border-color: #795548;
  color: #3e2723;
  background: #fffdfb;
}

[data-theme="coffee"] .mobile-menu-btn:hover,
[data-theme="coffee"] .mobile-menu-btn-active {
  background: #4e342e;
  color: #fff;
  border-color: #4e342e;
}

[data-theme="coffee"] .mobile-menu-link {
  color: #3e2723;
  border-bottom-color: rgba(121, 85, 72, 0.15);
}

[data-theme="coffee"] .mobile-menu-controls {
  border-bottom-color: rgba(121, 85, 72, 0.15);
}

[data-theme="coffee"] .mobile-menu-link:hover {
  background: rgba(121, 85, 72, 0.06);
}

.lang-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: none;
  border-radius: 9999px;
  background: #fff;
  border: 1.5px solid #000;
  cursor: pointer;
  padding: 4px;
  text-decoration: none;
  width: 88px;
  box-sizing: border-box;
}

.theme-select {
  flex: none;
  border: 1.5px solid #000;
  background: #fff;
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  height: 32px;
  padding: 0 0.75rem;
  cursor: pointer;
}

.lang-toggle-option {
  position: relative;
  z-index: 1;
  width: 38px;
  padding: 3px 0;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.25);
  user-select: none;
  white-space: nowrap;
}

.lang-toggle-option-active {
  color: transparent !important;
}

.lang-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 2;
  width: 38px;
  height: calc(100% - 6px);
  background: #000;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-toggle-thumb-end {
  transform: translateX(38px);
}

.comment-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  padding: 1.25rem 2rem;
  border: 1px solid #000;
  font-size: 0.875rem;
  font-weight: 500;
  max-width: 24rem;
  text-align: center;
  line-height: 1.5;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.comment-toast--visible {
  opacity: 1;
}

.comment-toast--success {
  background: #000;
  color: #fff;
}

.comment-toast--error {
  background: #fff;
  color: #c00;
  border-color: #c00;
}

.like-btn {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.like-btn:disabled {
  cursor: wait;
}

.post-body-divider {
  border-top: 0;
}

[data-theme="coffee"] body {
  background-color: #efebe9 !important;
  color: #3e2723 !important;
}

[data-theme="coffee"] header,
[data-theme="coffee"] footer {
  background-color: #f8f5f3 !important;
  border-color: #795548 !important;
}

[data-theme="coffee"] header {
  border-bottom-width: 4px !important;
}

[data-theme="coffee"] .text-black {
  color: #3e2723 !important;
}

[data-theme="coffee"] .bg-white {
  background-color: #fffdfb !important;
}

[data-theme="coffee"] .border-black {
  border-color: #795548 !important;
}

[data-theme="coffee"] .theme-select {
  border-color: #795548;
  background: #fffdfb;
  color: #3e2723;
}

[data-theme="coffee"] .lang-toggle {
  border-color: #795548;
  background: #fffdfb;
}

[data-theme="coffee"] .lang-toggle-thumb {
  background: #4e342e;
}

[data-theme="coffee"] .lang-toggle-option {
  color: rgba(62, 39, 35, 0.45);
}

[data-theme="coffee"] .post-content {
  color: #3e2723;
}

[data-theme="coffee"] .post-content h1,
[data-theme="coffee"] .post-content h2,
[data-theme="coffee"] .post-content h3,
[data-theme="coffee"] .post-content h4,
[data-theme="coffee"] .post-content h5,
[data-theme="coffee"] .post-content h6 {
  color: #3e2723;
}

[data-theme="coffee"] .post-content blockquote {
  border-left-color: #795548;
  color: rgba(62, 39, 35, 0.78);
}

[data-theme="coffee"] .post-content code {
  background-color: #f7efea;
  border-color: rgba(121, 85, 72, 0.22);
}

[data-theme="coffee"] .post-content pre {
  background-color: #f7efea;
  border-color: #795548;
}

[data-theme="coffee"] .post-content pre[data-language]::before,
[data-theme="coffee"] .post-content pre .language-label {
  color: rgba(62, 39, 35, 0.62);
}

[data-theme="coffee"] .post-content pre .code-copy-btn {
  background: #fffdfb;
  color: #3e2723;
  border-color: #795548;
  border-width: 1.5px;
}

[data-theme="coffee"] .post-content pre .code-copy-btn:hover {
  background: #4e342e;
  color: #fff;
  border-color: #4e342e;
}

[data-theme="coffee"] .post-content pre .code-copy-btn.is-copied {
  background: #6d4c41;
  color: #fff;
  border-color: #6d4c41;
}

[data-theme="coffee"] .post-content pre .code-copy-btn.is-failed {
  background: #8d6e63;
  color: #fff;
  border-color: #8d6e63;
}

[data-theme="coffee"] .post-content pre code {
  color: #3e2723;
  border: none;
}

[data-theme="coffee"] .post-content pre .hljs-comment,
[data-theme="coffee"] .post-content pre .hljs-quote {
  color: #9e9e9e;
}

[data-theme="coffee"] .post-content pre .hljs-keyword,
[data-theme="coffee"] .post-content pre .hljs-selector-tag {
  color: #c25193;
}

[data-theme="coffee"] .post-content pre .hljs-type,
[data-theme="coffee"] .post-content pre .hljs-literal,
[data-theme="coffee"] .post-content pre .hljs-constant {
  color: #238744;
}

[data-theme="coffee"] .post-content pre .hljs-title,
[data-theme="coffee"] .post-content pre .hljs-title.function_ {
  color: #09A1ED;
}

[data-theme="coffee"] .post-content pre .hljs-string,
[data-theme="coffee"] .post-content pre .hljs-symbol,
[data-theme="coffee"] .post-content pre .hljs-bullet {
  color: #b38700;
}

[data-theme="coffee"] .post-content pre .hljs-number {
  color: #d94e4a;
}

[data-theme="coffee"] .post-content pre .hljs-variable,
[data-theme="coffee"] .post-content pre .hljs-template-variable,
[data-theme="coffee"] .post-content pre .hljs-params {
  color: #3e2723;
}

[data-theme="coffee"] .post-content pre .hljs-built_in {
  color: #11658F;
}

[data-theme="coffee"] .post-content pre .hljs-attr,
[data-theme="coffee"] .post-content pre .hljs-attribute {
  color: #e57373;
}

[data-theme="coffee"] .post-content pre .hljs-tag,
[data-theme="coffee"] .post-content pre .hljs-name {
  color: #13BBB7;
}

[data-theme="coffee"] .post-content pre .hljs-regexp {
  color: #00A39F;
}

[data-theme="coffee"] .post-content pre .hljs-meta {
  color: #9e9e9e;
}

[data-theme="coffee"] .post-content pre .hljs-deletion {
  color: #d94e4a;
}

[data-theme="coffee"] .post-content pre .hljs-addition {
  color: #238744;
}

[data-theme="coffee"] .post-content table {
  border-color: rgba(121, 85, 72, 0.35);
  border-top: 4px solid #795548;
}

[data-theme="coffee"] .post-content th,
[data-theme="coffee"] .post-content td {
  border-color: rgba(121, 85, 72, 0.35);
}

[data-theme="coffee"] .post-content th {
  border-bottom: 1px solid rgba(121, 85, 72, 0.35);
  background: #efe4dd;
}

[data-theme="coffee"] .post-content a {
  color: #4e342e;
  border-bottom-color: rgba(78, 52, 46, 0.35);
}

[data-theme="coffee"] .post-body-divider {
  border-top: 4px solid #795548;
}

[data-theme="coffee"] article.p-6.bg-white.border.border-black,
[data-theme="coffee"] nav.my-8.p-6.bg-white.border.border-black,
[data-theme="coffee"] section .p-6.bg-white.border.border-black {
  border-top-width: 4px;
  border-top-color: #795548 !important;
  border-radius: 2px;
  box-shadow: 0 4px 12px rgba(62, 39, 35, 0.12);
}

[data-theme="coffee"] .post-content .mermaid-pre-rendered,
[data-theme="coffee"] .post-content .mermaid-source,
[data-theme="coffee"] .post-content .mermaid-diagram {
  background-color: #f7efea;
  border-color: #a1887f;
  border-style: dashed;
  border-radius: 12px;
}

[data-theme="coffee"] .post-content .mermaid-pre-rendered::before,
[data-theme="coffee"] .post-content .mermaid-source[data-language]::before {
  color: rgba(62, 39, 35, 0.62);
}

[data-theme="coffee"] .post-content .mermaid-diagram svg .edgePath .path {
  stroke: #8d6e63;
}

[data-theme="coffee"] .post-content .mermaid-diagram svg .label {
  color: #3e2723;
}
