/* The blog list (/blog/ and each topic's page). Builds on home.css. */

.top nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--sunken);
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn.quiet {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--ink);
}

.btn.quiet:hover {
  background: var(--sunken);
}

/* ---- Title and topics ---- */

.blog-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 40px;
  padding-top: 28px;
  padding-bottom: 24px;
}

.blog-top h1 {
  margin-top: 0;
}

.blog-top .lede {
  max-width: 640px;
  margin-top: 10px;
  margin-bottom: 0;
}

.topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topics a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--card);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.topics a span {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
}

.topics a:hover {
  background: var(--sunken);
}

.topics a[aria-current="page"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.topics a[aria-current="page"] span {
  color: inherit;
  opacity: 0.8;
}

/* ---- The posts ---- */

.blog {
  padding-top: 0;
}

.lead,
.entry {
  overflow: hidden;
  text-decoration: none;
  transition: box-shadow 0.15s ease;
}

.lead:hover,
.entry:hover {
  box-shadow: var(--shadow);
}

.lead:hover h3,
.entry:hover h3 {
  text-decoration: underline;
}

.lead img,
.entry img,
.lead .no-image,
.entry .no-image {
  display: block;
  width: 100%;
  object-fit: cover;
  background: var(--sunken);
}

.no-image {
  background-image: repeating-linear-gradient(-45deg, transparent 0 3px, var(--hatch) 3px 4px);
}

.label span + span::before {
  content: "·";
  margin-right: 8px;
}

.excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--ink-muted);
  text-wrap: pretty;
}

.lead time,
.entry time {
  font-size: 13px;
  color: var(--ink-subtle);
}

/* The newest post, wide. */

.lead {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 16px;
}

.lead img,
.lead .no-image {
  height: 100%;
  aspect-ratio: 3 / 2;
  border-right: 1px solid var(--border);
}

.lead > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 32px 40px;
}

.lead h3 {
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.2;
  text-wrap: balance;
}

.lead .excerpt {
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

.lead .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 4px;
}

.lead .more {
  font-size: 14px;
  font-weight: 600;
}

/* The rest, three across. */

.entries {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.entry {
  display: flex;
  flex-direction: column;
}

.entry img,
.entry .no-image {
  aspect-ratio: 3 / 2;
  border-bottom: 1px solid var(--border);
}

.entry > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px 18px;
}

.entry h3 {
  font-size: 17px;
  line-height: 1.3;
  font-weight: 700;
  text-wrap: balance;
}

.entry .excerpt {
  font-size: 14px;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.entry time {
  margin-top: auto;
  padding-top: 6px;
}

/* ---- Older and newer pages ---- */

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  font-size: 14px;
  color: var(--ink-muted);
}

.pager a {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-radius: 6px;
}

.pager a:hover {
  text-decoration: underline;
}

.pager [rel="prev"] {
  grid-column: 1;
}

.pager [rel="next"] {
  grid-column: 3;
  justify-self: end;
}

.pager span {
  grid-column: 2;
}

/* ---- Nothing here ---- */

.empty {
  padding: 32px 40px;
}

.empty p {
  margin-top: 6px;
  margin-bottom: 20px;
  color: var(--ink-muted);
}

/* ---- Narrower screens ---- */

@media (max-width: 1020px) {
  .lead {
    grid-template-columns: 1fr;
  }

  .lead img,
  .lead .no-image {
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .lead > div {
    padding: 24px 28px 28px;
  }

  .entries {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .blog-top {
    padding-top: 20px;
  }

  .lead > div,
  .empty {
    padding: 20px;
  }

  .entries {
    grid-template-columns: 1fr;
  }

  .pager {
    grid-template-columns: 1fr 1fr;
  }

  .pager span {
    display: none;
  }

  .pager [rel="next"] {
    grid-column: 2;
  }
}
