/* ==========================================================================
   category.css  —  Category / listing pages (Math Calculators, Misc
   Calculators, Tools hub). Hero band + card grid + cross-category banner.
   Load order: common, header, category, content, footer.
   ========================================================================== */

/* ------------------------------ Hero band ------------------------------ */
.cat-hero { background: var(--bg-hero); padding: 26px 0 44px; }

.cat-hero .calc-breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  font-size: .84rem; color: var(--muted); margin-bottom: 26px;
}
.cat-hero .calc-breadcrumb a { color: var(--muted); font-weight: 500; }
.cat-hero .calc-breadcrumb a:hover { color: var(--primary); }
.cat-hero .calc-breadcrumb .sep { width: 14px; height: 14px; opacity: .55; }
.cat-hero .calc-breadcrumb .current { color: var(--primary); font-weight: 600; }
[data-theme="dark"] .cat-hero .calc-breadcrumb a:hover { color: var(--primary-light); }
[data-theme="dark"] .cat-hero .calc-breadcrumb .current { color: var(--primary-light); }

.cat-hero-inner { display: flex; align-items: center; gap: 22px; }
.cat-hero-inner .icon-chip { width: 78px; height: 78px; border-radius: 22px; box-shadow: var(--shadow-md); }
.cat-hero-inner .icon-chip img { width: 40px; height: 40px; }
.cat-hero h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
.cat-hero .cat-tag {
  display: inline-block; margin-top: 6px;
  font-size: .8rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--primary);
}
.cat-hero .cat-tag.green { color: var(--green-dark); }
.cat-hero .cat-desc { margin-top: 8px; color: var(--muted); font-size: 1rem; max-width: 640px; }

.cat-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.cat-meta .badge-pill { background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }

/* ------------------------------ Card grid ------------------------------ */
.cat-cards { padding-block: 44px; background: var(--bg); }

.ccard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 18px;
}
.ccard {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  padding: 22px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.ccard:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.ccard-top { display: flex; align-items: center; justify-content: space-between; }
.ccard-top .icon-chip { width: 50px; height: 50px; border-radius: 14px; }
.ccard-top .icon-chip img { width: 25px; height: 25px; }
.ccard-top .micon { width: 20px; height: 20px; color: var(--muted); transition: color var(--transition), transform var(--transition); }
.ccard:hover .ccard-top .micon { color: var(--primary); transform: translateX(3px); }
.ccard h3 { font-size: 1.05rem; font-weight: 600; }
.ccard p { font-size: .88rem; color: var(--muted); line-height: 1.6; flex: 1 1 auto; }
.ccard .ccard-cta {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .88rem; font-weight: 600; color: var(--primary);
}
[data-theme="dark"] .ccard .ccard-cta { color: var(--primary-light); }

/* ------------------------- Cross-category banner ------------------------ */
.cat-switch { padding-block: 10px 54px; background: var(--bg); }
.cat-switch-card {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  background: var(--primary-grad);
  border-radius: var(--r-lg);
  padding: 28px 32px;
  color: #fff;
  box-shadow: var(--shadow-primary);
}
.cat-switch-card h3 { color: #fff; font-size: 1.25rem; margin-bottom: 4px; }
.cat-switch-card p { color: rgba(255, 255, 255, .82); font-size: .94rem; }
.cat-switch-card .btn-light { flex-shrink: 0; }

/* The /calculators directory lists a handful of category cards rather than a long
   item list, so it holds a three-column rhythm instead of auto-filling the row. */
.cat-index .ccard-grid { grid-template-columns: repeat(3, 1fr); }

/* =============================== RESPONSIVE ============================= */
@media (max-width: 900px) {
  .cat-index .ccard-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .cat-hero-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .cat-switch-card { padding: 24px 22px; }
  .cat-index .ccard-grid { grid-template-columns: 1fr; }
}
