/* Blog: list, categories, posts. Layout from the original blog, colors and type from styles.css */

.blog-hero {
  padding-bottom: 36px;
}

/* Cards */

div.cards {
  padding: 32px 0 72px;
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
}

.categories-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 8px 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.categories-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

ul.cards {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 3 300px;
  column-gap: 24px;
}

ul.cards li {
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  break-inside: avoid;
}

ul.cards li .banner {
  position: relative;
  height: 200px;
  background-color: var(--rule);
  background-position: center;
  background-size: cover;
}

ul.cards li .banner a {
  position: absolute;
  inset: 0;
}

ul.cards li .content {
  padding: 24px;
}

ul.cards li h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.25;
}

ul.cards li h2 a {
  text-decoration: none;
}

ul.cards li .body {
  margin: 16px 0;
  color: #3a342e;
  font-size: 1rem;
}

ul.cards li .body * {
  font: inherit;
  margin: 0;
}

ul.cards li .date {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

/* Category pill */

a.category {
  display: inline-block;
  margin-bottom: 14px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 26px;
  text-decoration: none;
  text-shadow: none;
  transition: background-color 200ms ease-in;
}

a.category:hover {
  background: var(--accent-soft);
  color: #fff;
}

/* Author */

.by {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
}

.by img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

/* Banner hero (post + category pages) */

.post-hero {
  display: flex;
  align-items: flex-end;
  min-height: 340px;
  padding: 0 max(24px, calc((100% - var(--max)) / 2)) 40px;
  background-color: var(--ink);
  background-position: center;
  background-size: cover;
  position: relative;
}

.post-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(28, 24, 20, 0.75), rgba(28, 24, 20, 0.1));
}

.post-hero > div {
  position: relative;
  max-width: 900px;
}

.post-hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.15;
}

.post-hero.category h1 {
  font-size: clamp(2.6rem, 7vw, 4.4rem);
}

/* Breadcrumbs */

ul.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 14px max(24px, calc((100% - var(--max)) / 2));
  list-style: none;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

ul.breadcrumbs svg {
  fill: currentColor;
}

ul.breadcrumbs a {
  text-decoration: none;
}

/* Post */

article > section:not(.post-hero) {
  display: flex;
  justify-content: center;
}

article .content {
  width: min(760px, calc(100% - 48px));
  padding: 48px 0 72px;
}

.by .author {
  color: var(--muted);
  font-weight: 400;
}

article .dates {
  margin: 18px 0 36px;
  color: var(--muted);
  font-size: 0.92rem;
}

article .dates p {
  margin: 0;
}

article .dates .published span,
article .dates .revised span {
  font-weight: 600;
}

article .dates .revised {
  margin-top: 4px;
  font-style: italic;
}

article .body,
article .body * {
  font-family: Palatino, "Palatino Linotype", Georgia, serif;
}

article .body {
  font-size: 1.15rem;
  line-height: 1.7;
}

article .body h1,
article .body h2,
article .body h3,
article .body h4,
article .body h5 {
  line-height: 1.2;
  margin: 1.6em 0 0.5em;
}

article .body h1 { font-size: 2rem; }
article .body h2 { font-size: 1.7rem; }
article .body h3 { font-size: 1.4rem; }
article .body h4,
article .body h5 { font-size: 1.2rem; }

article .body ul {
  padding: 12px 0 12px 28px;
}

article .body li {
  list-style-type: square;
  padding: 3px 0;
}

article .body a {
  color: var(--accent);
}

article .body img {
  height: auto;
  margin: 24px 0;
}

/* Tags */

article .tags {
  margin-top: 36px;
}

article .hashtag {
  padding-right: 6px;
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 700;
}

article .tag {
  display: inline-block;
  margin: 0 4px 8px 0;
  padding: 2px 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 0.82rem;
}

article .tag a {
  color: var(--accent);
  text-decoration: none;
}

article .tag:hover {
  background: var(--accent);
}

article .tag:hover a {
  color: #fff;
}

@media (max-width: 620px) {
  .post-hero {
    min-height: 260px;
    padding-bottom: 28px;
  }

  ul.cards li .content {
    padding: 20px;
  }
}
