/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: Georgia, 'Times New Roman', 'Noto Serif', serif;
  color: #1a1a2e;
  background-color: #fafaf8;
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Layout ===== */
.container {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== Header ===== */
header {
  background-color: #16213e;
  color: #fafaf8;
  padding: 1.5rem 0;
  border-bottom: 3px solid #0f3460;
}

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

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

header h1 a {
  color: #fafaf8;
  text-decoration: none;
}

header nav a {
  color: #c8d6e5;
  text-decoration: none;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.875rem;
  transition: color 0.2s;
}

header nav a:hover {
  color: #fff;
}

/* ===== Main ===== */
main {
  flex: 1;
  padding: 2rem 0;
}

/* ===== Filtre ===== */
.filtre-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-family: system-ui, -apple-system, sans-serif;
}

.filtre-btn {
  background: #fff;
  border: 1px solid #d1cdc4;
  color: #1a1a2e;
  padding: 0.35rem 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8125rem;
  transition: all 0.2s;
}

.filtre-btn:hover {
  border-color: #16213e;
  color: #16213e;
}

.filtre-btn.aktif {
  background-color: #16213e;
  color: #fafaf8;
  border-color: #16213e;
}

/* ===== Sözleşme Kartları ===== */
.sozlesme-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sozlesme-kart {
  background: #fff;
  border: 1px solid #e0ddd5;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  transition: border-color 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.sozlesme-kart:hover {
  border-color: #16213e;
}

.sozlesme-kart h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #16213e;
}

.sozlesme-kart .meta {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.8125rem;
  color: #6b7280;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.kategori-badge {
  background: #e8e6df;
  color: #4a4a4a;
  padding: 0.15rem 0.6rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-family: system-ui, -apple-system, sans-serif;
}

/* ===== Boş Durum ===== */
.bos-durum {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
  font-family: system-ui, -apple-system, sans-serif;
}

.bos-durum p {
  font-size: 0.9375rem;
}

/* ===== Sözleşme Görüntüleyici ===== */
.sozlesme-ust-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0ddd5;
  font-family: system-ui, -apple-system, sans-serif;
}

.sozlesme-ust-bar a,
.sozlesme-ust-bar button {
  font-size: 0.875rem;
  color: #16213e;
  text-decoration: none;
  background: none;
  border: 1px solid #d1cdc4;
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.sozlesme-ust-bar a:hover,
.sozlesme-ust-bar button:hover {
  background: #16213e;
  color: #fafaf8;
  border-color: #16213e;
}

/* ===== Markdown İçerik ===== */
.md-icerik {
  line-height: 1.8;
}

.md-icerik h1 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #16213e;
}

.md-icerik h2 {
  font-size: 1.35rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  color: #16213e;
}

.md-icerik h3 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.4rem;
}

.md-icerik p {
  margin-bottom: 1rem;
}

.md-icerik ul, .md-icerik ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.md-icerik li {
  margin-bottom: 0.3rem;
}

.md-icerik blockquote {
  border-left: 3px solid #16213e;
  padding-left: 1rem;
  margin: 1rem 0;
  color: #4a4a4a;
  font-style: italic;
}

.md-icerik hr {
  border: none;
  border-top: 1px solid #e0ddd5;
  margin: 1.5rem 0;
}

.md-icerik table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9375rem;
}

.md-icerik th, .md-icerik td {
  border: 1px solid #e0ddd5;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.md-icerik th {
  background: #f0eeea;
  font-weight: 600;
}

.md-icerik strong {
  font-weight: 700;
}

.md-icerik code {
  background: #f0eeea;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.875em;
}

/* ===== Yükleniyor ===== */
.yukleniyor {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
  font-family: system-ui, -apple-system, sans-serif;
}

/* ===== Footer ===== */
footer {
  padding: 1.25rem 0;
  text-align: center;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.8125rem;
  color: #9ca3af;
  border-top: 1px solid #e0ddd5;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  header h1 {
    font-size: 1.25rem;
  }

  .sozlesme-kart {
    padding: 1rem 1.1rem;
  }

  .sozlesme-kart .meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .sozlesme-ust-bar {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }
}

/* ===== Print ===== */
@media print {
  header, footer, .sozlesme-ust-bar, .filtre-bar {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
    line-height: 1.6;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .md-icerik h1 {
    border-bottom-color: #000;
  }

  .md-icerik th, .md-icerik td {
    border-color: #000;
  }

  @page {
    margin: 2cm;
  }
}
