/* File: assets/css/blog-cards.css */

/* Target only posts on your blog archive (including paged views) */
body.blog .sfs-posts-grid > article {
  /* nuke Astra’s margins & width */
  margin: 0 !important;
  width: auto !important;
  flex: none !important;
  padding: 0 20px;
}

/* Grid layout */
.sfs-posts-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(300px, 1fr)
  );
  gap: 2rem;
  justify-content: start;
}

/* Card wrapper */
.sfs-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--subtle-bg);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
}
.sfs-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.sfs-posts-grid article:last-child {
  border-bottom: 1px solid var(--subtle-bg);
}

/* Thumbnail */
.sfs-card-thumb {
  flex: 0 0 auto;
  width: 100%;
  height: 200px;
  overflow: hidden;
  border-radius: 100px / 100px;
  margin-top: 1rem;
}
.sfs-card-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

/* Body: title + excerpt */
.sfs-card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 1rem;
}
.sfs-card-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--headings);
}
.sfs-card-title a {
  text-decoration: none;
  color: inherit;
}
.sfs-excerpt {
  margin: 0.5rem 0;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
}

/* Footer: category | author on left, date on right */
.sfs-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-top: 1px solid var(--subtle-bg);
  font-size: 0.875rem;
  color: var(--text);
}
.sfs-meta-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sfs-post-cat {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--headings);
  border-radius: 0.5rem;
  color: var(--headings);
  text-transform: uppercase;
  font-size: 0.75rem;
}
/* Blog gets “headings” color */
.sfs-post-cat--blog {
  border-color: var(--headings);
  color: var(--headings);
  &:hover {
    background-color: var(--headings);
    color: var(--primary-bg);
  }
}
/* Newsletter gets “brand” color */
.sfs-post-cat--newsletter {
  border-color: var(--brand);
  color: var(--brand);
  &:hover {
    background-color: var(--brand);
    color: var(--primary-bg);
  }
}
/* Press Release gets “other” color */
.sfs-post-cat--press-release {
  border-color: var(--other);
  color: var(--other);
  &:hover {
    background-color: var(--other);
    color: var(--primary-bg);
  }
}
.sfs-card-author {
  margin-top: auto;
  font-style: italic;
  color: var(--text);
  font-size: 0.85em;
  &:hover a {
    color: var(--other);
  }
}
.sfs-post-date {
  white-space: nowrap;
}

/* Mobile */
@media (max-width: 767px) {
  .sfs-posts-grid {
    grid-template-columns: repeat(1, 1fr);
  }
}
