/* Blog — layered on top of legal.css, which supplies the tokens and nav. The footer is the storefront one; its styles are below. */

/* Article page: a full-bleed gradient banner (label, title, date, intro) above two
   columns — the article and the sticky sidebar — which both start at "On this page". */
.post-page { width: min(100% - 2.5rem, 1120px); margin: 0 auto; padding-top: clamp(2.75rem, 6vw, 4rem); }

.post-banner {
  position: relative;
  overflow: hidden;
  background-color: #2F5443;
  color: #fff;
}
.post-banner__inner {
  position: relative;
  z-index: 3;
  width: min(100% - 2.5rem, 1120px);
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 7rem) 0 clamp(3.5rem, 7vw, 5.5rem);
}
.post-banner .eyebrow { color: #E5E8D2; }
.post-banner .eyebrow a { color: inherit; text-decoration: none; }
.post-banner .eyebrow a:hover { text-decoration: underline; }
.post-banner h1 {
  max-width: 22ch;
  color: #fff;
  font-size: clamp(2.2rem, 5.2vw, 3.6rem);
  text-shadow: 0 2px 24px rgba(20, 38, 30, .28);
}
.post-banner .post-meta { margin: 1.1rem 0 1.6rem; color: rgba(248, 246, 236, .82); }
.post-banner .intro { max-width: 58ch; margin: 0; color: #F8F6EC; }
.post-hero figcaption { margin-top: .75rem; color: var(--muted); font-size: .85rem; }

/* Hero ------------------------------------------------------------------ */
.post-hero { margin: 0 0 2.25rem; }
.post-hero img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: .9rem;
  border: 1px solid var(--line);
}

/* Table of contents ----------------------------------------------------- */
.post-toc {
  margin: 0 0 2.5rem;
  padding: 1.1rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: #fff;
}
.post-toc p {
  margin: 0 0 .55rem;
  color: var(--forest);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.post-toc ul { margin: 0; padding-left: 1.1rem; }
.post-toc li { margin: .3rem 0; font-size: .95rem; }

/* Body ------------------------------------------------------------------ */
.post-body h2 { margin: 2.75rem 0 .7rem; font-size: 1.5rem; letter-spacing: -.02em; }
.post-body h3 { margin: 2rem 0 .5rem; color: var(--ink); font-size: 1.1rem; }
.post-body p { margin: 0 0 1.1rem; }
.post-body ul, .post-body ol { margin: 0 0 1.35rem; padding-left: 1.3rem; }
.post-body li { margin: .45rem 0; }
.post-body hr { height: 1px; margin: 2.5rem 0; border: 0; background: var(--line); }
.post-body code {
  padding: .1em .35em;
  border-radius: .3rem;
  background: #eef1ec;
  font-size: .9em;
}
/* Neutral rule, not the lime. Lime means "buy" on this site — it appears once
   per page, on the CTA button, and a pull quote should not compete with it. */
.post-body blockquote {
  margin: 1.75rem 0;
  padding: .3rem 0 .3rem 1.2rem;
  border-left: 2px solid var(--line);
  color: #35463b;
}
.post-body blockquote p { margin: 0; }

/* FAQ ------------------------------------------------------------------- */
.post-faq { margin-top: 3rem; }
.post-faq h2 { margin-bottom: 1.1rem; font-size: 1.5rem; letter-spacing: -.02em; }
.faq-item {
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item h3 { margin: 0 0 .4rem; color: var(--ink); font-size: 1.02rem; }
.faq-item p { margin: 0; color: #35463b; }

/* Article + sticky sidebar ----------------------------------------------
   The article keeps legal.css's reading styles; the grid only decides where it
   sits. The card inside the aside is what sticks, so the aside can stretch the
   full height of the article and give it a track to travel along. */
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(2.5rem, 5vw, 4.5rem);
}
.post-layout > .legal { width: auto; margin: 0; padding-top: 0; padding-bottom: 0; }
/* legal.css spaces the article from the footer with its own bottom padding;
   moved to the whole layout so a short article with a tall sidebar gets it too. */
.post-layout { padding-bottom: 5rem; }
.post-side__card {
  position: sticky;
  top: 2rem;
  padding: 2rem 1.75rem 1.6rem;
  border-radius: 28px;
  background: #f6ece0;
}
.post-side__eyebrow {
  margin: 0 0 1rem;
  color: #2f7a45;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.post-side__title {
  margin: 0 0 1rem;
  color: var(--ink);
  font-size: 1.75rem;
  line-height: 1.08;
  letter-spacing: -.035em;
}
.post-side__body { margin: 0 0 1.5rem; color: #203127; font-size: .95rem; line-height: 1.6; }
.post-side__btn {
  display: block;
  padding: .95rem 1.25rem;
  border-radius: 999px;
  background: #0e2e18;
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background-color .25s ease;
}
.post-side__btn:hover { background: #17512a; }
.post-side__btn:focus-visible { outline: 2px solid #0e2e18; outline-offset: 3px; }

@media (max-width: 1000px) {
  .post-layout { grid-template-columns: minmax(0, 720px); }
  /* The article's own bottom padding assumes it ends the page; here the card follows it. */
  .post-layout > .legal { padding-bottom: 2rem; }
  .post-side { padding: 0 0 4rem; }
  .post-side__card { position: static; }
}

/* Storefront footer -----------------------------------------------------
   Copied from styles.css (.foot and friends), with its tokens written out:
   the blog loads legal.css, whose token set is smaller and slightly different,
   and loading all of styles.css for a footer would restyle the whole page.
   Keep in step with styles.css. */
.shell { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.brand { display: block; width: min(175px, 44vw); }
.brand picture, .brand img { display: block; width: 100%; height: auto; }
.brand--foot { width: min(220px, 62vw); margin-bottom: 1.1rem; }

.foot {
  padding-block: clamp(3rem, 7vw, 4.5rem) 2rem;
  background: #151810;
  color: rgba(238,244,232,.65);
  font-size: .9rem;
}
.foot__inner { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 2.5rem; }
.foot__brand p { margin: 0; line-height: 1.7; max-width: 34ch; }
.foot__newsletter { align-self: start; }
.foot__newsletter h2 { margin: 0; color: #fbf9f5; font-size: clamp(.98rem, 1.2vw, 1.15rem); font-weight: 600; line-height: 1.3; }
.foot__newsletter p { margin: .5rem 0 .8rem; font-size: .82rem; line-height: 1.5; }
.foot__newsletter-form { display: flex; width: min(100%, 285px); }
.foot__newsletter input {
  min-width: 0; flex: 1; width: 100%; padding: .7rem .8rem;
  border: 1px solid rgba(238,244,232,.3); border-radius: .35rem 0 0 .35rem;
  background: rgba(238,244,232,.06); color: #fbf9f5; font: inherit; outline: none;
}
/* The honeypot field is .sr-only, but `.foot__newsletter input` outranks .sr-only
   and gives it width:100% — an invisible input ~500px past the right edge and a
   horizontal scrollbar. The homepage hides the same bug with overflow-x: clip;
   this fixes it instead. */
.foot__newsletter input.sr-only { width: 1px; height: 1px; padding: 0; border: 0; flex: none; }
.foot__newsletter input::placeholder { color: rgba(238,244,232,.42); }
.foot__newsletter input:focus { border-color: #c9f53f; box-shadow: 0 0 0 3px rgba(201,245,63,.14); }
.foot__newsletter-submit {
  padding: .7rem .85rem; border: 0; border-radius: 0 .35rem .35rem 0;
  background: #c9f53f; color: #07090a; font: inherit; font-size: .78rem; font-weight: 800; cursor: pointer;
}
.foot__newsletter-submit:disabled { opacity: .65; cursor: wait; }
.foot__newsletter-status { min-height: 1.2em; color: #c9f53f; }
.foot__contact { font-style: normal; line-height: 1.8; }
.foot__contact a { color: #c9f53f; text-underline-offset: 3px; }
.foot__legal {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(25rem, 72ch) minmax(0, 1fr);
  align-items: start; gap: 1rem;
  margin-top: 2.75rem; padding-top: 1.75rem; border-top: 1px solid rgba(238,244,232,.12);
  color: rgba(238,244,232,.4); font-size: .74rem; line-height: 1.6;
}
.foot__legal p { margin: 0; max-width: none; }
.foot__legal p:first-child { grid-column: 2; max-width: 72ch; text-align: center; }
.foot__legal-links {
  grid-column: 3; justify-self: end; display: flex; flex-direction: column;
  align-items: flex-end; gap: .35rem; text-align: right; white-space: nowrap;
}
.foot__legal-nav { display: flex; gap: .65rem; }
.foot__legal-links a { color: rgba(238,244,232,.72); text-decoration: underline; text-underline-offset: 3px; }
.foot__legal-links a:hover { color: #c9f53f; }

@media (max-width: 1024px) {
  .foot__inner { grid-template-columns: 1fr 1fr; }
  .foot__brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .foot__legal { grid-template-columns: 1fr; padding-bottom: 30px; }
  .foot__legal p:first-child, .foot__legal-links { grid-column: 1; }
  .foot__legal-links { justify-self: end; }
  .foot__inner { grid-template-columns: 1fr; }
  .foot { padding-bottom: 60px; }
}

/* Related --------------------------------------------------------------- */
/* Tables and figures inside an article. */
.post-table { margin: 1.75rem 0; overflow-x: auto; border: 1px solid #dcd9cf; border-radius: 18px; background: #fff; }
.post-table table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: .92rem; line-height: 1.45; }
.post-table th, .post-table td { padding: .85rem 1rem; text-align: left; vertical-align: top; }
.post-table th { background: #f3f1ea; color: #203127; font-weight: 600; }
.post-table td + td, .post-table th + th { border-left: 1px solid #ece9e1; }
.post-table tbody tr + tr td, .post-table tbody tr:first-child td { border-top: 1px solid #ece9e1; }
.post-figure { margin: 2rem 0; }
.post-figure img { display: block; width: 100%; height: auto; border-radius: 22px; }
.post-sources { margin-top: 3rem; }
.post-sources ul { padding-left: 1.2rem; font-size: .92rem; }
.post-sources li { margin: .4rem 0; }

/* Previous / next under each article: the blog page's list rows, side by side. */
.post-nav { margin-top: 3rem; }
.post-nav h2 { margin: 0 0 1.25rem; }
.post-list--pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.post-list--pair li + li { border-top: 0; border-left: 1px solid #e7e4dc; }
/* Half a column is too narrow for the reading time beside the title, so it
   drops underneath; it stays on the row's right edge by aligning to the end. */
.post-list--pair .post-row {
  height: 100%;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: .9rem;
}
.post-list--pair .post-row__side { align-self: flex-end; }
.post-list--pair .post-row__title { font-size: 1.05rem; }

/* Index listing ---------------------------------------------------------
   The newest three posts as a showcase — the newest on its own hero gradient,
   the next two as white cards beside it — then everything older as a list. */

.blog-index { width: min(100% - 2.5rem, 1180px); }
.blog-index > .eyebrow, .blog-index > h1, .blog-index > .intro { max-width: 62ch; }
.blog-index > .intro { margin-bottom: 2.75rem; }
/* A sentence-length headline needs a smaller scale than legal.css's one-word
   default, or it eats the page. */
.blog-index > h1 {
  max-width: 24ch;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  letter-spacing: -.035em;
}

/* The per-post gradient field, drawn entirely in CSS — no image download.
   It rebuilds the "Matcha cream" template from its six colours:
     Moon Yellow #F8F6EC · Pale Matcha #E5E8D2 · Young Willow #C3D3A8
     Garden Moss #94B37D · Young Willow #5F8A5C · Forest Tea #2F5443
   Layers, top to bottom: the dark Forest Tea pocket the title sits on, the pale
   sweeping arc, a light willow patch, cream along the bottom, and a green base.
   The blur melts them into one soft field. Each post's positions, tilt, hue and
   brightness arrive as custom properties from pipeline/gradients.py; change a
   colour or a layer here and every post follows. Used by the article banner and
   the featured card, so the two always match. */
.post-field {
  --c-cream: #F8F6EC;
  --c-pale: #E5E8D2;
  --c-willow-lt: #C3D3A8;
  --c-moss: #94B37D;
  --c-willow: #5F8A5C;
  --c-forest: #2F5443;
  position: absolute;
  inset: -12%;
  background:
    radial-gradient(ellipse 42% 38% at var(--dx, 45%) var(--dy, 62%),
      var(--c-forest) 0%, rgb(47 84 67 / .75) 40%, transparent 75%),
    radial-gradient(ellipse 58% 70% at var(--ax, 38%) var(--ay, 38%),
      transparent 64%, rgb(229 232 210 / .9) 67%, rgb(195 211 168 / .6) 70%, transparent 78%),
    radial-gradient(ellipse 22% 38% at var(--lx, 82%) var(--ly, 52%),
      var(--c-moss) 0%, transparent 70%),
    radial-gradient(ellipse 55% 30% at 8% 104%, var(--c-pale) 0%, transparent 72%),
    radial-gradient(ellipse 30% 40% at 100% 96%, var(--c-cream) 0%, transparent 70%),
    linear-gradient(var(--fr, 115deg), #45705a 0%, var(--c-willow) 48%, #6d9867 72%, #86a880 100%);
  filter: blur(28px) hue-rotate(var(--fh, 0deg)) brightness(var(--fb, 1));
}
/* Film grain, also code: an SVG noise pattern inline, overlay at 6%. */
.post-banner::after,
.lead-card--featured::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity: .06;
  pointer-events: none;
}

/* Lead grid: featured card left, spanning two rows; two cards stacked right. */
.lead-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 1.25rem;
}
.lead-grid--3 .lead-card--featured { grid-row: span 2; }
.lead-grid--1 { grid-template-columns: 1fr; }

.lead-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  overflow: hidden;
  border: 1px solid #dcd9cf;
  border-radius: 28px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  transition: border-color .3s ease, box-shadow .4s cubic-bezier(.16,1,.3,1), transform .4s cubic-bezier(.16,1,.3,1);
}
.lead-card:hover {
  border-color: #c3d3a8;
  box-shadow: 0 22px 48px -26px rgba(10,25,14,.3);
  transform: translateY(-3px);
}
.lead-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.1rem;
  margin-bottom: 1.1rem;
  color: #203127;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.lead-card__tag { color: #2f7a45; }
.lead-card__title {
  display: block;
  margin-bottom: 1rem;
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.035em;
}
.lead-card__excerpt { color: #203127; font-size: 1rem; line-height: 1.7; }
.lead-card__more {
  margin-top: auto;
  padding-top: 1.5rem;
  color: #2f7a45;
  font-size: .95rem;
  font-weight: 700;
}
.lead-card__more span { display: inline-block; margin-left: .3rem; transition: transform .3s ease; }
.lead-card:hover .lead-card__more span { transform: translate(2px, -2px); }

/* The featured card sits on its article's own hero gradient, under a 50% dark
   overlay so the white type reads anywhere on the field. */
.lead-card--featured {
  min-height: 460px;
  border: 0;
  background: #2F5443;
  color: #fff;
  box-shadow: 0 30px 60px -34px rgba(10,25,14,.55);
}
.lead-card--featured::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(10, 16, 12, .5);
}
.lead-card__inner {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.lead-card__bar {
  display: block;
  width: 64px;
  height: 4px;
  margin-bottom: 2.25rem;
  border-radius: 999px;
  background: var(--lime);
}
.lead-card__eyebrow {
  margin-bottom: 1.1rem;
  color: var(--lime);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.lead-card--featured .lead-card__title {
  max-width: 16ch;
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  line-height: 1.04;
  letter-spacing: -.045em;
}
.lead-card--featured .lead-card__excerpt { max-width: 44ch; color: rgba(248, 246, 236, .78); font-size: 1.05rem; }
.lead-card--featured .lead-card__meta { margin: auto 0 0; padding-top: 2.5rem; color: rgba(248, 246, 236, .7); }
.lead-card--featured .lead-card__tag { color: var(--lime); }

/* Everything older: a plain list, one line per post. */
.post-list {
  margin: 50px 0 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  border: 1px solid #dcd9cf;
  border-radius: 24px;
  background: #fff;
}
.post-list li { margin: 0; max-width: none; }
.post-list li + li { border-top: 1px solid #e7e4dc; }
.post-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.4rem clamp(1.25rem, 2.5vw, 2rem);
  color: var(--ink);
  text-decoration: none;
  transition: background-color .2s ease;
}
.post-row:hover { background: #f7f8f2; }
.post-row__main { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.post-row__meta { color: var(--muted); font-size: .85rem; }
.post-row__tag { color: #203127; font-weight: 600; }
.post-row__title { font-size: 1.2rem; font-weight: 500; line-height: 1.3; letter-spacing: -.015em; }
.post-row__side { flex: none; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.post-row__read { color: #2f7a45; font-weight: 600; }
.post-row__read span { display: inline-block; transition: transform .25s ease; }
.post-row:hover .post-row__read span { transform: translateX(3px); }

@media (max-width: 860px) {
  .lead-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .lead-grid--3 .lead-card--featured { grid-row: auto; }
  .lead-card--featured { min-height: 400px; }
  .post-list--pair { grid-template-columns: 1fr; }
  .post-list--pair li + li { border-left: 0; border-top: 1px solid #e7e4dc; }
}

@media (max-width: 600px) {
  .blog-index { width: min(100% - 2rem, 1180px); }
  .lead-card { border-radius: 22px; }
  .post-row { flex-direction: column; align-items: flex-start; gap: .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .lead-card, .lead-card__more span, .post-row__read span { transition: none; }
  .lead-card:hover { transform: none; }
}
