/* ==========================================================================
   Post Styles
   ========================================================================== */

.post-stream { display: flex; flex-direction: column; }

.post { padding: 1.25rem 0; border-bottom: 1px solid var(--border-light); }
.post:first-child { padding-top: 0; }
.post:last-child { border-bottom: none; }

/* --- Post Header --- */

.post-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.625rem; }
.post-avatar { flex-shrink: 0; }

.post-author { display: flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; min-width: 0; }
.post-username { font-weight: 600; }
.post-user-title { font-size: 0.75rem; color: var(--text-faint); }

.post-date { margin-left: auto; display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.post-date a { font-size: 0.75rem; color: var(--text-faint); }
.post-date a:hover { color: var(--accent); text-decoration: none; }
.post-number { font-size: 0.6875rem; color: var(--text-faint); }

/* --- Reply Indicator --- */

.post-reply-indicator { margin-bottom: 0.5rem; font-size: 0.75rem; }
.post-reply-indicator a { color: var(--text-faint); display: inline-flex; align-items: center; gap: 0.25rem; }
.post-reply-indicator a:hover { color: var(--accent); }
.post-reply-indicator a::before { content: "\21B5"; }

/* --- Post Body (cooked HTML) --- */

.post-body {
  line-height: 1.7;
  overflow-wrap: break-word;
  word-break: break-word;
  font-size: 1rem;
}

.post-body p { margin-bottom: 0.625rem; }
.post-body p:last-child { margin-bottom: 0; }

.post-body h1 { font-size: 1.375rem; font-weight: 700; margin: 1.125rem 0 0.4rem; }
.post-body h2 { font-size: 1.2rem; font-weight: 700; margin: 1rem 0 0.35rem; }
.post-body h3 { font-size: 1.0625rem; font-weight: 600; margin: 0.875rem 0 0.3rem; }
.post-body h4, .post-body h5, .post-body h6 { font-size: 0.9375rem; font-weight: 600; margin: 0.75rem 0 0.25rem; }

.post-body ul, .post-body ol { margin: 0.375rem 0 0.625rem 1.5rem; }
.post-body li { margin-bottom: 0.2rem; }

.post-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 0.625rem 0;
  padding: 0.375rem 0.875rem;
  background: var(--bg-subtle);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
}

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

.post-body pre {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  overflow-x: auto;
  margin: 0.625rem 0;
  font-size: 0.8125rem;
  line-height: 1.55;
}

.post-body code { font-family: var(--font-mono); font-size: 0.875em; }

.post-body :not(pre) > code {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

.post-body img { border-radius: var(--radius); margin: 0.2rem 0; }
.post-body a { color: var(--accent); }
.post-body a:hover { text-decoration: underline; }

.post-body table { border-collapse: collapse; width: 100%; margin: 0.625rem 0; }
.post-body th, .post-body td { border: 1px solid var(--border); padding: 0.4rem 0.625rem; text-align: left; font-size: 0.875rem; }
.post-body th { background: var(--bg-subtle); font-weight: 600; }

.post-body hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

/* Discourse-specific cooked elements */

.post-body .lightbox-wrapper { display: block; margin: 0.4rem 0; }
.post-body .lightbox-wrapper img { max-width: 100%; }

.post-body .quote { margin: 0.625rem 0; }

.post-body .quote .title {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.post-body .quote .title img { width: 20px; height: 20px; border-radius: 50%; }

.post-body .onebox {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.625rem 0.875rem;
  margin: 0.4rem 0;
}

.post-body .onebox h3 { margin-top: 0; }
.post-body .emoji { width: 20px; height: 20px; vertical-align: middle; }
.post-body .mention { color: var(--accent); font-weight: 500; }
.post-body .hashtag { color: var(--accent); }

.post-body details {
  margin: 0.4rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.625rem;
}

.post-body details summary { cursor: pointer; font-weight: 500; }

/* --- Post Footer --- */

.post-footer { display: flex; align-items: center; gap: 0.875rem; margin-top: 0.625rem; }

.post-likes, .post-replies {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-faint);
}

.post-likes svg, .post-replies svg { opacity: 0.6; }
.post-likes { color: var(--love); }
