/*
 * category.css
 * Styles for the single post category page (category.php).
 * Requires style.css and archive-post.css to be loaded first.
 * Only defines styles that differ from or extend archive-post.css.
 */

/* ──────────────────────────────────────────
   CATEGORY HERO
   Replaces .blog-hero with a richer, accented
   version focused on the current category.
────────────────────────────────────────── */
.cat-page-hero {
  position: relative;
  overflow: hidden;
  padding: 56px 0 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

/* Decorative backdrop — teal left orb + yellow right glow */
.cat-page-hero-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 45% 120% at 0%   60%, rgba(41,214,181,.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 100% at 100% 40%, rgba(232,255,71,.05)  0%, transparent 55%);
  pointer-events: none;
}

.cat-page-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, transparent, black 15%, black 80%, transparent);
  pointer-events: none;
}

.cat-page-hero .container {
  position: relative;
  z-index: 2;
}

/* ── Breadcrumb ── */
.cat-page-hero .breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.cat-page-hero .breadcrumb a { transition: color .2s; }
.cat-page-hero .breadcrumb a:hover { color: var(--accent); }
.cat-page-hero .breadcrumb-sep { opacity: .35; }

/* ── Hero top row: icon + text + stats ── */
.cat-hero-top {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

/* Category icon badge */
.cat-hero-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: rgba(41,214,181,.12);
  border: 1px solid rgba(41,214,181,.25);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.cat-hero-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--accent3);
  fill: none;
  stroke-width: 1.6;
}

/* Text block */
.cat-hero-text { flex: 1; min-width: 240px; }

.cat-hero-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent3);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cat-hero-eyebrow::before {
  content: '';
  width: 20px;
  height: 2px;
  background: var(--accent3);
  flex-shrink: 0;
}

.cat-hero-title {
  font-family: var(--ff-head);
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  letter-spacing: .04em;
  line-height: 1;
  margin-bottom: 12px;
}

.cat-hero-desc {
  font-size: 14px;
  color: var(--muted);
  max-width: 560px;
  line-height: 1.8;
}

/* Stats row */
.cat-hero-stats {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  align-self: flex-start;
  flex-wrap: wrap;
  margin-top: 4px;
}

.cat-hero-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  text-align: center;
  min-width: 84px;
}
.cat-hero-stat-val {
  font-family: var(--ff-head);
  font-size: 1.75rem;
  color: var(--accent);
  letter-spacing: .04em;
  line-height: 1;
}
.cat-hero-stat-lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 5px;
}

/* ── Sub-category pills strip (below hero top row) ── */
.cat-hero-subcats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 18px 0 28px;
  border-top: 1px solid var(--border);
}

.cat-hero-subcats-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  align-self: center;
  flex-shrink: 0;
  margin-right: 4px;
}

.subcat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  transition: all .2s;
  white-space: nowrap;
}
.subcat-pill:hover {
  border-color: var(--accent3);
  color: var(--accent3);
  background: rgba(41,214,181,.06);
}
.subcat-pill.all {
  background: rgba(41,214,181,.1);
  border-color: rgba(41,214,181,.3);
  color: var(--accent3);
}
.subcat-pill-count {
  font-size: 10px;
  font-weight: 800;
  background: rgba(255,255,255,.08);
  padding: 1px 6px;
  border-radius: 99px;
}

/* ──────────────────────────────────────────
   CATEGORY TOOLBAR
   Simpler than archive toolbar — no cross-
   category search, just sort + view toggle.
────────────────────────────────────────── */
.cat-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.cat-result-count {
  font-size: 13px;
  color: var(--muted);
  flex: 1;
  min-width: 0;
}
.cat-result-count strong { color: var(--text); }

/* ──────────────────────────────────────────
   POST GRID  (3-column, no featured slot)
   Reuses .post-card from archive-post.css.
   Only overrides the grid columns.
────────────────────────────────────────── */
.cat-post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* List-view variant */
.cat-post-grid.view-list {
  grid-template-columns: 1fr;
}
.cat-post-grid.view-list .post-card {
  flex-direction: row;
}
.cat-post-grid.view-list .post-card-thumb {
  aspect-ratio: 4/3;
  width: 220px;
  flex-shrink: 0;
}
.cat-post-grid.view-list .post-card-body { padding: 22px 24px; }

/* ──────────────────────────────────────────
   CATEGORY SIDEBAR
   Replaces the generic "About Blog" card
   with a category-specific info card.
────────────────────────────────────────── */
.cat-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 90px;  /* header only — no sticky cat bar here */
}

/* Reuses .blog-sidebar-card, .blog-sidebar-head,
   .blog-sidebar-body, .sidebar-post-item, etc.
   from archive-post.css without redefinition.   */

/* Category info card header accent strip */
.cat-info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.cat-info-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent3), var(--accent));
}

.cat-info-body {
  padding: 20px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cat-info-name {
  font-family: var(--ff-head);
  font-size: 1.25rem;
  letter-spacing: .04em;
  padding-top: 4px;
}

.cat-info-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.75;
}

.cat-info-meta {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.cat-info-meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cat-info-meta-val {
  font-family: var(--ff-head);
  font-size: 1.4rem;
  color: var(--accent3);
  letter-spacing: .04em;
}
.cat-info-meta-lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Related categories list in sidebar */
.related-cats-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.related-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
}
.related-cat-item:hover {
  color: var(--text);
  background: var(--surface2);
}
.related-cat-count {
  font-size: 10px;
  font-weight: 800;
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: 99px;
  color: var(--muted);
}

/* ──────────────────────────────────────────
   EMPTY STATE
────────────────────────────────────────── */
.cat-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  gap: 16px;
}
.cat-empty svg { opacity: .12; }
.cat-empty h3 {
  font-family: var(--ff-head);
  font-size: 1.6rem;
  letter-spacing: .04em;
  color: var(--text);
}
.cat-empty p { font-size: 14px; color: var(--muted); max-width: 360px; line-height: 1.7; }

/* ──────────────────────────────────────────
   RESPONSIVE
────────────────────────────────────────── */
@media (max-width: 1024px) {
  .blog-layout { grid-template-columns: 1fr; } /* shared with archive */

  .cat-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .cat-post-grid { grid-template-columns: repeat(2, 1fr); }

  .cat-hero-top { gap: 20px; }
  .cat-hero-stats { align-self: auto; }
}

@media (max-width: 768px) {
  .cat-hero-icon  { display: none; }
  .cat-hero-stats { display: none; }
  .cat-hero-title { font-size: 2.2rem; }

  .cat-post-grid { grid-template-columns: 1fr; }
  .cat-post-grid.view-list .post-card { flex-direction: column; }
  .cat-post-grid.view-list .post-card-thumb { width: 100%; aspect-ratio: 16/9; }

  .cat-sidebar { grid-template-columns: 1fr; }

  .cat-hero-subcats { padding-bottom: 20px; }
}

@media (max-width: 520px) {
  .cat-page-hero { padding: 40px 0 0; }
  .cat-hero-subcats-label { display: none; }
}
