/* ══════════════════════════════════════════════════════════════════════════
   eStorePoint — Blog post reading layout.
   Loaded only by post.php ($head_css = ['post']).
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Reading progress ─────────────────────────────────────────────────────
   Fixed above everything, including the sticky header, so the bar is never
   obscured while scrolling a long article. */
.read-progress{position:fixed;top:0;left:0;right:0;height:3px;z-index:200;background:rgba(29,153,65,.12);pointer-events:none;}
.read-progress-bar{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--green-600),var(--blue-600));transition:width .12s linear;}

/* ── Breadcrumb band ────────────────────────────────────────────────────
   .post-crumb-band / .post-crumbs / .crumb-current now live in style.css:
   they are generic layout primitives shared by the article, product, cart
   and checkout pages, and a page that does not load this per-page sheet
   would silently render them unstyled. */

/* ── Article head ─────────────────────────────────────────────────────── */
.post-article{padding:1.1rem 0 4rem;}
.post-head{max-width:760px;margin:0 auto 2.2rem;text-align:center;}
.post-title{
  font-size:clamp(1.85rem,4.4vw,2.9rem);line-height:1.16;letter-spacing:-.02em;
  margin:.7rem 0 0;color:var(--green-900);
}
.post-lead{
  font-size:clamp(1.02rem,1.6vw,1.16rem);line-height:1.6;color:var(--muted);
  margin:.95rem 0 0;max-width:62ch;margin-inline:auto;
}
/* .tag-link:hover is defined in style.css — the blog listing links chips too. */

/* Byline — the human beat under the headline. */
.byline{display:flex;gap:.8rem;align-items:center;justify-content:center;margin:1.5rem auto 0;}
.byline .avatar{width:44px;height:44px;font-size:1rem;}
.byline-text{text-align:left;display:flex;flex-direction:column;gap:.1rem;}
.byline-author{font-weight:600;color:var(--ink);font-size:.95rem;}
.byline-meta{font-size:.8rem;color:var(--muted);display:flex;gap:.4rem;flex-wrap:wrap;align-items:center;}

/* Cover sits wider than the byline but narrower than the layout, so the
   headline block reads as one unit. aspect-ratio reserves the box — without
   it the placeholder (800x600) and a real 16:9 upload would reflow the page
   differently and shift everything below on load. */
.post-cover{margin:2rem 0 0;border-radius:var(--radius);overflow:hidden;background:var(--green-50);aspect-ratio:16/9;}
.post-cover img{width:100%;height:100%;object-fit:cover;display:block;}

/* ── Layout: article + sticky aside ───────────────────────────────────── */
.post-layout{
  display:grid;grid-template-columns:minmax(0,1fr) 284px;
  gap:2.9rem;align-items:start;margin-top:2.6rem;
}
.post-main{min-width:0;}   /* min-width:0 so long words can't blow the grid out */
.post-aside{position:sticky;top:96px;display:flex;flex-direction:column;gap:1.5rem;}

.aside-title{
  font-size:.76rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
  color:var(--muted);margin:0 0 .75rem;
}

/* ── Table of contents ────────────────────────────────────────────────── */
.toc{
  border:1px solid var(--line);border-left:3px solid var(--green-600);
  border-radius:var(--radius-sm);padding:1rem 1.05rem;background:#fff;
}
.toc-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.1rem;}
.toc-list a{
  display:block;padding:.3rem .5rem;font-size:.86rem;line-height:1.4;color:var(--muted);
  border-radius:6px;text-decoration:none;transition:color .15s,background .15s;
}
.toc-list a:hover{color:var(--green-800);background:var(--green-50);}
/* Active section — set by post.js from the IntersectionObserver. */
.toc-list a.is-active{color:var(--green-800);background:var(--green-50);font-weight:600;}
.toc-l3 > a{padding-left:1.35rem;font-size:.82rem;}

/* Mobile disclosure. Hidden above 960px; a native <details> so the section
   list still works with JavaScript disabled. */
.toc-mobile{display:none;margin-bottom:1.6rem;}
.toc-mobile summary{
  cursor:pointer;font-weight:600;font-size:.92rem;padding:.2rem 0;
  list-style:none;display:flex;justify-content:space-between;align-items:center;gap:.6rem;
}
.toc-mobile summary::-webkit-details-marker{display:none;}
.toc-mobile summary::after{content:"";width:8px;height:8px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:rotate(45deg);transition:transform .2s;flex:none;}
.toc-mobile[open] summary::after{transform:rotate(-135deg);}
.toc-count{font-size:.76rem;color:var(--muted);font-weight:400;}
.toc-mobile .toc-list{margin-top:.7rem;border-top:1px solid var(--line);padding-top:.6rem;}

/* ── Share ────────────────────────────────────────────────────────────── */
.share-row,.post-share-inline{display:flex;gap:.45rem;flex-wrap:wrap;align-items:center;}
.share-btn{
  width:38px;height:38px;display:grid;place-items:center;flex:none;
  border:1px solid var(--line);border-radius:50%;background:#fff;color:var(--ink);
  cursor:pointer;transition:.18s;
}
.share-btn:hover{background:var(--green-600);border-color:var(--green-600);color:#fff;transform:translateY(-2px);}
.share-label{font-size:.76rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);margin-right:.2rem;}
.share-hint{font-size:.78rem;color:var(--green-800);margin:.5rem 0 0;min-height:1em;}
.post-share-inline{display:none;justify-content:center;margin:1.4rem 0 0;gap:.5rem;}

/* ── Aside CTA ────────────────────────────────────────────────────────── */
.aside-cta{
  display:block;padding:1.1rem;border-radius:var(--radius-sm);text-decoration:none;
  background:linear-gradient(150deg,#ffffff 0%,#f2faf6 38%,#dcefe4 100%);
  border:1px solid rgba(29,153,65,.22);box-shadow:0 2px 8px rgba(29,153,65,.06);
  transition:.2s;
}
.aside-cta:hover{background:linear-gradient(150deg,#ffffff 0%,#eef8f2 38%,#c9e7d4 100%);transform:translateY(-2px);}
.aside-cta-title{display:block;font-weight:700;color:var(--green-900);font-size:.95rem;}
.aside-cta-text{display:block;font-size:.82rem;color:var(--muted);margin-top:.3rem;line-height:1.5;}
.aside-cta-go{display:block;font-size:.84rem;font-weight:600;color:var(--green-700);margin-top:.6rem;}

/* ══ Article body typography ══════════════════════════════════════════════
   The admin editor writes bare HTML with no classes, so every element the
   rich-text toolbar can emit is styled here. The measure is capped at 68ch —
   past ~75 characters a line loses the reader on the return sweep. */
.prose{max-width:68ch;font-size:1.02rem;line-height:1.78;color:#2c3540;}
.prose > *:first-child{margin-top:0;}
.prose p{margin:0 0 1.15rem;}
.prose h2{
  font-size:1.5rem;line-height:1.3;color:var(--green-900);letter-spacing:-.01em;
  margin:2.4rem 0 .9rem;scroll-margin-top:96px;
}
.prose h3{font-size:1.16rem;color:var(--green-900);margin:1.9rem 0 .7rem;scroll-margin-top:96px;}
.prose h4{font-size:1rem;color:var(--green-900);margin:1.5rem 0 .6rem;scroll-margin-top:96px;}
.prose a{color:var(--green-700);text-decoration:underline;text-underline-offset:3px;}
.prose a:hover{color:var(--blue-600);}
.prose ul,.prose ol{margin:0 0 1.15rem;padding-left:1.35rem;}
.prose li{margin-bottom:.5rem;}
.prose li::marker{color:var(--green-600);}
.prose blockquote{
  margin:1.6rem 0;padding:1rem 1.3rem;border-left:3px solid var(--green-600);
  background:var(--green-50);border-radius:0 var(--radius-sm) var(--radius-sm) 0;
  font-style:italic;color:var(--muted);
}
.prose blockquote p:last-child{margin-bottom:0;}
.prose img{max-width:100%;height:auto;border-radius:var(--radius);display:block;margin:1.5rem 0;}
.prose figure{margin:1.6rem 0;}
.prose figcaption{font-size:.82rem;color:var(--muted);text-align:center;margin-top:.55rem;}
.prose hr{border:0;border-top:1px solid var(--line);margin:2.2rem 0;}
.prose code{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.88em;
  background:var(--green-50);color:var(--green-800);padding:.12em .4em;border-radius:4px;
}
.prose pre{background:#131a17;color:#e8f3ec;padding:1rem 1.15rem;border-radius:var(--radius-sm);overflow-x:auto;font-size:.86rem;line-height:1.6;}
.prose pre code{background:none;color:inherit;padding:0;}
.prose table{width:100%;border-collapse:collapse;margin:1.6rem 0;font-size:.92rem;}
.prose th,.prose td{border:1px solid var(--line);padding:.6rem .75rem;text-align:left;}
.prose th{background:var(--green-50);color:var(--green-900);font-weight:600;}
.prose strong{color:var(--green-900);}

/* ── Tags ─────────────────────────────────────────────────────────────── */
.post-tags{display:flex;gap:.5rem;flex-wrap:wrap;margin:2.2rem 0 0;max-width:68ch;}
.post-tags .tag{font-size:.78rem;padding:.3rem .75rem;}

/* ── Author card (E-E-A-T) ────────────────────────────────────────────── */
.author-card{
  display:flex;gap:1.1rem;align-items:flex-start;margin:2.6rem 0 0;max-width:68ch;
  padding:1.4rem;border:1px solid var(--line);border-radius:var(--radius);background:#fff;
  box-shadow:0 2px 10px rgba(17,34,24,.04);
}
.avatar-lg{width:64px;height:64px;font-size:1.5rem;background:var(--green-700);}
.author-name{margin:0;font-size:1.05rem;color:var(--green-900);}
.author-role{margin:.15rem 0 0;font-size:.78rem;color:var(--green-700);font-weight:600;text-transform:uppercase;letter-spacing:.06em;}
.author-bio{margin:.55rem 0 0;font-size:.9rem;line-height:1.6;color:var(--muted);}

/* ── Prev / next ──────────────────────────────────────────────────────── */
.post-nav{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin:2.6rem 0 0;max-width:68ch;}
.post-nav-item{
  display:flex;flex-direction:column;gap:.28rem;padding:1rem 1.15rem;text-decoration:none;
  border:1px solid var(--line);border-radius:var(--radius-sm);background:#fff;transition:.2s;min-width:0;
}
.post-nav-item:hover{border-color:var(--green-600);background:var(--green-50);transform:translateY(-2px);}
.post-nav-item.empty{visibility:hidden;}
.post-nav-item.next{text-align:right;}
.post-nav-dir{font-size:.74rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--green-700);}
.post-nav-title{font-weight:600;color:var(--green-900);font-size:.95rem;line-height:1.35;}
.post-nav-cat{font-size:.76rem;color:var(--muted);}

/* ── Comments ─────────────────────────────────────────────────────────── */
.post-comments{margin:3rem 0 0;max-width:68ch;}
.comments-title{display:flex;align-items:center;gap:.6rem;}
.count-pill{
  background:var(--green-100);color:var(--green-800);font-size:.78rem;font-weight:700;
  padding:.15rem .6rem;border-radius:999px;line-height:1.5;
}
.comment-form{padding:1.4rem;margin-bottom:1.6rem;}
.comment-head{display:flex;gap:.6rem;align-items:baseline;flex-wrap:wrap;}
.comment-body{margin:.2rem 0 0;}
.comment-list .comment:last-child{border-bottom:0;}

/* ── Related ──────────────────────────────────────────────────────────── */
.post-related{margin:3.2rem 0 0;}
.related-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1.1rem;}
.related-card .card-media{aspect-ratio:16/9;}
.related-card .card-title{font-size:.98rem;}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width:960px){
  .post-layout{grid-template-columns:minmax(0,1fr);gap:0;}
  .post-aside{display:none;}          /* its two blocks are already in flow */
  .toc-mobile{display:block;}
  .post-share-inline{display:flex;}
}
@media (max-width:640px){
  .prose{font-size:1rem;}
  .post-head{text-align:left;}
  .byline{justify-content:flex-start;}
  .byline-text{text-align:left;}
  .post-lead{margin-inline:0;}
  .post-cover{aspect-ratio:4/3;}
  .post-nav{grid-template-columns:1fr;}
  .post-nav-item.empty{display:none;}
  .post-nav-item.next{text-align:left;}
  .author-card{flex-direction:column;gap:.9rem;}
}
