/* ==========================================================================
   Blog article
   Loaded only by blog_post.php, via the $fm_extra_css hook in the header.
   Uses the design tokens from style.css — no new colours are invented here.
   ========================================================================== */

/* ---- hero --------------------------------------------------------------- */

.post-hero { padding: clamp(2rem, 5vw, 3.25rem) 0 0; }

.post-hero .post-meta-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem .9rem;
  margin: 1.35rem 0 1.1rem;
}

.post-cat {
  display: inline-flex;
  align-items: center;
  padding: .34rem .8rem;
  border-radius: var(--r-pill);
  background: var(--violet-050);
  border: 1px solid var(--violet-100);
  color: var(--violet-700);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
}

.post-cat:hover { background: var(--violet-100); }

.post-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-30); }

.post-meta-top time,
.post-readtime { font-size: .88rem; color: var(--ink-50); font-weight: 500; }

/* Full container width — no measure cap. A headline is display type, not body
   copy, so the reading-width limit that helps paragraphs only forced an
   unnecessary wrap here.
   style.css sets text-wrap: balance on every h1–h4. That evens the line lengths,
   so each line stops short of the container and the heading still reads as
   capped even with no max-width. Overridden here for the article title only —
   the rest of the site keeps the balanced headings. */
.post-hero h1 {
  font-size: clamp(1.95rem, 4.6vw, 3.35rem);
  line-height: 1.1;
  letter-spacing: -.025em;
  margin: 0 0 1.1rem;
  text-wrap: wrap;
}

.post-hero .post-standfirst {
  max-width: 62ch;
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  line-height: 1.6;
  color: var(--ink-70);
  margin: 0;
}

/* ---- author row --------------------------------------------------------- */

.post-byline {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.post-byline .avatar {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--soft-2);
}

.post-byline b { display: block; font-size: .95rem; }
.post-byline span { display: block; font-size: .84rem; color: var(--ink-50); }

/* ---- cover image -------------------------------------------------------- */

.post-cover {
  margin: clamp(1.75rem, 3.5vw, 2.75rem) 0 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--soft);
}

/* Width and height are always set on the img, so the space is reserved
   before the file arrives and the text below never jumps. */
.post-cover img { display: block; width: 100%; height: auto; }

/* ---- body layout -------------------------------------------------------- */

.post-body { padding: clamp(2.25rem, 4.5vw, 3.5rem) 0 0; }

.post-layout { display: grid; gap: clamp(2rem, 4vw, 3rem); }

@media (min-width: 1040px) {
  .post-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: clamp(2.5rem, 5vw, 4.5rem);
    align-items: start;
  }
}

.post-content { max-width: 72ch; min-width: 0; }

/* ---- prose -------------------------------------------------------------- */

.post-content > * + * { margin-top: 1.15rem; }

.post-content p {
  font-size: 1.045rem;
  line-height: 1.75;
  color: var(--ink-70);
}

.post-content h2 {
  margin-top: 2.6rem;
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  line-height: 1.25;
  letter-spacing: -.015em;
  scroll-margin-top: 110px;
}

.post-content h3 {
  margin-top: 1.9rem;
  font-size: clamp(1.12rem, 1.9vw, 1.32rem);
  scroll-margin-top: 110px;
}

.post-content ul,
.post-content ol { display: grid; gap: .6rem; padding-left: 0; }

.post-content ul { list-style: none; }

.post-content ul li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--ink-70);
  line-height: 1.65;
}

.post-content ul li::before {
  content: "";
  position: absolute;
  left: .3rem;
  top: .62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--violet);
}

.post-content ol { padding-left: 1.3rem; }
.post-content ol li { color: var(--ink-70); line-height: 1.65; padding-left: .3rem; }

.post-content a {
  color: var(--violet-700);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.post-content a:hover { color: var(--violet-900); }

.post-content strong { color: var(--ink); font-weight: 700; }

.post-content blockquote {
  margin: 2rem 0;
  padding: 1.35rem 1.5rem;
  border-left: 3px solid var(--violet);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--soft);
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--ink);
}

.post-content blockquote p { color: inherit; font-size: inherit; }
.post-content blockquote > *:first-child { margin-top: 0; }

/* Callout — for the "what this means for you" asides. */
.post-note {
  margin: 2rem 0;
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.post-note b {
  display: block;
  margin-bottom: .4rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--violet-700);
}

.post-note p { margin: 0; font-size: .97rem; }

/* Comparison tables need to scroll on their own rather than widen the page. */
.post-table { margin: 2rem 0; overflow-x: auto; }

.post-table table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: .95rem;
}

.post-table th,
.post-table td {
  padding: .8rem .9rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.post-table thead th {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-50);
  border-bottom: 1px solid var(--line);
}

.post-table td { color: var(--ink-70); }
.post-table tbody tr:last-child td { border-bottom: 0; }

/* ---- FAQ ---------------------------------------------------------------- */

.post-faq { margin-top: 2.75rem; }

.post-faq > h2 { margin-top: 0; }

.post-faq details {
  border-bottom: 1px solid var(--line);
}

.post-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 0;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--ink);
}

.post-faq summary::-webkit-details-marker { display: none; }

.post-faq summary i {
  flex: none;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ink-30);
  border-bottom: 2px solid var(--ink-30);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .25s var(--ease);
}

.post-faq details[open] summary i { transform: rotate(-135deg) translate(-2px, -2px); }

.post-faq .faq-a { padding: 0 0 1.15rem; }
.post-faq .faq-a p { margin: 0; font-size: .98rem; }

/* ---- sidebar ------------------------------------------------------------ */

@media (min-width: 1040px) {
  .post-aside { position: sticky; top: 100px; display: grid; gap: 1.15rem; }
}

.post-aside { display: grid; gap: 1.15rem; }

.aside-card {
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
}

.aside-card h2 {
  margin: 0 0 .9rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-50);
}

.aside-card ul { display: grid; gap: .1rem; margin: 0; padding: 0; list-style: none; }

.aside-card ul a {
  display: block;
  padding: .45rem 0 .45rem .8rem;
  border-left: 2px solid var(--line);
  font-size: .9rem;
  line-height: 1.45;
  color: var(--ink-50);
  text-decoration: none;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}

.aside-card ul a:hover { color: var(--ink); border-left-color: var(--violet-100); }

.aside-card ul a.is-current {
  color: var(--violet-700);
  border-left-color: var(--violet);
  font-weight: 600;
}

/* Course promo card */
.aside-cta {
  padding: 1.5rem 1.35rem;
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--paper);
}

.aside-cta h2 { color: rgba(255, 255, 255, .55); }

.aside-cta p {
  margin: 0 0 1.1rem;
  font-size: .94rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, .72);
}

.aside-cta .btn { width: 100%; justify-content: center; }

/* ---- author box + share ------------------------------------------------- */

.post-author-box {
  display: flex;
  flex-wrap: wrap;
  gap: 1.15rem;
  align-items: flex-start;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.post-author-box img {
  width: 60px;
  height: 60px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--soft-2);
}

.post-author-box .who { flex: 1 1 16rem; min-width: 0; }
.post-author-box b { display: block; margin-bottom: .3rem; }
.post-author-box p { margin: 0; font-size: .93rem; line-height: 1.6; color: var(--ink-70); }

/* ---- related ------------------------------------------------------------ */

.post-related { padding: clamp(3rem, 6vw, 5rem) 0; }

.post-related .rel-grid {
  display: grid;
  gap: 1.35rem;
  grid-template-columns: 1fr;
}

@media (min-width: 700px)  { .post-related .rel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .post-related .rel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.rel-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--paper);
  text-decoration: none;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}

.rel-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.rel-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }

.rel-card .rel-in { padding: 1.15rem 1.2rem 1.35rem; }

.rel-card .rel-cat {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--violet-700);
}

.rel-card h3 {
  margin: .45rem 0 .5rem;
  font-size: 1.03rem;
  line-height: 1.35;
  color: var(--ink);
}

.rel-card p { margin: 0; font-size: .9rem; line-height: 1.55; color: var(--ink-50); }

/* ---- print -------------------------------------------------------------- */

@media print {
  .post-aside, .post-related, .post-cover { display: none; }
  .post-content { max-width: none; }
}
