/* Article list and article pages. Loaded after /style.css. */

/* style.css colours every link blue and underlined; cards and breadcrumbs
   are links too but shouldn't look like it. */
.article-card, .article-card:visited, .article-card:hover,
.related-card, .related-card:visited, .related-card:hover,
.breadcrumbs a, .breadcrumbs a:visited {
  color: inherit !important;
  text-decoration: none !important;
}
.post-header-meta a, .post-header-meta a:visited { color: inherit !important; }

/* ── List page ───────────────────────────────── */
.articles-intro { color: #555; max-width: 640px; margin-bottom: 32px; }
.articles-intro p { margin-bottom: 12px; }

.articles-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap svg {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}
#search-input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
#search-input:focus { border-color: var(--ink); }
.cat-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-btn {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  border-radius: var(--radius);
  color: var(--ink-muted);
  transition: all 0.15s;
  font-family: var(--font-body);
}
.cat-btn:hover { border-color: var(--ink); color: var(--ink); }
.cat-btn.active { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }

#articles-list { display: flex; flex-direction: column; }
.article-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.15s;
  align-items: start;
}
.article-card:first-child { border-top: 1px solid var(--border); }
.article-card:hover { opacity: 0.75; }
.article-card.hidden { display: none; }
.article-cover {
  aspect-ratio: 4/3;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-cover-placeholder { width: 100%; height: 100%; }
.article-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.article-cat {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 20px;
}
.article-date { font-size: 12px; color: var(--ink-muted); }
.article-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  line-height: 1.2;
}
.article-summary { font-size: 13px; color: #555; line-height: 1.5; }
#no-results {
  padding: 48px 0;
  text-align: center;
  color: var(--ink-muted);
  font-size: 14px;
  display: none;
}

/* ── Article page ────────────────────────────── */
.breadcrumbs {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 24px;
}
.breadcrumbs a:hover { color: var(--ink) !important; }
.post-header { margin-bottom: 32px; }
.post-header h1 { margin-bottom: 12px; }
.post-header-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.post-header-meta > span { font-size: 13px; color: var(--ink-muted); }
.post-cover {
  width: 100%;
  aspect-ratio: 16/7;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 40px;
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-body {
  font-size: 16px;
  line-height: 1.75;
  color: #333;
  max-width: 640px;
}
.post-body img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  margin: 24px 0;
}
.post-body figure { margin: 24px 0; }
.post-body figure img { margin: 0; }
.post-body figcaption { font-size: 13px; color: var(--ink-muted); margin-top: 8px; }
.post-body p { margin-bottom: 20px; }
.post-body h2, .post-body h3 { font-family: var(--font-display); font-weight: 400; margin: 40px 0 16px; line-height: 1.25; }
.post-body h2 { font-size: 26px; }
.post-body h3 { font-size: 21px; }
.post-body ul, .post-body ol { margin: 0 0 20px 22px; }
.post-body li { margin-bottom: 8px; }
.post-body blockquote { border-left: 3px solid var(--border); padding-left: 16px; color: #555; margin: 0 0 20px; }
.post-body code { font-size: 14px; background: var(--surface); padding: 1px 5px; border-radius: 3px; }
.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 24px 0;
  text-align: left;
  display: block;
  overflow-x: auto;
}
.post-body th {
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  text-align: left;
}
.post-body td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; color: #333; }
.post-body tr:nth-child(even) td { background: var(--surface); }
.post-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 40px;
}
.post-images img {
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: cover;
  border: 1px solid var(--border);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--ink-muted);
  transition: all 0.15s;
}
.share-btn:hover { border-color: var(--ink); color: var(--ink); }
.share-btn.copied { border-color: #3ab06e; color: #3ab06e; }

/* "Want one built?" box at the end of an article */
.post-cta {
  max-width: 640px;
  margin-top: 48px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.post-cta .eyebrow { margin-bottom: 6px; }
.post-cta-name { font-family: var(--font-display); font-size: 22px; line-height: 1.2; }
.post-cta-meta { font-size: 13px; color: var(--ink-muted); margin-top: 4px; }

.related { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--border); }
.related h2 { margin-bottom: 20px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.related-cover {
  aspect-ratio: 4/3;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 10px;
}
.related-cover img { width: 100%; height: 100%; object-fit: cover; }
.related-card:hover { opacity: 0.75; }
.related-title { font-family: var(--font-display); font-size: 17px; line-height: 1.25; margin-top: 6px; }

@media (max-width: 768px) {
  .article-card { grid-template-columns: 1fr; gap: 12px; }
  .article-cover { aspect-ratio: 16/7; }
  .related-grid { grid-template-columns: 1fr; }
}
