/* Articles gallery + reader — extends landing.css */
.articles-page,
.article-page {
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
  padding-bottom: 4rem;
}

.articles-hero {
  margin-bottom: 2rem;
}

.articles-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  margin: 0 0 0.75rem;
  line-height: 1.15;
}

.articles-hero-lead {
  color: var(--text-muted);
  max-width: 58ch;
  margin: 0 0 1.25rem;
}

.articles-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.articles-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.articles-filter button {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.articles-filter button:hover,
.articles-filter button[aria-pressed="true"] {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: rgba(233, 69, 96, 0.45);
}

.articles-filter button[aria-pressed="true"] {
  background: rgba(233, 69, 96, 0.15);
}

.articles-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: auto;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.35rem;
}

.articles-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.articles-card[hidden] {
  display: none !important;
}

.articles-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  border-color: rgba(233, 69, 96, 0.35);
  text-decoration: none;
}

.articles-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.articles-card-media {
  aspect-ratio: 1200 / 627;
  background: var(--bg-elevated);
  overflow: hidden;
}

.articles-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.articles-card-body {
  padding: 1rem 1.1rem 1.15rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.articles-card-body strong {
  font-size: 1.02rem;
  line-height: 1.35;
  color: var(--text);
}

.articles-card-teaser {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.articles-card-tags {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-top: 0.35rem;
}

.article-tag {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(233, 69, 96, 0.12);
  color: var(--text-muted);
  border: 1px solid rgba(233, 69, 96, 0.2);
}

.articles-empty {
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.articles-empty[hidden] {
  display: none !important;
}

.articles-how {
  margin-top: 2.5rem;
  padding: 1rem 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
  color: var(--text-muted);
}

.articles-how code {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* Reader page */
.article-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.article-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.article-header h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.article-lead {
  margin: 0 0 0.85rem;
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 44rem;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.article-cover {
  margin: 0 0 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.article-cover img {
  display: block;
  width: 100%;
  height: auto;
}

.article-body {
  max-width: 44rem;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.25rem;
  font-size: 0.92rem;
}

.article-body th,
.article-body td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.65rem;
  text-align: left;
}

.article-body th {
  background: var(--bg-card);
  color: var(--text);
}

.article-body pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.45;
}

.article-body pre code {
  background: transparent;
  border: none;
  padding: 0;
}

.article-body pre.mermaid {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1.25rem 0;
  overflow-x: auto;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.4;
}

.article-body pre.mermaid svg {
  max-width: 100%;
  height: auto;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.article-body blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  color: var(--text-muted);
}

.article-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}

.article-footer-nav a {
  font-weight: 600;
}
