/* =========================================================
   CoffeeNCoders — post.css: one blog post (/blog/<slug>/, blog-post.php). Loaded after main.css.
   Dark hero (breadcrumb, title, excerpt, by-line) → optional cover picture → white reading column with a sticky
   "On this page" list (the post's ## headings) → "Keep reading" cards. Reading type: 18px, ~68 characters a line.
   ========================================================= */

.ps-draft { position: relative; z-index: 101; padding: 10px 16px; text-align: center; font-size: 14px; color: var(--ink); background: var(--amber); }
.ps-draft a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Hero ---------- */
.ps-hero {
  position: relative; overflow: hidden; color: var(--cream);
  padding: clamp(130px, 17vh, 180px) 0 clamp(56px, 6vw, 84px);
  background: radial-gradient(45% 60% at 85% 10%, rgba(226, 117, 58, .2), transparent 70%), var(--espresso);
}
.ps-hero__inner { max-width: calc(1032px + var(--gutter) * 2); }   /* lines up with the contents list + text below */
.ps-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted-dark); }
.ps-crumbs a { transition: color .2s; }
.ps-crumbs a:hover { color: var(--amber); }
.ps-hero__title { margin-top: 20px; font-family: var(--display); font-size: clamp(30px, 3.4vw, 50px); font-weight: 700; line-height: 1.08; letter-spacing: -.045em; }
.ps-hero__lead { margin-top: 18px; font-size: 18px; line-height: 1.6; color: rgba(247, 242, 235, .78); }
.ps-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 28px; font-size: 14px; color: var(--muted-dark); }
.ps-meta > span + span::before { content: ""; display: inline-block; width: 3px; height: 3px; margin-right: 16px; vertical-align: middle; border-radius: 50%; background: currentColor; }
.ps-meta__by { display: inline-flex; align-items: center; gap: 10px; color: var(--cream); font-weight: 500; }
.ps-meta__mark { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--copper); }
.ps-meta__mark img { width: 15px; height: 19px; object-fit: cover; object-position: left; filter: brightness(0) invert(1); }

/* ---------- Cover ---------- */
.ps-cover { background: linear-gradient(var(--espresso) 50%, #fff 50%); }
.ps-cover img { width: 100%; max-height: 560px; object-fit: cover; border-radius: 24px; box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .5); }

/* ---------- Body ---------- */
.ps-body { padding-block: clamp(56px, 7vw, 96px); background: #fff; }
.ps-body--cover { padding-top: clamp(40px, 5vw, 64px); }
.ps-grid { display: grid; grid-template-columns: 240px minmax(0, 720px); justify-content: center; gap: clamp(32px, 5vw, 72px); align-items: start; }
.ps-grid:not(:has(.ps-toc)) { grid-template-columns: minmax(0, 720px); }
.ps-toc { position: sticky; top: 110px; }
.ps-toc__title { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ps-toc ol { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.ps-toc a { display: block; margin-left: -1px; padding: 6px 0 6px 14px; font-size: 14px; line-height: 1.4; color: var(--muted); border-left: 2px solid transparent; transition: color .2s, border-color .2s; }
.ps-toc a:hover { color: var(--ink); border-color: var(--copper); }
.ps-toc a.is-on { color: var(--ink); font-weight: 600; border-left-color: var(--copper); }   /* the part being read (post.js) */

/* the text */
.ps-text { font-size: 18px; line-height: 1.75; color: #3a302a; }
.ps-text > * + * { margin-top: 1.1em; }
/* one section per heading: a clicked contents link lights its section with a warm wash that fades (post.js) */
.ps-sec { margin-top: 1.4em; margin-inline: -22px; padding: 14px 22px 8px; border-radius: 18px; scroll-margin-top: 100px; transition: background-color .9s ease, box-shadow .9s ease; }
.ps-sec.is-lit { background: #fbf1e6; box-shadow: inset 3px 0 0 var(--copper); transition-duration: .25s; }
.ps-sec > * + * { margin-top: 1.1em; }
.ps-text h2 { font: 700 clamp(24px, 2.2vw, 30px)/1.2 var(--display); letter-spacing: -.03em; color: var(--ink); }
.ps-text h3 { margin-top: 1.6em; font: 700 20px/1.3 var(--display); letter-spacing: -.02em; color: var(--ink); }
.ps-text h2 + *, .ps-text h3 + * { margin-top: .6em; }
.ps-text strong { font-weight: 600; color: var(--ink); }
.ps-text a:not(.btn):not(.wa-chat__btn) { color: var(--copper); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .2s; }
.ps-text a:not(.btn):not(.wa-chat__btn):hover { color: #b4521f; }
.ps-text code { padding: .1em .4em; border-radius: 6px; font-family: var(--mono); font-size: .85em; background: #f6efe7; }
.ps-text ul, .ps-text ol { padding-left: 1.3em; }
.ps-text li + li { margin-top: .45em; }
.ps-text li::marker { color: var(--copper); }
.ps-text blockquote { margin-inline: 0; padding: 18px 24px; border-radius: 0 16px 16px 0; border-left: 3px solid var(--copper); background: #fbf5ee; font-size: 19px; font-weight: 500; color: var(--ink); }
.ps-text figure { margin-inline: 0; }
.ps-text figure img { width: 100%; border-radius: 16px; }
.ps-text figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); text-align: center; }

/* the call to action at the end of every post */
.ps-cta {
  display: grid; justify-items: start; gap: 12px; margin-top: 2.6em !important; padding: 28px 30px; border-radius: 22px; color: var(--cream);
  background: radial-gradient(60% 90% at 100% 100%, rgba(226, 117, 58, .4), transparent 70%), var(--espresso);
}
.ps-cta__title { font: 700 24px/1.2 var(--display); letter-spacing: -.03em; }
.ps-cta__text { font-size: 16px; line-height: 1.6; color: var(--muted-dark); }
.ps-cta__wa { display: inline-flex; justify-self: start; }   /* the shared WhatsApp button, sized to its words */

/* ---------- Keep reading ---------- */
.ps-more { padding-block: clamp(56px, 7vw, 96px); background: var(--paper); border-top: 1px solid var(--line); }
.ps-more__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.ps-more__title { font: 700 clamp(24px, 2.4vw, 32px) var(--display); letter-spacing: -.035em; }
.ps-more__all { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--ink); transition: color .25s; }
.ps-more__all span { display: inline-flex; transition: transform .25s var(--ease); }
.ps-more__all:hover { color: var(--copper); }
.ps-more__all:hover span { transform: translateX(3px); }
.ps-more__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.ps-card { display: grid; gap: 10px; padding: 26px; border-radius: 20px; background: #fff; border: 1px solid var(--line); transition: border-color .3s, transform .3s var(--ease), box-shadow .3s; }
.ps-card:hover { border-color: rgba(226, 117, 58, .35); box-shadow: 0 24px 48px -30px rgba(90, 50, 20, .45); }
.ps-card__meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--muted); }
.ps-card__meta b { font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--copper); }
.ps-card__title { font: 700 20px/1.25 var(--display); letter-spacing: -.025em; }
.ps-card__text { font-size: 15px; line-height: 1.6; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .ps-grid { grid-template-columns: minmax(0, 720px); }
  .ps-toc { position: static; padding: 18px 20px; border-radius: 16px; background: var(--paper); }
  .ps-toc ol { border-left: 0; }
  .ps-toc a { padding-left: 0; border-left: 0; }
  .ps-toc a.is-on { color: var(--copper); }
  .ps-sec { margin-inline: -12px; padding: 12px 12px 6px; border-radius: 14px; }
}
@media (max-width: 640px) {
  .ps-hero { padding-top: 110px; }
  .ps-text { font-size: 17px; }
  .ps-more__grid { grid-template-columns: 1fr; }
  .ps-cta { padding: 22px; }
  .ps-cta__wa { justify-self: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .ps-card { transition: none; }
}
