/* ============================================================
   Blog — index + article pages.
   Builds on styles.css (same tokens, same nav/footer).
   ============================================================ */

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

.blog { padding: clamp(48px, 7vw, 92px) clamp(16px, 4vw, 34px) clamp(64px, 8vw, 104px); }

.blog__head { max-width: 760px; margin: 0 auto clamp(38px, 5vw, 60px); text-align: center; }
.blog__head h1 { font-size: clamp(38px, 6vw, 62px); color: var(--brand); margin-bottom: 16px; }
.blog__intro { margin: 0; color: var(--ink-soft); font-size: 17px; }

.blog__grid {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; gap: clamp(18px, 2.4vw, 28px);
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
}

.blog__empty {
  max-width: 520px; margin: 0 auto; text-align: center;
  color: var(--ink-soft); font-size: 17px;
}
.blog__empty a { color: var(--brand); font-weight: 700; }

.pcard {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  transition: border-color .2s;
}
.pcard:hover { border-color: var(--brand-lt); }
.pcard__link { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%; }

.pcard__media { overflow: hidden; background: var(--bg-warm); }
.pcard__media img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

.pcard__body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.pcard__title { font-size: 21px; font-weight: 800; color: var(--brand); line-height: 1.3; }
.pcard__desc { margin: 0; font-size: 15.2px; color: var(--ink); line-height: 1.62; }
.pcard__meta {
  margin: auto 0 0; padding-top: 12px; display: flex; flex-wrap: wrap; gap: 8px;
  font-size: 13.4px; color: var(--ink-soft);
}

/* ---------- article ---------- */

.post { padding: clamp(34px, 5vw, 64px) clamp(16px, 4vw, 34px) clamp(56px, 7vw, 92px); }

.post > article { max-width: 760px; margin: 0 auto; }

.post__head { margin-bottom: clamp(26px, 4vw, 40px); }
.post__back {
  display: inline-block; margin-bottom: 20px; text-decoration: none;
  font-size: 14.5px; font-weight: 700; color: var(--ink-soft);
  transition: color .2s;
}
.post__back:hover { color: var(--brand); }

.post__head h1 {
  font-size: clamp(31px, 5vw, 50px); color: var(--brand);
  line-height: 1.2; margin-bottom: 16px;
}
.post__meta {
  margin: 0; display: flex; flex-wrap: wrap; gap: 8px;
  font-size: 14.5px; color: var(--ink-soft);
}
.post__lede {
  margin: 20px 0 0; font-size: 18.5px; line-height: 1.68;
  color: var(--ink-soft); font-weight: 300;
  padding-inline-start: 16px; border-inline-start: 3px solid var(--brand-lt);
}

.post__hero {
  margin: clamp(26px, 4vw, 40px) auto; max-width: 760px;
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow);
}
.post__hero img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

/* --- the article body is publisher HTML; style it generically --- */

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

.post__body > * { max-width: 760px; margin-inline: auto; }

.post__body h2 {
  font-size: clamp(25px, 3.4vw, 33px); color: var(--brand);
  margin: 1.9em 0 .55em; line-height: 1.28;
}
.post__body h3 {
  font-size: clamp(20px, 2.6vw, 24px); color: var(--ink);
  margin: 1.6em 0 .45em; font-weight: 700;
}
.post__body h4 { font-size: 18.5px; margin: 1.4em 0 .4em; font-weight: 700; }

.post__body p { margin: 0 0 1.15em; }

.post__body a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.post__body a:hover { color: var(--brand-lt); }

.post__body ul, .post__body ol { margin: 0 0 1.25em; padding-inline-start: 1.4em; }
.post__body li { margin-bottom: .5em; }

.post__body img, .post__body video {
  max-width: 100%; height: auto; border-radius: var(--r);
  margin: 1.6em auto; box-shadow: var(--shadow);
}

.post__body figure { margin: 1.7em auto; }
.post__body figcaption {
  margin-top: 9px; font-size: 14px; color: var(--ink-soft);
  text-align: center; font-style: italic;
}

.post__body blockquote {
  margin: 1.7em 0; padding: 4px 20px;
  border-inline-start: 3px solid var(--brand-lt);
  color: var(--ink-soft); font-size: 18.5px; font-weight: 300;
}

.post__body pre {
  background: var(--panel); border-radius: var(--r); padding: 16px 18px;
  overflow-x: auto; direction: ltr; text-align: start;
  font-size: 14.5px; line-height: 1.6;
}
.post__body code {
  background: var(--panel); border-radius: 5px; padding: .12em .38em;
  font-size: .9em; direction: ltr; unicode-bidi: embed;
}
.post__body pre code { background: none; padding: 0; }

/* tables can be wide — let them scroll rather than push the page sideways */
.post__body table {
  width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 15.5px;
  display: block; overflow-x: auto;
}
.post__body th, .post__body td {
  border: 1px solid var(--line); padding: 9px 13px; text-align: start;
}
.post__body th { background: var(--panel); font-weight: 700; }

.post__body hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }

.post__tags {
  max-width: 760px; margin: clamp(30px, 4vw, 46px) auto 0; padding: 0;
  list-style: none; display: flex; flex-wrap: wrap; gap: 8px;
}
.post__tags li {
  background: var(--panel); color: var(--ink-soft);
  padding: 5px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
}

/* ---------- end-of-post CTA ---------- */

.post__cta {
  max-width: 760px; margin: clamp(46px, 6vw, 74px) auto 0;
  background: var(--panel-2); border-radius: var(--r-lg);
  padding: clamp(28px, 4vw, 42px); text-align: center;
}
.post__cta h2 { font-size: clamp(23px, 3vw, 30px); color: var(--brand); margin-bottom: 12px; }
.post__cta p { margin: 0 0 22px; color: var(--ink-soft); font-size: 16.5px; }
.post__cta-btns { display: flex; flex-wrap: wrap; gap: 11px; justify-content: center; }

/* ---------- footer links ---------- */

.foot__note a { color: var(--brand); font-weight: 600; text-decoration: none; }
.foot__note a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .blog ~ .foot, .post ~ .foot { margin-top: 0; }
}

@media (max-width: 560px) {
  .blog__grid { grid-template-columns: 1fr; }
  .post__cta-btns .btn { width: 100%; }
}
