/* ==========================================================================
   Single post — reading-optimised layout + sticky "On This Page" TOC
   (Not a clone of anything on the main site — designed to feel native to the
   brand: Arial, blue/orange accents, calm grays, generous measure.)
   ========================================================================== */

.pts-post-wrap {
  max-width: var(--pts-container);
  margin-inline: auto;
  padding: 40px var(--pts-gutter) 64px;
}

/* Two columns: article + TOC rail. TOC is 260px, sits on the right. */
.pts-post-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 56px;
  align-items: start;
}

/* ---- Article header ------------------------------------------------------ */
.pts-article { min-width: 0; }
.pts-article__head { max-width: 760px; margin-bottom: 28px; }

.pts-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--pts-blue);
  margin-bottom: 14px;
}
.pts-eyebrow::before {
  content: ""; width: 22px; height: 2px; background: var(--pts-orange); display: inline-block;
}

.pts-article__title {
  font-size: clamp(30px, 4.2vw, 44px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--pts-heading);
  margin: 0 0 18px;
}

.pts-article__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  font-size: 15px; color: var(--pts-gray-500);
  padding-bottom: 22px;
  border-bottom: 1px solid var(--pts-gray-200);
}
.pts-article__meta .pts-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--pts-gray-200); }
.pts-article__author { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--pts-gray-700); }
.pts-article__author img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }

.pts-article__cover {
  margin: 28px 0 8px;
  border-radius: var(--pts-radius);
  overflow: hidden;
  border: 1px solid var(--pts-gray-100);
}
.pts-article__cover img { width: 100%; display: block; }

/* ---- Article body typography -------------------------------------------- */
.pts-content {
  max-width: 760px;         /* comfortable measure ≈ 70 characters */
  font-size: 18px;
  line-height: 1.78;
  color: var(--pts-ink);
}
.pts-content > * { margin-block: 0 0; }
.pts-content > * + * { margin-top: 1.35em; }

.pts-content p { margin: 0; }
.pts-content a {
  color: var(--pts-blue);
  text-decoration: underline;
  text-decoration-color: rgba(37,99,235,.35);
  text-underline-offset: 3px;
  transition: text-decoration-color .15s ease;
}
.pts-content a:hover { text-decoration-color: var(--pts-blue); }

/* Heading hierarchy — H2 gets a brand device, H3 is clearly a step down */
.pts-content h2 {
  font-size: 27px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em;
  color: var(--pts-heading);
  margin-top: 2.2em; margin-bottom: .1em;
  padding-left: 16px;
  border-left: 4px solid var(--pts-orange);
  scroll-margin-top: 130px;   /* clears the sticky header when jumping to anchors */
}
.pts-content h3 {
  font-size: 21px; line-height: 1.3; font-weight: 700;
  color: var(--pts-heading);
  margin-top: 1.8em; margin-bottom: .1em;
  scroll-margin-top: 130px;
}
.pts-content h4 {
  font-size: 18px; font-weight: 700; color: var(--pts-gray-700);
  margin-top: 1.6em; scroll-margin-top: 130px;
}

.pts-content ul, .pts-content ol { padding-left: 1.4em; }
.pts-content li { margin-top: .5em; }
.pts-content li::marker { color: var(--pts-blue); }

.pts-content blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 22px;
  border-left: 4px solid var(--pts-blue);
  color: var(--pts-gray-700); font-style: italic; font-size: 19px;
}
.pts-content img, .pts-content figure { border-radius: var(--pts-radius); }
.pts-content figure { margin-inline: 0; }
.pts-content figcaption { font-size: 14px; color: var(--pts-gray-500); text-align: center; margin-top: 8px; }

.pts-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em; background: var(--pts-gray-100); padding: .15em .4em; border-radius: 4px;
}
.pts-content pre {
  background: #0f172a; color: #e2e8f0; padding: 18px 20px; border-radius: var(--pts-radius);
  overflow-x: auto; font-size: 14.5px; line-height: 1.6;
}
.pts-content pre code { background: none; padding: 0; color: inherit; }

.pts-content table { width: 100%; border-collapse: collapse; font-size: 16px; }
.pts-content th, .pts-content td { border: 1px solid var(--pts-gray-200); padding: 10px 14px; text-align: left; }
.pts-content th { background: var(--pts-gray-50); font-weight: 700; }

.pts-content hr { border: 0; border-top: 1px solid var(--pts-gray-200); margin: 2.4em 0; }

/* Tags + share row under the article */
.pts-article__foot {
  max-width: 760px; margin-top: 40px; padding-top: 24px;
  border-top: 1px solid var(--pts-gray-200);
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
}
.pts-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.pts-tag {
  font-size: 13px; font-weight: 600; color: var(--pts-gray-600);
  background: var(--pts-gray-100); padding: 6px 12px; border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.pts-tag:hover { background: var(--pts-blue); color: #fff; }

/* ==========================================================================
   "On This Page" table of contents  — the signature element
   ========================================================================== */
.pts-toc {
  position: sticky;
  top: 96px;                 /* clears the sticky header */
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  border: 1px solid var(--pts-gray-200);
  border-radius: var(--pts-radius);
  background: var(--pts-white);
  padding: 6px;
}
.pts-toc__head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 10px;
  font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--pts-heading);
}
.pts-toc__head svg { width: 17px; height: 17px; color: var(--pts-blue); }

.pts-toc__list { list-style: none; margin: 0; padding: 4px 0 8px; position: relative; }
/* the vertical rail the active marker rides on */
.pts-toc__list::before {
  content: ""; position: absolute; left: 14px; top: 6px; bottom: 6px;
  width: 2px; background: var(--pts-gray-100); border-radius: 2px;
}
.pts-toc__item { position: relative; }
.pts-toc__item a {
  display: block;
  padding: 7px 14px 7px 26px;
  font-size: 14px; line-height: 1.4;
  color: var(--pts-gray-600);
  border-radius: 0 6px 6px 0;
  transition: color .15s ease, background .15s ease;
}
.pts-toc__item a:hover { color: var(--pts-heading); background: var(--pts-gray-50); }
.pts-toc__item--h3 a { padding-left: 40px; font-size: 13.5px; }

/* active marker */
.pts-toc__item a::before {
  content: ""; position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 0; border-radius: 2px; background: var(--pts-blue);
  transition: height .18s ease;
}
.pts-toc__item.is-active > a { color: var(--pts-blue); font-weight: 700; }
.pts-toc__item.is-active > a::before { height: 20px; }

.pts-toc__progress { display: none; }

/* ---- Mobile: TOC collapses into a disclosure above the article ---------- */
@media (max-width: 1024px) {
  .pts-post-grid { grid-template-columns: 1fr; gap: 0; }
  .pts-toc {
    position: static; max-height: none; overflow: visible;
    order: -1; margin-bottom: 28px;
  }
  .pts-toc__head {
    cursor: pointer; width: 100%;
    justify-content: space-between; padding: 14px;
  }
  .pts-toc__head .pts-toc__chevron { width: 18px; height: 18px; margin-left: auto; transition: transform .2s ease; color: var(--pts-gray-500); }
  .pts-toc[data-collapsed="true"] .pts-toc__chevron { transform: rotate(-90deg); }
  .pts-toc[data-collapsed="true"] .pts-toc__list { display: none; }
}
@media (min-width: 1025px) {
  .pts-toc__chevron { display: none; }
}

/* ---- Related / prev-next ------------------------------------------------- */
.pts-postnav {
  max-width: 760px; margin: 40px 0 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.pts-postnav a {
  border: 1px solid var(--pts-gray-200); border-radius: var(--pts-radius);
  padding: 16px 18px; transition: border-color .15s ease, box-shadow .15s ease;
}
.pts-postnav a:hover { border-color: var(--pts-blue); box-shadow: var(--pts-shadow-sm); }
.pts-postnav span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--pts-gray-500); }
.pts-postnav strong { font-size: 16px; color: var(--pts-heading); font-weight: 600; }
.pts-postnav .pts-postnav--next { text-align: right; }
@media (max-width: 560px) { .pts-postnav { grid-template-columns: 1fr; } }
