/* Search form (hero, lists, 404) */
.search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  max-width: var(--measure);
}
.search-form label { flex-basis: 100%; }
.search-form input { flex: 1 1 14rem; }

/* Home */
.hero .search-form { margin-top: var(--sp-2); }
main > .hero + .stack,
main > .stack + .stack { margin-top: var(--section-gap); }
.count-line { color: var(--muted); font-size: var(--fs-sm); line-height: var(--lh-sm); }

.chip-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.chip-list .meta { display: inline-flex; align-items: center; min-height: var(--tap); }

.tool-grid {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.tool-card,
.section-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-3);
}
.tool-card .btn { margin-top: auto; }

/* Post cards */
.post-card {
  position: relative;
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.post-card-cover {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  overflow: hidden;
  background: var(--sunken);
  border-radius: var(--r-md);
  color: var(--muted);
}
.post-card-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.post-card-cover svg { width: 2.5rem; height: 2.5rem; }
.post-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 0;
}
.post-card h3 {
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-link { color: var(--text); text-decoration: none; }
.post-card-link:hover { color: var(--accent); text-decoration: underline; }
.post-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.post-card-cats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
}
@media (min-width: 600px) {
  .post-card {
    flex-direction: column;
    align-items: stretch;
  }
  .post-card-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
  }
  .post-card-cover svg { width: 3rem; height: 3rem; }
}

/* Post card grid: 3 columns on a phone, more as the page widens; narrow cells show cover and title only. */
.grid-posts { --cell: 13rem; --gap: var(--sp-3); }
.grid-posts > .post-card {
  container-type: inline-size;
  flex-direction: column;
  align-items: stretch;
  padding: var(--sp-2);
}
.grid-posts .post-card-cover { width: 100%; height: auto; aspect-ratio: 4 / 3; }
@container (max-width: 260px) {
  .post-card-cats { display: none; }
}
@container (max-width: 200px) {
  .post-card-body .meta { display: none; }
  .post-card h3 { font-size: var(--fs-sm); line-height: var(--lh-sm); -webkit-line-clamp: 3; }
}

/* About */
.links-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}
.links-list a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}
