/* ============================================================
   TBB Category Cards: shared base for every category archive
   Tokens, theme-proof reset, page header, cards, tags, pagination.

   Look: white page, near-black type, neutral greys, one cream/brown
   highlight (bold text in the category description). Cards: warm
   hairline, faint fill, no shadow, 14px radius. No blue anywhere;
   orange only on link hover.

   Colours read the site tokens from TBB Pages (variables.css loads on
   every front-end page) and fall back to the same values without it.
   All sizes are px: the theme sets a small root font size.

   Specificity: the reset is (0,1,2) so it beats theme element rules;
   every component rule is ".tbb-cc .x" (0,2,0) or more.
   ============================================================ */

.tbb-cc {
  --cc-fg:          var(--tbb-fg, #0a0a0a);
  --cc-muted:       var(--tbb-muted, #404040);
  --cc-subtle:      var(--tbb-subtle, #737373);
  --cc-border:      var(--tbb-border, #e5e5e5);
  --cc-border-hi:   #d4d4d4;
  --cc-hl:          var(--tbb-hl, #854d0e);
  --cc-hl-soft:     rgb(133 77 14 / .06);
  --cc-edge:        var(--tbb-edge, rgb(120 53 15 / .15));
  --cc-edge-hover:  var(--tbb-edge-hover, rgb(120 53 15 / .3));
  --cc-fill:        var(--tbb-fill, rgb(255 255 255 / .7));
  --cc-brand:       var(--tbb-brand, oklch(66.6% .179 58.318));
  --cc-solid-bg:    var(--tbb-solid-bg, #171717);
  --cc-solid-fg:    var(--tbb-solid-fg, #ffffff);
  --cc-solid-hover: var(--tbb-solid-hover, #2a2a2a);
  --cc-primary:     var(--tbb-primary, #262626);
  --cc-primary-fg:  var(--tbb-primary-fg, #fafafa);
  --cc-ghost:       var(--tbb-ghost-hover, #f5f5f5);
  --cc-tag:         var(--tbb-tag, #e5e7eb);
  --cc-ok:          var(--tbb-ok, #16a34a);
  --cc-radius:      var(--tbb-radius, 10px);
  --cc-ring:        0 0 0 3px rgb(10 10 10 / .06);
  --cc-font:        var(--tbb-font, 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  --cc-display:     var(--tbb-font-display, 'Montserrat', 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif);

  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  width: 100%;
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 24px 96px;
  background: transparent;
  color: var(--cc-fg);
  font-family: var(--cc-font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: light;
}

/* Soft warm glow behind the page header */
.tbb-cc::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 420px;
  background: radial-gradient(55% 50% at 50% 30%, rgb(253 186 116 / .14), transparent 70%);
  pointer-events: none;
}

/* ── Theme-proof reset ───────────────────────────────────────── */
.tbb-cc *,
.tbb-cc *::before,
.tbb-cc *::after { box-sizing: border-box; }

.tbb-cc :is(h1, h2, h3, p):is(h1, h2, h3, p) {
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: normal;
  text-transform: none;
  color: inherit;
}
.tbb-cc :is(a, button):is(a, button) { text-decoration: none; box-shadow: none; text-shadow: none; }
.tbb-cc :is(button, input, select):is(button, input, select) {
  margin: 0;
  font-family: inherit;
  letter-spacing: normal;
  text-transform: none;
  box-shadow: none;
}
.tbb-cc :is(a, button, input, select):is(a, button, input, select):focus-visible {
  outline: 2px solid var(--cc-fg);
  outline-offset: 2px;
}
.tbb-cc [hidden] { display: none !important; }

.tbb-cc .tbb-cc-icon {
  display: inline-block;
  flex-shrink: 0;
  width: 1em;
  height: 1em;
}

/* ── Page header ─────────────────────────────────────────────── */
.tbb-cc .tbb-cc-head {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 0 32px;
  text-align: center;
}
.tbb-cc .tbb-cc-head__title {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.025em;
  color: var(--cc-fg);
  text-wrap: balance;
}
.tbb-cc .tbb-cc-head__desc {
  max-width: 640px;
  margin: 12px auto 0;
  font-size: 16px;
  line-height: 1.65;
  color: var(--cc-muted);
}
.tbb-cc .tbb-cc-head__desc p + p { margin-top: 8px; }
/* Bold text in the category description becomes the highlight phrase */
.tbb-cc .tbb-cc-head__desc :is(strong, b) {
  font-family: var(--cc-display);
  font-weight: 500;
  letter-spacing: -.025em;
  text-transform: capitalize;
  color: var(--cc-hl);
}
.tbb-cc .tbb-cc-head__desc a {
  color: var(--cc-fg);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s;
}
.tbb-cc .tbb-cc-head__desc a:hover { color: var(--cc-brand); }

/* ── Cards ───────────────────────────────────────────────────── */
.tbb-cc .tbb-cc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--cc-edge);
  border-radius: calc(var(--cc-radius) + 4px);
  background: var(--cc-fill);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  box-shadow: none;
  transition: border-color .3s, opacity .3s;
}
.tbb-cc .tbb-cc-card:hover { border-color: var(--cc-edge-hover); opacity: 1; }

.tbb-cc .tbb-cc-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--cc-tag);
  border-radius: 4px;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--cc-muted);
  white-space: nowrap;
}

/* Button on a card */
.tbb-cc .tbb-cc-btn-card,
.tbb-cc .tbb-cc-btn-card:focus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 14px;
  border: 0;
  border-radius: calc(var(--cc-radius) - 2px);
  background: var(--cc-primary);
  color: var(--cc-primary-fg);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  transition: opacity .2s;
}
.tbb-cc .tbb-cc-btn-card:hover { opacity: .9; background: var(--cc-primary); color: var(--cc-primary-fg); }
.tbb-cc .tbb-cc-btn-card .tbb-cc-icon { font-size: 15px; }

/* Solid button: one per screen, top-right + bottom-left corners */
.tbb-cc .tbb-cc-btn-solid,
.tbb-cc .tbb-cc-btn-solid:focus {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 0 var(--cc-radius) 0 var(--cc-radius);
  background: var(--cc-solid-bg);
  color: var(--cc-solid-fg);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: background-color .2s;
}
.tbb-cc .tbb-cc-btn-solid:hover { background: var(--cc-solid-hover); color: var(--cc-solid-fg); }
.tbb-cc .tbb-cc-btn-solid .tbb-cc-icon { margin-left: -2px; font-size: 16px; }

/* ── Pagination ──────────────────────────────────────────────── */
.tbb-cc .tbb-cc-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 48px;
}
.tbb-cc .tbb-cc-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: calc(var(--cc-radius) - 2px);
  background: transparent;
  color: var(--cc-fg);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  transition: background-color .2s, color .2s;
}
.tbb-cc .tbb-cc-pagination a.page-numbers:hover { background: var(--cc-ghost); color: var(--cc-fg); }
.tbb-cc .tbb-cc-pagination .page-numbers.current {
  border-color: var(--cc-border);
  background: #ffffff;
  font-weight: 600;
}
.tbb-cc .tbb-cc-pagination .page-numbers.dots { color: var(--cc-subtle); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (min-width: 640px) {
  .tbb-cc { padding-inline: 32px; }
  .tbb-cc .tbb-cc-head { padding: 56px 0 40px; }
  .tbb-cc .tbb-cc-head__title { font-size: 42px; }
  .tbb-cc .tbb-cc-head__desc { font-size: 18px; }
  .tbb-cc .tbb-cc-card { opacity: .9; }
}

@media (prefers-reduced-motion: reduce) {
  .tbb-cc *,
  .tbb-cc *::before,
  .tbb-cc *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
