/* ==========================================================================
   Blog: category bar, post list, single post
   ========================================================================== */

.blog { padding-top: 77px; }

.blog-wrap {
  max-width: 940px;
  margin-inline: auto;
}

/* ---------- Category bar ---------- */
.blog-bar {
  display: flex;
  align-items: center;
  height: 48px;
  margin-bottom: 36px;
  font: 300 18px/1 var(--font-body);
  color: var(--color-ink);
}

.blog-bar__cats {
  display: flex;
  align-items: center;
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.blog-bar__cats a:hover,
.blog-bar__cats a[aria-current="page"] { color: #808080; }

.blog-more { position: relative; }
.blog-more summary {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  cursor: pointer;
}
.blog-more summary::-webkit-details-marker { display: none; }
.blog-more summary svg { width: 12px; height: 12px; transition: transform 0.2s ease; }
.blog-more[open] summary svg { transform: rotate(180deg); }
.blog-more ul {
  position: absolute;
  top: calc(100% + 14px);
  left: -20px;
  z-index: 5;
  min-width: 200px;
  margin: 0;
  padding: 10px 0;
  list-style: none;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
.blog-more li a { display: block; padding: 10px 20px; }
.blog-more li a:hover { background: #f7f7f7; }

.blog-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.blog-search input {
  width: 0;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  font: 300 16px/1.2 var(--font-body);
  background: transparent;
  transition: width 0.25s ease, border-color 0.25s ease;
}
.blog-search.is-open input,
.blog-search input:focus { width: 180px; border-bottom-color: var(--color-ink); outline: none; }
.blog-search button {
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--color-ink);
}
.blog-search svg { width: 19px; height: 19px; fill: currentColor; }

/* ---------- Post list ---------- */
.post-list {
  display: grid;
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-card {
  position: relative;
  display: grid;
  grid-template-columns: 453px 1fr;
  height: 340.5px;
  border: 1px solid var(--color-border);
  background: #fff;
  overflow: hidden;
}
.post-card--text { grid-template-columns: 1fr; }

.post-card__media { overflow: hidden; margin: -1px 0 -1px -1px; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }

.post-card__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 26px 36px 25px;
}

.byline {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 34px;
  font: 300 12px/1.4 var(--font-body);
  color: var(--color-ink);
}
.byline img { width: 32px; height: 32px; border-radius: 50%; }
.byline__meta span + span::before { content: "·"; margin: 0 6px; }
.post-card .byline__meta { display: grid; grid-template-columns: auto auto 1fr; line-height: 1.3; }
.post-card .byline__meta > span:first-child { grid-column: 1 / -1; }
.post-card .byline__meta > span:nth-child(2)::before { content: none; }

.post-card__title {
  margin-top: 18px;
  font: 300 26px/1.3 var(--font-heading);
  color: var(--color-ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card__title a::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.post-card:hover .post-card__title { color: #808080; }

.post-card__excerpt {
  margin-top: 11px;
  font: 300 16px/1.5 var(--font-body);
  color: var(--color-ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-list__empty { padding: 40px 0; font-size: 16px; text-align: center; }

/* ---------- Single post ---------- */
.post {
  border: 1px solid var(--color-border);
  padding: 72px 100px 56px;
}

.post__title {
  margin: 18px 0 32px;
  font: 300 40px/50px var(--font-heading);
  color: var(--color-ink);
}

.post .byline { font-size: 14px; }

.post__content {
  font: 300 18px/27px var(--font-body);
  color: var(--color-ink);
}
.post__content::after { content: ""; display: table; clear: both; }
.post__content p { min-height: 27px; overflow-wrap: anywhere; }
.post__content .center { text-align: center; }
.post__content a { text-decoration: underline; }
.post__content .gap { height: 27px; }
.post__content hr { margin: 1em 0; border: 0; border-top: 1px solid currentColor; }

.post__content figure { margin: 0 0 16px; }
.post__content figure img { width: 100%; }
.post__content figcaption { margin-top: 8px; font-size: 14px; text-align: center; color: var(--color-muted); }
.fig--center { margin-inline: auto !important; }
.fig--right { float: right; margin: 0 0 16px 40px !important; }
.fig--left { float: left; margin: 0 40px 16px 0 !important; }
.fig--small { width: min(350px, 50%); }

.post__footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.post__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  font: 300 14px/1.5 var(--font-body);
}
.post__tags a:hover { color: #808080; }

.share {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 0 0;
  border-top: 1px solid var(--color-border);
}
.share a,
.share button {
  display: grid;
  place-items: center;
  width: 20px; height: 20px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-ink);
  cursor: pointer;
}
.share svg { width: 19px; height: 19px; fill: currentColor; }
.share svg[stroke] { fill: none; }
.share a:hover, .share button:hover { opacity: 0.6; }
.share__status { font-size: 13px; color: var(--color-muted); }

/* Recent posts under a post */
.related { margin-top: 40px; }
.related__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
  font: 300 16px/1 var(--font-body);
  color: var(--color-ink);
}
.related__head a:hover { color: #808080; }

.related__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-card {
  position: relative;
  height: 100%;
  border: 1px solid var(--color-border);
}
.mini-card__media { aspect-ratio: 292 / 164; background: #f2f2f2; overflow: hidden; }
.mini-card__media img { width: 100%; height: 100%; object-fit: cover; }
.mini-card__title {
  padding: 20px 20px 28px;
  font: 300 18px/1.4 var(--font-heading);
  color: var(--color-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mini-card__title a::after { content: ""; position: absolute; inset: 0; }
.mini-card:hover .mini-card__title { color: #808080; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .blog { padding-top: 8px; }
  .blog-bar { height: auto; flex-wrap: wrap; gap: 12px 0; margin-bottom: 24px; }
  .blog-bar__cats { flex-wrap: wrap; gap: 12px 24px; }
  .blog-search { margin-left: 0; flex-basis: 100%; }
  .blog-search input { width: 100%; border-bottom-color: #ccc; }
  .blog-search.is-open input, .blog-search input:focus { width: 100%; }

  .post-card,
  .post-card--text { grid-template-columns: 1fr; height: auto; }
  .post-card__media { margin: 0; aspect-ratio: 4 / 3; }
  .post-card__body { padding: 20px; }
  .post-card__title { font-size: 24px; }

  .post { padding: 32px 20px; border-inline: 0; margin-inline: calc(var(--gutter) * -1); }
  .post__title { font-size: 30px; line-height: 1.3; }
  .fig--right, .fig--left { float: none; margin: 0 auto 16px !important; }
  .fig--small { width: min(350px, 100%); }
  .post__content figure { max-width: 100% !important; }

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