/* === A.W Blog — Modern Design System === */

:root {
  /* Light theme */
  --bg-primary: #fafafa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f5f5f5;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  --accent: #0d9488; /* Teal — tech vibe */
  --accent-light: #ccfbf1;
  --accent-dark: #0f766e;
  --border: #e5e5e5;
  --border-light: #f0f0f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-lg: 16px;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

[data-theme="dark"] {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #1a1a1a;
  --bg-hover: #222222;
  --text-primary: #fafafa;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --accent: #2dd4bf;
  --accent-light: #134e4a;
  --accent-dark: #5eead4;
  --border: #2a2a2a;
  --border-light: #1f1f1f;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.4);
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

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

/* === Navigation === */
.site-nav {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 101;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: color 0.2s ease;
}

.nav-logo:hover {
  color: var(--accent-dark);
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 6px 14px;
  border-radius: 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--accent);
  background: var(--bg-hover);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-light);
}

/* === Hero Section === */
.hero {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--border);
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-light) 0%, transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 60px;
  align-items: center;
}

.hero-text h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero-text .subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 500px;
}

.hero-stats {
  display: flex;
  gap: 32px;
  margin-bottom: 32px;
}

.stat {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.author-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 16px;
}

.author-name {
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 4px;
}

.author-role {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.author-bio {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* === Search & Filter Bar === */
.control-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.control-bar-content {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 280px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: all 0.2s ease;
}

.search-box:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.filter-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-tag {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-tag.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.theme-toggle {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

/* === Posts Grid === */
.posts-section {
  padding: 48px 0 80px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
  list-style: none;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.post-card:hover::before {
  opacity: 1;
}

.post-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.tag-daily {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.tag-weekly {
  background: #fef3c7;
  color: #92400e;
}

.tag-post {
  background: #e0e7ff;
  color: #3730a3;
}

[data-theme="dark"] .tag-daily {
  background: var(--accent-light);
  color: var(--accent-dark);
}

[data-theme="dark"] .tag-weekly {
  background: #451a03;
  color: #fcd34d;
}

[data-theme="dark"] .tag-post {
  background: #1e1b4b;
  color: #a5b4fc;
}

.post-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  margin-bottom: 12px;
  line-height: 1.3;
}

.post-title:hover {
  color: var(--accent);
}

.post-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.post-date::before {
  content: '📅 ';
}

.reading-time::before {
  content: '⏱️ ';
}

.post-summary {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === Featured Post === */
.featured-post {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
}

.featured-post .post-title {
  font-size: 1.75rem;
}

.featured-post .post-summary {
  -webkit-line-clamp: 5;
}

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  grid-column: 1 / -1;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-text {
  color: var(--text-muted);
  font-size: 1.125rem;
}

/* === Footer === */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 48px 0;
  margin-top: 80px;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
}

.footer-brand h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.footer-links h4 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.footer-links a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 0;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  margin-top: 32px;
  padding-top: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* === Loading Animation === */
.loading {
  text-align: center;
  padding: 60px;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === Animations === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-card {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.post-card:nth-child(1) { animation-delay: 0.1s; }
.post-card:nth-child(2) { animation-delay: 0.2s; }
.post-card:nth-child(3) { animation-delay: 0.3s; }
.post-card:nth-child(4) { animation-delay: 0.4s; }
.post-card:nth-child(5) { animation-delay: 0.5s; }
.post-card:nth-child(6) { animation-delay: 0.6s; }

/* === Responsive === */
@media (max-width: 768px) {
  .hero {
    padding: 60px 0 40px;
  }
  
  .hero-content {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .hero-text h1 {
    font-size: 2.5rem;
  }
  
  .hero-stats {
    justify-content: center;
  }
  
  .posts-grid {
    grid-template-columns: 1fr;
  }
  
  .featured-post {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .control-bar-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-box {
    width: 100%;
  }
}

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* === Selection === */
::selection {
  background: var(--accent-light);
  color: var(--accent-dark);
}

[data-theme="dark"] ::selection {
  background: var(--accent-light);
  color: var(--accent);
}
