.blog-page {
  background: #fff;
}

.blog-wrap {
  padding: 40px 20px 80px;
  max-width: 1160px;
}

/* Homepage sections use a 5em top margin; keep the writings index tight. */
.blog-page .blog-wrap > .blog-lede,
.blog-page .blog-wrap > .blog-timeline,
.blog-page .blog-wrap > .blog-era-blurb,
.blog-page .blog-wrap > .blog-filters,
.blog-page .blog-wrap > .blog-tag-filters,
.blog-page .blog-wrap > .blog-count,
.blog-page .blog-wrap > .blog-empty,
.blog-page .blog-wrap > .blog-list,
.blog-page .blog-wrap > .blog-crumb {
  margin-top: 0;
}

.blog-lede {
  color: #4a5563;
  max-width: 46rem;
  margin: 0.5rem 0 1.25rem;
}

.blog-timeline {
  margin: 0 0 1.15rem;
  padding: 1rem 1.1rem 0.85rem;
  background: #f7f8f9;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
}

.blog-timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.65rem;
}

.blog-timeline-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6b7280;
}

.blog-timeline-span {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #282828;
}

.blog-timeline-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #9aa1ab;
  margin: 0 0 0.45rem 168px;
}

.blog-era-row {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) 200px;
  gap: 10px;
  align-items: center;
  width: 100%;
  margin: 0 0 6px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.blog-era-row:hover .blog-era-name,
.blog-era-row.is-active .blog-era-name {
  color: #111;
}

.blog-era-name {
  font-size: 13px;
  font-weight: 600;
  color: #4a5563;
}

.blog-era-track {
  position: relative;
  height: 12px;
  background: #e8eaee;
  border-radius: 999px;
  overflow: hidden;
}

.blog-era-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
}

.blog-era-bar--singularity-hacker { background: #1f4b3a; }
.blog-era-bar--medium { background: #0b6e4f; }
.blog-era-bar--0xjustice { background: #282828; }
.blog-era-bar--qacc { background: #3b2f7a; }
.blog-era-bar--clawbank { background: #8a1f12; }

.blog-era-row.is-active .blog-era-track {
  box-shadow: 0 0 0 2px #ffde00;
}

.blog-era-dates {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}

.blog-era-blurb {
  color: #4a5563;
  font-size: 15px;
  line-height: 1.55;
  max-width: 52rem;
  margin: 0 0 1rem;
}

.blog-era-blurb[hidden] {
  display: none !important;
}

.blog-era-blurb-dates {
  color: #6b7280;
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 0.75rem;
}

.blog-tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 1rem;
}

.blog-filter {
  background: #fff;
  border: 1px solid #d5d8de;
  color: #282828;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.blog-filter:hover,
.blog-filter:focus {
  border-color: #282828;
}

.blog-filter.is-active {
  background: #ffde00;
  border-color: #ffde00;
  color: #282828;
}

.blog-tag-filter {
  background: #fff;
  border: 1px solid #d5d8de;
  color: #4a5563;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.blog-tag-filter:hover,
.blog-tag-filter:focus {
  border-color: #282828;
  color: #282828;
}

.blog-tag-filter.is-active {
  background: #282828;
  border-color: #282828;
  color: #fff;
}

.blog-count {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 1rem;
}

.blog-empty {
  padding: 2rem 1rem;
  border: 1px dashed #d5d8de;
  color: #6b7280;
  text-align: center;
}

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

.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #f7f8f9;
  padding: 0 0 1.25rem;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  min-width: 0;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.blog-card:hover {
  border-color: #cfd3da;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
  transform: translateY(-2px);
}

.blog-card-cover {
  width: 100%;
  aspect-ratio: 21 / 9;
  overflow: hidden;
  background: #eceef1;
  flex-shrink: 0;
}

.blog-card-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-cover img {
  transform: scale(1.04);
}

.blog-card:not(:has(.blog-card-cover))::before {
  content: "";
  display: block;
  aspect-ratio: 21 / 9;
  background: #eceef1;
}

.blog-card .blog-card-meta,
.blog-card h3,
.blog-card > p {
  padding-left: 1.15rem;
  padding-right: 1.15rem;
}

.blog-card .blog-card-meta {
  padding-top: 1.1rem;
}

/* Bulma sets article { display: block }, which overrides the hidden attribute. */
.blog-card[hidden],
.blog-card.is-hidden-card,
.blog-empty[hidden] {
  display: none !important;
}

.blog-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0.4rem 0 0.45rem;
  color: #2f3742;
}

.blog-card h3 a {
  color: inherit;
  text-decoration: none;
}

.blog-card h3 a:hover {
  color: #111;
  text-decoration: underline;
}

.blog-card p {
  margin: 0;
  color: #4a5563;
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 13px;
  color: #6b7280;
}

.blog-tag {
  display: inline-block;
  background: #282828;
  color: #fff;
  padding: 2px 10px;
  border-radius: 3px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.blog-tag--0xjustice { background: #282828; }
.blog-tag--singularity-hacker { background: #1f4b3a; }
.blog-tag--medium { background: #0b6e4f; }
.blog-tag--qacc { background: #3b2f7a; }
.blog-tag--clawbank { background: #8a1f12; }

.navbar .nav-link a.is-current {
  border-bottom-color: #ffde00;
  color: #ffde00;
}

.blog-crumb {
  margin: 0 0 1.25rem;
}

.blog-crumb a {
  color: #282828;
  font-weight: 600;
}

.blog-article h1 {
  font-size: 36px;
  font-weight: 700;
  color: #2f3742;
  margin: 0.4rem 0 0.75rem;
  line-height: 1.2;
}

.blog-source {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 2rem;
  word-break: break-word;
}

.blog-source a {
  color: #282828;
}

.blog-prose {
  color: #2f3742;
  font-size: 17px;
  line-height: 1.7;
  max-width: 46rem;
}

.blog-prose > *:first-child {
  margin-top: 0;
}

.blog-prose h1,
.blog-prose h2,
.blog-prose h3,
.blog-prose h4 {
  color: #2f3742;
  font-weight: 700;
  margin: 1.8rem 0 0.7rem;
  line-height: 1.25;
}

.blog-prose h2 { font-size: 28px; }
.blog-prose h3 { font-size: 22px; }

.blog-prose p,
.blog-prose ul,
.blog-prose ol,
.blog-prose blockquote,
.blog-prose pre,
.blog-prose table {
  margin: 0 0 1.1rem;
}

.blog-cover {
  margin: 0 0 1.5rem;
}

.blog-cover img,
.blog-prose img,
.blog-prose video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.2rem 0;
}

.blog-cover img {
  margin: 0;
}

.blog-prose a {
  color: #282828;
  text-decoration: underline;
}

.blog-prose blockquote {
  border-left: 4px solid #ffde00;
  padding: 0.2rem 0 0.2rem 1rem;
  color: #4a5563;
}

.blog-prose pre,
.blog-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.blog-prose pre {
  background: #282828;
  color: #f7f8f9;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  border-radius: 3px;
}

.blog-prose :not(pre) > code {
  background: #f0f1f3;
  padding: 0.1em 0.35em;
}

.blog-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.blog-prose th,
.blog-prose td {
  border: 1px solid #d5d8de;
  padding: 0.4rem 0.6rem;
  text-align: left;
}

.blog-prose hr {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 2rem 0;
}

@media (max-width: 1024px) {
  .blog-wrap {
    padding-top: 80px;
  }

  .blog-article h1 {
    font-size: 28px;
  }
}

@media (max-width: 960px) {
  .blog-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .blog-timeline-scale {
    margin-left: 0;
  }

  .blog-era-row {
    grid-template-columns: 1fr;
    gap: 4px;
    margin-bottom: 10px;
  }

  .blog-era-dates {
    white-space: normal;
  }
}

@media (max-width: 600px) {
  .blog-list {
    grid-template-columns: 1fr;
  }

  .blog-card h3 {
    font-size: 1.1rem;
  }
}
