/* ── READING PROGRESS BAR ── */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: var(--accent);
  z-index: 101;
  width: 0%;
  transition: width 0.1s linear;
}

/* ── POST PAGE ── */
.post-page {
  max-width: var(--col);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) var(--gap) clamp(4rem, 8vw, 6rem);
}

/* Reading column — cover photo fills the full container; everything else centers at 720px */
.post-page article > header,
.post-body,
.post-footer,
.post-footnotes,
#post-actions,
#post-related,
.support-section {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* ── BILINGUAL POSTS ── */
/* Vietnamese blocks hidden when lang=en; English blocks hidden when lang=vi */
html[lang="en"] .lang-vi { display: none; }
html[lang="vi"] .lang-en { display: none; }

/* ── BACK LINK ── */
.post-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-light);
  text-decoration: none;
  margin-bottom: 3rem;
  transition: color 0.15s;
}
.post-back::before { content: '←'; margin-right: 2px; }
.post-back:hover { color: var(--accent); }

/* ── POST COVER PHOTO ── */
.post-cover {
  margin: 0 0 3rem;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 16/7;
  background: var(--paper-warm);
  border: 1px solid var(--paper-warm);
}
.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── POST HEADER ── */
.post-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.post-title {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 5vw, 3.1rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 1.5rem;
}

.post-byline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-light);
  letter-spacing: 0.05em;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--paper-warm);
  margin-bottom: 3rem;
  flex-wrap: wrap;
}
.post-byline-sep { color: var(--paper-warm); }

/* ── POST BODY TYPOGRAPHY ── */
.post-body {
  font-size: 18px;
  line-height: 1.85;
  color: var(--ink);
}
.post-body p {
  margin-bottom: 1.6rem;
}
.post-body p:first-child {
  font-size: 20px;
  line-height: 1.75;
  color: var(--ink);
}
.post-body h2 {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 3rem 0 1rem;
  color: var(--ink);
}
.post-body h3 {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin: 2.5rem 0 0.75rem;
}
.post-body blockquote {
  margin: 2.5rem 0;
  padding: 1.5rem 2rem;
  border-left: 3px solid var(--gold);
  background: var(--gold-pale);
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  font-style: italic;
  line-height: 1.55;
  color: var(--ink);
  border-radius: 0 4px 4px 0;
}
.post-body blockquote cite {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-light);
  font-style: normal;
  margin-top: 0.75rem;
}
.post-body img {
  max-width: 100%;
  max-height: 600px;
  object-fit: contain;
  display: block;
}

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.post-body a:hover { color: var(--ink); }
.post-body strong { font-weight: 500; }
.post-body em { font-style: italic; }
.post-body ul, .post-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.6rem;
}
.post-body li { margin-bottom: 0.4rem; }

.post-body sup {
  font-size: 0.65em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
  top: -0.5em;
}
.post-body sup a {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--mono);
  font-weight: 400;
}
.post-body sup a:hover { text-decoration: underline; }

/* ── FOOTNOTES ── */
.post-footnotes {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(26,22,19,0.15);
}
.post-footnotes-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(26,22,19,0.4);
  margin-bottom: 1rem;
}
.post-footnotes ol {
  padding-left: 1.5rem;
  margin: 0;
}
.post-footnotes li {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(26,22,19,0.6);
  margin-bottom: 0.6rem;
  font-family: var(--sans);
}
.post-footnotes li em { font-style: italic; color: inherit; }
.post-footnotes li a {
  color: var(--accent);
  text-decoration: none;
}
.post-footnotes li a:hover { text-decoration: underline; }

/* ── POST FOOTER ── */
.post-footer {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--paper-warm);
  background: transparent;
  color: var(--ink);
}
.post-footer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.5rem;
}
.post-footer-tags .entry-tag {
  background: transparent;
  border: 1px solid #e8d5a0;
  color: var(--ink-mid);
}

/* ── RELATED POSTS ── */
.post-related {
  margin-top: 4rem;
}
.post-related-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--paper-warm);
}
.post-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--gold-pale);
  border: 1px solid #e8d5a0;
}
.post-related-card {
  background: var(--gold-pale);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s;
  display: block;
}
.post-related-card:hover { background: #faf0d0; }
.post-related-card .rc-cat {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.post-related-card .rc-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink);
}

/* ── SUPPORT SECTION ── */
.support-section {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--paper-warm);
}
.support-inner {
  background: var(--paper-card);
  border: 1px solid var(--paper-warm);
  border-radius: 10px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
}
.support-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 1rem;
}
.support-text {
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-mid);
  margin-bottom: 1.75rem;
  max-width: 58ch;
}
.support-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.5rem;
  background: #fdf8ec;
  border: 1px solid #e8d5a0;
  border-radius: 100px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 1.25rem;
}
.support-btn:hover {
  border-color: var(--gold);
  background: #faf0d0;
}
.support-fine {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-light);
  margin: 0;
  letter-spacing: 0.04em;
}

/* ── NEWSLETTER SECTION ── */
.newsletter-section {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--paper-warm);
}
.newsletter-inner {
  background: var(--paper-card);
  border: 1px solid var(--paper-warm);
  border-radius: 10px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
}
.newsletter-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 1rem;
}
.newsletter-text {
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-mid);
  margin-bottom: 1.5rem;
  max-width: 58ch;
}
.newsletter-row {
  display: flex;
  gap: 8px;
  max-width: 440px;
  margin-bottom: 0.75rem;
}
.newsletter-input {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 1px solid var(--paper-warm);
  border-radius: 100px;
  font-family: var(--sans);
  font-size: 14px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
.newsletter-input:focus { border-color: var(--accent); }
.newsletter-input.input-error { border-color: #c0392b; }
.newsletter-btn {
  padding: 0.6rem 1.4rem;
  background: var(--accent);
  border: none;
  border-radius: 100px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.newsletter-btn:hover { opacity: 0.88; }
.newsletter-fine {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-light);
  margin: 0;
  letter-spacing: 0.04em;
}
.newsletter-success {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 15px;
  color: var(--ink-mid);
}
.newsletter-check {
  font-size: 18px;
  color: var(--accent);
}
@media (max-width: 480px) {
  .newsletter-row { flex-direction: column; max-width: 100%; }
  .newsletter-btn { width: 100%; }
}
[data-theme="dark"] .newsletter-input { background: var(--gold-pale); border-color: rgba(232,226,217,0.18); }
[data-theme="dark"] .newsletter-input:focus { border-color: var(--accent); }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .post-title { font-size: 1.7rem; }
  .post-body { font-size: 17px; }
  .post-body p:first-child { font-size: 18px; }
}

/* ── DARK MODE ── */
[data-theme="dark"] .post-footnotes { border-top-color: rgba(232,226,217,0.12); }
[data-theme="dark"] .post-footnotes-label { color: rgba(232,226,217,0.35); }
[data-theme="dark"] .post-footnotes li { color: rgba(232,226,217,0.55); }
[data-theme="dark"] .post-footer-tags .entry-tag { border-color: rgba(232,226,217,0.18); color: var(--ink-mid); }
[data-theme="dark"] .post-actions { border-top-color: rgba(232,226,217,0.12); }
[data-theme="dark"] .action-btn { border-color: rgba(232,226,217,0.18); }
[data-theme="dark"] .action-btn:hover { border-color: rgba(232,226,217,0.4); color: var(--ink); }
[data-theme="dark"] .post-related-grid { background: var(--gold-pale); border-color: rgba(232,226,217,0.1); }
[data-theme="dark"] .post-related-card { background: var(--gold-pale); }
[data-theme="dark"] .post-related-card:hover { background: #2d2318; }
[data-theme="dark"] .support-btn { background: var(--gold-pale); border-color: rgba(232,226,217,0.18); }
[data-theme="dark"] .support-btn:hover { background: #2d2318; border-color: var(--gold); }

/* ── WEBMENTIONS ── */
.webmention-section {
  margin: 2rem 0;
  padding: 1.5rem 0 0;
  border-top: 1px solid rgba(0,0,0,0.08);
}
.wm-inner { max-width: 680px; }
.wm-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 1rem;
}
.wm-reactions { margin-bottom: 1.25rem; }
.wm-reactions-label {
  font-size: 13px;
  color: var(--ink-mid);
  margin-bottom: 0.5rem;
}
.wm-facepile {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.wm-avatar {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  display: block;
  text-decoration: none;
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
  transition: transform 0.15s;
}
.wm-avatar:hover { transform: scale(1.12); z-index: 1; }
.wm-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wm-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--sans);
}
.wm-replies { display: flex; flex-direction: column; gap: 1rem; }
.wm-reply { display: flex; gap: 0.75rem; align-items: flex-start; }
.wm-reply-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.wm-reply-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wm-reply-body {
  flex: 1;
  background: var(--gold-pale, #faf7f2);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}
.wm-reply-meta { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.35rem; }
.wm-reply-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
}
.wm-reply-name:hover { text-decoration: underline; }
.wm-reply-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-light);
}
.wm-reply-text { font-size: 14px; color: var(--ink-mid); line-height: 1.5; }
[data-theme="dark"] .webmention-section { border-top-color: rgba(232,226,217,0.12); }
[data-theme="dark"] .wm-reply-body { background: var(--gold-pale); }
[data-theme="dark"] .wm-avatar { border-color: var(--paper); }
[data-theme="dark"] .wm-reply-avatar { border-color: var(--paper); }
