/* Blog category navigation. Scoped to the blog's .post-page body class, so nothing here reaches
 * a calculator page. Every colour is a token from styles.css, which keeps the light, dark and
 * Auto themes consistent. The links are ordinary anchors and work with JavaScript off.
 */

/* ---------------------------------------------------------------- The blog landing page */

.post-page .blog-topics { margin: 0 0 28px; }
.post-page .blog-topics-heading {
  margin: 0 0 12px;
  font-size: 1.15rem;
  line-height: 1.3;
}
.post-page .blog-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.post-page .blog-category-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}
.post-page .blog-category-card:hover {
  border-color: var(--highlight);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.post-page .blog-category-card:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 3px;
}
.post-page .blog-category-icon { font-size: 1.35rem; line-height: 1.2; }
.post-page .blog-category-name { font-weight: 700; line-height: 1.25; }
.post-page .blog-category-copy {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
}
.post-page .blog-category-count {
  margin-top: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--highlight);
}
.post-page .blog-all-articles {
  margin: 30px 0 12px;
  font-size: 1.15rem;
  line-height: 1.3;
}

/* ---------------------------------------------------------------- Category labels on cards and articles */

.post-page .post-item .post-category { margin: 10px 0 0; }
.post-page .blog-category-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}
.post-page .blog-category-link:hover { border-color: var(--highlight); }
.post-page .blog-category-link:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
}
/* In an article's title block the label sits on its own line under the back links. */
.post-page .page-title > .blog-category-link {
  display: flex;
  margin: 0 0 10px;
}

/* ---------------------------------------------------------------- The category archive */

.post-page .blog-category-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--muted);
}
.post-page .blog-category-breadcrumb a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.post-page .blog-category-breadcrumb a:hover { text-decoration: underline; }
.post-page .blog-category-breadcrumb a:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
}
.post-page .blog-category-breadcrumb .breadcrumb-separator { color: var(--muted); }
.post-page .blog-category-intro { max-width: 68ch; }
.post-page .blog-category-countline {
  margin: 6px 0 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--highlight);
}
.post-page .blog-category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 26px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
.post-page .blog-category-nav a {
  display: inline-block;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}
.post-page .blog-category-nav a:hover { border-color: var(--highlight); }
.post-page .blog-category-nav a:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
}
.post-page .blog-category-nav a[aria-current="page"] {
  border-color: var(--highlight);
  color: var(--highlight);
  background: var(--card);
}
.post-page .post-body > .blog-category-calculators { margin: 28px 0 14px; }
.post-page .post-body > .blog-category-back { margin: 0 0 24px; font-size: 0.9rem; }

@media (max-width: 760px) {
  .post-page .blog-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .post-page .blog-category-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .post-page .blog-category-card { transition: none; }
  .post-page .blog-category-card:hover { transform: none; }
}
