/* ═══════════════════════════════════════════════════════════
   KALKI JESEN BLOG — Black & White Minimal
   Philosophical / Science Writer Aesthetic
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #ffffff;
  --bg-card: #f8f8f8;
  --bg-hover: #f0f0f0;
  --text: #1a1a1a;
  --text-muted: #666666;
  --accent: #000000;
  --accent-hover: #333333;
  --border: #e0e0e0;
  --radius: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Playfair Display', Georgia, serif;
  --max-width: 1100px;
  --content-width: 720px;
  --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.7; }

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

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

/* ═══ HEADER — SOLID BLACK ═══ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #000000;
  padding: 14px 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo { display: flex; align-items: center; }
.site-logo img { height: 32px; width: auto; filter: brightness(0) invert(1); }

.site-nav { display: flex; gap: 32px; }
.nav-link {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: color var(--transition);
}
.nav-link:hover, .nav-link.active { color: #ffffff; opacity: 1; }
.nav-link.active { border-bottom: 1px solid #fff; padding-bottom: 2px; }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}

/* ═══ HERO — CLEAN WHITE ═══ */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 16px;
  color: var(--text);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
  font-weight: 300;
}

/* ═══ MAIN CONTENT ═══ */
.main-content {
  padding: 48px 0;
}

/* ═══ SEARCH & FILTER ═══ */
.search-bar {
  margin-bottom: 24px;
}

.search-input {
  width: 100%;
  padding: 12px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition);
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: #999; }

.category-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.cat-btn {
  padding: 6px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition);
}
.cat-btn:hover { border-color: var(--accent); color: var(--text); }
.cat-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ═══ POSTS GRID ═══ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-bottom: 48px;
}

.post-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.post-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.post-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 16px;
}

.post-card-category {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.post-card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
  line-height: 1.4;
}

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 16px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.78rem;
  color: #999;
}

/* ═══ SINGLE POST ═══ */
.post-single {
  padding: 60px 0;
}

.post-single .container {
  max-width: var(--content-width);
}

.post-header { margin-bottom: 40px; }

.post-category-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.post-title {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--text);
}

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

.post-featured-img {
  width: 100%;
  border-radius: var(--radius);
  margin-top: 32px;
}

.post-body {
  font-size: 1.05rem;
  line-height: 1.9;
  color: #2a2a2a;
}

.post-body h2 {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  margin: 48px 0 16px;
  color: var(--text);
}

.post-body h3 {
  font-size: 1.3rem;
  margin: 36px 0 12px;
  color: var(--text);
}

.post-body p { margin-bottom: 20px; }

.post-body img {
  border-radius: 6px;
  margin: 32px 0;
}

.post-body blockquote {
  border-left: 3px solid #000;
  padding: 16px 24px;
  margin: 32px 0;
  background: #f9f9f9;
  font-style: italic;
  color: var(--text-muted);
}

.post-body code {
  background: #f4f4f4;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.88em;
}

.post-body pre {
  background: #1a1a1a;
  color: #e0e0e0;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 24px 0;
}

.post-body pre code { background: none; padding: 0; color: inherit; }

.post-body ul, .post-body ol {
  margin: 16px 0;
  padding-left: 24px;
}

.post-body li { margin-bottom: 8px; }

.post-footer {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.post-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.tag {
  padding: 5px 12px;
  background: #f4f4f4;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.tag:hover { border-color: var(--accent); color: var(--text); opacity: 1; }

.back-link {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.back-link:hover { color: var(--accent); opacity: 1; }

/* ═══ PAGINATION ═══ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 48px;
}

.page-btn {
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--accent); color: var(--text); }
.page-btn.active { background: #000; border-color: #000; color: #fff; }

/* ═══ CATEGORIES PAGE ═══ */
.page-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  margin-bottom: 40px;
  text-align: center;
  color: var(--text);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.category-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
  display: block;
  color: var(--text);
}
.category-card:hover {
  border-color: var(--accent);
  opacity: 1;
}
.category-card h3 { margin-bottom: 6px; font-size: 1.1rem; }
.category-card p { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 10px; }
.category-card .post-count { font-size: 0.78rem; color: #999; }

/* ═══ ABOUT ═══ */
.about-page { max-width: var(--content-width); margin: 0 auto; }
.about-content { font-size: 1.05rem; line-height: 1.9; color: #2a2a2a; }
.about-content p { margin-bottom: 20px; }

/* ═══ FOOTER — BLACK ═══ */
.site-footer {
  background: #000;
  color: rgba(255,255,255,0.6);
  padding: 32px 0;
  text-align: center;
  font-size: 0.82rem;
}

/* ═══ UTILITIES ═══ */
.loading-spinner {
  text-align: center;
  padding: 60px;
  color: var(--text-muted);
  font-size: 1rem;
}

.empty-state {
  text-align: center;
  padding: 60px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .site-nav { display: none; }
  .mobile-menu-btn { display: block; }

  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 1rem; }
  .hero { padding: 50px 0 40px; }

  .posts-grid { grid-template-columns: 1fr; }
  .post-title { font-size: 1.8rem; }
  .post-body { font-size: 1rem; }

  .page-title { font-size: 1.8rem; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-title { font-size: 1.6rem; }
  .post-card { padding: 18px; }
}
