@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

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

/* ── THEME VARIABLES ── */
:root {
  --bg: #ffffff;
  --bg-raised: #ffffff;
  --border: #e8e8e8;
  --border-strong: #0a0a0a;
  --text-primary: #0a0a0a;
  --text-secondary: #1a1a1a;
  --text-body: #333;
  --text-muted: #666;
  --text-faint: #999;
  --text-ghost: #ccc;
  --tag-bg: transparent;
  --tag-border: #e8e8e8;
  --tag-text: #666;
  --badge-fill: #e8e8e8;
  --serif: 'Cormorant Garamond', 'Georgia', serif;
  --sans: 'DM Sans', 'Helvetica Neue', sans-serif;
}

[data-theme="dark"] {
  --bg: #111111;
  --bg-raised: #1a1a1a;
  --border: #2a2a2a;
  --border-strong: #e8e8e8;
  --text-primary: #f0f0f0;
  --text-secondary: #d8d8d8;
  --text-body: #b0b0b0;
  --text-muted: #888;
  --text-faint: #666;
  --text-ghost: #444;
  --tag-bg: transparent;
  --tag-border: #333;
  --tag-text: #888;
  --badge-fill: #2a2a2a;
}

html { font-size: 16px; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text-secondary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

a { color: var(--text-secondary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── HEADER ── */
.site-header {
  border-bottom: 1px solid var(--border-strong);
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  position: relative;
}

.site-header__emblem {
  font-family: var(--serif);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .4rem;
}

.site-header__title {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  color: var(--text-primary);
}

.site-header__sub {
  font-family: var(--sans);
  font-size: .8rem;
  font-weight: 400;
  color: var(--text-faint);
  margin-top: .5rem;
  letter-spacing: .04em;
}

.site-header__author {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 400;
  color: var(--text-faint);
  margin-top: .3rem;
  letter-spacing: .03em;
}

/* ── DETAIL KÜNYE ── */
.detail-kunye {
  font-family: var(--sans);
  font-size: .88rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: .03em;
  text-align: center;
  padding-bottom: 1.2rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.detail-kunye__link {
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  margin-top: .4rem;
  transition: color .15s ease;
}

.detail-kunye__link:hover {
  color: var(--text-primary);
  text-decoration: none;
}

/* ── THEME TOGGLE ── */
.theme-toggle {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s ease;
  font-size: 1.1rem;
}

.theme-toggle:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

/* ── STATS ── */
.stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding: 1.2rem 2rem;
  border-bottom: 1px solid var(--border);
}

.stats__item { text-align: center; }

.stats__val {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stats__label {
  font-size: .65rem;
  font-weight: 500;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-top: .1rem;
}

/* ── FILTERS ── */
.filters {
  display: flex;
  justify-content: center;
  gap: .5rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.filters__btn {
  padding: .35rem .9rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  letter-spacing: .02em;
}

.filters__btn:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.filters__btn.active {
  background: var(--text-primary);
  color: var(--bg);
  border-color: var(--text-primary);
}

/* ── CONTAINER ── */
.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* ── KARAR CARDS ── */
.karar {
  border-bottom: 1px solid var(--border);
  padding: 2rem 0 2rem 3rem;
  position: relative;
  transition: opacity .3s ease, transform .3s ease;
}

.karar:last-child { border-bottom: none; }

.karar__num {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-faint);
  position: absolute;
  top: 2rem;
  left: 0;
  letter-spacing: -.02em;
}

.karar__ref {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: .03em;
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

.karar__link {
  font-size: .65rem;
  font-weight: 500;
  color: var(--text-ghost);
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  transition: color .15s ease;
}

.karar__link:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.karar__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: .6rem;
  gap: .75rem;
}

.karar__konu {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
}

.karar__ozet {
  font-size: .85rem;
  color: var(--text-body);
  line-height: 1.75;
  margin-bottom: 1rem;
}

.karar__foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: .75rem;
}

.karar__tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  flex: 1;
  min-width: 0;
}

.karar__foot .btn {
  flex-shrink: 0;
}

.tag {
  font-size: .65rem;
  font-weight: 500;
  color: var(--tag-text);
  padding: .15rem .5rem;
  border: 1px solid var(--tag-border);
  background: var(--tag-bg);
  letter-spacing: .02em;
}

/* ── SONUÇ BADGES ── */
.sonuc {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .2rem .6rem;
  border: 1px solid;
  white-space: nowrap;
  flex-shrink: 0;
}

.sonuc--onama  { color: var(--text-body); border-color: var(--text-body); }
.sonuc--bozma  { color: var(--text-primary); border-color: var(--text-primary); background: var(--badge-fill); }
.sonuc--duzelt { color: var(--text-faint); border-color: var(--text-ghost); }
.sonuc--red    { color: var(--text-muted); border-color: var(--text-muted); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 500;
  padding: .45rem 1rem;
  border: 1px solid var(--text-primary);
  background: var(--bg);
  color: var(--text-primary);
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
  letter-spacing: .02em;
  white-space: nowrap;
}

.btn:hover {
  background: var(--text-primary);
  color: var(--bg);
  text-decoration: none;
}

.btn--filled {
  background: var(--text-primary);
  color: var(--bg);
}

.btn--filled:hover {
  background: var(--bg);
  color: var(--text-primary);
}

.btn--ghost {
  border-color: var(--border);
  color: var(--text-muted);
}

.btn--ghost:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  background: var(--bg);
}

.btn i { font-size: 1rem; line-height: 1; }

/* ── DETAIL PAGE ── */
.detail-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: .75rem;
}

.detail-nav__group {
  display: flex;
  gap: .5rem;
}

.detail-summary {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.detail-summary__konu {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: .75rem;
}

.detail-summary__ozet {
  font-size: .88rem;
  color: var(--text-body);
  line-height: 1.85;
  border-left: 2px solid var(--text-primary);
  padding-left: 1.25rem;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

.meta-cell {
  padding: .85rem 1rem;
  border-right: 1px solid var(--border);
}

.meta-cell:last-child { border-right: none; }

.meta-cell__label {
  font-size: .6rem;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: .2rem;
}

.meta-cell__value {
  font-family: var(--serif);
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.metin-header {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--text-primary);
  margin-bottom: 1.5rem;
  letter-spacing: .02em;
}

.metin {
  font-size: .88rem;
  line-height: 2;
  color: var(--text-secondary);
}

.metin p {
  margin-bottom: .7rem;
  text-align: justify;
  hyphens: auto;
}

.metin .metin-baslik {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  margin: 2rem 0 .5rem;
  padding-bottom: .3rem;
  border-bottom: 1px solid var(--border);
}

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 2.5rem 1.5rem;
  font-size: .72rem;
  color: var(--text-faint);
  letter-spacing: .02em;
}

.site-footer a { color: var(--text-muted); }

/* ── RESPONSIVE: TABLET ── */
@media (max-width: 768px) {
  .page-layout { flex-direction: column; }

  .site-header { padding: 2rem 1.5rem 1.5rem; }
  .site-header__title { font-size: 1.6rem; }
  .detail-kunye { font-size: .72rem; }

  .theme-toggle { top: .8rem; right: .8rem; width: 32px; height: 32px; font-size: 1rem; }

  .stats { gap: 1.5rem; padding: 1rem 1rem; }
  .stats__val { font-size: 1.2rem; }
  .stats__label { font-size: .6rem; }

  .filters { padding: .75rem 1rem; gap: .4rem; }
  .filters__btn { font-size: .7rem; padding: .3rem .7rem; }

  .wrap { padding: 1.5rem 1rem; }

  .karar { padding: 1.5rem 0 1.5rem 2.5rem; }
  .karar__num { top: 1.6rem; }
  .karar__ref { font-size: .68rem; }
  .karar__konu { font-size: 1.1rem; }
  .karar__ozet { font-size: .82rem; line-height: 1.7; }

  .detail-meta { grid-template-columns: 1fr 1fr; }
  .meta-cell:nth-child(2) { border-right: none; }
  .meta-cell:nth-child(3), .meta-cell:nth-child(4) { border-top: 1px solid var(--border); }

  .detail-summary__konu { font-size: 1.25rem; }
  .detail-summary__ozet { font-size: .84rem; padding-left: 1rem; }

  .metin { font-size: .84rem; }
}

/* ── RESPONSIVE: PHONE ── */
@media (max-width: 480px) {
  .site-header { padding: 1.5rem 1rem 1.2rem; }
  .site-header__title { font-size: 1.3rem; }
  .site-header__emblem { font-size: .65rem; letter-spacing: .2em; }
  .site-header__sub { font-size: .72rem; }
  .detail-kunye { font-size: .65rem; }

  .theme-toggle { top: .6rem; right: .6rem; width: 30px; height: 30px; font-size: .9rem; }

  .stats { gap: .8rem; padding: .8rem .5rem; flex-wrap: wrap; }
  .stats__val { font-size: 1rem; }
  .stats__label { font-size: .55rem; letter-spacing: .08em; }

  .filters { padding: .6rem .75rem; gap: .3rem; }
  .filters__btn { font-size: .65rem; padding: .25rem .55rem; }

  .wrap { padding: 1rem .75rem; }

  .karar { padding: 1.2rem 0 1.2rem 2rem; }
  .karar__num { font-size: .9rem; top: 1.3rem; }
  .karar__ref { font-size: .62rem; margin-bottom: .35rem; }
  .karar__top { flex-direction: column; gap: .4rem; }
  .karar__konu { font-size: 1rem; }
  .karar__ozet { font-size: .78rem; line-height: 1.65; margin-bottom: .75rem; }

  .sonuc { font-size: .6rem; align-self: flex-start; }

  .karar__foot { flex-wrap: wrap; align-items: flex-end; gap: .5rem; }
  .karar__foot .btn { margin-left: auto; }
  .tag { font-size: .6rem; }
  .btn { font-size: .72rem; padding: .4rem .8rem; }

  .detail-nav { gap: .5rem; }
  .detail-nav__group { gap: .35rem; }
  .btn--ghost { font-size: .7rem; padding: .35rem .65rem; }

  .detail-meta { grid-template-columns: 1fr; }
  .meta-cell { border-right: none; border-bottom: 1px solid var(--border); }
  .meta-cell:last-child { border-bottom: none; }
  .meta-cell { padding: .65rem .75rem; }
  .meta-cell__value { font-size: .85rem; }

  .detail-summary { padding: 1rem 0; margin-bottom: 1.5rem; }
  .detail-summary__konu { font-size: 1.1rem; }
  .detail-summary__ozet { font-size: .8rem; line-height: 1.7; padding-left: .75rem; }

  .metin { font-size: .8rem; line-height: 1.85; }
  .metin p { text-align: left; }
  .metin-header { font-size: .9rem; }
  .metin .metin-baslik { font-size: .9rem; }

  .site-footer { padding: 1.5rem 1rem; font-size: .65rem; }
}

/* ── RESPONSIVE: VERY SMALL ── */
@media (max-width: 360px) {
  .site-header__title { font-size: 1.1rem; }
  .detail-kunye { font-size: .58rem; }
  .stats { gap: .5rem; }
  .stats__val { font-size: .9rem; }
  .karar { padding-left: 1.6rem; }
  .karar__num { font-size: .8rem; }
  .karar__ref { font-size: .58rem; }
  .karar__konu { font-size: .92rem; }
  .filters__btn { font-size: .6rem; padding: .2rem .45rem; }
}

/* ── SIDEBAR & PAGE LAYOUT ── */
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: 100%;
  padding: .65rem 1rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: .04em;
  transition: color .15s ease;
}

.sidebar-toggle:hover { color: var(--text-primary); }

.page-layout {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
}

.page-layout .wrap {
  max-width: none;
  margin: 0;
  flex: 1;
  min-width: 0;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 2rem 1.25rem;
  position: sticky;
  top: 0;
  align-self: flex-start;
  max-height: 100vh;
  overflow-y: auto;
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); }

.sidebar__title {
  font-family: var(--serif);
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: .02em;
  margin-bottom: 1.25rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border-strong);
}

.sidebar__reset {
  display: flex;
  align-items: center;
  gap: .3rem;
  width: 100%;
  padding: .35rem .4rem;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: .7rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: .75rem;
  letter-spacing: .02em;
}

.sidebar__reset:hover { color: var(--text-primary); }

.sidebar__group { margin-bottom: 1.25rem; }

.sidebar__heading {
  font-family: var(--serif);
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-faint);
  margin-bottom: .4rem;
  padding-bottom: .25rem;
  border-bottom: 1px solid var(--border);
}

.sidebar__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: .25rem .4rem;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 400;
  cursor: pointer;
  transition: all .15s ease;
  text-align: left;
  letter-spacing: .01em;
}

.sidebar__item:hover { color: var(--text-primary); }

.sidebar__item.active {
  color: var(--text-primary);
  font-weight: 600;
  border-left: 2px solid var(--text-primary);
  padding-left: calc(.4rem - 2px);
}

.sidebar__count {
  font-size: .6rem;
  color: var(--text-ghost);
  font-weight: 500;
  min-width: 1.2rem;
  text-align: right;
}

.sidebar__item.active .sidebar__count { color: var(--text-faint); }

.sidebar__item.hidden {
  display: none;
}

/* ── ACTIVE FILTER CHIPS ── */
.sidebar__chips {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-bottom: .75rem;
}

.active-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-family: var(--sans);
  font-size: .65rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--text-primary);
  padding: .2rem .5rem;
  cursor: pointer;
  transition: opacity .15s ease;
  letter-spacing: .02em;
}

.active-chip:hover {
  opacity: .75;
}

.active-chip i {
  font-size: .55rem;
  line-height: 1;
}

.sidebar__result-count {
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: .4rem .5rem;
  margin-bottom: .75rem;
  border: 1px solid var(--text-primary);
  text-align: center;
  letter-spacing: .02em;
}

/* ── SIDEBAR OVERLAY & CLOSE (desktop hidden) ── */
.sidebar-overlay {
  display: none;
}

.sidebar__close {
  display: none;
}

/* ── MOBILE BOTTOM SHEET (must come AFTER base sidebar styles) ── */
@media (max-width: 768px) {
  .sidebar-toggle {
    display: flex;
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s cubic-bezier(.4,0,.2,1);
  }
  .sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    border-right: none;
    border-top: 1px solid var(--border);
    border-bottom: none;
    background: var(--bg);
    z-index: 100;
    padding: 1rem 1rem 2rem;
    align-self: auto;
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(.4,0,.2,1);
  }
  .sidebar.open {
    transform: translateY(0);
  }

  .sidebar__close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: .75rem;
    right: .75rem;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 1;
    transition: color .15s ease, border-color .15s ease;
  }
  .sidebar__close:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
  }

  .sidebar__item {
    min-height: 44px;
  }
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  .karar {
    transition: none;
  }
  .sidebar {
    transition: none;
  }
}

/* ── PRINT ── */
@media print {
  .detail-nav, .site-footer, .btn, .filters, .stats, .theme-toggle { display: none !important; }
  .metin { font-size: .8rem; line-height: 1.8; }
  .site-header { border-bottom: 2px solid #000; }
  body { font-size: 10pt; background: #fff; color: #000; }
}
