/* The blog: the index at /blog, one page per post, and the newest three on the
   front page. Built by `pnpm site:blog` from apps/site/blog. */

.page-blog main {
  padding-bottom: 40px;
}

/* What the blog is, in two lines, on a band of its own like every other page's
   head, so it does not read as the title of the first post under it. */
.blog-hero {
  padding: 48px 0 40px;
  background:
    radial-gradient(760px 360px at 82% -30%, rgba(120, 96, 220, 0.2), transparent 62%),
    #090b10;
  border-bottom: 1px solid var(--line);
}
.blog-hero h1 {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 6px 0 8px;
  color: var(--ink);
}
.blog-hero p {
  color: var(--ink2);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}
.blog-list {
  padding: 24px 0 80px;
}

/* Three to a row at most, so each cover is large enough to read. */
.post-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
@media (max-width: 960px) {
  .post-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .post-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}
.post-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--soft);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s;
}
.post-card:hover,
.post-card:focus-visible {
  border-color: var(--accent);
}
.post-card__media {
  position: relative;
  display: block;
}
.post-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--line);
}
.post-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 18px 18px 20px;
}
/* The date and the reading time close the card, on a line of their own. */
.post-card__body > .post-card__when {
  margin-top: auto;
  padding-top: 6px;
}
.post-card__when {
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
}
.post-card__title {
  font-family: var(--font-head);
  font-size: 1.12rem;
  line-height: 1.3;
  color: var(--ink);
  font-weight: 600;
}
.post-card__text {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink2);
}

.blog-home .post-cards {
  margin-top: 28px;
}
.blog-home__all {
  margin: 26px 0 0;
}

/* `.wow .wrap` sets the site's wide column; a post reads in a narrow one. */
.wow .wrap.post-wrap {
  max-width: 828px;
}
.crumbs {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 48px 0 18px;
}
.crumbs a {
  color: var(--ink2);
  text-decoration: none;
}
.crumbs a:hover {
  text-decoration: underline;
}
.post h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  color: var(--ink);
}
.post-meta {
  color: var(--muted);
  font-size: 0.9375rem;
  margin: 0 0 28px;
}
.post-cover {
  margin: 0 0 36px;
}
.post-cover img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  display: block;
}

.post-body {
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--ink2);
}
.post-body p {
  margin: 0 0 1.15em;
}
.post-body .lede {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--ink);
}
.post-body h2 {
  font-family: var(--font-head);
  font-size: 1.6rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 2.2em 0 0.7em;
}
.post-body h3 {
  font-size: 1.2rem;
  color: var(--ink);
  margin: 1.6em 0 0.5em;
}
.post-body ul,
.post-body ol {
  padding-left: 1.3em;
  margin: 0 0 1.2em;
}
.post-body li {
  margin: 0 0 0.55em;
}
.post-body strong {
  color: var(--ink);
}
.post-body a {
  color: var(--accent2);
  text-underline-offset: 3px;
}
.post-body .source {
  font-size: 0.875rem;
  color: var(--muted);
}
/* Checklists use the site's own `.checks` rows (wow.css): a tick and a rule. */
.post-body ul.checks {
  list-style: none;
  padding: 0;
  margin: 0 0 1.4em;
}
.post-body ul.checks li {
  margin: 0;
  font-size: 1rem;
}
.post-body .table-wrap {
  overflow-x: auto;
  margin: 0 0 1.4em;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.5;
}
.post-body th,
.post-body td {
  padding: 11px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.post-body th {
  color: var(--ink);
  font-weight: 600;
  background: var(--soft);
}
.post-body tbody tr:last-child td {
  border-bottom: 0;
}
.post-body .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.post-body figure {
  margin: 2em 0;
}
.post-body figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}
.post-body figcaption {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 10px;
}
.post-body figure.plain {
  color: var(--ink);
}
.post-body .timeline {
  width: 100%;
  height: auto;
  display: block;
}

.post-cta {
  margin: 48px 0 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}
.post-cta h2 {
  font-family: var(--font-head);
  font-size: 1.4rem;
  margin: 0 0 8px;
  color: var(--ink);
}
.post-cta p {
  margin: 0 0 18px;
  color: var(--ink2);
  line-height: 1.6;
}
.post-cta .ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.post-more {
  margin: 56px 0 0;
}
.post-more h2 {
  font-family: var(--font-head);
  font-size: 1.3rem;
  color: var(--ink);
  margin: 0 0 18px;
}

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

/* Category chips, the search, and the newest post with the next three beside it. */
.post-chip {
  display: inline-block;
  white-space: nowrap;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(182, 155, 255, 0.14);
  color: var(--accent2);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-right: 6px;
}
.post-chip--link {
  text-decoration: none;
  margin: 0 0 14px;
}
.post-chip--link:hover {
  background: rgba(182, 155, 255, 0.24);
}
.post-card[hidden],
.blog-top[hidden] {
  display: none;
}
.blog-top {
  padding: 36px 0 24px;
}
.blog-top__title {
  margin-bottom: 18px;
}
.blog-top__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.blog-feature {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: inherit;
  text-decoration: none;
}
.blog-feature .post-card__media img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  border: 1px solid var(--line);
}
.blog-feature__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.blog-feature__title {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.2;
  color: var(--ink);
  font-weight: 600;
}
.blog-feature:hover .blog-feature__title,
.blog-side__item:hover .blog-side__title {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.blog-side {
  display: flex;
  flex-direction: column;
}
.blog-side__item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.blog-side__item:first-child {
  padding-top: 0;
}
.blog-side__item img {
  width: 150px;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: block;
}
.blog-side__item > span {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.blog-side__item .post-card__when {
  font-size: 0.8125rem;
  color: var(--muted);
}
.blog-side__title {
  font-family: var(--font-head);
  font-size: 1.02rem;
  line-height: 1.3;
  color: var(--ink);
  font-weight: 600;
}
.blog-list__title {
  font-family: var(--font-head);
  font-size: 1.2rem;
  color: var(--ink);
  margin: 24px 0 14px;
}
.blog-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 26px;
}
.blog-chip {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink2);
  cursor: pointer;
}
.blog-chip span {
  margin-left: 4px;
  color: var(--muted);
  font-weight: 500;
}
.blog-chip[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b0716;
}
.blog-chip[aria-pressed='true'] span {
  color: #2a1d55;
}
.blog-none {
  color: var(--ink2);
  margin: 10px 0 0;
}
.blog-none a {
  color: var(--accent2);
}
@media (max-width: 900px) {
  .blog-top__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 520px) {
  .blog-side__item {
    grid-template-columns: 110px minmax(0, 1fr);
  }
  .blog-side__item img {
    width: 110px;
  }
}
