/* Insights Hub Page - Complete Self-Contained CSS (Fixed Mobile Firefox) */

/* =================================================================
BACKGROUND ELEMENTS (from main.css)
================================================================= */
.background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-behind);
  pointer-events: none;
  }
  
  .background-blur {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('/assets/images/bg_light_blur.gif') no-repeat center center;
  background-size: cover;
  background-attachment: fixed;
  }
  
  .background-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 40% 80%, rgba(245, 158, 11, 0.1) 0%, transparent 50%);
  animation: backgroundFloat 20s ease-in-out infinite;
  }
  
  .background-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: var(--bg-grid-size) var(--bg-grid-size);
  opacity: 0.5;
  }
  
  @keyframes backgroundFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  33% {
    transform: translateY(-10px) rotate(1deg);
  }
  66% {
    transform: translateY(5px) rotate(-1deg);
  }
  }
  
  /* =================================================================
   NAVBAR COMPONENT (from navbar.css)
   ================================================================= */
  .navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-floating);
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border-primary);
  transition: all var(--duration-normal) var(--ease-out);
  opacity: 1;
  transform: translateY(0);
  }
  
  .navbar.visible {
  transform: translateY(0);
  opacity: 1;
  }
  
  .navbar.scrolled {
  background: rgba(0, 0, 0, 0.95);
  box-shadow: var(--shadow-lg);
  }
  
  .navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--navbar-height);
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  }
  
  .navbar-brand {
  display: flex;
  align-items: center;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  text-decoration: none;
  transition: all var(--duration-normal) var(--ease-out);
  }
  
  .navbar-brand:hover {
  transform: scale(1.05);
  }
  
  .brand-text {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  color: white;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
  position: relative;
  overflow: hidden;
  }
  
  .brand-text::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s var(--ease-out);
  }
  
  .navbar-brand:hover .brand-text::before {
  left: 100%;
  }
  
  .navbar-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all var(--duration-normal) var(--ease-out);
  }
  
  .navbar-toggle:hover {
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  }
  
  .hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: var(--radius-full);
  transition: all var(--duration-normal) var(--ease-out);
  transform-origin: center;
  }
  
  .hamburger-line:not(:last-child) {
  margin-bottom: 4px;
  }
  
  .navbar-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
  }
  
  .navbar-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scale(0);
  }
  
  .navbar-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
  }
  
  .navbar-menu {
  display: flex;
  align-items: center;
  }
  
  .navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
  list-style: none;
  margin: 0;
  padding: 0;
  }
  
  .nav-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  }
  
  .nav-section-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--font-weight-semibold);
  }
  
  /* Current page section styling */
  .nav-section--current .nav-section-label {
  color: #e67e22;
  }
  
  .nav-section--current .nav-link--current {
  color: #e67e22;
  background: rgba(230, 126, 34, 0.1);
  }
  
  .nav-section--current .nav-link--current:hover {
  color: #d35400;
  background: rgba(230, 126, 34, 0.2);
  }
  
  /* Other pages section styling */
  .nav-section--other .nav-section-label {
  color: #3498db;
  }
  
  .nav-section--other .nav-link--other {
  color: #3498db;
  }
  
  .nav-section--other .nav-link--other:hover {
  color: #2980b9;
  background: rgba(52, 152, 219, 0.1);
  }
  
  .nav-section-links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
  }
  
  .nav-link {
  position: relative;
  padding: var(--space-sm) var(--space-lg);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-base);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--duration-normal) var(--ease-out);
  overflow: hidden;
  }
  
  .nav-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: all var(--duration-normal) var(--ease-out);
  transform: translateX(-50%);
  }
  
  .nav-link:hover::before {
  width: 80%;
  }
  
  .nav-link:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  }
  
  /* Mobile navbar styles */
  @media (max-width: 1023px) {
  .navbar-toggle {
    display: flex;
  }
  
  .navbar-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border-primary);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--duration-normal) var(--ease-out);
  }
  
  .navbar-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  
  .navbar-nav {
    flex-direction: column;
    padding: var(--space-xl);
    gap: var(--space-xl);
    width: 100%;
  }
  
  .nav-section {
    width: 100%;
    align-items: stretch;
    gap: var(--space-md);
  }
  
  .nav-section-label {
    text-align: center;
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border-secondary);
  }
  
  .nav-section-links {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .nav-link {
    width: 100%;
    padding: var(--space-lg);
    text-align: center;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-lg);
  }
  
  .nav-link::before {
    display: none;
  }
  
  .nav-link:hover {
    transform: translateX(5px);
  }
  }
  
  /* =================================================================
   BUTTON COMPONENT (from buttons.css)
   ================================================================= */
  .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
  user-select: none;
  white-space: nowrap;
  }
  
  .btn:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  }
  
  .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  }
  
  .btn--primary {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-md);
  }
  
  .btn--primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s var(--ease-out);
  }
  
  .btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-lg);
  }
  
  .btn--primary:hover::before {
  left: 100%;
  }
  
  .btn--primary:active {
  transform: translateY(0);
  }
  
  .btn--outline {
  background: transparent;
  color: var(--color-text-primary);
  border-color: var(--color-border-primary);
  }
  
  .btn--outline:hover {
  background: var(--color-bg-card);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  }
  
  .btn--outline:active {
  transform: translateY(0);
  }
  
  .btn--lg {
  padding: var(--space-xl) var(--space-3xl);
  font-size: var(--font-size-lg);
  border-radius: var(--radius-xl);
  }
  
  .btn--sm {
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-md);
  }
  
  .btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
  }
  
  .btn--ghost:hover {
  background: var(--color-bg-card);
  color: var(--color-text-primary);
  transform: translateY(-1px);
  }
  
  .btn-icon {
  flex-shrink: 0;
  transition: transform var(--duration-normal) var(--ease-out);
  }
  
  .btn:hover .btn-icon {
  transform: translateX(2px);
  }
  
  /* =================================================================
   LAYOUT COMPONENTS (FIXED FOOTER POSITIONING)
   ================================================================= */
  .container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  }
  
  main {
  position: relative;
  z-index: var(--z-base);
  flex: 1; /* This makes main take up available space, pushing footer down */
  }
  
  /* =================================================================
   SECTION COMPONENTS (REDUCED INSIGHTS-POSTS PADDING)
   ================================================================= */
  .section {
  padding: var(--space-6xl) 0;
  position: relative;
  }
  
  .section:first-of-type {
  padding-top: 0;
  }
  
  /* Specific reduction for insights-posts section */
  .insights-posts {
  padding: calc(var(--space-6xl) * 0.3) 0; /* Much less padding on top/bottom */
  flex: 1;
  }
  
  .section-header {
  text-align: center;
  margin-bottom: var(--space-4xl);
  }
  
  .section-title {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  background: var(--gradient-text);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--space-lg);
  line-height: var(--line-height-tight);
  }
  
  .section-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: var(--line-height-relaxed);
  }
  
  /* =================================================================
   INSIGHTS PAGE SPECIFIC STYLES
   ================================================================= */
  
  /* Insights Hero - FURTHER REDUCED SPACING */
  .insights-hero {
  padding: calc(var(--navbar-height) + var(--space-3xl)) 0 calc(var(--space-md) * 0.5); /* 50% less bottom space */
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  }
  
  /* =================================================================
   SEARCH & FILTER CONTROLS (STICKY ON MOBILE)
   ================================================================= */
  .insights-controls {
  position: sticky;
  top: var(--navbar-height);
  z-index: var(--z-raised);
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border-primary);
  padding: var(--space-lg) 0;
  transition: all var(--duration-normal) var(--ease-out);
  }
  
  .controls-grid {
  display: grid;
  grid-template-columns: 1fr auto auto; /* Search first, then filter, then sort toggle */
  gap: var(--space-xl);
  align-items: center;
  }
  
  /* Search Container - FIXED */
  .search-container {
  flex: 1;
  max-width: 400px;
  }
  
  .search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  }
  
  .search-icon {
  position: absolute;
  left: var(--space-lg);
  color: var(--color-text-muted);
  pointer-events: none;
  z-index: 2;
  }
  
  .search-input {
  width: 100%;
  padding: var(--space-lg) var(--space-lg) var(--space-lg) 3rem;
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  transition: all var(--duration-normal) var(--ease-out);
  font-family: inherit;
  }
  
  .search-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
  }
  
  .search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: rgba(255, 255, 255, 0.15);
  }
  
  .search-clear {
  position: absolute;
  right: var(--space-lg);
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: all var(--duration-normal) var(--ease-out);
  }
  
  .search-clear:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.1);
  }
  
  /* Filter Container - SIMPLIFIED */
  .filter-container {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  }
  
  .filter-controls {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  }
  
  .filter-btn {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-primary);
  color: var(--color-text-muted);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  white-space: nowrap;
  }
  
  .filter-btn:hover {
  background: var(--color-bg-card-hover);
  border-color: var(--color-border-accent);
  color: var(--color-text-primary);
  }
  
  .filter-btn.active {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
  }
  
  .filter-toggle {
  display: none;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-primary);
  color: var(--color-text-muted);
  padding: var(--space-sm);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  }
  
  .filter-toggle:hover {
  background: var(--color-bg-card-hover);
  color: var(--color-text-primary);
  }
  
  /* Sort Container - NOW A TOGGLE */
  .sort-container {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  }
  
  /* CRITICAL: Hide mobile elements immediately to prevent flash - but only for larger mobile screens */
  @media (max-width: 768px) and (min-width: 321px) {
    .filter-container,
    .sort-container,
    .results-summary {
      display: none !important; /* Force hide immediately on mobile */
      visibility: hidden !important; /* Double protection */
    }
  }
  
  .sort-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-full);
  padding: var(--space-sm);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  user-select: none;
  }
  
  .sort-toggle:hover {
  background: var(--color-bg-card-hover);
  border-color: var(--color-border-accent);
  }
  
  .sort-toggle-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
  }
  
  .sort-toggle-switch {
  position: relative;
  width: 40px;
  height: 20px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-primary);
  transition: all var(--duration-normal) var(--ease-out);
  }
  
  .sort-toggle-switch::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 16px;
  height: 16px;
  background: var(--color-text-primary);
  border-radius: 50%;
  transition: all var(--duration-normal) var(--ease-out);
  }
  
  .sort-toggle.oldest-first .sort-toggle-switch {
  background: var(--color-primary);
  border-color: var(--color-primary);
  }
  
  .sort-toggle.oldest-first .sort-toggle-switch::after {
  transform: translateX(20px);
  background: white;
  }
  
  /* Results Summary - INTEGRATED */
  .results-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  white-space: nowrap;
  }
  
  .results-count {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  }
  
  .results-filter {
  font-size: var(--font-size-sm);
  color: var(--color-text-accent);
  }
  
  /* =================================================================
   INSIGHT CARDS (FURTHER REDUCED SPACING)
   ================================================================= */
  .insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
  margin-top: calc(var(--space-lg) * 0.5); /* 50% less space from controls */
  }
  
  .insight-card {
  background: rgba(255, 255, 255, 0.15); /* Darkened from 0.45 */
  border: 1px solid rgba(255, 255, 255, 0.25); /* Darkened from 0.35 */
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
  /* FIXED: Start hidden for graceful page load animation */
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  }
  
  /* FIXED: Class to show cards after page load */
  .insight-card.loaded {
  opacity: 1;
  transform: translateY(0) scale(1);
  }
  
  .insight-card:hover {
  transform: translateY(-5px);
  border-color: var(--color-border-accent);
  box-shadow: var(--shadow-lg);
  }
  
  /* REMOVED: All .insight-card--featured styles since we're removing the featured card */
  
  .insight-image {
  position: relative;
  width: 100%;
  height: 140px;
  overflow: hidden;
  }
  
  .insight-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
  }
  
  .insight-card:hover .insight-image img {
  transform: scale(1.05);
  }
  
  .insight-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
  }
  
  .insight-card:hover .insight-overlay {
  opacity: 1;
  }
  
  .insight-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  border-radius: 50%;
  color: white;
  transition: all var(--duration-normal) var(--ease-out);
  text-decoration: none;
  }
  
  .insight-link:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-glow);
  }
  
  .insight-content {
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
  }
  
  .insight-meta {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
  }
  
  .insight-date {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  }
  
  .insight-category {
  background: var(--gradient-accent);
  color: white;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  }
  
  .insight-read-time {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  }
  
  .insight-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-md);
  }
  
  .insight-title a {
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-out);
  }
  
  .insight-title a:hover {
  color: var(--color-text-accent);
  }
  
  .insight-excerpt {
  color: var(--color-text-muted);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-md);
  flex: 1;
  font-size: var(--font-size-sm);
  }
  
  .insight-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  }
  
  .tag {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-text-muted);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all var(--duration-normal) var(--ease-out);
  }
  
  .tag:hover {
  background: var(--color-accent);
  color: white;
  transform: translateY(-1px);
  }
  
  .insight-actions {
  display: flex;
  gap: var(--space-md);
  margin-top: auto;
  }
  
  /* =================================================================
   PAGINATION (MUCH CLOSER TO NEWSLETTER)
   ================================================================= */
  .pagination-container {
  margin-top: var(--space-xl); /* Reduced further */
  padding: calc(var(--space-lg) * 0.4) 0; /* 60% closer to newsletter */
  border-top: 1px solid var(--color-border-primary);
  }
  
  .pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  max-width: 600px;
  margin: 0 auto;
  }
  
  .pagination-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-2xl);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-primary);
  color: var(--color-text-primary);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  }
  
  .pagination-btn:hover:not(:disabled) {
  background: var(--color-bg-card-hover);
  border-color: var(--color-border-accent);
  transform: translateY(-2px);
  }
  
  .pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  }
  
  .pagination-numbers {
  display: flex;
  gap: var(--space-sm);
  }
  
  .pagination-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-primary);
  color: var(--color-text-primary);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  }
  
  .pagination-number:hover {
  background: var(--color-bg-card-hover);
  border-color: var(--color-border-accent);
  }
  
  .pagination-number.active {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
  }
  
  /* =================================================================
   NEWSLETTER SECTION
   ================================================================= */
  .newsletter {
  padding: var(--space-4xl) 0;
  background: var(--color-bg-secondary);
  text-align: center;
  }
  
  .newsletter-content {
  max-width: 600px;
  margin: 0 auto;
  }
  
  .newsletter-form {
  margin-top: var(--space-2xl);
  }
  
  .newsletter-note {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  backdrop-filter: blur(10px);
  }
  
  .newsletter-note p {
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-sm);
  }
  
  .newsletter-note p:last-child {
  margin-bottom: 0;
  }
  
  .newsletter-note a {
  color: var(--color-text-accent);
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-out);
  }
  
  .newsletter-note a:hover {
  color: var(--color-primary);
  }
  
  /* =================================================================
   CTA SECTION (EVEN CLOSER TO FOOTER)
   ================================================================= */
  .insights-cta {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  text-align: center;
  padding: var(--space-3xl) 0; /* Reduced top padding by ~30% */
  }
  
  .cta-content {
  max-width: 600px;
  margin: 0 auto;
  }
  
  .cta-title {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-lg);
  }
  
  .cta-description {
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-2xl);
  }
  
  .cta-actions {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: calc(var(--space-xl) * 0.8); /* 20% less space to footer */
  }
  
  /* =================================================================
   FOOTER COMPONENT - FIXED LEFT/RIGHT LAYOUT + CLOSER TO CTA
   ================================================================= */
  .footer {
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border-primary);
  padding: var(--space-xl) 0; /* Reduced from var(--space-3xl) - 30% closer to CTA */
  margin-top: 0; /* Removed margin since CTA now has bottom margin */
  position: relative;
  z-index: var(--z-raised);
  }
  
  .footer-content {
  display: flex;
  flex-direction: row; /* Left/right layout like index.html */
  justify-content: space-between;
  align-items: center;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  }
  
  .footer-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  }
  
  .footer-text p {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin: 0;
  line-height: var(--line-height-normal);
  }
  
  .footer-links {
  display: flex;
  gap: var(--space-xl);
  align-items: center;
  }
  
  .footer-link {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-out);
  white-space: nowrap;
  }
  
  .footer-link:hover {
  color: var(--color-text-accent);
  }
  
  /* =================================================================
   UTILITY CLASSES
   ================================================================= */
  .text-center { text-align: center; }
  .text-left { text-align: left; }
  .text-right { text-align: right; }
  
  .skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  padding: 8px;
  text-decoration: none;
  z-index: 1000;
  border-radius: var(--radius-md);
  }
  
  .skip-link:focus {
  top: 6px;
  }
  
  /* =================================================================
   RESPONSIVE DESIGN
   ================================================================= */
  
  /* Tablet adjustments */
  @media (max-width: 1024px) {
  .controls-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .search-container {
    max-width: none;
  }
  
  .filter-container {
    justify-content: center;
  }
  
  .sort-container {
    justify-content: center;
  }
  }
  
  /* Mobile adjustments - FIXED VIEWPORT SPILLOVER + SPACING */
  @media (max-width: 768px) {
  html {
    overflow-x: hidden;
  }
  
  body {
    overflow-x: hidden;
    max-width: 100vw;
  }
  
  * {
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .insights-hero {
    padding: calc(var(--navbar-height) + var(--space-2xl)) 0 calc(var(--space-xs)); /* 76% less bottom spacing */
  }
  
  .insights-controls {
    position: sticky;
    top: var(--navbar-height);
    padding: var(--space-sm) 0; /* Reduced padding */
    transition: transform var(--duration-normal) var(--ease-out);
  }
  
  .insights-controls.collapsed {
    transform: translateY(calc(-100% + 50px));
  }
  
  .controls-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xs); /* Reduced gap */
    max-width: 100%;
    overflow: hidden;
  }
  
  .search-container {
    max-width: none;
    order: 1;
  }
  
  .search-input {
    padding: calc(var(--space-sm) * 0.85) var(--space-lg) calc(var(--space-sm) * 0.85) 3rem; /* Reduced top/bottom padding by ~15% */
    font-size: 16px; /* Prevents zoom on iOS */
    max-width: 100%;
  }
  
  /* FIXED: Force mobile controls to be hidden by default */
  .filter-container,
  .sort-container,
  .results-summary {
    display: none; /* Hide by default on mobile */
  }
  
  .mobile-controls-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xs) var(--space-sm); /* Reduced padding */
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    order: 2;
    font-size: 11px; /* Smaller text */
    max-width: 100%;
    overflow: hidden;
  }
  
  .mobile-controls-toggle:hover {
    background: var(--color-bg-card-hover);
  }
  
  .mobile-controls-content {
    order: 3;
    display: none;
    grid-template-columns: 1fr;
    gap: var(--space-xs); /* Reduced gap */
    margin-top: var(--space-xs); /* Reduced margin */
    max-width: 100%;
    overflow: hidden;
  }
  
  .mobile-controls-content.expanded {
    display: grid;
  }
  
  /* When mobile controls are active, show the moved elements */
  .mobile-controls-content .filter-container,
  .mobile-controls-content .sort-container,
  .mobile-controls-content .results-summary {
    display: flex !important; /* Override the mobile hide */
    visibility: visible !important; /* Override the mobile hide */
  }
  
  .mobile-controls-content .results-summary {
    display: flex !important;
    justify-content: center;
  }
  
  .filter-container {
    justify-content: center;
    max-width: 100%;
    overflow: hidden;
  }
  
  .filter-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xs);
    width: 100%;
    max-width: 100%;
  }
  
  .filter-btn {
    padding: var(--space-xs) var(--space-sm);
    font-size: 10px; /* Smaller text */
    text-align: center;
    background: rgba(255, 255, 255, 0.15); /* Darker background */
    border: 1px solid rgba(255, 255, 255, 0.25);
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 24px; /* Reduced height */
  }
  
  .filter-btn:hover {
    background: rgba(255, 255, 255, 0.25);
  }
  
  .sort-container {
    justify-content: center;
    max-width: 100%;
    overflow: hidden;
  }
  
  .sort-toggle {
    font-size: 11px; /* Smaller text */
    padding: var(--space-xs) var(--space-sm);
    max-width: 100%;
  }
  
  .sort-toggle-text {
    font-size: 10px;
  }
  
  .sort-toggle-switch {
    width: 32px;
    height: 16px;
  }
  
  .sort-toggle-switch::after {
    width: 12px;
    height: 12px;
  }
  
  .sort-toggle.oldest-first .sort-toggle-switch::after {
    transform: translateX(16px);
  }
  
  .results-summary {
    justify-content: center;
    text-align: center;
    font-size: 10px; /* Smaller text */
    max-width: 100%;
    overflow: hidden;
    word-break: break-word;
  }
  
  .insights-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    max-width: 100%;
    overflow: hidden;
    margin-top: calc(var(--space-lg) * 0.5); /* 50% less space beneath controls */
  }
  
  .insight-card {
    max-width: 100%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.12) !important; /* FIXED: More opaque for better readability */
    border: 1px solid rgba(255, 255, 255, 0.2) !important; /* Slightly more visible border too */
  }
  
  .insight-meta {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }
  
  .insight-actions {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .pagination-container {
    margin-top: var(--space-lg);
    padding: calc(var(--space-md) * 0.5) 0; /* 50% less space beneath Next button */
  }
  
  .pagination-controls {
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .pagination-btn {
    width: 100%;
    justify-content: center;
  }
  
  .cta-actions {
    flex-direction: column;
    align-items: center;
    margin-bottom: calc(var(--space-xl) * 0.5); /* 50% closer to footer */
  }
  
  .footer {
    padding: var(--space-lg) 0; /* Reduced mobile footer padding */
  }
  
  .footer-content {
    display: flex; /* Fixed: now same as desktop */
    flex-direction: row; /* Left/right layout like desktop */
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
    overflow: hidden;
  }
  
  .footer-links {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
    max-width: 100%;
    overflow: hidden;
  }
  
  .container {
    padding: 0 var(--space-sm);
    max-width: 100%;
    overflow: hidden;
  }
  }
  
  /* CRITICAL: Ultra-narrow mobile adjustments for Firefox 270px viewport */
  @media (max-width: 320px) {
  /* Force absolute minimum width and prevent horizontal overflow */
  html {
    overflow-x: hidden;
    width: 100%;
  }
  
  body {
    min-width: 270px; /* Support Firefox mobile minimum */
    max-width: 100vw;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
  }
  
  /* Force all elements to respect container bounds */
  *, *::before, *::after {
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  /* Ultra-tight container for narrow viewports */
  .container {
    padding: 0 4px; /* Minimal padding for 270px viewport */
    max-width: 100%;
    overflow: hidden;
    width: 100%;
  }
  
  /* Navbar adjustments for ultra-narrow */
  .navbar-container {
    padding: 0 4px;
    max-width: 100%;
  }
  
  .brand-text {
    width: 32px;
    height: 32px;
    font-size: var(--font-size-base);
  }
  
  /* Hero section ultra-compact */
  .insights-hero {
    padding: calc(var(--navbar-height) + var(--space-lg)) 0 var(--space-sm);
  }
  
  .section-title {
    font-size: var(--font-size-2xl);
    word-break: break-word;
    hyphens: auto;
  }
  
  .section-subtitle {
    font-size: var(--font-size-base);
    word-break: break-word;
    hyphens: auto;
  }
  
  /* Controls ultra-compact */
  .insights-controls {
    padding: 4px 0;
  }
  
  .controls-grid {
    gap: 4px;
    padding: 0;
  }
  
  .search-input {
    padding: 6px 8px 6px 2rem;
    font-size: 14px; /* Smaller to prevent zoom */
    border-radius: 4px;
  }
  
  .search-icon {
    left: 6px;
    width: 16px;
    height: 16px;
  }
  
  .mobile-controls-toggle {
    padding: 4px 6px;
    font-size: 9px;
    border-radius: 4px;
  }
  
  .mobile-controls-content {
    gap: 4px;
    margin-top: 4px;
  }
  
  /* Filter buttons ultra-compact */
  .filter-controls {
    grid-template-columns: 1fr 1fr; /* Keep 2-column but tighter */
    gap: 2px;
  }
  
  .filter-btn {
    padding: 2px 4px;
    font-size: 8px;
    min-height: 20px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Sort toggle ultra-compact */
  .sort-toggle {
    padding: 2px 4px;
    font-size: 8px;
    gap: 2px;
  }
  
  .sort-toggle-text {
    font-size: 8px;
    white-space: nowrap;
  }
  
  .sort-toggle-switch {
    width: 24px;
    height: 12px;
  }
  
  .sort-toggle-switch::after {
    width: 8px;
    height: 8px;
    top: 1px;
    left: 1px;
  }
  
  .sort-toggle.oldest-first .sort-toggle-switch::after {
    transform: translateX(12px);
  }
  
  /* Results summary ultra-compact */
  .results-summary {
    font-size: 8px;
    padding: 0 2px;
    text-align: center;
    word-break: break-word;
  }
  
  /* Cards ultra-compact */
  .insights-grid {
    gap: var(--space-sm);
    margin-top: 4px;
  }
  
  .insight-card {
    border-radius: var(--radius-lg);
  }
  
  .insight-content {
    padding: var(--space-sm);
  }
  
  .insight-title {
    font-size: var(--font-size-base);
    word-break: break-word;
    hyphens: auto;
  }
  
  .insight-excerpt {
    font-size: var(--font-size-xs);
    word-break: break-word;
    hyphens: auto;
  }
  
  .insight-meta {
    gap: var(--space-xs);
    flex-wrap: wrap;
  }
  
  .insight-category,
  .insight-date,
  .insight-read-time {
    font-size: 8px;
  }
  
  .tag {
    padding: 1px 3px;
    font-size: 7px;
    border-radius: 2px;
  }
  
  /* Pagination ultra-compact */
  .pagination-container {
    margin-top: var(--space-sm);
    padding: var(--space-xs) 0;
  }
  
  .pagination-controls {
    gap: var(--space-xs);
  }
  
  .pagination-btn {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-xs);
  }
  
  .pagination-number {
    width: 28px;
    height: 28px;
    font-size: var(--font-size-xs);
  }
  
  /* CTA ultra-compact */
  .cta-title {
    font-size: var(--font-size-xl);
    word-break: break-word;
    hyphens: auto;
  }
  
  .cta-description {
    font-size: var(--font-size-sm);
    word-break: break-word;
    hyphens: auto;
  }
  
  .cta-actions {
    gap: var(--space-sm);
  }
  
  .btn {
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--font-size-sm);
  }
  
  /* Footer ultra-compact */
  .footer {
    padding: var(--space-sm) 0;
  }
  
  .footer-content {
    flex-direction: column;
    gap: var(--space-xs);
    text-align: center;
    padding: 0 4px;
  }
  
  .footer-text p {
    font-size: 9px;
    word-break: break-word;
  }
  
  .footer-links {
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .footer-link {
    font-size: 9px;
    white-space: nowrap;
  }
  }
  
  /* Desktop improvements */
  @media (min-width: 1200px) {
  .insights-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .section-title {
    font-size: var(--font-size-5xl);
  }
  
  .pagination-controls {
    max-width: 800px;
  }
  }
  
  /* GLOBAL PAGE STRUCTURE FIX - PROPER FLEXBOX LAYOUT */
  html, body {
  height: 100%;
  overflow-x: hidden;
  }
  
  body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  }
  
  /* Ensure main content area grows to fill space */
  main {
  flex: 1;
  display: flex;
  flex-direction: column;
  }
  
  /* Make the insights-posts section grow to push footer down */
  .insights-posts {
  flex: 1;
  }