/* Blog-only styles, layered on top of the site's stylesheet.
 *
 * Kept separate so the marketing pages cannot be changed by accident: the
 * blog needs long-form reading rules the landing page has no use for.
 */

.blog-hero { padding-bottom: 8px; }
.blog-hero h1 { margin-bottom: 6px; }

/* --- index --- */
.idx { list-style: none; padding: 0; margin: 24px 0 64px; }
.idx > li {
  padding: 20px 0;
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}
.idx > li:first-child { border-top: 1px solid rgba(0, 0, 0, .08); }
.idx-title {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 4px;
}
.idx-desc { margin: 4px 0 6px; opacity: .82; }
.idx-date { font-size: .82rem; opacity: .6; }

/* --- article ---
   A measure of roughly 68 characters. Long-form text set to the full width of
   a landing page is measurably harder to read, and the whole point of these
   pages is that somebody reads them to the end. */
.post { max-width: 68ch; margin: 0 auto 72px; }
.post h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  line-height: 1.15;
  margin: 8px 0 10px;
}
.post-back { font-size: .9rem; margin: 24px 0 0; }
.post-meta { font-size: .85rem; opacity: .6; margin: 0 0 28px; }
/* The name carries a little more weight than the date beside it: a reader
   deciding whether to trust an article looks for who wrote it. */
/* The byline is a link now, but it should not shout: a coloured link in the
   middle of a grey meta line reads as a call to action, and this one is
   attribution. Inherits the line's colour, and only underlines on hover. */
.post-meta .author {
  font-weight: 600; opacity: .85;
  color: inherit; text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, .18);
}
.post-meta .author:hover { color: #c8563a; border-bottom-color: #c8563a; }

/* The hero image sits between the byline and the body. width and height are
   set on the <img> so the browser reserves the right box before the file
   arrives: without them the text below jumps down on load, which is the
   layout shift Core Web Vitals measures. aspect-ratio keeps that box correct
   once CSS takes over from the attributes. */
.post-hero {
  margin: 0 0 32px; border-radius: 14px; overflow: hidden;
  background: var(--cream-card, #ece5d8);
}
.post-hero img {
  display: block; width: 100%; height: auto; aspect-ratio: auto;
  object-fit: contain;
}

.post-body { font-size: 1.05rem; line-height: 1.72; }
.post-body h2 {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.5rem;
  margin: 44px 0 12px;
  line-height: 1.25;
}
.post-body h3 { font-size: 1.15rem; margin: 32px 0 8px; }
.post-body p { margin: 0 0 18px; }
.post-body ul, .post-body ol { margin: 0 0 18px; padding-left: 24px; }
.post-body li { margin-bottom: 8px; }
.post-body blockquote {
  margin: 24px 0;
  padding: 2px 0 2px 18px;
  border-left: 3px solid #c8563a;
  opacity: .9;
}
.post-body code {
  font-size: .92em;
  background: rgba(0, 0, 0, .05);
  padding: 1px 5px;
  border-radius: 4px;
}
.post-body pre {
  background: rgba(0, 0, 0, .05);
  padding: 14px 16px;
  border-radius: 8px;
  overflow-x: auto;
}
.post-body pre code { background: none; padding: 0; }

/* Wide tables scroll inside their own box rather than pushing the page
   sideways on a phone. */
.tablewrap { overflow-x: auto; margin: 0 0 22px; }
.post-body table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.post-body th, .post-body td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, .1);
}
.post-body th { font-weight: 700; }

.post-cta {
  margin-top: 48px;
  padding: 22px 24px;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 12px;
  background: rgba(200, 86, 58, .05);
}
.post-cta p { margin: 0 0 12px; }
.post-cta p:last-child { margin: 0; }

/* The call to action was never actually styled as a button.
 *
 * It carries class="cta", which this stylesheet did not define, so it fell
 * back to the plain link colour and sat as brick-on-brick-tint text: measured
 * at 1.37:1 against the panel behind it, far under the 4.5 it needs and close
 * to invisible. The one link on every article that exists to be clicked was
 * the least readable thing on the page.
 *
 * Same shape as the site's .btn so the blog and the landing page agree, and
 * on the brand fill, where white text measures above AA. */
.post-cta .cta {
  display: inline-block;
  background: var(--brick);
  color: #fff;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 12px;
}
.post-cta .cta:hover { background: var(--brick-dark); color: #fff; text-decoration: none; }

/* The lead-in sits on the tinted panel, where the body grey falls to 4.12:1.
   `strong` is named explicitly: it carries its own colour rule elsewhere, so
   setting the paragraph alone leaves the bold product name below AA. */
.post-cta p,
.post-cta strong { color: var(--ink); }

@media (prefers-color-scheme: dark) {
  .idx > li, .idx > li:first-child,
  .post-body th, .post-body td { border-color: rgba(255, 255, 255, .12); }
  .post-body code, .post-body pre { background: rgba(255, 255, 255, .07); }
  .post-cta { border-color: rgba(255, 255, 255, .14); background: rgba(200, 86, 58, .1); }
}

/* === the blog, brought onto the site's language ==========================
   Everything below overrides the rules above rather than replacing them in
   place, for one reason: those rules and their comments record why the blog
   reads the way it does -- the 68-character measure, the byline that a reader
   can check, the table that scrolls instead of squashing. None of that
   changes here. What changes is the surface it sits on. */

/* --- the index ---------------------------------------------------------- */
.blog-head .band-in { max-width: var(--page); padding-top: 64px; padding-bottom: 64px; }
.blog-head h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.05; margin: 0 0 14px; }
.blog-head .sub { font-size: 1.08rem; line-height: 1.6; margin: 0; max-width: 34em; }

.idx { list-style: none; padding: 0; margin: 0 0 40px; border-top: 2px solid var(--ink); }
.idx > li { border: 0; border-bottom: 2px solid var(--ink); padding: 0; }
.idx > li:first-child { border-top: 0; }
/* The whole row is the link, not just the title: a 40px-tall target in the
   middle of a full-width row is a needle to hit on a phone. */
.idx > li > a {
  display: flex; align-items: center; gap: 20px;
  padding: 24px 4px; color: inherit; font-weight: 400; text-decoration: none;
}
.idx > li > a:hover, .idx > li > a:focus-visible {
  background: var(--cream-card); text-decoration: none;
}
.idx-date {
  flex: 0 0 8.5em; font-family: Inter, -apple-system, sans-serif;
  font-size: .72rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--brick-dark); opacity: 1;
}
.idx-text { flex: 1 1 auto; min-width: 0; }
.idx-title {
  display: block; font-family: Fraunces, Georgia, serif;
  font-size: 1.3rem; font-weight: 600; line-height: 1.25; color: var(--ink);
  border: 0;
}
.idx-desc {
  display: block; margin: 6px 0 0; opacity: 1;
  font-size: .92rem; line-height: 1.5; color: var(--ink-soft);
}
.idx > li > a svg { flex: 0 0 auto; color: var(--ink); }
@media (max-width: 620px) {
  .idx > li > a { flex-wrap: wrap; gap: 8px 14px; padding: 20px 4px; }
  .idx-date { flex-basis: 100%; }
  .idx > li > a svg { display: none; }
}

/* --- the article -------------------------------------------------------- */
.post-head .band-in { max-width: var(--page); padding-top: 40px; padding-bottom: 56px; }
.post-head .post-back { font-size: .85rem; margin: 0 0 26px; font-weight: 600; }
.post-head .post-back a { color: var(--score-mid); }
.post-head h1 {
  font-size: clamp(2rem, 5vw, 3rem); line-height: 1.08; margin: 0 0 18px;
  letter-spacing: -0.01em;
}
.post-head .post-meta { font-size: .88rem; opacity: 1; margin: 0; }
.post-head .post-meta .author { color: var(--score-mid); border-bottom-color: currentColor; }
.post-head .post-meta .author:hover { color: #fff; border-bottom-color: #fff; }

/* The measure stays. A long article is read, not scanned, and 68 characters is
   what makes that possible; no amount of graphic language is worth losing it. */
.post { max-width: 68ch; margin: 0 auto 8px; padding: 0; }
.post-body h2 { font-family: Fraunces, Georgia, serif; }
.post-body blockquote {
  border-left: 3px solid var(--ink); background: var(--paper);
  padding: 14px 18px; border-radius: 0;
}
.post-hero { margin: 0; }
.post-hero img { display: block; width: 100%; height: auto; border-radius: 0; }

/* The closing call to action, as a band rather than a rounded panel. */
.post-cta { margin: 0; padding: 0; background: var(--brick); border: 0; border-radius: 0; }
.post-cta .band-in { max-width: var(--page); padding-top: 48px; padding-bottom: 48px; }
.post-cta p { margin: 0 0 16px; color: #fff; font-size: 1.05rem; }
.post-cta p:last-child { margin: 0; }
.post-cta strong { color: #fff; }
.post-cta .cta {
  display: inline-block; background: #fff; color: var(--brick);
  border: 2px solid #fff; border-radius: 0; padding: 12px 22px;
  font-weight: 700; text-decoration: none;
}
.post-cta .cta:hover {
  background: transparent; color: #fff; text-decoration: none;
}

/* --- how far through you are -------------------------------------------- */
/* The one piece of gamification an article earns: it answers "how much is
   left", which is a question the reader actually has. Fixed under the header,
   2px, and it does nothing at all under reduced motion. */
.read-bar {
  position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 60;
  background: transparent; pointer-events: none;
}
.read-bar > i {
  display: block; height: 100%; background: var(--score-mid);
  transform: scaleX(0); transform-origin: 0 50%;
}
@media (prefers-reduced-motion: reduce) { .read-bar { display: none; } }
@media print { .read-bar { display: none; } }

/* --- reveal on scroll, same contract as the home page -------------------- */
[data-reveal] { transition: opacity .5s ease, transform .5s ease; }
.js-reveal [data-reveal]:not(.seen) { opacity: 0; transform: translateY(14px); }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { transition: none; }
  .js-reveal [data-reveal]:not(.seen) { opacity: 1; transform: none; }
}
@media print { .js-reveal [data-reveal]:not(.seen) { opacity: 1; transform: none; } }
