/* Blog / Markdown content — used where Tailwind Typography (prose) is not in the build */

.post-body {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: #334155;
  --post-link: #2563eb;
  --post-link-hover: #1d4ed8;
  --post-code-bg: #f1f5f9;
  --post-pre-bg: #f8fafc;
  --post-pre-border: #e2e8f0;
  --post-table-stripe: #f8fafc;
  --post-h2-border: #e2e8f0;
}

/* Prefer ## in Markdown (page title is the template h1) */
.post-body h1 {
  font-size: 1.625rem;
  line-height: 1.3;
  font-weight: 700;
  color: #0f172a;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.02em;
}

.post-body h2 {
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 700;
  color: #0f172a;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--post-h2-border);
  letter-spacing: -0.02em;
}

.post-body h1:first-child,
.post-body h2:first-child {
  margin-top: 0;
}

.post-body h3 {
  font-size: 1.2rem;
  line-height: 1.4;
  font-weight: 650;
  color: #0f172a;
  margin: 1.75rem 0 0.65rem;
  letter-spacing: -0.015em;
}

.post-body h4 {
  font-size: 1.05rem;
  font-weight: 650;
  color: #1e293b;
  margin: 1.5rem 0 0.5rem;
}

.post-body p {
  margin: 0.85em 0;
}

.post-body ul,
.post-body ol {
  margin: 0.85em 0;
  padding-left: 1.35rem;
}

.post-body ul {
  list-style-type: disc;
}

.post-body ol {
  list-style-type: decimal;
}

.post-body li {
  margin: 0.35em 0;
  padding-left: 0.25rem;
}

.post-body li::marker {
  color: #64748b;
}

.post-body a {
  color: var(--post-link);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

.post-body a:hover {
  color: var(--post-link-hover);
}

.post-body strong,
.post-body b {
  font-weight: 600;
  color: #1e293b;
}

.post-body em {
  font-style: italic;
}

.post-body blockquote {
  margin: 1.25rem 0;
  padding: 0.5rem 0 0.5rem 1rem;
  border-left: 3px solid #3b82f6;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.08), transparent 70%);
  color: #475569;
  font-style: italic;
}

.post-body blockquote p {
  margin: 0.4em 0;
}

.post-body hr {
  margin: 2rem 0;
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

/* Inline code */
.post-body :not(pre) > code {
  background: var(--post-code-bg);
  color: #0f172a;
  font-size: 0.88em;
  padding: 0.15em 0.4em;
  border-radius: 0.3rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  border: 1px solid #e2e8f0;
}

/* Fenced code — markdown wraps in <pre><code> */
.post-body pre {
  background: var(--post-pre-bg);
  color: #0f172a;
  font-size: 0.9rem;
  line-height: 1.6;
  padding: 1rem 1.15rem;
  border-radius: 0.5rem;
  border: 1px solid var(--post-pre-border);
  overflow-x: auto;
  margin: 1.5rem 0;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
  display: block;
  white-space: pre;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* GFM / PHP Extra tables from markdown */
.post-body .table-wrap {
  margin: 1.75rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.post-body .table-wrap table {
  width: 100%;
  min-width: 32rem;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Legacy posts without .table-wrap wrapper */
.post-body > table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.5;
  display: table;
  margin: 1.75rem 0;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.post-body thead th {
  text-align: left;
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 600;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.post-body td {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
  color: #334155;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.post-body tbody tr:nth-child(even) td {
  background: var(--post-table-stripe);
}

.post-body tbody tr:last-child td {
  border-bottom: none;
}

.post-body tfoot td {
  font-weight: 600;
  color: #0f172a;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

/* Images in body */
.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 1.5rem 0;
  border: 1px solid #e2e8f0;
}

/* Definition-style leading term + paragraph pairs */
.post-body dl {
  margin: 1rem 0;
}

.post-body dt {
  font-weight: 600;
  color: #1e293b;
  margin-top: 0.75rem;
}

.post-body dd {
  margin: 0.25rem 0 0.5rem 1rem;
  color: #475569;
}
