/**
 * Prose styles for entry/post content.
 * Makes HTML content readable and visually balanced.
 * Uses :where() for low specificity so block editor styles can override.
 */

.entry-content,
.post-content {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-default);
}

.entry-content :where(p),
.post-content :where(p) {
  margin: 0 0 1em;
}

.entry-content :where(p):last-child,
.post-content :where(p):last-child {
  margin-bottom: 0;
}

.entry-content :where(h1, h2, h3, h4, h5, h6),
.post-content :where(h1, h2, h3, h4, h5, h6) {
  margin: 1.25em 0 0.5em;
  font-weight: 700;
  color: var(--text-default);
  line-height: 1.3;
}

.entry-content :where(h1):first-child,
.post-content :where(h1):first-child,
.entry-content :where(h2):first-child,
.post-content :where(h2):first-child {
  margin-top: 0;
}

.entry-content :where(h1),
.post-content :where(h1) { font-size: 1.6em; }
.entry-content :where(h2),
.post-content :where(h2) { font-size: 1.4em; }
.entry-content :where(h3),
.post-content :where(h3) { font-size: 1.2em; }
.entry-content :where(h4, h5, h6),
.post-content :where(h4, h5, h6) { font-size: 1.1em; }

.entry-content :where(a),
.post-content :where(a) {
  color: var(--primary-color);
  text-decoration: underline;
}
.entry-content :where(a):hover,
.post-content :where(a):hover {
  text-decoration-thickness: 2px;
}

.entry-content :where(ul, ol),
.post-content :where(ul, ol) {
  margin: 0 0 1em;
  padding-left: 1.5em;
}

.entry-content :where(ul),
.post-content :where(ul) {
  list-style-type: disc;
}

.entry-content :where(ol),
.post-content :where(ol) {
  list-style-type: decimal;
}

.entry-content :where(li),
.post-content :where(li) {
  margin-bottom: 0.35em;
}

.entry-content :where(li > ul),
.entry-content :where(li > ol),
.post-content :where(li > ul),
.post-content :where(li > ol) {
  margin: 0.35em 0 0;
}

.entry-content :where(blockquote),
.post-content :where(blockquote) {
  margin: 1em 0;
  padding: 0.75em 1em 0.75em 1.25em;
  border-left: 4px solid var(--border-color);
  background: var(--surface-color);
  color: var(--text-default);
  font-style: italic;
}

.entry-content :where(blockquote p:last-child),
.post-content :where(blockquote p:last-child) {
  margin-bottom: 0;
}

.entry-content :where(hr),
.post-content :where(hr) {
  margin: 1.5em 0;
  border: none;
  border-top: 1px solid var(--border-color);
}

.entry-content :where(pre),
.entry-content :where(code),
.post-content :where(pre),
.post-content :where(code) {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.entry-content :where(code),
.post-content :where(code) {
  padding: 0.15em 0.35em;
  font-size: 0.9em;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.entry-content :where(pre),
.post-content :where(pre) {
  margin: 1em 0;
  padding: 1em;
  overflow-x: auto;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.entry-content :where(pre code),
.post-content :where(pre code) {
  padding: 0;
  background: none;
  border: none;
}

.entry-content :where(table),
.post-content :where(table) {
  width: 100%;
  margin: 1em 0;
  border-collapse: collapse;
}

.entry-content :where(th, td),
.post-content :where(th, td) {
  padding: 0.5em 0.75em;
  border: 1px solid var(--border-color);
  text-align: left;
}

.entry-content :where(th),
.post-content :where(th) {
  font-weight: 600;
  background: var(--surface-color);
}

.entry-content :where(img),
.post-content :where(img) {
  max-width: 100%;
  height: auto;
  display: block;
}
