.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1.25rem;
  padding: 0;
  list-style: none;
}

.blog-card {
  display: block;
  height: 100%;
  overflow: hidden;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  color: #262626;
  background: #fff;
}

.blog-card:hover {
  color: #262626;
  border-color: #965100;
}

.blog-card img,
.blog-cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
}

.blog-card span {
  display: block;
  padding: 0.9rem 1rem;
}

.blog-cover {
  margin: 1rem auto 2rem;
  border-radius: 10px;
}

.blog-cover figcaption {
  padding-block: 0.4rem;
  font-size: 0.85rem;
}

.blog-cover figcaption a {
  color: #173b67;
  text-decoration: underline !important;
}

/* Keep article metadata icons visible even when the icon font is unavailable. */
small > span:is(.fa-calendar-alt, .fa-user)::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.12em;
  background-color: currentColor;
  mask: var(--article-meta-icon) center / contain no-repeat;
}

small > span.fa-calendar-alt {
  --article-meta-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M7 3v4m10-4v4M3 10h18'/%3E%3C/svg%3E");
}

small > span.fa-user {
  --article-meta-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3Cpath d='M4 21v-2a5 5 0 0 1 5-5h6a5 5 0 0 1 5 5v2'/%3E%3C/svg%3E");
}

.latest-posts {
  margin-block: 2rem;
}

.latest-posts h2 {
  font-size: 1.3rem;
  margin: 0;
}

.latest-posts-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.latest-posts-controls:not([hidden]) {
  display: flex;
  gap: 0.5rem;
}

.latest-posts-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2rem) / 3);
  gap: 1rem;
  margin: 0;
  padding: 0.75rem 0.375rem;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: inline mandatory;
  scroll-padding-inline: 0.375rem;
}

.latest-posts-track > li {
  min-width: 0;
  scroll-snap-align: start;
}

@media (max-width: 767px) {
  .latest-posts-track {
    grid-auto-columns: calc((100% - 1rem) / 2);
  }
}

@media (max-width: 479px) {
  .latest-posts-track {
    grid-auto-columns: 100%;
  }
}

.latest-posts-controls [aria-disabled="true"] {
  opacity: 0.55;
  cursor: default;
}
