/* =========================================================
   BARKER PUBLISHING HOUSE — BLOG section
   Loaded ONLY on /blog/ pages, after golden.css.

   Kept in its own file rather than appended to main.css so a blog
   change can never repaint the 14 existing pages or force a sitewide
   cache bust. It introduces ZERO new tokens, ZERO new fonts and no
   framework — every value below is a var() reference to the existing
   system, which is what lets golden.css re-skin the blog for free.
   ========================================================= */

/* ---------- 1 · Page heads ---------- */
.page-head--post,
.page-head--blog { padding-bottom: clamp(2rem, 4vw, 3.5rem); }

.blog-hub-head { max-width: 800px; }

/* ---------- 2 · Post header meta ---------- */
.post-head { max-width: 860px; }

.post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem;
  margin-top: 1.6rem; padding-top: 1.3rem;
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-sm); color: var(--text-muted);
}
.post-byline { color: var(--ember-700); font-weight: 500; }
.post-meta-sep { opacity: 0.45; }

/* ---------- 3 · Hero ---------- */
.post-hero { margin-top: clamp(2rem, 4vw, 3.2rem); }
.post-hero .clip-frame {
  overflow: hidden;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lift);
}
.post-hero img {
  display: block; width: 100%; height: auto;
  aspect-ratio: 16 / 9; object-fit: cover;
}

/* ---------- 4 · Article body ---------- */
.post-body-zone { padding-top: clamp(3rem, 6vw, 5rem); }

/* 68ch is the readable measure. The body column is centered inside the
   1260px container rather than filling it. */
.post-body {
  max-width: 68ch;
  margin-inline: auto;
  font-size: 1.09rem;
  line-height: 1.75;
  color: var(--text-body);
}

.post-body > * + * { margin-top: 1.45rem; }

.post-body h2 {
  margin-top: clamp(3rem, 5vw, 4.2rem);
  margin-bottom: 0.2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line-soft);
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}
.post-body h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.post-body h3 {
  margin-top: 2.4rem; margin-bottom: 0.1rem;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  color: var(--text-strong);
}

.post-body p { text-wrap: pretty; }

/* Editorial opening: drop cap on the first paragraph only. */
.post-body > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 3.6em; line-height: 0.72; float: left;
  margin: 0.06em 0.11em 0 0;
  color: var(--ember-600); font-weight: 500;
}

.post-body ul.prose,
.post-body ol.prose { padding-left: 1.3rem; }
.post-body ul.prose li,
.post-body ol.prose li { margin-bottom: 0.6rem; padding-left: 0.25rem; }
.post-body ul.prose li::marker { color: var(--ember-500); }
.post-body ol.prose li::marker { color: var(--ember-600); font-weight: 600; }

.post-body a {
  color: var(--ember-700);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--hair-gold);
  transition: color var(--t-fast), text-decoration-color var(--t-fast);
}
.post-body a:hover { color: var(--ember-600); text-decoration-color: var(--ember-500); }
.post-body a:focus-visible { outline: 2px solid var(--ember-500); outline-offset: 3px; border-radius: 2px; }

/* ---------- 5 · Body components ---------- */

/* Checklist — the "give away the secrets" payload block */
.post-checklist {
  margin-block: 2.2rem;
  padding: clamp(1.4rem, 2.4vw, 1.9rem) clamp(1.3rem, 2.2vw, 1.8rem);
  background: var(--paper-0);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-soft);
}
.post-checklist h3 { margin: 0 0 1rem; font-size: var(--fs-h4); color: var(--text-strong); }
.post-checklist ul { list-style: none; padding: 0; margin: 0; }
.post-checklist li {
  position: relative; padding-left: 1.85rem; margin-bottom: 0.75rem;
  font-size: 1.02rem; line-height: 1.6;
}
.post-checklist li:last-child { margin-bottom: 0; }
.post-checklist li::before {
  content: ""; position: absolute; left: 0; top: 0.52em;
  width: 9px; height: 5px;
  border-left: 1.5px solid var(--ember-500);
  border-bottom: 1.5px solid var(--ember-500);
  transform: rotate(-45deg);
}

/* Callout */
.post-callout {
  margin-block: 2.2rem;
  padding: 1.15rem 1.4rem;
  border-left: 2px solid var(--ember-500);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--ember-050);
}
.post-callout p { margin: 0; font-size: 1.02rem; color: var(--text-body); }

/* Spec table — the wrapper scrolls, never the page.
   Breaks out past the 68ch prose measure on wide screens: a 3-column spec table
   does not fit the reading column, and clipping a column is worse than a table
   that is slightly wider than the text around it. Cells wrap rather than nowrap,
   so the table only scrolls when it genuinely cannot fit. */
.post-table-wrap {
  margin-block: 2.2rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--paper-0);
}
@media (min-width: 1100px) {
  .post-table-wrap { margin-inline: -7rem; }
}
.post-table { width: 100%; border-collapse: collapse; font-size: 0.96rem; }
.post-table th,
.post-table td { padding: 0.85rem 1.1rem; text-align: left; vertical-align: top; }
.post-table td:first-child { white-space: nowrap; font-weight: 500; color: var(--text-strong); }
.post-table thead th {
  font-family: var(--font-body); font-size: var(--fs-label);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ember-700); font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.post-table tbody tr + tr td { border-top: 1px solid var(--line-soft); }
.post-table tbody tr:nth-child(even) { background: var(--gallery); }

/* Before/after redline. Ported from service.css, which blog pages do not load. */
.svc-redline {
  margin-block: 2.2rem; padding: 1.1rem 1.3rem;
  border-left: 2px solid var(--oxblood); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--paper-0);
}
.svc-redline p { font-size: 0.94rem; margin: 0.25rem 0; color: var(--text-body); }
.svc-redline del { color: var(--oxblood); text-decoration-color: var(--oxblood); }
.svc-redline ins { color: var(--ember-600); text-decoration: none; font-weight: 500; }

/* ---------- 6 · Mid-article inline CTA (~40% scroll) ---------- */
.post-inline-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1.2rem;
  margin-block: clamp(2.4rem, 4vw, 3.2rem);
  padding: clamp(1.4rem, 2.6vw, 1.9rem);
  border: 1px solid var(--ember-200);
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--ember-050), var(--paper-0) 70%);
  box-shadow: var(--shadow-soft);
}
.post-inline-cta-text {
  flex: 1 1 18rem; margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.9vw, 1.3rem);
  line-height: 1.3; letter-spacing: -0.01em;
  color: var(--text-strong);
}
.post-inline-cta .btn { flex: 0 0 auto; }

/* ---------- 7 · Card grid (matches .service-card language) ---------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}

.blog-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper-0);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  transition: transform var(--t-med) var(--ease-out),
              border-color var(--t-med),
              box-shadow var(--t-med);
}
.blog-card::before {
  content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%; z-index: 2;
  background: linear-gradient(90deg, var(--ember-500), var(--ember-300));
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-med) var(--ease-out);
}
.blog-card:hover { transform: translateY(-6px); border-color: var(--ember-200); box-shadow: var(--shadow-lift); }
.blog-card:hover::before { transform: scaleX(1); }
.blog-card:focus-visible { outline: 2px solid var(--ember-500); outline-offset: 3px; }

.blog-card-media { overflow: hidden; background: var(--paper-100); }
.blog-card-media img {
  display: block; width: 100%; height: auto;
  aspect-ratio: 16 / 9; object-fit: cover;
  transition: transform var(--t-slow) var(--ease-out);
}
.blog-card:hover .blog-card-media img { transform: scale(1.04); }

.blog-card-body {
  display: flex; flex-direction: column; flex-grow: 1;
  padding: clamp(1.35rem, 2.2vw, 1.75rem);
}
.blog-card-body .eyebrow { margin-bottom: 0.85rem; }
.blog-card-title {
  font-size: clamp(1.18rem, 1.9vw, 1.42rem);
  line-height: 1.18; margin-bottom: 0.65rem;
  color: var(--text-strong);
  transition: color var(--t-fast);
}
.blog-card:hover .blog-card-title { color: var(--ember-700); }
.blog-card-dek {
  font-size: var(--fs-sm); line-height: 1.6;
  color: var(--text-muted); flex-grow: 1;
}
.blog-card-meta {
  display: flex; align-items: center; gap: 0.5rem;
  margin-top: 1.3rem; padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.82rem; color: var(--text-muted);
}

/* Featured card: image beside copy instead of above it */
.blog-card.span-2 { grid-column: span 2; }
@media (min-width: 901px) {
  .blog-card.span-2 { flex-direction: row; }
  .blog-card.span-2 .blog-card-media { flex: 0 0 46%; }
  .blog-card.span-2 .blog-card-media img { height: 100%; aspect-ratio: auto; }
  .blog-card.span-2 .blog-card-body { justify-content: center; }
  .blog-card.span-2 .blog-card-title { font-size: clamp(1.5rem, 2.4vw, 1.95rem); }
  /* The featured card is as tall as the two rows beside it. Letting the dek grow
     (which is what pins the meta row to the bottom of a normal card) strands the
     copy at the top with a large void beneath it, so release it here and let the
     block centre as a group. */
  .blog-card.span-2 .blog-card-dek { flex-grow: 0; }
  .blog-card.span-2 .blog-card-meta { margin-top: 1.6rem; }
}

/* ---------- 8 · Category nav ---------- */
.blog-cats {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-top: clamp(2rem, 4vw, 2.8rem);
}
.blog-cats a {
  padding: 0.5rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm); color: var(--text-body);
  transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast);
}
.blog-cats a:hover { color: var(--ember-700); border-color: var(--ember-300); background: var(--ember-050); }
.blog-cats a:focus-visible { outline: 2px solid var(--ember-500); outline-offset: 2px; }
.blog-cats a.is-active {
  color: var(--paper-0);
  background: var(--ember-600);
  border-color: var(--ember-600);
}

/* ---------- 9 · Pagination ---------- */
.blog-pagination {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 1.4rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line-soft);
}
.blog-pagination a {
  color: var(--ember-700); font-size: var(--fs-sm); font-weight: 500;
  transition: color var(--t-fast);
}
.blog-pagination a:hover { color: var(--ember-600); }
.blog-pagination a:focus-visible { outline: 2px solid var(--ember-500); outline-offset: 3px; border-radius: 2px; }
.blog-pagination-count { font-size: var(--fs-sm); color: var(--text-muted); }

.blog-empty {
  max-width: var(--container-narrow); margin-inline: auto;
  text-align: center; color: var(--text-muted); font-size: var(--fs-lead);
}

/* ---------- 10 · Responsive ---------- */
@media (max-width: 900px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-card.span-2 { grid-column: span 2; }
  .post-body { font-size: 1.05rem; }
  .post-inline-cta { flex-direction: column; align-items: flex-start; }
  .post-inline-cta .btn { width: 100%; justify-content: center; }
}

@media (max-width: 560px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-card.span-2 { grid-column: span 1; }
  .post-body > p:first-of-type::first-letter { font-size: 3em; }
  .post-meta { gap: 0.4rem; font-size: 0.85rem; }
  .post-table th,
  .post-table td { padding: 0.7rem 0.85rem; }
}

/* ---------- 11 · Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .blog-card,
  .blog-card-media img,
  .blog-card::before { transition: none; }
  .blog-card:hover { transform: none; }
  .blog-card:hover .blog-card-media img { transform: none; }
}
