/* ==========================================================================
   PoIPoE Blog Framework - Professional MEV Trading Content Platform
   Design System: Dark Mode First, Data-Focused, Corporate Professional
   ========================================================================== */

/* ==========================================================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ========================================================================== */

:root {
  /* Color System */
  --accent-glow: #00E0FF;
  --accent-text: #00B8D4;
  --accent-dark: #005C6B;
  
  --bg-page: #000000;
  --bg-surface-1: #0A0A0A;
  --bg-surface-2: #141414;
  --bg-surface-3: #1F1F1F;
  --border-subtle: #262626;
  
  --text-primary: #E4E4E7;
  --text-secondary: #A0A0A0;
  --text-disabled: #525252;
  
  --success: #22C55E;
  --warning: #F59E0B;
  --error: #EF4444;
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;
  
  /* Spacing (8px base grid) */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-xxl: 64px;
  --space-xxxl: 96px;
  
  /* Layout */
  --container-max-width: 1280px;
  --content-max-width: 720px;
  --grid-gap: var(--space-md);
  
  /* Animation */
  --transition-fast: 200ms ease-out;
  --transition-normal: 250ms ease-out;
  --transition-slow: 300ms ease-out;
}

/* ==========================================================================
   BASE STYLES & RESET
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ==========================================================================
   TYPOGRAPHY SYSTEM
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

h1 { font-size: 3rem; } /* 48px */
h2 { font-size: 2.25rem; } /* 36px */
h3 { font-size: 1.5rem; } /* 24px */
h4 { font-size: 1.25rem; } /* 20px */
h5 { font-size: 1.125rem; } /* 18px */
h6 { font-size: 1rem; } /* 16px */

p {
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.text-secondary { color: var(--text-secondary); }
.text-disabled { color: var(--text-disabled); }

/* Links */
a {
  color: var(--accent-text);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-glow);
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-surface-1);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-glow);
}

pre {
  font-family: var(--font-mono);
  background: var(--bg-surface-1);
  padding: var(--space-md);
  border-radius: 12px;
  overflow-x: auto;
  margin: var(--space-md) 0;
  border: 1px solid var(--border-subtle);
}

pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

/* ==========================================================================
   LAYOUT & CONTAINERS
   ========================================================================== */

.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.content-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--grid-gap);
}

.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.nav-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-content {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-glow), var(--accent-text));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-weight: 800;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-glow);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-glow);
}

/* Mobile Navigation */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
}

.mobile-menu {
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-md);
  transform: translateY(-100%);
  opacity: 0;
  transition: all var(--transition-normal);
  z-index: 999;
}

.mobile-menu.active {
  transform: translateY(0);
  opacity: 1;
}

.mobile-nav-link {
  display: block;
  padding: var(--space-sm) 0;
  color: var(--text-primary);
  font-weight: 500;
}

/* ==========================================================================
   BUTTONS & INTERACTIVE ELEMENTS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-glow);
  color: #000;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--accent-glow);
  border: 1px solid var(--accent-glow);
}

.btn-outline:hover {
  background: var(--accent-glow);
  color: #000;
}

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
}

.btn-large {
  padding: var(--space-sm) var(--space-xl);
  font-size: 18px;
}

/* ==========================================================================
   BLOG HEADER & HERO
   ========================================================================== */

.blog-hero {
  padding: calc(80px + var(--space-xxxl)) 0 var(--space-xxxl);
  text-align: center;
  background: linear-gradient(180deg, var(--bg-page) 0%, var(--bg-surface-1) 100%);
}

.blog-hero h1 {
  font-size: 4rem;
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, var(--text-primary), var(--accent-glow));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.blog-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-xl);
}

/* ==========================================================================
   BLOG CATEGORIES
   ========================================================================== */

.blog-categories {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin: var(--space-xl) 0;
  flex-wrap: wrap;
}

.category-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.category-btn:hover,
.category-btn.active {
  background: var(--accent-glow);
  color: #000;
  border-color: var(--accent-glow);
  transform: translateY(-1px);
}

/* ==========================================================================
   BLOG CARDS & GRID
   ========================================================================== */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: var(--space-lg);
  margin: var(--space-xxl) 0;
}

.blog-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  transition: all var(--transition-slow);
  position: relative;
}

.blog-card:hover {
  background: var(--bg-surface-3);
  border-color: var(--accent-glow);
  box-shadow: 0 0 32px 0 rgba(0, 224, 255, 0.15);
  transform: translateY(-4px);
}

.blog-image {
  position: relative;
  height: 240px;
  overflow: hidden;
}

.blog-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-surface-1), var(--bg-surface-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 3rem;
}

.blog-overlay {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
}

.post-category {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-category.performance { background: var(--success); color: #000; }
.post-category.education { background: var(--accent-glow); color: #000; }
.post-category.analysis { background: var(--warning); color: #000; }
.post-category.developer { background: var(--accent-text); color: #000; }
.post-category.news { background: var(--error); color: #000; }

.blog-content {
  padding: var(--space-md);
}

.blog-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
  font-size: 14px;
  color: var(--text-secondary);
}

.blog-title {
  margin-bottom: var(--space-sm);
}

.blog-title a {
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.blog-title a:hover {
  color: var(--accent-glow);
}

.blog-excerpt {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-subtle);
}

.author-info {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.author-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-glow), var(--accent-text));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-weight: 700;
  font-size: 14px;
}

.author-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.blog-stats {
  display: flex;
  gap: var(--space-sm);
  font-size: 12px;
  color: var(--text-secondary);
}

.stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   FEATURED POST
   ========================================================================== */

.featured-post {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-xl);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-glow);
  border-radius: 20px;
  overflow: hidden;
  margin: var(--space-xl) 0;
  padding: var(--space-xl);
  position: relative;
}

.featured-post::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-glow), var(--accent-text));
}

.featured-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  font-size: 14px;
}

.featured-title {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  line-height: 1.2;
}

.featured-title a {
  color: var(--text-primary);
}

.featured-title a:hover {
  color: var(--accent-glow);
}

.featured-excerpt {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.featured-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.featured-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-1);
  border-radius: 12px;
  min-height: 300px;
}

/* ==========================================================================
   INDIVIDUAL BLOG POST STYLES
   ========================================================================== */

.post-header {
  padding: calc(80px + var(--space-xl)) 0 var(--space-xl);
  text-align: center;
  background: linear-gradient(180deg, var(--bg-page) 0%, var(--bg-surface-1) 100%);
}

.post-title {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.post-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
  font-size: 16px;
  color: var(--text-secondary);
}

.post-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-md) var(--space-xxl);
}

.post-content h2 {
  margin-top: var(--space-xxl);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--accent-glow);
}

.post-content h3 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.post-content blockquote {
  background: var(--bg-surface-1);
  border-left: 4px solid var(--accent-glow);
  padding: var(--space-md);
  margin: var(--space-lg) 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-secondary);
}

.post-content ul,
.post-content ol {
  margin: var(--space-md) 0;
  padding-left: var(--space-lg);
}

.post-content li {
  margin-bottom: var(--space-xs);
}

/* Performance Metrics Display */
.performance-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  padding: var(--space-lg);
  background: var(--bg-surface-2);
  border-radius: 12px;
  border: 1px solid var(--accent-glow);
}

.metric-item {
  text-align: center;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-glow);
  display: block;
}

.metric-label {
  font-size: 14px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   NEWSLETTER SIGNUP
   ========================================================================== */

.newsletter-signup {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-xl);
  align-items: center;
  padding: var(--space-xl);
  background: var(--bg-surface-2);
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  margin: var(--space-xxl) 0;
}

.signup-title {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.signup-description {
  color: var(--text-secondary);
  margin: 0;
}

.signup-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-width: 400px;
}

.form-group {
  display: flex;
  gap: var(--space-sm);
}

.form-input {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 16px;
  transition: border-color var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-glow);
  box-shadow: 0 0 0 3px rgba(0, 224, 255, 0.1);
}

.form-note {
  font-size: 12px;
  color: var(--text-disabled);
  text-align: center;
  margin: 0;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
  background: var(--bg-surface-1);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-xxl) 0 var(--space-lg);
  margin-top: var(--space-xxl);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-section h4 {
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--space-xs);
}

.footer-links a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent-glow);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* ==========================================================================
   ANIMATIONS & UTILITIES
   ========================================================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-animate] {
  animation: fadeInUp 0.6s ease-out;
}

[data-delay] {
  animation-delay: attr(data-delay number, 0ms);
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1024px) {
  .featured-post {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .newsletter-signup {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .signup-form {
    min-width: auto;
  }
}

@media (max-width: 768px) {
  :root {
    --space-xxxl: 64px;
    --space-xxl: 48px;
    --space-xl: 32px;
  }
  
  .nav-menu {
    display: none;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.5rem; }
  
  .blog-hero h1 {
    font-size: 2.5rem;
  }
  
  .blog-title {
    font-size: 1.125rem;
  }
  
  .featured-title {
    font-size: 2rem;
  }
  
  .post-title {
    font-size: 2rem;
  }
  
  .blog-grid {
    grid-template-columns: 1fr;
  }
  
  .blog-categories {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: var(--space-sm);
  }
  
  .category-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  .post-meta {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .performance-metrics {
    grid-template-columns: 1fr;
  }
  
  .form-group {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-sm);
  }
  
  .blog-content,
  .post-content {
    padding: var(--space-sm);
  }
  
  .blog-card {
    margin: 0 -4px;
  }
  
  .newsletter-signup {
    padding: var(--space-md);
    margin: var(--space-lg) 0;
  }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
  .nav-container,
  .mobile-menu,
  .newsletter-signup,
  .footer,
  .blog-overlay {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .blog-card,
  .featured-post {
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}