/* ==========================================================================
   Category pages — the same ledger language as tool-page.css
   --------------------------------------------------------------------------
   Loaded last on category/*.html. Restyles the shared tool cards and the
   category hero without changing markup. The home page has its own
   assets/home.css.

   What changes, and why:
   - Tool cards lose their per-category colour (ten hues on one grid read as
     noise) and their pills. The category becomes a quiet label, the card
     ends in a dashed rule and a "calculate" line, like a ledger entry.
   - Section titles carry the brand's equals bars instead of free-floating
     centred headings.
   ========================================================================== */

:root {
  --hub-line: color-mix(in srgb, var(--primary-text) 14%, transparent);
  --hub-radius: 18px;
  --hub-bars: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 40'%3E%3Crect x='0' y='6' width='60' height='11' rx='5.5'/%3E%3Crect x='22' y='23' width='38' height='11' rx='5.5'/%3E%3C/svg%3E");
}

/* ── Section headings ───────────────────────────────────────────────────── */

.v2-section-header {
  align-items: end;
  text-align: start;
  margin-bottom: 24px;
}
.v2-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(24px, 2.8vw, 32px);
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}
.v2-section-title::before {
  content: "";
  width: 26px;
  height: 17px;
  flex: none;
  background: var(--accent);
  -webkit-mask: var(--hub-bars) center / contain no-repeat;
          mask: var(--hub-bars) center / contain no-repeat;
}
.v2-section-subtitle {
  color: var(--text-muted);
  font-size: var(--text-base, 16px);
  margin-top: 4px;
}
.v2-section-link {
  font-weight: 600;
  color: var(--primary-text);
}

/* ── Tool cards (home grid and category grid) ───────────────────────────── */

.tools-grid .tool-item .tool-card {
  --cat: var(--primary-text);
  --cat-tint: color-mix(in srgb, var(--primary-text) 9%, transparent);
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 20px 20px 16px;
  background: var(--surface);
  border: 1px solid var(--hub-line) !important; /* index.html sets an inline amber border on "new" cards */
  border-radius: var(--hub-radius);
  box-shadow: none;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.tools-grid .tool-item .tool-card:hover {
  border-color: var(--primary-text) !important;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -18px rgba(26, 58, 92, .35);
}
.tools-grid .tool-item .tool-card .card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
}
.tools-grid .tool-item .tool-card .tool-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--cat-tint);
  color: var(--primary-text);
}
/* The category, as a label rather than a pill. */
.tools-grid .tool-item .tool-card .tool-tag {
  padding: 0;
  background: none !important;
  color: var(--text-muted) !important;
  border: 0;
  font-size: var(--text-xs, 13px);
  font-weight: 500;
}
.tools-grid .tool-item .tool-card .tool-tag .ico { display: none; }
.tools-grid .tool-item .tool-card.is-new .tool-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-text) !important;
  font-weight: 700;
}
.tools-grid .tool-item .tool-card.is-new .tool-tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.tools-grid .tool-item .tool-card h3 {
  font-size: var(--text-md, 17px);
  font-weight: 700;
  line-height: 1.55;
  color: var(--text);
  margin: 4px 0 0;
}
.tools-grid .tool-item .tool-card p {
  font-size: var(--text-sm, 14px);
  line-height: 1.75;
  color: var(--text-muted);
  margin: 0;
}
.tools-grid .tool-item .tool-card .card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--hub-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tools-grid .tool-item .tool-card .calc-now {
  color: var(--primary-text);
  font-weight: 700;
  font-size: var(--text-sm, 14px);
  background: none;
  padding: 0;
}
.tools-grid .tool-item .tool-card .arrow-icon {
  color: var(--accent-text);
  transition: transform .18s ease;
}
.tools-grid .tool-item .tool-card:hover .arrow-icon { transform: translateX(-4px); }

/* ── Category pages ────────────────────────────────────────────────────── */

/* The hero reads like a tool page header: start-aligned, no card, no
   coloured side stripe (each page set its own in an inline style). */
.category-page .category-hero {
  max-width: none;
  margin: 28px 0 32px;
  padding: 0;
  background: none;
  border: 0 !important;
  box-shadow: none;
  text-align: start;
}
.category-page .category-hero-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 0 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary-text) 9%, transparent);
  color: var(--primary-text);
  font-size: 24px;
}
.category-page .category-hero h1 {
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.4;
  color: var(--text);
  max-width: 28ch;
  margin: 0 0 12px;
}
.category-page .category-hero-desc {
  max-width: 64ch;
  margin: 0;
  font-size: var(--text-md, 18px);
  line-height: 1.8;
  color: var(--text-muted);
}
.category-page .category-hero .last-updated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: var(--text-xs, 13px);
  color: var(--text-muted);
}
.category-page .category-hero .last-updated::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success, #27ae60);
}

/* The tools grid section keeps the full width; tool-page.css narrows the
   other content sections to a reading column. */
.category-page > .content-section:has(.tools-grid) { max-width: none; margin-inline: 0; }
.category-page .category-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
/* Every card on a category page belongs to that category, so the label
   only repeats the page title. */
.category-page .tools-grid .tool-card .tool-tag { display: none; }
.category-page .tools-grid .tool-card.is-new .tool-tag { display: inline-flex; }

.category-page .other-categories-grid { gap: 10px; }
.category-page .cat-link-card {
  border: 1px solid var(--hub-line) !important;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: none;
}
.category-page .cat-link-card:hover { border-color: var(--primary-text) !important; transform: none; }
.category-page .cat-link-icon { color: var(--primary-text); }

@media (prefers-reduced-motion: reduce) {
  .tools-grid .tool-item .tool-card:hover { transform: none; }
}
