/* =====================================================================
 * The blog
 *
 * Ordinary writing. Nothing here is generated, and nothing costs credit.
 *
 * Three across, matching the tool cards on the front page — the site
 * already has a shape for "a row of things you can open", and inventing
 * a second one for articles would only make the two look unrelated.
 * ================================================================== */

.bf-blog,
.bf-post {
  padding: 46px 0 20px;
}

.bf-blog .bf-container,
.bf-post .bf-container {
  width: min(1600px, 83%);
  max-width: min(1600px, 83%);
  margin-inline: auto;
}

.bf-post .bf-container {
  width: min(820px, 90%);
  max-width: min(820px, 90%);
}

/* ---- the index ------------------------------------------------------ */

.bf-blog__head {
  margin-bottom: 36px;
  text-align: center;
}

.bf-blog__head h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 800;
  color: var(--bf-text);
}

.bf-blog__head p {
  margin: 0;
  font-size: var(--bf-size-base);
  color: var(--bf-text-muted);
}

.bf-blog__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

@media (max-width: 1000px) {
  .bf-blog__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .bf-blog__grid { grid-template-columns: 1fr; }
}

/* ---- a card --------------------------------------------------------- */

.bf-blog__card {
  border: 1px solid var(--bf-line);
  border-radius: 16px;
  background: var(--surface-2);
  overflow: hidden;
  transition: var(--bf-ease-all);
}

.bf-blog__card:hover {
  border-color: var(--bf-line-strong);
  background: var(--surface-3);
}

.bf-blog__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.bf-blog__cover {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--surface-3);
  overflow: hidden;
}

.bf-blog__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/*
 * An article without a picture still keeps its shape.
 *
 * Left to itself the card would be shorter than the ones beside it and
 * the row would look broken rather than varied.
 */
.bf-blog__blank {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--bf-text-dim);
}

.bf-blog__blank svg {
  width: 34px;
  height: 34px;
}

.bf-blog__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  padding: 18px 18px 16px;
}

.bf-blog__cat {
  align-self: flex-start;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(169, 79, 49, .13);
  color: var(--orange-400);
  font-size: 12.5px;
  font-weight: 600;
}

.bf-blog__text strong {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.75;
  color: var(--bf-text);
}

.bf-blog__excerpt {
  flex: 1;
  font-size: var(--bf-size-sm);
  line-height: 2;
  color: var(--bf-text-muted);
}

.bf-blog__text time {
  font-size: var(--bf-size-sm);
  color: var(--bf-text-dim);
}

/* ---- paging --------------------------------------------------------- */

.bf-blog__pages {
  margin-top: 34px;
  text-align: center;
}

.bf-blog__pages .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 13px;
  margin: 0 3px;
  border: 1px solid var(--bf-line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--bf-text-muted);
  text-decoration: none;
  transition: var(--bf-ease-all);
}

.bf-blog__pages .page-numbers:hover {
  border-color: var(--bf-line-strong);
  color: var(--bf-text);
}

.bf-blog__pages .page-numbers.current {
  border-color: var(--orange-600);
  background: var(--orange-500);
  color: var(--bf-on-accent);
}

.bf-blog__pages .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.bf-blog__none {
  margin: 60px 0;
  color: var(--bf-text-muted);
  text-align: center;
}

/* ---- one article ---------------------------------------------------- */

.bf-post__crumbs {
  margin: 0 0 18px;
  font-size: var(--bf-size-sm);
  color: var(--bf-text-dim);
}

.bf-post__crumbs a {
  color: var(--bf-text-muted);
  text-decoration: none;
}

.bf-post__crumbs a:hover {
  color: var(--orange-400);
}

.bf-post__crumbs span {
  margin: 0 7px;
}

.bf-post__body h1 {
  margin: 0 0 14px;
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 800;
  line-height: 1.5;
  color: var(--bf-text);
}

.bf-post__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 26px;
  font-size: var(--bf-size-sm);
  color: var(--bf-text-dim);
}

.bf-post__meta a {
  color: var(--orange-400);
  text-decoration: none;
}

.bf-post__cover {
  margin: 0 0 30px;
  border-radius: var(--bf-radius-md);
  overflow: hidden;
}

.bf-post__cover img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---- the words themselves ------------------------------------------- */

.bf-prose {
  font-size: 16.5px;
  line-height: 2.2;
  color: var(--bf-text-muted);
}

.bf-prose > * + * {
  margin-top: 22px;
}

.bf-prose h2,
.bf-prose h3 {
  margin-top: 40px;
  color: var(--bf-text);
  line-height: 1.6;
}

.bf-prose h2 { font-size: 24px; }
.bf-prose h3 { font-size: 19px; }

.bf-prose a {
  color: var(--orange-400);
}

.bf-prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--bf-radius-md);
}

.bf-prose blockquote {
  margin-inline: 0;
  padding: 4px 18px;
  border-inline-start: 3px solid var(--orange-600);
  color: var(--bf-text);
}

.bf-prose code {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-3);
  font-size: .92em;
}

.bf-prose pre {
  padding: 18px;
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius-md);
  background: var(--surface-1);
  overflow-x: auto;
  direction: ltr;
  text-align: left;
}

.bf-prose ul,
.bf-prose ol {
  padding-inline-start: 22px;
}

.bf-prose li + li {
  margin-top: 8px;
}

/* ---- what to read next ---------------------------------------------- */

.bf-post__more {
  margin-top: 56px;
  padding-top: 34px;
  border-top: 1px solid var(--bf-line);
}

.bf-post__more h2 {
  margin: 0 0 22px;
  font-size: 21px;
  font-weight: 700;
  color: var(--bf-text);
}

/*
 * Under an article the column is narrow, so three across would be three
 * slivers. Two fits the measure the words are set at.
 */
.bf-post__more .bf-blog__grid {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 620px) {
  .bf-post__more .bf-blog__grid { grid-template-columns: 1fr; }
}

/* ---- searching, and a page that is not there ------------------------ */

.bf-blog__search {
  display: flex;
  gap: 10px;
  width: min(520px, 100%);
  margin: 24px auto 0;
}

.bf-blog__search .bf-input {
  flex: 1;
}

.bf-404__ways {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
