/* -*- coding: utf-8 -*- */
/*
BIT HINT (EN)
- Purpose: Provide one lightweight, shared visual system for the whole topic-driven site.
- Functions: Defines the site shell, topic navigation chips, readable prose defaults, and responsive behavior.
- Change Log:
  - 2026-03-20: Perfect symmetry applied. Header and Topic Card share the exact same width. Global flex architecture applied for absolute Y-centering.
- Compatibility: Modern browsers; graceful fallback for older engines.
- Fail-Open: The HTML stays readable even if advanced visual effects are ignored.
*/

:root {
  /* GÖZ YORMAYAN (EYE-FRIENDLY) SLATE & SOFT BLUE PALETİ */
  --bg: #0f172a; 
  --bg-soft: #1e293b; 
  --panel: rgba(15, 23, 42, 0.85);
  --panel-strong: rgba(30, 41, 59, 0.95);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f8fafc; 
  --muted: #94a3b8; 
  --accent: #60a5fa; 
  --accent-strong: #93c5fd; 
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-pill: 999px;
  
  /* KUSURSUZ SİMETRİ: Hem menü hem metin kutusu aynı genişlikte */
  --container: 850px; 
  
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: ui-serif, Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc;
    --bg-soft: #f1f5f9;
    --panel: rgba(255, 255, 255, 0.9);
    --panel-strong: rgba(255, 255, 255, 0.98);
    --line: rgba(15, 23, 42, 0.08);
    --line-strong: rgba(15, 23, 42, 0.15);
    --text: #0f172a;
    --muted: #64748b;
    --accent: #3b82f6;
    --accent-strong: #2563eb;
    --shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg), var(--bg-soft)) no-repeat fixed;
  font-family: var(--font-sans);
  line-height: 1.8;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  
  /* GLOBAL FLEX - İÇERİĞİ TAM MERKEZE YERLEŞTİRİR */
  display: flex;
  flex-direction: column;
  align-items: center; 
}

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

.site-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center; /* KUSURSUZ Y-EKSENİ MERKEZLEME */
}

/* HEADER & MAIN WRAPPERS */
.site-header {
  width: 100%;
  padding: 24px 16px 0;
  display: flex;
  justify-content: center; /* KAPSAYICIYI MERKEZLER */
}

.site-main {
  width: 100%;
  padding: 24px 16px 40px;
  display: flex;
  justify-content: center; /* KAPSAYICIYI MERKEZLER */
}

/* ORTAK GENİŞLİK MATEMATİĞİ (SİMETRİ ZIRHI) */
.site-header-inner,
.topic-card {
  width: 100%;
  max-width: var(--container); /* İKİSİ DE 850px */
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-align: center; /* TÜM İÇERİK MERKEZE HİZALI */
}

.site-header-inner {
  padding: 24px 20px;
  background: var(--panel);
}

.topic-card {
  padding: clamp(24px, 4vw, 40px);
}

/* BRANDING & CHIPS */
.site-brand {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.05em;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  margin-bottom: 15px;
}

.topic-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.topic-chip:hover,
.topic-chip:focus-visible {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
  outline: none;
}

.topic-chip.is-active {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(96, 165, 250, 0.1); 
  font-weight: 500;
}

/* TOPIC TYPOGRAPHY */
.topic-header {
  padding-bottom: 24px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 28px;
}

.topic-kicker {
  margin: 0 0 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.8rem;
  font-weight: 700;
}

.topic-header h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--text);
}

.topic-description {
  margin: 16px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  max-width: 60ch;
}

/* PROSE (CONTENT FORMATTING) */
.prose {
  color: var(--text);
  margin: 0 auto; 
  max-width: 70ch; /* Okunabilirliği bozmamak için makale genişliği sınırlandırıldı */
}

.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre {
  margin: 0 0 20px;
  font-size: clamp(1.05rem, 1.2vw, 1.15rem);
}

.prose h2,
.prose h3 {
  font-family: var(--font-serif);
  line-height: 1.3;
  margin: 40px 0 16px;
  color: var(--text);
}

.prose h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.prose h3 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }

.prose ul,
.prose ol {
  padding-left: 0;
  list-style-position: inside;
  display: inline-block; /* Listeleri merkeze alırken noktaları dağıtmaz */
  text-align: left; 
}

.prose li + li { margin-top: 12px; }

.prose blockquote {
  padding: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  color: var(--accent-strong);
  font-style: italic;
  margin: 30px auto;
  max-width: 90%;
}

.prose pre {
  padding: 20px;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  line-height: 1.6;
  text-align: left; 
}

.prose strong { color: var(--text); font-weight: 700; }
.prose a { text-underline-offset: 4px; text-decoration-thickness: 1px; }

.fade-in { animation: fadeIn 0.3s ease-out; }

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

/* =========================================
   MOBİL (KUSURSUZ UYUM & TAŞMA ENGELLEME)
   ========================================= */
@media (max-width: 720px) {
  .site-header { padding-top: 16px; }

  .site-header-inner,
  .topic-card {
    border-radius: 20px; /* Mobilde daha yumuşak köşeler */
  }

  .site-header-inner { padding: 20px 16px 16px; }
  .site-main { padding-top: 16px; }
  .topic-card { padding: 24px 16px 30px; }

  .topic-nav {
    flex-direction: column; /* Mobilde linkler alt alta düzgün dizilir */
    gap: 8px;
  }

  .topic-chip {
    width: 100%;
    justify-content: center;
    border-radius: 12px; 
    padding: 12px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-in, .topic-chip { animation: none !important; transition: none !important; }
}