/* ── Blog Post Body Typography ── */
.post-body {
  color: #374151;
  font-size: 1.125rem;
  line-height: 1.65;
}
.dark .post-body {
  color: #d1d5db;
}

.post-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}
.dark .post-body h2 {
  color: #f9fafb;
}

.post-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1f2937;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}
.dark .post-body h3 {
  color: #e5e7eb;
}

.post-body p {
  margin-bottom: 1.15rem;
}

.post-body a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.dark .post-body a {
  color: #60a5fa;
}
.post-body a:hover {
  color: #1d4ed8;
}
.dark .post-body a:hover {
  color: #93c5fd;
}

.post-body ul,
.post-body ol {
  margin: 0 0 1.4rem 1.5rem;
}
.post-body ul { list-style-type: disc; }
.post-body ol { list-style-type: decimal; }
.post-body li { margin-bottom: 0.4rem; }

.post-body blockquote {
  border-left: 4px solid #2563eb;
  margin: 1.75rem 0;
  padding: 0.75rem 1.25rem;
  background: #eff6ff;
  border-radius: 0 8px 8px 0;
  color: #1e40af;
  font-style: italic;
}
.dark .post-body blockquote {
  background: #1e3a5f33;
  color: #93c5fd;
  border-left-color: #3b82f6;
}

.post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875em;
  background: #f3f4f6;
  color: #be185d;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}
.dark .post-body code {
  background: #1f2937;
  color: #f472b6;
}

.post-body pre {
  background: #1f2937;
  color: #e5e7eb;
  padding: 1.25rem 1.5rem;
  border-radius: 10px;
  overflow-x: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 1.75rem 0;
  font-size: 0.9rem;
  line-height: 1.65;
}
/* Real code blocks (language declared): allow horizontal scroll, no wrapping */
.post-body [class*="language-"]:not(.language-plaintext) pre {
  overflow-x: auto;
  white-space: pre;
  word-break: normal;
}
.post-body pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.post-body hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 1rem 0;
}
.dark .post-body hr {
  border-top-color: #374151;
}

.post-body strong { color: #111827; font-weight: 600; }
.dark .post-body strong { color: #f9fafb; }

/* figcaption inside post body inherits dark text */
.dark .post-body figcaption { color: #9ca3af; }

/* ── Copy button ── */
.code-wrapper {
  position: relative;
}
.copy-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: rgba(255, 255, 255, 0.07);
  color: #9ca3af;
  border-width: 1px !important;
  border-style: solid !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  border-radius: 5px;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  z-index: 10;
  line-height: 1.5;
}
.copy-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #f3f4f6;
}
.copy-btn.copied {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.35) !important;
}

/* ── Tables ── */
.post-body table {
  width: 100%;
  border-collapse: collapse !important;
  margin: 1.75rem 0;
  font-size: 0.95rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  overflow: hidden;
}
.dark .post-body table {
  border-color: #374151;
}
.post-body th {
  background-color: #f3f4f6 !important;
  color: #111827;
  font-weight: 600;
  text-align: left;
  padding: 0.65rem 1rem;
  border-bottom-width: 2px !important;
  border-bottom-style: solid !important;
  border-bottom-color: #d1d5db !important;
}
.dark .post-body th {
  background-color: #1f2937 !important;
  color: #f9fafb;
  border-bottom-color: #4b5563 !important;
}
.post-body td {
  padding: 0.6rem 1rem;
  border-bottom-width: 1px !important;
  border-bottom-style: solid !important;
  border-bottom-color: #e5e7eb !important;
  color: #374151;
  vertical-align: top;
}
.dark .post-body td {
  border-bottom-color: #374151 !important;
  color: #d1d5db;
}
.post-body tr:last-child td {
  border-bottom-width: 0 !important;
}
.post-body tbody tr:hover td {
  background-color: #f9fafb;
}
.dark .post-body tbody tr:hover td {
  background-color: #111827;
}

/* ── Like button ── */
.like-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 2px solid #e5e7eb !important;
  border-radius: 50%;
  width: 72px;
  height: 72px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  color: #9ca3af;
  padding: 0;
  justify-content: center;
}
.dark .like-btn {
  border-color: #374151 !important;
  color: #6b7280;
}
.like-btn:hover {
  border-color: #f43f5e !important;
  color: #f43f5e;
  transform: scale(1.06);
}
.like-btn.liked {
  border-color: #f43f5e !important;
  color: #f43f5e;
}
.like-btn.liked .like-icon {
  fill: #f43f5e;
}
.like-btn:not(.liked) .like-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.like-icon {
  width: 28px;
  height: 28px;
  transition: fill 0.2s, stroke 0.2s;
}
.like-count {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

/* pop animation on click */
@keyframes like-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.25); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.like-btn.popping {
  animation: like-pop 0.35s ease;
}
