/* ------------------------------------------------------------------
   Blog and article styles.

   Sits on top of styles.css and uses its tokens, its .site-header,
   .footer, .page-head, .wave, .tag and .btn-mint.

   Nothing decorative that costs scroll. The page head is compact, the
   first card or paragraph is on screen without scrolling, and the
   article uses the width: a reading measure on the left and a rail on
   the right that keeps the download in reach.
   ------------------------------------------------------------------ */

/* ------------------------------------------------------- blog index */

.blog-index { background: var(--page); }

.blog-index__inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(28px, 3.5vw, 44px) 20px clamp(56px, 7vw, 88px);
}

.post-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* The grid item is the <li>, so the span goes there. */
.post-grid > li:first-child { grid-column: 1 / -1; }

.post-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  text-decoration: none;
  transition:
    border-color 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out);
}
.post-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 1px 2px rgb(20 24 31 / 0.05), 0 10px 24px -14px rgb(20 24 31 / 0.22);
}
.post-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.post-card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.post-card__date {
  font-size: 13px;
  color: var(--ink-faint);
}

.post-card__title {
  margin: 0;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  text-wrap: balance;
  transition: color 0.3s var(--ease-out);
}
.post-card:hover .post-card__title { color: var(--accent); }

.post-card__desc {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.post-card__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--accent);
}

/* The pillar guide, laid out as a feature on a wide screen. */
.post-card--lead {
  background: var(--brand-wash);
  border-color: #D6EDE0;
  padding: clamp(24px, 3.5vw, 36px);
}
.post-card--lead .post-card__title { font-size: clamp(24px, 3vw, 32px); }

@media (min-width: 860px) {
  .post-card--lead {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    column-gap: clamp(32px, 5vw, 72px);
    row-gap: 14px;
    align-items: start;
  }
  .post-card--lead .post-card__top { grid-column: 1 / -1; }
  .post-card--lead .post-card__title { grid-column: 1; grid-row: 2 / span 2; align-self: center; }
  .post-card--lead .post-card__desc { grid-column: 2; grid-row: 2; font-size: 16.5px; }
  .post-card--lead .post-card__more { grid-column: 2; grid-row: 3; margin-top: 0; padding-top: 0; }
}

/* --------------------------------------------------------- the post */

.post { background: var(--page); }

.post__inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(28px, 3.5vw, 44px) 20px clamp(56px, 7vw, 88px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
}

@media (min-width: 960px) {
  .post__inner {
    grid-template-columns: minmax(0, 680px) 320px;
    justify-content: space-between;
    column-gap: clamp(40px, 5vw, 80px);
    align-items: start;
  }
  .post__aside {
    position: sticky;
    top: 96px;
  }
}

.post__body {
  font-size: 17.5px;
  line-height: 1.68;
  color: var(--ink-soft);
}

.post__body > p { margin: 0 0 22px; }

.post__body > p:first-child {
  font-size: 19.5px;
  line-height: 1.55;
  color: var(--ink);
}

.post__body h2 {
  margin: 40px 0 14px;
  font-family: var(--display);
  font-size: clamp(23px, 2.8vw, 29px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--ink);
  scroll-margin-top: 100px;
}

.post__body h3 {
  margin: 30px 0 10px;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
}

.post__body ul,
.post__body ol {
  margin: 0 0 22px;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.post__body li { position: relative; padding-left: 26px; }

.post__body ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--brand-mint);
}

.post__body ol { counter-reset: post-ol; }
.post__body ol > li { counter-increment: post-ol; }
.post__body ol > li::before {
  content: counter(post-ol);
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.post__body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(10, 115, 88, 0.35);
}
.post__body a:hover { text-decoration-color: var(--accent); }
.post__body a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.post__body strong { color: var(--ink); font-weight: 600; }

/* ------------------------------------------- the sample email block

   Every post carries an example first email. It is shown as a message,
   not an indented quote, because that is the product's argument made
   visible. The first paragraph of the quote is always the subject.
   ------------------------------------------------------------------ */

.post__body blockquote {
  margin: 28px 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.post__body blockquote > p {
  margin: 0;
  padding: 0 20px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--ink-soft);
}
.post__body blockquote > p:first-child {
  padding: 12px 20px;
  background: var(--brand-wash);
  border-bottom: 1px solid var(--line);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
}
.post__body blockquote > p:nth-child(2) { padding-top: 18px; }
.post__body blockquote > p:last-child { padding-bottom: 18px; color: var(--ink-faint); }
.post__body blockquote > p + p { margin-top: 12px; }

/* -------------------------------------------------------- the rail */

.post__aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rail-card {
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.rail-card--download {
  background: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
}

.rail-card__title {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.rail-card--download .rail-card__title { color: #FFFFFF; }

.rail-card__text {
  margin: 0 0 14px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.rail-card--download .rail-card__text { color: var(--brand-muted); }

.rail-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-control);
  background: var(--brand-mint);
  color: var(--brand);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.3s var(--ease-out);
}
.rail-card__btn:hover { background: var(--brand-mint-hover); color: var(--brand); }
.rail-card__btn:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }

.rail-card__btn--ghost {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--line-strong);
}
.rail-card__btn--ghost:hover { background: var(--brand-wash); border-color: var(--accent); color: var(--accent); }
.rail-card__btn--ghost:focus-visible { outline: 2px solid var(--accent); }

.rail-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.rail-card__list li + li { border-top: 1px solid var(--line-soft); }
.rail-card__list a {
  display: block;
  padding: 10px 0;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.3s var(--ease-out);
}
.rail-card__list a:hover { color: var(--accent); }
.rail-card__list a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* On a phone the rail follows the title, download card only, and the
   related posts and generator link reappear at the foot of the text. */
.post__foot { display: none; flex-direction: column; gap: 14px; margin-top: 8px; }

@media (max-width: 959px) {
  .post__aside { order: -1; }
  .post__aside .rail-card:not(.rail-card--download) { display: none; }
  .post__foot { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  .post-card, .post-card__title, .rail-card__btn { transition: none; }
}

/* The grid column that holds the text. min-width keeps a long word or a
   wide code line from stretching the column past its track. */
.post__main { min-width: 0; }

/* A table in a policy: the data processing agreement lists what is
   processed as one. Plain rows, the label column narrow. */
.post__body table { width: 100%; margin: 1.5rem 0; border-collapse: collapse; font-size: 0.95em; }
.post__body th, .post__body td { padding: 0.65rem 0.75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line, #e2eae6); }
.post__body th { width: 9.5rem; font-weight: 600; color: var(--ink, #0c1f1b); }
