:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --accent: var(--ghost-accent-color, #2563eb);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
  --radius: 12px;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: #1e293b;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--muted); }

/* Okuma İlerleme Çubuğu */
#reading-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--accent); z-index: 1000; transition: width 0.08s linear;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; height: 64px;
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--text); font-weight: 800; font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; }
.brand-logo { max-height: 32px; }

.site-nav ul { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a { color: var(--muted); font-weight: 500; font-size: 0.92rem; }
.site-nav a:hover, .site-nav .nav-current a { color: var(--text); text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
[data-theme="light"] .theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-moon { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.55rem 1rem; border-radius: 8px; font-weight: 600; font-size: 0.9rem;
  border: 1px solid transparent; cursor: pointer; transition: opacity 0.15s;
}
.btn:hover { text-decoration: none; opacity: 0.92; }
.btn-sm { padding: 0.42rem 0.85rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }

/* Hero */
.hero { padding: 3.5rem 0 2.5rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.hero-compact { padding: 2.5rem 0 2rem; }
.hero-badge {
  display: inline-block; padding: 0.25rem 0.75rem; border-radius: 999px;
  background: var(--surface-2); color: var(--accent); font-size: 0.8rem; font-weight: 600;
  margin-bottom: 0.85rem;
}
.hero-title { margin: 0 0 0.75rem; font-size: clamp(1.85rem, 3.5vw, 2.75rem); line-height: 1.15; letter-spacing: -0.025em; }
.hero-desc { margin: 0; max-width: 680px; color: var(--muted); font-size: 1.05rem; }

.tag-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.4rem; }
.tag-pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.75rem; border-radius: 999px; font-size: 0.82rem; font-weight: 500;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}
.tag-pill:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.tag-pill span { color: var(--muted); font-size: 0.75rem; }

/* Ana Grid & Sidebar */
.content-grid {
  display: grid; grid-template-columns: 1fr 300px; gap: 2rem;
  padding-top: 2.25rem; padding-bottom: 3rem;
}
.section-head h2 { margin: 0 0 1.25rem; font-size: 1.25rem; }
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.post-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 2.25rem 0; }

.post-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.post-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.post-card-image { width: 100%; height: 185px; object-fit: cover; }
.post-card-body { padding: 1.2rem; display: flex; flex-direction: column; flex: 1; }
.post-card-meta { display: flex; align-items: center; gap: 0.6rem; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.6rem; }
.badge {
  display: inline-block; padding: 0.15rem 0.55rem; border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent); font-weight: 600; font-size: 0.76rem;
}
.badge:hover { text-decoration: none; }
.post-card-title { margin: 0 0 0.55rem; font-size: 1.12rem; line-height: 1.35; }
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--accent); text-decoration: none; }
.post-card-excerpt { margin: 0 0 1rem; color: var(--muted); font-size: 0.9rem; flex: 1; }
.post-card-footer { display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.read-more { font-weight: 600; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 1.25rem; }
.sidebar-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow);
}
.sidebar-card h3 { margin: 0 0 0.65rem; font-size: 1rem; }
.category-list { list-style: none; margin: 0; padding: 0; }
.category-list li + li { border-top: 1px solid var(--border); }
.category-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.55rem 0; color: var(--text); font-size: 0.9rem;
}
.category-list a:hover { color: var(--accent); text-decoration: none; }
.count-badge {
  background: var(--surface-2); color: var(--muted);
  font-size: 0.76rem; padding: 0.1rem 0.5rem; border-radius: 999px;
}

/* Makale Detay + Sticky TOC */
.post-layout {
  display: grid; grid-template-columns: minmax(0, 780px) 260px; gap: 2.5rem;
  justify-content: center; padding-top: 2.5rem; padding-bottom: 4rem;
}
.page-layout { max-width: 820px; padding-top: 2.5rem; padding-bottom: 4rem; }
.post-meta-top { display: flex; align-items: center; gap: 0.6rem; font-size: 0.88rem; color: var(--muted); margin-bottom: 0.85rem; flex-wrap: wrap; }
.post-title { margin: 0 0 0.85rem; font-size: clamp(1.75rem, 3.2vw, 2.5rem); line-height: 1.2; letter-spacing: -0.025em; }
.post-excerpt { font-size: 1.12rem; color: var(--muted); margin: 0 0 1.25rem; }
.post-author-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.75rem; }
.author-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.author-avatar-lg { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.author-hero { display: flex; align-items: center; gap: 1.25rem; }
.author-name { font-weight: 600; color: var(--text); }
.author-bio { margin: 0; font-size: 0.84rem; }
.post-cover { margin: 0 0 2rem; }
.post-cover img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.post-cover figcaption { text-align: center; font-size: 0.82rem; color: var(--muted); margin-top: 0.5rem; }

/* Prose & Kod Blokları */
.prose { font-size: 1.03rem; line-height: 1.8; }
.prose h2 { margin: 2.2rem 0 0.8rem; font-size: 1.5rem; scroll-margin-top: 84px; }
.prose h3 { margin: 1.75rem 0 0.6rem; font-size: 1.2rem; scroll-margin-top: 84px; }
.prose pre {
  position: relative; border-radius: 10px; padding: 1.15rem; overflow-x: auto;
  font-family: "JetBrains Mono", monospace; font-size: 0.88rem; line-height: 1.6;
}
.prose :not(pre) > code {
  font-family: "JetBrains Mono", monospace; font-size: 0.86em;
  background: var(--surface-2); padding: 0.15rem 0.4rem; border-radius: 5px;
}
.prose blockquote {
  margin: 1.5rem 0; padding: 0.9rem 1.2rem;
  border-left: 4px solid var(--accent); background: var(--surface-2);
  border-radius: 0 8px 8px 0;
}
.prose img { border-radius: 10px; cursor: zoom-in; }

.copy-code-btn {
  position: absolute; top: 8px; right: 8px; padding: 4px 10px;
  font-size: 12px; font-weight: 600; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2); background: rgba(15, 23, 42, 0.85);
  color: #f8fafc; cursor: pointer;
}
.copy-code-btn:hover { background: var(--accent); }

/* Sticky TOC */
.toc-sidebar { position: relative; }
.toc-card {
  position: sticky; top: 84px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem;
}
.toc-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.7rem; }
#toc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
#toc-list a { color: var(--muted); font-size: 0.84rem; display: block; line-height: 1.4; }
#toc-list a:hover, #toc-list a.active { color: var(--accent); font-weight: 600; text-decoration: none; }
#toc-list li.toc-h3 { padding-left: 0.85rem; }

.post-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 2rem 0; }
.post-prev-next { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 2rem 0; }
.prev-next-card {
  display: flex; flex-direction: column; gap: 0.25rem; padding: 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text);
}
.prev-next-card.next { text-align: right; }
.prev-next-card:hover { border-color: var(--accent); text-decoration: none; }
.comments-section { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--border); }

/* Sayfalama & Footer */
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; }
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 2.25rem 0; margin-top: 2rem; }
.footer-inner { display: flex; flex-direction: column; gap: 0.75rem; }
.footer-links ul { display: flex; gap: 1rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.copyright { font-size: 0.84rem; margin: 0; }

/* Dil Seçici (TR / EN) */
.lang-switch {
  display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.lang-btn {
  padding: 0.3rem 0.55rem; font-size: 0.78rem; font-weight: 700; color: var(--muted);
  background: var(--surface);
}
.lang-btn.active, .lang-btn:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* Hızlı Kategori Filtreleme Barı (ergineer.com.tr tarzı) */
.filter-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.25rem;
}
.filter-head h2 { margin: 0; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.filter-btn {
  padding: 0.32rem 0.75rem; border-radius: 999px; font-size: 0.82rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer;
}
.filter-btn.active, .filter-btn:hover {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

/* Makale Sonu İletişim / Danışmanlık CTA */
.post-cta-box {
  display: flex; align-items: center; justify-content: space-between; gap: 1.25rem;
  flex-wrap: wrap; padding: 1.35rem 1.5rem; margin: 2rem 0;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow);
}
.post-cta-box h3 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.post-cta-box p { margin: 0; font-size: 0.92rem; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(2, 6, 23, 0.88);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; padding: 2rem; cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 90vh; max-width: 92vw; border-radius: 10px; }

@media (max-width: 960px) {
  .content-grid, .post-layout { grid-template-columns: 1fr; }
  .toc-sidebar { display: none !important; }
  .post-grid, .post-grid-3 { grid-template-columns: 1fr; }
  .site-nav { display: none; }
}
