/* ═══════════════════════════════════════════════════════
   POST CSS — Single article page
   Headspace-exact: warm, airy, generous whitespace
   ═══════════════════════════════════════════════════════ */

/* ── Post layout ── */
.post-wrapper {
  max-width: 740px; margin: 0 auto;
  padding: 72px 36px 100px;
}

/* ── Post header ── */
.post-header { margin-bottom: 52px; }
.post-category-badge {
  display: inline-flex; align-items: center;
  padding: 8px 18px;
  background: var(--orange-light);
  border-radius: var(--r-full); font-size: 12px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--orange); margin-bottom: 20px;
}
.post-title {
  font-size: clamp(30px, 4.5vw, 48px);
  font-weight: 800; line-height: 1.12;
  letter-spacing: -1.2px; color: var(--gray-900);
  margin-bottom: 20px;
}
.post-excerpt {
  font-size: 19px; color: var(--text-2);
  line-height: 1.75; margin-bottom: 32px;
}
.post-meta {
  display: flex; align-items: center; gap: 22px;
  flex-wrap: wrap; font-size: 14px; color: var(--text-3);
  padding-bottom: 32px; border-bottom: 1px solid var(--gray-200);
}
.post-meta span { display: flex; align-items: center; gap: 6px; }
.post-meta .author-name { font-weight: 600; color: var(--text-2); }

/* ── Article content ── */
article { max-width: 700px; margin: 0 auto; }
article h2 {
  font-size: 26px; font-weight: 700;
  margin: 48px 0 16px; color: var(--gray-900);
  letter-spacing: -.4px;
}
article h3 {
  font-size: 20px; font-weight: 600;
  margin: 36px 0 12px; color: var(--gray-900);
}
article h4 {
  font-size: 17px; font-weight: 600;
  margin: 28px 0 10px; color: var(--gray-700);
}
article p {
  font-size: 17px; line-height: 1.9;
  color: var(--gray-600); margin-bottom: 22px;
}
article ul, article ol { padding-right: 26px; margin-bottom: 22px; }
article li {
  font-size: 17px; line-height: 1.85;
  margin-bottom: 10px; color: var(--gray-600);
}
article blockquote {
  border-right: 3px solid var(--orange);
  padding: 18px 26px;
  background: var(--orange-50);
  margin: 32px 0;
  border-radius: 0 var(--r) var(--r) 0;
}
article blockquote p {
  margin-bottom: 0; font-style: italic;
  color: var(--gray-700);
}
article a {
  color: var(--orange); font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px;
}
article a:hover { color: var(--orange-hover); }
article strong { color: var(--gray-900); font-weight: 700; }
article em { font-style: italic; }
article hr {
  border: none; border-top: 1px solid var(--gray-200);
  margin: 52px 0;
}

/* ── Markdown table ── */
article table {
  width: 100%; border-collapse: collapse;
  font-size: 14px; margin-bottom: 28px;
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
article thead tr { background: var(--warm-100); }
article th {
  padding: 16px 20px; text-align: right;
  font-weight: 700; color: var(--gray-600);
  font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--gray-200);
}
article td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text-2); vertical-align: top;
}
article tbody tr:last-child td { border-bottom: none; }
article tbody tr:hover td { background: var(--orange-50); }
article td strong { color: var(--text); }

/* ── References ── */
.references-box {
  background: var(--warm-100);
  border-radius: var(--r-xl);
  padding: 36px; margin-top: 60px;
}
.references-box h3 {
  font-size: 18px; font-weight: 700;
  color: var(--gray-900); margin-bottom: 20px;
}
.references-list { list-style: none; padding: 0; margin: 0; counter-reset: ref-counter; }
.references-list li {
  font-size: 14px; color: var(--text-2); line-height: 1.7;
  padding: 14px 0; border-bottom: 1px solid var(--gray-200);
  counter-increment: ref-counter;
}
.references-list li:last-child { border-bottom: none; }
.references-list li::before {
  content: counter(ref-counter) ". ";
  font-weight: 700; color: var(--orange);
}
.references-list a {
  color: var(--orange); text-decoration: none; font-weight: 500;
}
.references-list a:hover { text-decoration: underline; }
.ref-journal { font-size: 12px; color: var(--text-3); margin-top: 3px; }

/* ── Disclaimer box ── */
.disclaimer-box {
  background: var(--yellow-light);
  border-radius: var(--r-xl);
  padding: 32px 36px; margin-top: 60px;
}
.disclaimer-box h4 {
  font-size: 16px; font-weight: 700;
  color: #8B6914; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.disclaimer-box p {
  font-size: 15px; color: #7A6020;
  line-height: 1.75; margin-bottom: 0;
}

/* ── Back button ── */
.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px;
  background: var(--orange); color: #fff;
  border-radius: var(--r-full); font-size: 15px; font-weight: 600;
  text-decoration: none; margin-top: 52px;
  transition: all .25s var(--ease);
}
.back-btn:hover { background: var(--orange-hover); transform: translateY(-2px); box-shadow: var(--shadow); }

/* ── Post responsive ── */
@media (max-width: 600px) {
  .post-wrapper { padding: 40px 20px 72px; }
  .post-title { font-size: 28px; }
  .post-excerpt { font-size: 17px; }
  article h2 { font-size: 22px; }
  article h3 { font-size: 19px; }
  article p { font-size: 16px; }
  article li { font-size: 16px; }
  .references-box { padding: 26px; }
  .disclaimer-box { padding: 24px 26px; }
}

/* ═══════════════════════════════════════════════════════
   PHASE 4 — Reading mode toolbar + sizes
   ═══════════════════════════════════════════════════════ */

.reading-toolbar {
  position: sticky; top: 88px; z-index: 5;
  display: flex; gap: 8px; justify-content: flex-end;
  margin-bottom: -8px;
}
.rt-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border-2);
  border-radius: var(--r-full);
  font-family: var(--font); font-size: 13px; font-weight: 600;
  color: var(--text-2); cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color .15s, color .15s;
}
.rt-btn:hover { border-color: var(--orange); color: var(--orange); }
.rt-btn svg { width: 14px; height: 14px; }
.rt-A { font-size: 12px; }
.rt-A-big { font-size: 16px; }
.rt-btn[aria-pressed="true"] {
  background: var(--green-light);
  border-color: var(--green);
  color: var(--green);
}

/* Body-level classes — toggle on/off and font-size cycles */
body.reading-mode {
  background: var(--warm-50);
}
body.reading-mode .post-wrapper {
  max-width: 640px;
}
body.reading-mode article p,
body.reading-mode article li {
  line-height: 1.95;
  color: var(--text);
}
body.reading-mode .post-meta,
body.reading-mode .post-category-badge {
  opacity: .7;
}

body.reading-large article p,
body.reading-large article li { font-size: 18px; }
body.reading-large .post-excerpt { font-size: 21px; }

body.reading-xlarge article p,
body.reading-xlarge article li { font-size: 20px; line-height: 1.9; }
body.reading-xlarge .post-excerpt { font-size: 22px; }
body.reading-xlarge .post-title { font-size: clamp(34px, 5vw, 52px); }

/* Hide the reading toolbar in print */
@media print {
  .reading-toolbar { display: none !important; }
}
