/*
Theme Name: TradeBasis Insights
Theme URI: https://insights.tradebasis.ca
Author: TradeBasis
Author URI: https://tradebasis.ca
Description: Custom dark theme for TradeBasis Automotive Market Insights blog. Matches the design language of the Lite and Pro product pages.
Version: 1.4.0
License: Proprietary
Text Domain: tradebasis-insights
*/

/* ── DESIGN TOKENS ── */
:root {
  --tb-navy: #0B1220;
  --tb-navy-mid: #0F1B2D;
  --tb-navy-light: #162035;
  --tb-card: #1A2540;
  --tb-card-hover: #1E2D4A;
  --tb-blue: #4D7EF7;
  --tb-blue-light: #6B96FF;
  --tb-blue-glow: rgba(77, 126, 247, 0.15);
  --tb-green: #34D399;
  --tb-green-dim: rgba(52, 211, 153, 0.12);
  --tb-amber: #FBBF24;
  --tb-amber-dim: rgba(251, 191, 36, 0.12);
  --tb-text: #F1F5F9;
  --tb-text-mid: #94A3B8;
  --tb-text-dim: #64748B;
  --tb-border: rgba(255,255,255,0.06);
  --tb-border-light: rgba(255,255,255,0.1);
  --tb-border-blue: rgba(77, 126, 247, 0.25);
  --tb-radius: 12px;
  --tb-radius-lg: 20px;
  --tb-font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --tb-mono: 'JetBrains Mono', monospace;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── BASE ── */
html { scroll-behavior: smooth; }
body {
  font-family: var(--tb-font);
  background: var(--tb-navy);
  color: var(--tb-text-mid);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a {
  color: var(--tb-blue-light);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--tb-text); }
img { max-width: 100%; height: auto; display: block; }

.tb-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ══════════════════════════════════════
   PROMO BANNER — sticky on all devices
   ══════════════════════════════════════ */
.tb-promo-banner {
  display: block;
  background: linear-gradient(90deg, var(--tb-blue) 0%, #3B5BDB 50%, var(--tb-blue-light) 100%);
  padding: 10px 24px;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.2s ease;
  position: sticky;
  top: 0;
  z-index: 110;
}
.tb-promo-banner:hover { opacity: 0.92; color: #fff; }
.tb-promo-inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  justify-content: center;
}
.tb-promo-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.tb-promo-text-desktop {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.92);
}
.tb-promo-text-mobile {
  display: none;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.tb-promo-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.tb-promo-cta svg {
  transition: transform 0.2s ease;
}
.tb-promo-banner:hover .tb-promo-cta svg {
  transform: translateX(2px);
}

/* ══════════════════════════════════════
   SITE HEADER
   ══════════════════════════════════════ */
.tb-site-header {
  background: rgba(11, 18, 32, 0.92);
  border-bottom: 1px solid var(--tb-border);
  padding: 0 24px;
  position: sticky;
  top: 38px; /* sits below the promo banner */
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.tb-header-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* Logo — PNG mark + wordmark */
.tb-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--tb-text);
}
.tb-logo:hover { color: var(--tb-text); }
.tb-logo-img {
  height: 30px;
  width: auto;
  display: block;
}
.tb-logo-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tb-text);
  white-space: nowrap;
}
.tb-logo-text .tb-blue { color: var(--tb-blue-light); }

/* Nav */
.tb-header-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tb-header-nav a {
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}
.tb-nav-cta-outline {
  padding: 8px 16px;
  color: var(--tb-blue-light);
  border: 1px solid var(--tb-border-blue);
  border-radius: 8px;
  font-weight: 600 !important;
}
.tb-nav-cta-outline:hover {
  border-color: var(--tb-blue-light);
  color: var(--tb-text);
  background: var(--tb-blue-glow);
}
.tb-header-nav .tb-nav-cta {
  padding: 8px 16px;
  background: var(--tb-blue);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.tb-header-nav .tb-nav-cta:hover {
  background: var(--tb-blue-light);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(77, 126, 247, 0.3);
}

/* ══════════════════════════════════════
   CATEGORY NAV
   ══════════════════════════════════════ */
.tb-category-nav {
  background: var(--tb-navy-mid);
  border-bottom: 1px solid var(--tb-border);
  padding: 0 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tb-category-nav::-webkit-scrollbar { display: none; }
.tb-category-nav-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 48px;
}
.tb-cat-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--tb-text-dim);
  border-radius: 6px;
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.15s ease;
}
.tb-cat-link:hover {
  color: var(--tb-text-mid);
  background: rgba(255,255,255,0.04);
}
.tb-cat-link.active {
  color: var(--tb-blue-light);
  background: var(--tb-blue-glow);
  font-weight: 600;
}

/* ══════════════════════════════════════
   BLOG INDEX HERO
   ══════════════════════════════════════ */
.tb-blog-hero {
  background: var(--tb-navy);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(77, 126, 247, 0.12), transparent);
  padding: 72px 24px 56px;
  text-align: center;
  position: relative;
}
.tb-blog-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--tb-border-light), transparent);
}
.tb-blog-hero h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--tb-text);
  margin-bottom: 12px;
}
.tb-blog-hero p {
  font-size: 17px;
  color: var(--tb-text-mid);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ══════════════════════════════════════
   POST CARDS (INDEX / ARCHIVE)
   ══════════════════════════════════════ */
.tb-posts { padding: 56px 24px 80px; }
.tb-posts-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.tb-post-card {
  background: var(--tb-card);
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius-lg);
  padding: 36px 32px;
  transition: border-color 0.2s ease, transform 0.15s ease;
  display: block;
  text-decoration: none;
  color: inherit;
}
.tb-post-card:hover {
  border-color: var(--tb-border-blue);
  transform: translateY(-2px);
  color: inherit;
}
.tb-post-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tb-post-card-category {
  display: inline-block;
  padding: 3px 10px;
  background: var(--tb-blue-glow);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tb-blue-light);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.tb-post-card-date {
  font-size: 13px;
  color: var(--tb-text-dim);
  font-family: var(--tb-mono);
}
.tb-post-card h2 {
  font-size: clamp(20px, 3vw, 24px);
  font-weight: 700;
  color: var(--tb-text);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.tb-post-card p {
  font-size: 15px;
  color: var(--tb-text-mid);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tb-post-card-read {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tb-blue-light);
  letter-spacing: 0.01em;
}
.tb-post-card-read svg {
  width: 14px; height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  transition: transform 0.2s ease;
}
.tb-post-card:hover .tb-post-card-read svg { transform: translateX(3px); }

/* ══════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════ */
.tb-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 24px 80px;
}
.tb-pagination a,
.tb-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  border: 1px solid var(--tb-border);
  color: var(--tb-text-mid);
  text-decoration: none;
  transition: all 0.2s ease;
}
.tb-pagination a:hover {
  border-color: var(--tb-border-blue);
  color: var(--tb-text);
  background: var(--tb-card);
}
.tb-pagination .current {
  background: var(--tb-blue);
  border-color: var(--tb-blue);
  color: #fff;
  font-weight: 600;
}

/* ══════════════════════════════════════
   SINGLE POST — HERO
   ══════════════════════════════════════ */
.tb-single-hero {
  background: var(--tb-navy);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(77, 126, 247, 0.1), transparent);
  padding: 56px 24px 48px;
  position: relative;
}
.tb-single-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--tb-border-light), transparent);
}
.tb-single-hero .tb-container { max-width: 800px; }
.tb-single-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.tb-single-hero h1 {
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--tb-text);
  margin-bottom: 16px;
  max-width: 720px;
}
.tb-single-excerpt {
  font-size: 18px;
  color: var(--tb-text-mid);
  line-height: 1.65;
  max-width: 640px;
}

/* ══════════════════════════════════════
   SINGLE POST — CONTENT
   ══════════════════════════════════════ */
.tb-post-content { padding: 56px 24px 80px; }
.tb-post-content .tb-container { max-width: 740px; }
.tb-post-content h2 {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  color: var(--tb-text);
  letter-spacing: -0.02em;
  margin: 48px 0 16px;
  line-height: 1.2;
}
.tb-post-content h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--tb-text);
  letter-spacing: -0.01em;
  margin: 36px 0 12px;
  line-height: 1.3;
}
.tb-post-content h4 {
  font-size: 17px;
  font-weight: 600;
  color: var(--tb-text);
  margin: 28px 0 10px;
}
.tb-post-content p {
  font-size: 16px;
  color: var(--tb-text-mid);
  line-height: 1.75;
  margin-bottom: 20px;
}
.tb-post-content strong { color: var(--tb-text); font-weight: 600; }
.tb-post-content em { font-style: italic; }
.tb-post-content a {
  color: var(--tb-blue-light);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(107, 150, 255, 0.3);
}
.tb-post-content a:hover { text-decoration-color: var(--tb-blue-light); }
.tb-post-content ul,
.tb-post-content ol {
  margin: 16px 0 24px 24px;
  color: var(--tb-text-mid);
}
.tb-post-content li { margin-bottom: 8px; line-height: 1.65; font-size: 16px; }
.tb-post-content blockquote {
  border-left: 3px solid var(--tb-blue);
  padding: 16px 24px;
  margin: 24px 0;
  background: var(--tb-card);
  border-radius: 0 var(--tb-radius) var(--tb-radius) 0;
}
.tb-post-content blockquote p { color: var(--tb-text); font-size: 16px; margin-bottom: 0; }
.tb-post-content hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--tb-border-light), transparent);
  margin: 48px 0;
}

/* Tables */
.tb-post-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--tb-radius);
  overflow: hidden;
  border: 1px solid var(--tb-border);
  margin: 24px 0 32px;
  font-size: 14px;
}
.tb-post-content table th {
  background: var(--tb-card);
  font-weight: 600;
  color: var(--tb-text);
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--tb-border);
}
.tb-post-content table td {
  background: var(--tb-navy-light);
  color: var(--tb-text-mid);
  padding: 12px 16px;
  border-bottom: 1px solid var(--tb-border);
}
.tb-post-content table tr:last-child td { border-bottom: none; }
.tb-post-content table tr:hover td { background: var(--tb-card); }

/* Code */
.tb-post-content code {
  font-family: var(--tb-mono);
  font-size: 14px;
  background: var(--tb-card);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--tb-green);
}
.tb-post-content pre {
  background: var(--tb-card);
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  padding: 24px;
  overflow-x: auto;
  margin: 24px 0;
}
.tb-post-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: var(--tb-text-mid);
}

/* ══════════════════════════════════════
   POST FOOTER — BACK LINK
   ══════════════════════════════════════ */
.tb-post-footer { padding: 0 24px 80px; }
.tb-post-footer .tb-container {
  max-width: 740px;
  padding-top: 32px;
  border-top: 1px solid var(--tb-border);
}
.tb-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tb-blue-light);
  text-decoration: none;
}
.tb-back-link svg {
  width: 14px; height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  transition: transform 0.2s ease;
}
.tb-back-link:hover svg { transform: translateX(-3px); }

/* ══════════════════════════════════════
   BOLD CTA BANNER — FOOTER
   ══════════════════════════════════════ */
.tb-cta-banner-bold {
  position: relative;
  overflow: hidden;
  padding: 72px 24px;
  text-align: center;
  background: linear-gradient(170deg, #0B1220 0%, #0E1A30 30%, #132244 60%, #162B5A 100%);
  border-top: 1px solid var(--tb-border);
}
.tb-cta-banner-bold::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(77, 126, 247, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 126, 247, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 20%, transparent 70%);
}
.tb-cta-banner-bold::after {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(77, 126, 247, 0.2) 0%, transparent 60%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.tb-cta-inner {
  position: relative;
  z-index: 2;
  max-width: 640px;
  margin: 0 auto;
}
.tb-cta-headline {
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--tb-text);
  margin-bottom: 16px;
}
.tb-cta-headline .tb-accent {
  background: linear-gradient(135deg, var(--tb-blue-light), var(--tb-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.tb-cta-sub {
  font-size: 17px;
  color: var(--tb-text-mid);
  max-width: 480px;
  margin: 0 auto 32px;
  line-height: 1.6;
}
.tb-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  background: var(--tb-blue);
  color: #fff;
  font-family: var(--tb-font);
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
  letter-spacing: 0.01em;
  box-shadow: 0 0 0 1px rgba(77, 126, 247, 0.3), 0 8px 32px rgba(77, 126, 247, 0.2);
}
.tb-cta-btn:hover {
  background: var(--tb-blue-light);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(107, 150, 255, 0.4), 0 12px 48px rgba(77, 126, 247, 0.35);
}
.tb-cta-btn:visited { color: #fff; }
.tb-cta-btn svg { transition: transform 0.2s ease; }
.tb-cta-btn:hover svg { transform: translateX(2px); }
.tb-cta-note {
  display: block;
  margin-top: 16px;
  font-size: 13px;
  color: var(--tb-text-dim);
}
.tb-cta-proof {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.tb-cta-proof-item { text-align: center; }
.tb-cta-proof-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--tb-text);
  letter-spacing: -0.02em;
}
.tb-cta-proof-label {
  font-size: 12px;
  color: var(--tb-text-dim);
  margin-top: 2px;
}
.tb-cta-proof-divider {
  width: 1px; height: 32px;
  background: var(--tb-border-light);
}
.tb-orb-left, .tb-orb-right {
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}
.tb-orb-left {
  background: radial-gradient(circle, rgba(52, 211, 153, 0.08) 0%, transparent 60%);
  bottom: -100px; left: -100px;
}
.tb-orb-right {
  background: radial-gradient(circle, rgba(77, 126, 247, 0.1) 0%, transparent 60%);
  top: -80px; right: -80px;
}

/* ══════════════════════════════════════
   SITE FOOTER
   ══════════════════════════════════════ */
.tb-site-footer {
  background: var(--tb-navy);
  border-top: 1px solid var(--tb-border);
  padding: 32px 24px;
  text-align: center;
}
.tb-site-footer p { font-size: 13px; color: var(--tb-text-dim); }
.tb-site-footer a { color: var(--tb-text-dim); text-decoration: none; }
.tb-site-footer a:hover { color: var(--tb-text-mid); }

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 768px) {
  .tb-post-card { padding: 28px 24px; }
  .tb-single-hero { padding: 40px 20px 36px; }
  .tb-post-content { padding: 40px 20px 60px; }
  .tb-blog-hero { padding: 52px 20px 40px; }
  .tb-cta-banner-bold { padding: 56px 20px; }
  .tb-cta-proof { gap: 20px; }

  /* Banner: swap to short mobile text */
  .tb-promo-text-desktop { display: none; }
  .tb-promo-text-mobile { display: inline; }
  .tb-promo-banner { padding: 10px 16px; }

  /* Header: hide Start Appraising, rely on banner for conversion */
  .tb-nav-cta-outline { display: none; }

  /* Sticky offset for mobile (banner may be slightly taller) */
  .tb-site-header { top: 38px; }
}
@media (max-width: 520px) {
  .tb-post-card-meta { gap: 8px; }
  .tb-post-content table { font-size: 13px; }
  .tb-post-content table th,
  .tb-post-content table td { padding: 10px 12px; }
  .tb-cta-proof-divider { display: none; }
  .tb-cta-proof { gap: 24px; }
}
