/* ─── Public blog styles ────────────────────────────────────────
   Standalone stylesheet for the PHP-rendered /blog pages. Uses the
   same brand tokens as the main React site so the look is native.
   No dependency on Next.js's generated CSS. */

:root {
  --forest: #47623e;
  --forest-700: #354a2f;
  --sage: #87ae73;
  --sage-300: #b8d0a2;
  --ivory: #f6f2ea;
  --bone: #ede7d8;
  --midnight: #1c2a20;
  --charcoal: #2b3229;
  --stone: #6b7469;
  --stone-muted: #a3a89f;
  --line: #d9d3c4;
  --shadow-soft: 0 20px 40px -20px rgba(0,0,0,0.15);
  --header-height: 84px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--charcoal);
  background: var(--ivory);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--forest); text-decoration: none; }
h1, h2, h3, h4 {
  font-family: Georgia, "Playfair Display", serif;
  color: var(--charcoal);
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-weight: 700;
  margin: 0;
}
.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--sage);
  font-weight: 600;
  margin: 0 0 1.2rem;
}
.eyebrow::before { content: "— "; }

.container { max-width: 1240px; margin-inline: auto; padding-inline: 1.5rem; }
@media (min-width: 900px) { .container { padding-inline: 3rem; } }

.cta-btn, .ghost-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.95rem 2rem;
  border-radius: 999px;
  font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.18em;
  transition: background 0.3s, transform 0.3s, color 0.3s;
  cursor: pointer; font-family: inherit;
  border: 1.5px solid transparent;
}
.cta-btn { background: var(--forest); color: var(--ivory); box-shadow: 0 12px 30px -12px rgba(71,98,62,0.5); }
.cta-btn:hover { background: var(--forest-700); transform: translateY(-2px); color: var(--ivory); }
.ghost-btn { background: transparent; color: var(--forest); border-color: var(--line); }
.ghost-btn:hover { border-color: var(--forest); }

/* ── Site header ── */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(246, 242, 234, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem;
  height: var(--header-height);
}
.brand-link img { height: 2.6rem; width: auto; }
.site-nav { display: none; gap: 2rem; }
@media (min-width: 1000px) { .site-nav { display: flex; } }
.site-nav a {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.22em;
  color: var(--forest); transition: color 0.2s;
}
.site-nav a.is-active,
.site-nav a:hover { color: var(--forest-700); }
.menu-toggle {
  display: inline-flex; background: transparent; border: 1px solid var(--line);
  border-radius: 999px; padding: 0.55rem; color: var(--forest); cursor: pointer;
}
@media (min-width: 1000px) { .menu-toggle { display: none; } }
.site-header .cta-btn { display: none; }
@media (min-width: 1000px) { .site-header .cta-btn { display: inline-flex; padding: 0.65rem 1.4rem; box-shadow: none; } }

.mobile-nav {
  position: fixed; inset: var(--header-height) 0 0 0; z-index: 30;
  background: rgba(28, 42, 32, 0.96);
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
  padding: 3rem 1.5rem;
}
body.nav-open .mobile-nav { opacity: 1; pointer-events: auto; }
.mobile-nav-inner { display: flex; flex-direction: column; gap: 1.4rem; max-width: 30rem; margin: 0 auto; text-align: center; }
.mobile-nav a {
  color: var(--ivory); font-family: Georgia, serif; font-size: 1.8rem;
  padding: 0.5rem 0; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.mobile-nav .cta-btn { margin-top: 1rem; align-self: center; }
.cta-btn.wide { justify-content: center; width: 100%; }

/* ── Hero (blog index) ── */
.page-hero {
  position: relative;
  isolation: isolate;      /* traps children's z-index so the -1/-2 hero image and overlay don't slide behind the body */
  min-height: 60svh;
  color: var(--ivory);
  overflow: hidden;
  padding: 6rem 0 4rem;
  display: flex; align-items: flex-end;
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to bottom, rgba(71,98,62,0.55), rgba(28,42,32,0.75));
}
.hero-overlay.dark {
  background: linear-gradient(to bottom, rgba(28,42,32,0.3) 0%, rgba(28,42,32,0.85) 100%);
}
.page-hero .container, .page-hero .hero-inner { position: relative; z-index: 2; }
.page-hero .eyebrow { color: var(--sage-300); }
.page-hero h1 {
  font-size: clamp(2.4rem, 5.8vw, 4.6rem);
  color: var(--ivory);
  max-width: 40rem;
  margin: 0.4rem 0 1.2rem;
}
.page-hero .lead { max-width: 34rem; color: rgba(246,242,234,0.85); font-size: 1.05rem; margin: 0; }

/* ── Post index grid ── */
.posts-section { padding: 5rem 0; }
.posts-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 2rem; }
@media (min-width: 700px) { .posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1050px) { .posts-grid { grid-template-columns: repeat(3, 1fr); } }
.posts-grid.two-up { grid-template-columns: 1fr; }
@media (min-width: 800px) { .posts-grid.two-up { grid-template-columns: 1fr 1fr; } }

.post-card {
  display: flex; flex-direction: column;
  background: white; border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  height: 100%; color: inherit;
}
.post-card:hover { transform: translateY(-6px); }
.post-cover { aspect-ratio: 16/10; background: var(--bone); overflow: hidden; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.post-card:hover .post-cover img { transform: scale(1.04); }
.post-body { padding: 1.6rem 1.8rem 1.8rem; display: flex; flex-direction: column; gap: 0.8rem; flex: 1; }
.post-meta {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--stone); margin: 0; font-weight: 500;
}
.post-body h3 { font-size: 1.35rem; color: var(--charcoal); line-height: 1.25; margin: 0.2rem 0 0.4rem; }
.post-excerpt { font-size: 0.9rem; color: var(--stone); margin: 0; line-height: 1.55; }
.read-more {
  margin-top: auto; padding-top: 1rem;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.22em;
  color: var(--forest); font-weight: 600;
}

.empty-state { text-align: center; padding: 5rem 1rem; }
.empty-state h1, .empty-state h2 { font-size: 2rem; color: var(--charcoal); margin: 0 0 0.6rem; }
.empty-state p { color: var(--stone); }

/* ── Single post ── */
.post-view { background: var(--ivory); }
.post-hero {
  position: relative; overflow: hidden;
  isolation: isolate;      /* same stacking-context trap as .page-hero above */
  color: var(--ivory);
  padding: 6rem 0 4rem;
  min-height: 55svh;
  display: flex; align-items: flex-end;
}
.post-hero .container, .post-hero .hero-inner { position: relative; z-index: 2; }
.post-hero h1 {
  font-size: clamp(2.2rem, 5.2vw, 4rem);
  color: var(--ivory);
  max-width: 42rem;
  margin: 0.4rem 0 1.2rem;
}
.post-hero .post-meta { color: rgba(246,242,234,0.85); }
.post-hero .eyebrow { color: var(--sage-300); }

.post-body-wrap { padding: 4rem 0 5rem; }
.post-grid {
  display: grid; gap: 3rem;
  grid-template-columns: 1fr;
}
@media (min-width: 1000px) { .post-grid { grid-template-columns: 240px 1fr; gap: 4rem; } }

/* ToC sidebar */
.post-toc {
  position: static;
  padding: 1.6rem 1.4rem;
  background: var(--bone);
  border-radius: 12px;
}
@media (min-width: 1000px) {
  .post-toc { position: sticky; top: calc(var(--header-height) + 1.5rem); align-self: start; background: transparent; padding: 0; }
}
.post-toc .eyebrow { color: var(--stone); font-size: 0.66rem; margin-bottom: 0.9rem; }
.post-toc ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.post-toc li a { display: block; color: var(--stone); font-size: 0.9rem; line-height: 1.4; padding: 0.15rem 0; border-left: 2px solid transparent; padding-left: 0.7rem; transition: color 0.2s, border-color 0.2s; }
.post-toc li a:hover { color: var(--forest); border-color: var(--forest); }
.post-toc .toc-l3 { padding-left: 1.4rem; font-size: 0.85rem; }

.post-body-main { min-width: 0; }
.post-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--charcoal);
  max-width: 44rem;
}
.post-content > *:first-child { margin-top: 0; }
.post-content p { margin: 0 0 1.4rem; }
.post-content h2, .post-content h3 {
  font-family: Georgia, serif;
  color: var(--forest);
  scroll-margin-top: calc(var(--header-height) + 1rem);
  margin: 2.4rem 0 0.8rem;
}
.post-content h2 { font-size: 1.9rem; }
.post-content h3 { font-size: 1.35rem; }
.post-content a { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { color: var(--forest-700); }
.post-content ul, .post-content ol { margin: 0 0 1.4rem; padding-left: 1.6rem; }
.post-content ul { list-style-type: disc; }
.post-content ol { list-style-type: decimal; }
.post-content ul ul { list-style-type: circle; }
.post-content ul ul ul { list-style-type: square; }
.post-content li { margin-bottom: 0.5rem; }
.post-content li::marker { color: var(--forest); }
/* TinyMCE indent button uses inline padding-left on <p>. Cap it so an
   editor who mashes the indent button 10 times doesn't push text off
   the reading column. */
.post-content p[style*="padding-left"] { max-width: 100%; }
.post-content blockquote {
  border-left: 3px solid var(--forest);
  padding: 0.6rem 1.4rem;
  color: var(--stone);
  font-style: italic;
  margin: 1.8rem 0;
  background: var(--bone);
  border-radius: 0 8px 8px 0;
}
.post-content img { border-radius: 12px; margin: 1.6rem 0; box-shadow: var(--shadow-soft); }
.post-content pre { background: var(--midnight); color: var(--ivory); padding: 1.2rem; border-radius: 10px; overflow-x: auto; }
.post-content code { background: var(--bone); padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.9em; }
.post-content pre code { background: transparent; padding: 0; }
.post-content table { border-collapse: collapse; margin: 1.4rem 0; width: 100%; }
.post-content table th, .post-content table td { border: 1px solid var(--line); padding: 0.7rem 1rem; text-align: left; }
.post-content table th { background: var(--bone); font-weight: 600; }
.post-content iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 12px; margin: 1.4rem 0; }

/* FAQs on the post */
.post-faqs { margin: 4rem 0 3rem; max-width: 44rem; }
.post-faqs h2 { font-family: Georgia, serif; color: var(--forest); font-size: 1.8rem; margin: 0 0 1.5rem; }
.faq-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  padding: 1.2rem 0;
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 1.1rem;
  color: var(--charcoal);
  font-weight: 600;
  list-style: none;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  color: var(--forest);
  font-size: 1.6rem;
  transition: transform 0.3s;
  line-height: 1;
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-body { padding: 0 0 1.4rem; color: var(--stone); line-height: 1.7; font-size: 1rem; }

/* Author card */
.post-author {
  margin: 3rem 0 2rem;
  padding: 1.6rem 1.8rem;
  background: var(--bone);
  border-radius: 14px;
  display: flex; gap: 1.2rem; align-items: flex-start;
  max-width: 44rem;
}
.post-author img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.author-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--stone); margin: 0; font-weight: 600; }
.author-name { font-family: Georgia, serif; font-size: 1.1rem; color: var(--charcoal); margin: 0.2rem 0 0.4rem; font-weight: 700; }
.author-bio { color: var(--stone); font-size: 0.9rem; margin: 0; line-height: 1.55; }

.post-cta { display: flex; gap: 0.8rem; margin-top: 3rem; flex-wrap: wrap; }

/* Related posts */
.related-section { padding: 4rem 0 5rem; background: var(--bone); }
.related-section .posts-grid { margin-top: 1.5rem; }

/* ── Footer ── */
.site-footer {
  background: var(--midnight); color: var(--ivory);
  padding: 4rem 0 1.5rem;
  margin-top: 5rem;
}
.footer-inner {
  display: grid; gap: 3rem;
  grid-template-columns: 1fr;
  margin-bottom: 2rem;
}
@media (min-width: 700px) { .footer-inner { grid-template-columns: 1.5fr 1fr 1fr; } }
.foot-logo { height: 2.8rem; margin-bottom: 1.4rem; filter: brightness(0) invert(1); }
.foot-tag { font-family: Georgia, serif; font-size: 1.4rem; color: var(--ivory); margin: 0 0 0.6rem; }
.foot-desc { color: rgba(246,242,234,0.6); max-width: 22rem; font-size: 0.9rem; margin: 0; }
.site-footer h4 { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.22em; color: var(--sage-300); margin: 0 0 1.2rem; font-family: inherit; font-weight: 600; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.7rem; font-size: 0.9rem; }
.site-footer a { color: rgba(246,242,234,0.8); transition: color 0.2s; }
.site-footer a:hover { color: var(--ivory); }

.foot-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.4rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  color: rgba(246,242,234,0.5); font-size: 0.78rem;
}
@media (min-width: 700px) { .foot-bottom { flex-direction: row; justify-content: space-between; } }
