/*
Theme Name: GeneratePress
Theme URI: https://generatepress.com
Author: Tom Usborne & TradeNest.ai
Author URI: https://tradenest.ai
Description: GeneratePress customized for TradeNest.ai - AI-Driven E-Commerce & Global Sourcing Intelligence.
Version: 3.6.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: generatepress
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ==========================================================================
   1. Design System & CSS Custom Properties
   ========================================================================== */
:root {
  /* Brand Colors */
  --tn-primary: #4F46E5;
  --tn-primary-hover: #4338CA;
  --tn-primary-light: #6366F1;
  --tn-primary-subtle: rgba(79, 70, 229, 0.08);
  --tn-primary-glow: rgba(79, 70, 229, 0.22);

  --tn-emerald: #10B981;
  --tn-emerald-dark: #059669;
  --tn-emerald-subtle: rgba(16, 185, 129, 0.1);
  --tn-cyan: #06B6D4;
  --tn-purple: #8B5CF6;
  --tn-amber: #F59E0B;

  /* Surfaces & Backgrounds */
  --tn-bg: #F8FAFC;
  --tn-surface: #FFFFFF;
  --tn-surface-alt: #F1F5F9;
  --tn-surface-dark: #0B0F17;
  --tn-surface-dark-card: #0F172A;
  --tn-surface-dark-border: rgba(255, 255, 255, 0.08);

  /* Borders */
  --tn-border: #E2E8F0;
  --tn-border-hover: #CBD5E1;

  /* Text Hierarchy */
  --tn-text-main: #0F172A;
  --tn-text-body: #334155;
  --tn-text-muted: #64748B;
  --tn-text-light: #F8FAFC;
  --tn-text-light-muted: #94A3B8;

  /* Typography */
  --tn-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", 'Plus Jakarta Sans', Roboto, sans-serif;
  --tn-font-heading: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --tn-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Elevation Shadows */
  --tn-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --tn-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --tn-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --tn-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --tn-shadow-glow: 0 0 24px var(--tn-primary-glow);

  /* Radii */
  --tn-radius-sm: 6px;
  --tn-radius-md: 10px;
  --tn-radius-lg: 16px;
  --tn-radius-xl: 24px;
  --tn-radius-full: 9999px;

  --tn-transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   2. Reset & Typography
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: var(--tn-font-sans);
  color: var(--tn-text-main);
  background-color: var(--tn-bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--tn-bg);
  color: var(--tn-text-body);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

#page, .site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.site-content {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 0 auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

.site-content .content-area,
.site-content > div,
.site-content > main,
.tn-frontpage-wrapper,
.tn-single-wrapper,
.tn-page-container,
.tn-hero {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--tn-font-heading);
  color: var(--tn-text-main);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin-top: 0;
}

h1 { font-size: clamp(2.25rem, 4vw + 1rem, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3vw + 0.5rem, 2.25rem); }
h3 { font-size: clamp(1.3rem, 2vw + 0.25rem, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 0.95rem; }

p {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

a {
  color: var(--tn-primary);
  text-decoration: none;
  transition: var(--tn-transition);
}

a:hover {
  color: var(--tn-primary-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.text-gradient {
  background: linear-gradient(135deg, #818CF8 0%, #06B6D4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* ==========================================================================
   3. Sticky Navigation Bar
   ========================================================================== */
.tn-reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--tn-primary), var(--tn-emerald));
  width: 0%;
  z-index: 1000;
  transition: width 0.1s linear;
}

.tn-header-wrapper {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(11, 15, 23, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--tn-surface-dark-border);
}

.tn-nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tn-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--tn-font-heading);
  font-weight: 800;
  font-size: 1.45rem;
  color: var(--tn-text-light);
  letter-spacing: -0.03em;
}

.tn-logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--tn-primary) 0%, var(--tn-emerald) 100%);
  border-radius: var(--tn-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0 16px var(--tn-primary-glow);
}

.tn-logo-ai-badge {
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #A5B4FC;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-left: 4px;
}

.tn-nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tn-nav-link {
  color: #CBD5E1;
  font-weight: 600;
  font-size: 0.92rem;
  transition: var(--tn-transition);
  position: relative;
}

.tn-nav-link:hover,
.tn-nav-link.active {
  color: #FFFFFF;
}

.tn-nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -24px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--tn-primary-light);
  box-shadow: 0 0 8px var(--tn-primary);
}

.tn-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tn-cta-button {
  background: linear-gradient(135deg, var(--tn-primary) 0%, var(--tn-primary-light) 100%);
  color: white !important;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 9px 20px;
  border-radius: var(--tn-radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px var(--tn-primary-glow);
  transition: var(--tn-transition);
}

.tn-cta-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--tn-primary-glow);
}

.tn-mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--tn-text-light);
  cursor: pointer;
  padding: 6px;
}

/* Mobile Drawer */
.tn-mobile-menu {
  position: fixed;
  top: 72px;
  left: 0;
  width: 100%;
  background: #0B0F17;
  border-bottom: 1px solid var(--tn-surface-dark-border);
  padding: 1.5rem;
  display: none;
  flex-direction: column;
  gap: 1rem;
  z-index: 899;
  box-shadow: var(--tn-shadow-xl);
}

.tn-mobile-menu.active {
  display: flex;
}

.tn-mobile-link {
  color: #CBD5E1;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tn-mobile-link:hover { color: white; }

.tn-menu-overlay {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  width: 100%;
  height: calc(100vh - 72px);
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 898;
}

.tn-menu-overlay.active { display: block; }

/* ==========================================================================
   4. High-Impact Hero Section
   ========================================================================== */
.tn-hero {
  background-color: var(--tn-surface-dark);
  background-image: 
    radial-gradient(at 50% 0%, rgba(79, 70, 229, 0.25) 0px, transparent 65%),
    radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.16) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(139, 92, 246, 0.14) 0px, transparent 50%);
  color: var(--tn-text-light);
  padding: 5rem 1.5rem 4.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--tn-surface-dark-border);
}

.tn-hero-container {
  max-width: 920px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.tn-badge-glow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(79, 70, 229, 0.16);
  border: 1px solid rgba(129, 140, 248, 0.35);
  color: #A5B4FC;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--tn-radius-full);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--tn-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--tn-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  70% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.tn-hero h1 {
  color: #FFFFFF;
  font-size: clamp(2.35rem, 5vw + 0.5rem, 3.85rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.tn-hero-subtitle {
  font-size: clamp(1.05rem, 1.5vw + 0.5rem, 1.25rem);
  color: #94A3B8;
  max-width: 760px;
  margin: 0 auto 2.5rem;
  line-height: 1.65;
}

.tn-hero-search {
  max-width: 580px;
  margin: 0 auto 2.5rem;
}

.tn-search-form {
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--tn-radius-md);
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  transition: var(--tn-transition);
}

.tn-search-form:focus-within {
  border-color: var(--tn-primary-light);
  box-shadow: 0 0 20px var(--tn-primary-glow);
}

.tn-search-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 16px;
  color: white;
  font-size: 0.95rem;
  outline: none;
  font-family: var(--tn-font-sans);
}

.tn-search-input::placeholder { color: #64748B; }

.tn-search-submit {
  background: var(--tn-primary);
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: var(--tn-radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--tn-transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tn-search-submit:hover { background: var(--tn-primary-hover); }

/* ==========================================================================
   5. Category Filter Pills & Grids
   ========================================================================== */
.tn-category-pills {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tn-pill-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--tn-surface);
  border: 1px solid var(--tn-border);
  color: var(--tn-text-main);
  padding: 8px 18px;
  border-radius: var(--tn-radius-full);
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: var(--tn-shadow-sm);
  transition: var(--tn-transition);
}

.tn-pill-link:hover {
  border-color: var(--tn-primary);
  color: var(--tn-primary);
  transform: translateY(-2px);
  box-shadow: var(--tn-shadow-md);
}

.tn-pill-link.active {
  background: var(--tn-primary);
  color: white;
  border-color: var(--tn-primary);
  box-shadow: 0 4px 12px var(--tn-primary-glow);
}

.tn-pill-badge {
  font-size: 0.75rem;
  background: #F1F5F9;
  color: #475569;
  padding: 2px 8px;
  border-radius: var(--tn-radius-full);
  font-weight: 700;
}

.tn-pill-link.active .tn-pill-badge {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

/* Article Cards Grid */
.tn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

.tn-card {
  background: var(--tn-surface);
  border: 1px solid var(--tn-border);
  border-radius: var(--tn-radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: var(--tn-transition);
  position: relative;
  box-shadow: var(--tn-shadow-sm);
}

.tn-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--tn-shadow-xl);
  border-color: var(--tn-border-hover);
}

.tn-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.tn-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: var(--tn-radius-full);
}

.tn-badge-ai { background: #E0E7FF; color: #4338CA; border: 1px solid #C7D2FE; }
.tn-badge-sourcing { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.tn-badge-growth { background: #F3E8FF; color: #6B21A8; border: 1px solid #E9D5FF; }
.tn-badge-default { background: #F1F5F9; color: #334155; border: 1px solid #E2E8F0; }

.tn-reading-time {
  font-size: 0.8rem;
  color: var(--tn-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.tn-card-title {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.75rem;
}

.tn-card-title a {
  color: var(--tn-text-main);
  text-decoration: none;
}

.tn-card-title a:hover { color: var(--tn-primary); }

.tn-card-excerpt {
  font-size: 0.94rem;
  color: var(--tn-text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex: 1;
}

.tn-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--tn-border);
  margin-top: auto;
}

.tn-read-more-btn {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--tn-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.tn-read-more-btn:hover {
  color: var(--tn-primary-hover);
  transform: translateX(3px);
}

/* ==========================================================================
   6. Single Post Layout & Sticky TOC Sidebar
   ========================================================================== */
.tn-single-wrapper {
  max-width: 1240px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.tn-single-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
}

.tn-toc-sidebar {
  position: sticky;
  top: 100px;
  background: var(--tn-surface);
  border: 1px solid var(--tn-border);
  border-radius: var(--tn-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--tn-shadow-sm);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.tn-toc-header {
  font-family: var(--tn-font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tn-text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--tn-border);
}

.tn-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tn-toc-item { margin: 0; }
.tn-toc-h3 { padding-left: 1rem; }

.tn-toc-link {
  color: var(--tn-text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
  display: block;
  padding: 4px 8px;
  border-radius: var(--tn-radius-sm);
  border-left: 2px solid transparent;
  transition: var(--tn-transition);
}

.tn-toc-link:hover {
  color: var(--tn-primary);
  background: #F8FAFC;
}

.tn-toc-link.active {
  color: var(--tn-primary);
  font-weight: 700;
  border-left-color: var(--tn-primary);
  background: var(--tn-primary-subtle);
}

.tn-single-article {
  background: var(--tn-surface);
  border: 1px solid var(--tn-border);
  border-radius: var(--tn-radius-xl);
  padding: 3.25rem;
  box-shadow: var(--tn-shadow-sm);
}

.tn-post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--tn-border);
}

.tn-post-header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.tn-post-title {
  font-size: clamp(2.2rem, 3.5vw + 1rem, 3.1rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}

.tn-post-author-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tn-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tn-primary) 0%, var(--tn-emerald) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--tn-font-heading);
}

/* Article Body Typography */
.tn-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #27272A;
}

.tn-content h2 {
  font-size: 1.85rem;
  margin-top: 2.75rem;
  margin-bottom: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--tn-border);
}

.tn-content h3 {
  font-size: 1.45rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.tn-content p { margin-bottom: 1.5rem; }

.tn-content ul, .tn-content ol {
  margin-bottom: 1.75rem;
  padding-left: 1.5rem;
}

.tn-content li { margin-bottom: 0.6rem; }

.tn-content blockquote {
  margin: 2.25rem 0;
  padding: 1.5rem 2rem;
  background: #F8FAFC;
  border-left: 4px solid var(--tn-primary);
  border-radius: 0 var(--tn-radius-md) var(--tn-radius-md) 0;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--tn-text-main);
  line-height: 1.6;
}

/* ==========================================================================
   7. Key Takeaways Callout, Comparison Tables & Product Recommendation Cards
   ========================================================================== */
/* Key Takeaways Callout */
.tn-callout, .tn-key-takeaways {
  margin: 2.25rem 0;
  padding: 1.75rem 2rem;
  border-radius: var(--tn-radius-lg);
  background: #F8FAFC;
  border: 1px solid var(--tn-border);
  box-shadow: var(--tn-shadow-sm);
}

.tn-callout-header, .tn-key-takeaways-header {
  font-family: var(--tn-font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.85rem;
}

.tn-callout-key-takeaway, .tn-key-takeaways {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #064E3B;
}
.tn-callout-key-takeaway .tn-callout-header,
.tn-key-takeaways-header {
  color: #047857;
}

.tn-callout-ai-prompt {
  background: #F5F3FF;
  border-color: #DDD6FE;
  color: #4C1D95;
}
.tn-callout-ai-prompt .tn-callout-header { color: #5B21B6; }

.tn-callout-pro-tip {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1E3A8A;
}
.tn-callout-pro-tip .tn-callout-header { color: #1D4ED8; }

.tn-callout-warning {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #78350F;
}
.tn-callout-warning .tn-callout-header { color: #B45309; }

/* Responsive Data & Comparison Tables */
.tn-table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 2.25rem 0;
  border-radius: var(--tn-radius-lg);
  border: 1px solid var(--tn-border);
  box-shadow: var(--tn-shadow-sm);
}

.tn-comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background: white;
  font-size: 0.95rem;
}

.tn-comparison-table th {
  background: #0F172A;
  color: white;
  padding: 14px 18px;
  font-weight: 700;
  font-family: var(--tn-font-heading);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.tn-comparison-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--tn-border);
  color: var(--tn-text-body);
  vertical-align: middle;
}

.tn-comparison-table tr:hover td { background: #F8FAFC; }

.tn-rating-stars {
  color: #F59E0B;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Tool Recommendation Card with Top Pick Badge */
.tn-tool-card {
  background: white;
  border: 2px solid var(--tn-border);
  border-radius: var(--tn-radius-lg);
  padding: 2rem;
  margin: 2.5rem 0;
  box-shadow: var(--tn-shadow-md);
  position: relative;
}

.tn-tool-card.featured {
  border-color: var(--tn-primary);
  box-shadow: 0 8px 24px var(--tn-primary-glow);
}

.tn-tool-badge-top-pick {
  position: absolute;
  top: -14px;
  left: 24px;
  background: linear-gradient(135deg, var(--tn-primary) 0%, var(--tn-emerald) 100%);
  color: white;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: var(--tn-radius-full);
  box-shadow: var(--tn-shadow-sm);
}

.tn-tool-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.tn-tool-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
}

.tn-tool-cta-btn {
  background: var(--tn-primary);
  color: white !important;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 20px;
  border-radius: var(--tn-radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tn-tool-cta-btn:hover {
  background: var(--tn-primary-hover);
  transform: translateY(-1px);
}

/* ==========================================================================
   8. Lead Capture Strip & Footer
   ========================================================================== */
.tn-lead-capture-strip {
  background: linear-gradient(135deg, #0B0F17 0%, #0F172A 100%);
  color: white;
  border-radius: var(--tn-radius-xl);
  padding: 3.5rem 2.5rem;
  margin: 4.5rem 0;
  border: 1px solid var(--tn-surface-dark-border);
  box-shadow: var(--tn-shadow-xl);
  text-align: center;
}

.tn-lead-capture-strip h3 {
  color: white;
  font-size: 2.1rem;
  margin-bottom: 0.75rem;
}

.tn-lead-capture-strip p {
  color: #94A3B8;
  max-width: 620px;
  margin: 0 auto 2rem;
  font-size: 1.05rem;
}

.tn-footer {
  background: #0B0F17;
  color: #94A3B8;
  border-top: 1px solid var(--tn-surface-dark-border);
  padding: 4.5rem 1.5rem 2.5rem;
  font-size: 0.92rem;
  margin-top: auto;
}

.tn-footer-container {
  max-width: 1280px;
  margin: 0 auto;
}

.tn-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1.25fr 1fr;
  gap: 3.5rem;
  margin-bottom: 3.5rem;
}

.tn-footer-brand p {
  color: #64748B;
  margin-top: 1rem;
  line-height: 1.65;
  max-width: 380px;
}

.tn-footer-title {
  color: white;
  font-family: var(--tn-font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.tn-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tn-footer-links a {
  color: #94A3B8;
  transition: var(--tn-transition);
}

.tn-footer-links a:hover {
  color: white;
  padding-left: 3px;
}

.tn-newsletter-bar {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--tn-surface-dark-border);
  border-radius: var(--tn-radius-lg);
  padding: 2rem 2.5rem;
  margin-bottom: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.tn-newsletter-bar h4 {
  color: white;
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.tn-newsletter-bar p {
  color: #94A3B8;
  margin: 0;
  font-size: 0.92rem;
}

.tn-newsletter-form {
  display: flex;
  gap: 8px;
  flex: 1;
  max-width: 440px;
  min-width: 280px;
}

.tn-newsletter-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--tn-radius-sm);
  padding: 10px 14px;
  color: white;
  font-size: 0.9rem;
  outline: none;
}

.tn-newsletter-btn {
  background: var(--tn-primary);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: var(--tn-radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.tn-ftc-disclosure {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--tn-radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
  font-size: 0.82rem;
  color: #64748B;
  line-height: 1.6;
}

.tn-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==========================================================================
   9. Page, Archive, 404 & Responsive Rules
   ========================================================================== */
.tn-page-container {
  max-width: 880px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
}

.tn-page-header {
  margin-bottom: 2.5rem;
  text-align: center;
}

.tn-page-card {
  background: white;
  border: 1px solid var(--tn-border);
  border-radius: var(--tn-radius-xl);
  padding: 3rem;
  box-shadow: var(--tn-shadow-sm);
}

.tn-archive-header {
  background: linear-gradient(135deg, #0B0F17 0%, #0F172A 100%);
  color: white;
  border-radius: var(--tn-radius-xl);
  padding: 3.5rem 2.5rem;
  margin-bottom: 3rem;
  text-align: center;
  box-shadow: var(--tn-shadow-lg);
}

.tn-archive-header h1 {
  color: white;
  margin-bottom: 0.75rem;
}

.tn-archive-description {
  color: #94A3B8;
  max-width: 650px;
  margin: 0 auto;
  font-size: 1.1rem;
}

.tn-404-container {
  max-width: 700px;
  margin: 4rem auto;
  padding: 3rem 1.5rem;
  text-align: center;
}

.tn-404-badge {
  font-size: 5rem;
  font-weight: 800;
  font-family: var(--tn-font-heading);
  line-height: 1;
  background: linear-gradient(135deg, var(--tn-primary) 0%, var(--tn-emerald) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

@media (max-width: 1024px) {
  .tn-single-layout { grid-template-columns: 1fr; }
  .tn-toc-sidebar { position: static; max-height: none; margin-bottom: 2rem; }
  .tn-footer-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
}

@media (max-width: 768px) {
  .tn-nav-links { display: none; }
  .tn-mobile-toggle { display: block; }
  .tn-single-article, .tn-page-card { padding: 1.75rem; }
  .tn-footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .tn-grid { grid-template-columns: 1fr; }
  .tn-newsletter-bar { flex-direction: column; align-items: stretch; }
  .tn-newsletter-form { max-width: 100%; }
}
