:root {
  --primary: #6D53FF;
  --accent: #E5FF53;
  --text: #2d2d2d;
  --muted: #666;
  --bg: #fff;
  --bg-light: #f9f9f9;
  --font: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 760px;
}

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

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  font-size: 17px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* NAV */
nav {
  background: var(--primary);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 56px;
}
nav .brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}
nav .brand:hover { color: var(--accent); text-decoration: none; }
nav .nav-links a {
  color: rgba(255,255,255,0.85);
  margin-left: 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}
nav .nav-links a:hover { color: var(--accent); }

/* CONTAINER */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.container-wide { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* HERO (index only) */
.hero {
  background: var(--primary);
  color: #fff;
  padding: 4rem 1.5rem;
  text-align: center;
}
.hero h1 { font-size: 2.2rem; margin-bottom: 0.5rem; }
.hero p { opacity: 0.85; font-size: 1.1rem; }

/* POST GRID */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 3rem 0;
}
.card {
  background: var(--bg-light);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s;
  border: 1px solid #eee;
}
.card:hover { box-shadow: 0 4px 20px rgba(109,83,255,0.15); text-decoration: none; }
.card-img { width: 100%; height: 180px; object-fit: cover; background: #e0e0e0; }
.card-img-placeholder { width: 100%; height: 180px; background: linear-gradient(135deg, var(--primary) 0%, #9b8eff 100%); }
.card-body { padding: 1.2rem; flex: 1; display: flex; flex-direction: column; }
.card-meta { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.4rem; }
.card-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; line-height: 1.4; }
.card-excerpt { font-size: 0.88rem; color: var(--muted); flex: 1; }
.card-cats { margin-top: 0.8rem; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.cat-tag {
  background: var(--accent);
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

/* CATEGORY FILTER */
.cat-filter {
  padding: 1.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.cat-filter span { font-weight: 600; margin-right: 0.5rem; font-size: 0.9rem; }
.cat-btn {
  background: #eee;
  border: none;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s;
}
.cat-btn:hover, .cat-btn.active { background: var(--primary); color: #fff; }

/* SINGLE POST */
.post-header {
  background: var(--primary);
  color: #fff;
  padding: 3rem 1.5rem 2rem;
}
.post-header .post-meta { font-size: 0.85rem; opacity: 0.8; margin-bottom: 0.75rem; }
.post-header h1 { font-size: 2rem; line-height: 1.3; }
.post-header .post-cats { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }

.post-content {
  padding: 2.5rem 0 4rem;
  color: #333;
}
.post-content img { max-width: 100%; border-radius: 6px; margin: 1rem 0; }
.post-content h2 { font-size: 1.4rem; margin: 2rem 0 0.75rem; color: var(--primary); }
.post-content h3 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
.post-content p { margin-bottom: 1.25rem; }
.post-content ul, .post-content ol { padding-left: 1.75rem; margin-bottom: 1.25rem; }
.post-content li { margin-bottom: 0.4rem; }
.post-content blockquote { border-left: 3px solid var(--accent); padding: 0.5rem 1.25rem; margin: 1.5rem 0; color: var(--muted); background: var(--bg-light); border-radius: 0 6px 6px 0; }
.post-content pre, .post-content code { background: var(--bg-light); border-radius: 4px; font-family: monospace; }
.post-content pre { padding: 1rem; overflow-x: auto; margin: 1rem 0; font-size: 0.9rem; }
.post-content code { padding: 2px 5px; font-size: 0.9em; }
.post-content a { color: var(--primary); }
.post-content table { border-collapse: collapse; width: 100%; margin: 1.5rem 0; }
.post-content th, .post-content td { border: 1px solid #ddd; padding: 0.5rem 0.75rem; }
.post-content th { background: var(--bg-light); font-weight: 600; }

.back-link { display: inline-block; margin-bottom: 1.5rem; color: var(--primary); font-size: 0.9rem; }
.back-link:hover { text-decoration: underline; }

/* FOOTER */
footer {
  background: var(--primary);
  color: rgba(255,255,255,0.8);
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.85rem;
}
footer a { color: var(--accent); }

/* PAGINATION */
.pagination { display: flex; justify-content: center; gap: 0.5rem; padding: 2rem 0; }
.pagination button {
  background: #eee;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  font-family: var(--font);
}
.pagination button.active { background: var(--primary); color: #fff; }

@media (max-width: 600px) {
  nav { padding: 0 1rem; }
  .hero h1 { font-size: 1.5rem; }
  .post-header h1 { font-size: 1.4rem; }
  nav .nav-links a { margin-left: 1rem; font-size: 0.8rem; }
}
