/* ==========================================================================
   Shared components: cards, filters, chips, search, empty states
   ========================================================================== */

/* ---------- Card grids ---------- */
.grid-posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 40px 32px;
}
.grid-cases {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: 24px;
}

/* ---------- Post card ---------- */
.post-card { display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: var(--ink); }
.post-card:hover { color: var(--accent); }
.post-card__cover { aspect-ratio: 16 / 9; }
.post-card__cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.post-card__meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font: 400 12.5px var(--font-mono); color: var(--muted); }
.post-card__meta .tag { padding: 4px 7px; }
.post-card h3 { font: 500 23px/1.25 var(--font-serif); color: inherit; text-wrap: pretty; }
.post-card p { color: var(--muted); font-size: 16px; }

/* ---------- Use case card ---------- */
.case-card {
  display: flex; flex-direction: column; gap: 16px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none; color: var(--ink);
  transition: border-color .15s;
}
.case-card:hover { border-color: var(--accent); color: var(--ink); }
.case-card h3 { font: 500 26px/1.2 var(--font-serif); text-wrap: pretty; }
.case-card p { color: var(--muted); font-size: 16px; }
.case-card p strong { color: var(--ink); font-weight: 600; }
.case-card__more { margin-top: auto; font-weight: 600; font-size: 15px; color: var(--accent); }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Filter bar + chips ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: space-between;
  margin: 48px 0 36px;
  padding: 16px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 38px; padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent; color: var(--ink);
  font: 500 14px var(--font-sans);
  cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.search {
  flex: 0 1 320px; min-width: 200px;
  display: flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface);
}
.search:focus-within { border-color: var(--accent); }
.search__icon { width: 13px; height: 13px; border: 1.5px solid var(--muted); border-radius: 50%; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 400 15px var(--font-sans); }

.empty { padding: 48px 0; text-align: center; color: var(--muted); }
.empty button { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- Why list (home + about) ---------- */
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 28px; }
.why-item { border-top: 1px solid var(--line); padding-top: 14px; }
.why-item h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.why-item p { color: var(--muted); font-size: 15.5px; }

/* ---------- Form fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.field input, .field textarea {
  height: 48px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--ink);
  font: 400 16px var(--font-sans);
}
.field textarea { height: auto; padding: 12px 14px; line-height: 1.6; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field--full { grid-column: 1 / -1; }

/* Honeypot field for spam bots — hidden from people */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { font-size: 15px; }
.form-status--error { color: #B3261E; }
html.dark .form-status--error { color: #F2B8B5; }
