/* ================================================================
   FONT IMPORT - add this to your <head> in header.php
   BEFORE any other stylesheet link:

   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=Inter:ital,wght@0,400;0,500;0,600;1,400&display=swap">
   ================================================================ */

/* ============================================================
   CASE STUDIES PAGE - case-studies.css
   Requires app.css variables: --ink, --ink2, --signal, --signal2,
   --card, --surface, --border, --muted, --text, --radius,
   --radius-sm, --font, --mono, --white
   ============================================================ */

/* ── SECTION WRAPPER ── */
.cs-results-section {
  padding: 72px 0 80px;
  background: var(--surface, #f8f9fc);
}

/* ── FILTER TOOLBAR ── */
.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
  align-items: center;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 11px;
  font-family: var(--mono, monospace);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted, #6b7280);
  white-space: nowrap;
  margin-right: 2px;
}

.filter-btn {
  font-family: var(--font, sans-serif);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 100px;
  border: 1.5px solid var(--border, #e5e7eb);
  background: var(--card, #fff);
  color: var(--muted, #6b7280);
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
  line-height: 1;
}

.filter-btn:hover {
  border-color: var(--signal, #00e5a0);
  color: var(--ink, #0a0e1a);
}

.filter-btn.active {
  background: var(--ink, #0a0e1a);
  border-color: var(--ink, #0a0e1a);
  color: #fff;
}

/* Count badge inside button */
.filter-btn .ct {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-family: var(--mono, monospace);
  background: rgba(255,255,255,.18);
  border-radius: 100px;
  padding: 1px 6px;
  margin-left: 5px;
}
.filter-btn:not(.active) .ct {
  background: var(--border, #e5e7eb);
  color: var(--muted, #6b7280);
}

/* Result count text on right */
.result-count {
  margin-left: auto;
  font-size: 12px;
  font-family: var(--mono, monospace);
  color: var(--muted, #6b7280);
  white-space: nowrap;
}

/* ── CARDS GRID ── */
#cs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 1024px) {
  #cs-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  #cs-grid { grid-template-columns: 1fr; }
}

/* ── CARD ── */
.rc {
  background: var(--card, #fff);
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 16px);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  position: relative;
  overflow: hidden;
  animation: rcFadeUp .4s ease both;
}

.rc::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--signal, #00e5a0), var(--signal2, #00c4ff));
  opacity: 0;
  transition: opacity .2s;
}

.rc:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,.08);
  border-color: rgba(0,229,160,.3);
}

.rc:hover::before { opacity: 1; }

.rc.hidden { display: none; }

/* Card head */
.rc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  gap: 10px;
}

.rc-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink, #0a0e1a);
  line-height: 1.25;
}

.rc-loc {
  font-size: 12px;
  color: var(--muted, #6b7280);
  margin-top: 3px;
}

.rc-rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink, #0a0e1a);
  background: var(--signal, #00e5a0);
  padding: 5px 11px;
  border-radius: 100px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Industry tag */
.rc-ind {
  display: inline-block;
  font-size: 11px;
  font-family: var(--mono, monospace);
  letter-spacing: .07em;
  text-transform: uppercase;
  font-weight: 500;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid var(--border, #e5e7eb);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 16px;
}

/* Keywords */
.rc-kl {
  font-size: 11px;
  font-family: var(--mono, monospace);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted, #6b7280);
  margin-bottom: 8px;
}

.rc-kws {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.rc-kws li {
  font-size: 12px;
  font-weight: 500;
  color: var(--text, #1f2937);
  background: #f9fafb;
  border: 1px solid var(--border, #e5e7eb);
  padding: 4px 10px;
  border-radius: 6px;
}

/* Graph toggle button */
.rc-graph-btn {
  font-family: var(--font, sans-serif);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted, #6b7280);
  background: none;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm, 10px);
  padding: 9px 14px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: all .18s ease;
  margin-top: auto; /* pushes btn to bottom of card before graph */
}

.rc-graph-btn:hover {
  border-color: var(--signal, #00e5a0);
  color: var(--ink, #0a0e1a);
  background: rgba(0,229,160,.05);
}

.rc-graph-btn.open {
  background: var(--ink, #0a0e1a);
  border-color: var(--ink, #0a0e1a);
  color: #fff;
}

/* Graph slide area - FIXED: no blank gap when closed */
.rc-graph-area {
  overflow: hidden;
  max-height: 0;
  transition: max-height .35s ease;
}

.rc-graph-area.open {
  max-height: 180px; /* exactly enough for the chart */
  padding-top: 14px;
}

.rc-graph-area canvas {
  display: block;
  width: 100% !important;
  height: 150px !important;
}

/* Card footer */
.rc-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e5e7eb);
  flex-wrap: wrap;
}

.rc-t {
  font-size: 12px;
  color: var(--muted, #6b7280);
  font-family: var(--mono, monospace);
}

.rc-ai {
  font-size: 11px;
  font-weight: 600;
  color: var(--signal, #00e5a0);
  background: rgba(0,229,160,.1);
  border: 1px solid rgba(0,229,160,.25);
  padding: 3px 8px;
  border-radius: 100px;
}

.rc-flag {
  font-size: 16px;
  margin-left: auto;
}

/* ── EMPTY STATE ── */
.cs-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  display: none;
}

.cs-empty.show { display: block; }
.cs-empty__icon { font-size: 48px; margin-bottom: 12px; }
.cs-empty__title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.cs-empty__sub { color: var(--muted, #6b7280); }

/* ── GBP PERFORMANCE DASHBOARD ── */
.gbp-dashboard {
  margin-top: 64px;
  margin-bottom: 32px;
  background: var(--card, #fff);
  border: 1.5px solid var(--border, #e5e7eb);
  border-top: 3px solid var(--signal, #00e5a0);
  border-radius: var(--radius, 16px);
  padding: 48px 52px;
}

.gbp-dash__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 32px;
}

.gbp-dash__eyebrow {
  display: none;
}

.gbp-dash__title {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink, #0a0e1a);
  margin-bottom: 6px;
}

.gbp-dash__meta {
  font-size: 13px;
  color: var(--muted, #6b7280);
  font-family: var(--mono, monospace);
  margin-top: 4px;
}

.gbp-dash__hero-nums {
  display: flex;
  gap: 40px;
  text-align: right;
}

.gbp-dash__hero-val {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}

.gbp-dash__hero-label {
  font-size: 12px;
  color: var(--muted, #6b7280);
  margin-top: 5px;
  font-family: var(--mono, monospace);
}

.gbp-dash__hero-growth {
  font-size: 13px;
  font-weight: 700;
  color: var(--signal, #00e5a0);
  margin-top: 3px;
}

.gbp-dash__legend {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.gbp-leg {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text, #1f2937);
  font-weight: 500;
}

.gbp-leg::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot);
  flex-shrink: 0;
}

.gbp-dash__chart-wrap {
  width: 100%;
  height: 320px;
  margin-bottom: 32px;
}

.gbp-dash__chart-wrap canvas {
  width: 100% !important;
  height: 320px !important;
}

.gbp-dash__metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.gbp-metric {
  background: var(--surface, #f8f9fc);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm, 10px);
  padding: 28px 20px;
  text-align: center;
}

.gbp-metric__icon { font-size: 24px; margin-bottom: 10px; }
.gbp-metric__val  { font-size: 30px; font-weight: 800; color: var(--ink, #0a0e1a); margin-bottom: 6px; }
.gbp-metric__label{ font-size: 13px; color: var(--muted, #6b7280); font-family: var(--mono, monospace); margin-bottom: 6px; }
.gbp-metric__growth { font-size: 14px; font-weight: 700; color: var(--signal, #00e5a0); }

/* ── OWN PROOF ── */
.own-proof {
  margin-top: 5rem;
  background: var(--ink, #0a0e1a);
  border-radius: var(--radius, 16px);
  padding: 48px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.own-proof::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,229,160,.12) 0%, transparent 70%);
  pointer-events: none;
}

.own-proof h3 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
}

.own-proof h3 em {
  font-style: normal;
  color: var(--signal, #00e5a0);
}

.own-proof p {
  color: rgba(255,255,255,.65);
  max-width: 600px;
  margin: 0 auto 28px;
  line-height: 1.6;
  font-size: 15px;
}

.own-kws {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.own-kw {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink, #0a0e1a);
  background: var(--signal, #00e5a0);
  padding: 6px 14px;
  border-radius: 100px;
}

.own-since {
  font-family: var(--mono, monospace);
  font-size: 12px;
  color: rgba(255,255,255,.4);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ── ANIMATION ── */
@keyframes rcFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .filter-toolbar { gap: 8px; }
  .own-proof { padding: 32px 20px; }
  .gbp-dashboard { padding: 24px 20px; }
  .gbp-dash__hero-nums { text-align: left; }
  .gbp-dash__metrics { grid-template-columns: repeat(2, 1fr); }
}

