:root {
  --bg-light: #f4f6f9;
  --bg-dark: #0f1522;
  --surface-light: #ffffff;
  --surface-dark: #182235;
  --surface-alt-light: #eef2f8;
  --surface-alt-dark: #212e46;
  --text-light: #182232;
  --text-dark: #e8eef8;
  --muted-light: #596780;
  --muted-dark: #9fb0cc;
  --border-light: #dce3ef;
  --border-dark: #2c3b57;
  --brand-light: #1b2a52;
  --brand-dark: #7aa6ff;
  --accent-light: #9e2b33;
  --accent-dark: #f0757e;

  --bg: var(--bg-light);
  --surface: var(--surface-light);
  --surface-alt: var(--surface-alt-light);
  --text: var(--text-light);
  --muted: var(--muted-light);
  --border: var(--border-light);
  --brand: var(--brand-light);
  --accent: var(--accent-light);

  color-scheme: light dark;
  accent-color: var(--brand);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--bg-dark);
    --surface: var(--surface-dark);
    --surface-alt: var(--surface-alt-dark);
    --text: var(--text-dark);
    --muted: var(--muted-dark);
    --border: var(--border-dark);
    --brand: var(--brand-dark);
    --accent: var(--accent-dark);
  }
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) {
  color-scheme: dark;
  --bg: var(--bg-dark);
  --surface: var(--surface-dark);
  --surface-alt: var(--surface-alt-dark);
  --text: var(--text-dark);
  --muted: var(--muted-dark);
  --border: var(--border-dark);
  --brand: var(--brand-dark);
  --accent: var(--accent-dark);
}

:root:has(> head > meta[name="color-scheme"][content="light"]) {
  color-scheme: light;
  --bg: var(--bg-light);
  --surface: var(--surface-light);
  --surface-alt: var(--surface-alt-light);
  --text: var(--text-light);
  --muted: var(--muted-light);
  --border: var(--border-light);
  --brand: var(--brand-light);
  --accent: var(--accent-light);
}

@supports (color: light-dark(white, black)) {
  :root {
    --bg: light-dark(var(--bg-light), var(--bg-dark));
    --surface: light-dark(var(--surface-light), var(--surface-dark));
    --surface-alt: light-dark(var(--surface-alt-light), var(--surface-alt-dark));
    --text: light-dark(var(--text-light), var(--text-dark));
    --muted: light-dark(var(--muted-light), var(--muted-dark));
    --border: light-dark(var(--border-light), var(--border-dark));
    --brand: light-dark(var(--brand-light), var(--brand-dark));
    --accent: light-dark(var(--accent-light), var(--accent-dark));
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

/* İçerik Kopyalama Koruması (Arama ve yorum kutuları hariç) */
.copy-protected,
.detail-body,
.detail-title,
.card-title,
.card-desc {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

img {
  -webkit-user-drag: none;
  user-select: none;
}

input,
textarea {
  -webkit-user-select: text;
  user-select: text;
}

@media print {
  .detail-body,
  #posts-grid,
  #pages-grid,
  #qa-list {
    display: none !important;
  }
  body::after {
    content: "© Adalet Pusulam — İçeriklerin izinsiz çoğaltılması korumalıdır. Lütfen Adalet Pusulam Android Uygulamasını kullanınız.";
    display: block;
    padding: 48px 24px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
  }
}

.container {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Uygulama Tanıtım Şeridi */
.app-banner {
  background: linear-gradient(90deg, #1b2a52 0%, #70121a 100%);
  color: #fff;
  font-size: 13.5px;
  padding: 9px 0;
}

.app-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-play {
  background: #ffffff;
  color: #1b2a52;
  font-weight: 700;
  font-size: 12.5px;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.btn-play:hover { opacity: 0.92; }

/* Üst Başlık */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 62px;
  padding-top: 8px;
  padding-bottom: 8px;
  flex-wrap: wrap;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-mark { font-size: 25px; }

.brand-name {
  font-size: 18.5px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1.2;
}

.brand-tagline {
  font-size: 12px;
  color: var(--muted);
}

.main-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.nav-tab:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.nav-tab.active {
  background: var(--surface-alt);
  color: var(--brand);
  border-color: var(--border);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-header-app {
  background: #9e2b33;
  color: #ffffff;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.btn-header-app:hover { background: #7f1f26; }

.icon-toggle {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
}

.admin-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.admin-link:hover {
  color: var(--text);
  background: var(--surface-alt);
}

/* Ana İki Sütunlu Portal Yerleşimi (Sol Dikey Kategori Listesi + Sağ İçerik) */
.main-content {
  flex: 1;
  padding-top: 22px;
  padding-bottom: 48px;
}

.portal-layout {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.category-sidebar {
  position: sticky;
  top: 82px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.category-accordion summary {
  list-style: none;
}

.category-accordion summary::-webkit-details-marker {
  display: none;
}

.sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--brand);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}

.accordion-chevron {
  font-size: 13px;
  color: var(--muted);
  display: none;
}

.category-vlist {
  display: flex;
  flex-direction: column;
  padding: 6px;
  gap: 2px;
  max-height: calc(100vh - 290px);
  overflow-y: auto;
}

.cat-vitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: none;
  border-left: 3px solid transparent;
  background: transparent;
  color: var(--text);
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.cat-vitem:hover {
  background: var(--surface-alt);
  color: var(--brand);
}

.cat-vitem.active {
  background: var(--surface-alt);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 700;
}

.cat-vitem-arrow {
  font-size: 14px;
  color: var(--muted);
  flex-shrink: 0;
}

.app-promo-card {
  padding: 16px;
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-alt) 100%);
}

.app-promo-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

.app-promo-title {
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 6px;
  color: var(--text);
}

.app-promo-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.btn-block {
  width: 100%;
}

.portal-main-col {
  min-width: 0;
}

.filter-section {
  margin-bottom: 18px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 12px;
}

.search-box:focus-within {
  border-color: var(--brand);
}

.search-icon {
  margin-right: 8px;
  font-size: 16px;
}

#search-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  padding: 10px 4px;
  outline: none;
}

.search-clear {
  border: none;
  background: var(--surface-alt);
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
}

.badge-category {
  display: inline-block;
  background: #1b2a52;
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.section-head h1 {
  font-size: 21px;
  font-weight: 800;
}

.muted-text {
  color: var(--muted);
  font-size: 13px;
}

/* Kart Izgarası */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.card-thumb {
  width: 100%;
  height: 172px;
  object-fit: cover;
  background: var(--surface-alt);
}

.card-initial {
  width: 100%;
  height: 124px;
  background: linear-gradient(135deg, #1b2a52 0%, #304878 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
}

.card-body {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.card-cat {
  color: var(--accent);
  font-weight: 700;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

.card-desc {
  font-size: 13.5px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.status-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  margin-top: 12px;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: #9e2b33;
  color: #ffffff;
}

.btn-primary:hover { background: #7f1f26; }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover { background: var(--surface-alt); }

/* Detay Ekranı */
.detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.detail-title {
  font-size: 25px;
  line-height: 1.3;
  margin-bottom: 18px;
}

.detail-cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 20px;
}

.detail-body {
  font-size: 16px;
  line-height: 1.75;
  overflow-wrap: break-word;
}

.detail-body p, .detail-body ul, .detail-body ol, .detail-body table, .detail-body blockquote {
  margin-bottom: 14px;
}

.detail-body h2, .detail-body h3, .detail-body h4 {
  margin: 22px 0 10px;
  line-height: 1.35;
}

.detail-body ul, .detail-body ol { padding-left: 22px; }

.detail-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 10px 0;
}

.detail-body table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
}

.detail-body th, .detail-body td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

.app-inline-cta {
  margin-top: 24px;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.app-inline-cta p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}

.legal-notice {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--surface-alt);
  border-left: 4px solid var(--accent);
  font-size: 13.5px;
}

/* Yorumlar ve Soru-Cevap */
.comments-section {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
}

.comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.comments-head h2 { font-size: 18px; }

.comments-list, .qa-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.comment-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}

.comment-author-name {
  font-weight: 700;
  color: var(--brand);
}

.comment-post-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
}

.comment-post-link:hover { text-decoration: underline; }

.comment-body-text {
  font-size: 14.5px;
  white-space: pre-wrap;
}

.admin-reply-box {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border-left: 3px solid #2e7d32;
  border-radius: 8px;
  font-size: 14px;
}

.admin-reply-title {
  font-size: 12px;
  font-weight: 700;
  color: #2e7d32;
  margin-bottom: 3px;
}

/* Diyalog */
.portal-dialog {
  margin: auto;
  width: calc(100% - 24px);
  max-width: 520px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  padding: 0;
}

.portal-dialog::backdrop {
  background: rgba(10, 15, 28, 0.58);
  backdrop-filter: blur(2px);
}

.dialog-form {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dialog-head h2 { font-size: 18px; }

.dialog-note { line-height: 1.45; }

.form-label {
  font-size: 13px;
  font-weight: 600;
}

.form-input, .form-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14.5px;
}

.form-textarea { resize: vertical; }

.form-msg {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface-alt);
}

.form-msg.error { color: #d32f2f; }
.form-msg.success { color: #2e7d32; }

.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

/* Alt Bilgi */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 22px 0;
  font-size: 13px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover { color: var(--text); text-decoration: underline; }

.portal-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #1b2a52;
  color: #ffffff;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 90;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* Mobil ve Tablet Uyum */
@media (max-width: 880px) {
  .portal-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .category-sidebar {
    position: static;
  }
  .accordion-chevron {
    display: inline-block;
  }
  .category-vlist {
    max-height: 280px;
  }
}

@media (max-width: 640px) {
  .detail-card { padding: 18px 16px; }
  .detail-title { font-size: 21px; }
  .comments-section { padding: 16px; }
  .btn-header-app { display: none; }
}
