/* 1000Scholars - tek stil dosyasi.
   Harici font/CDN yuklenmez: sayfa agirligi dusuk kalsin ve ziyaretci
   ucuncu taraf sunuculara istek atmasin (gizlilik sozumuzun geregi). */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-sunken: #eef0f4;
  --surface: #ffffff;
  --border: #dce0e7;
  --border-strong: #c3cad4;

  --text: #16202c;
  --text-soft: #5a6674;
  /* #8b95a3 idi: yumusak zeminde 2.83:1 ile WCAG AA'nin (4.5:1) altinda
     kaliyordu. Bu renk kartlardaki tarih/sayi metinlerinde kullaniliyor,
     yani okunmasi gereken bilgi. #68727f en koyu zeminde bile 4.28:1. */
  --text-faint: #68727f;

  --accent: #1f5fbf;
  --accent-hover: #17498f;
  --accent-soft: #eaf1fc;
  --accent-text: #ffffff;

  --ok: #17734a;
  --ok-soft: #e6f4ec;
  --warn: #8a5a09;
  --warn-soft: #fdf3e0;
  --danger: #a32828;
  --danger-soft: #fbeaea;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .05);
  --shadow-lg: 0 8px 32px rgba(16, 24, 40, .12);

  --wrap: 1160px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10151c;
    --bg-soft: #161d26;
    --bg-sunken: #1c2531;
    --surface: #18202a;
    --border: #2a3542;
    --border-strong: #3b4857;

    --text: #e7ecf2;
    --text-soft: #a3b0c0;
    /* #78889b idi: hero'nun sunken zemininde 4.27:1 ile AA'nin altinda. */
    --text-faint: #8592a4;

    --accent: #5c9bf5;
    --accent-hover: #7cb0f8;
    --accent-soft: #17273f;
    --accent-text: #0b1220;

    --ok: #56c48d;
    --ok-soft: #142c22;
    --warn: #e0ab5a;
    --warn-soft: #2d2517;
    --danger: #ef7a7a;
    --danger-soft: #2e1a1a;

    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, .45);
  }
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.7rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

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

img { max-width: 100%; height: auto; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--text-soft); }
.small { font-size: .875rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-text); padding: .6rem 1rem;
}
.skip-link:focus { left: 0; }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --- basliklar --- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; height: 62px; }

.brand { font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 1.4rem; }
.site-nav a { color: var(--text-soft); font-size: .94rem; font-weight: 500; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a.btn { color: var(--accent-text); }
/* Bulunulan sayfa: renk TEK basina yeterli degil (renk korlugu), alt cizgi
   ikinci bir isaret olarak ekleniyor. */
.site-nav a.active {
  color: var(--text); font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}

.nav-toggle {
  display: none; margin-left: auto; background: none; border: 0; cursor: pointer;
  padding: .5rem; flex-direction: column; gap: 4px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); }

@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none; position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: .5rem 20px 1rem; box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: .7rem 0; border-bottom: 1px solid var(--border); }
  .site-nav a.btn { margin-top: .75rem; border-bottom: 0; text-align: center; }
}

/* --- dugmeler --- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .6rem 1.1rem; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-text);
  border: 1px solid transparent; font: inherit; font-size: .94rem; font-weight: 550;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; color: var(--accent-text); }
.btn-sm { padding: .42rem .8rem; font-size: .875rem; }
.btn-lg { padding: .8rem 1.5rem; font-size: 1rem; }
.btn-ghost {
  background: transparent; color: var(--text); border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger); filter: brightness(.9); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* --- rozetler --- */

.badge {
  display: inline-block; padding: .18rem .55rem; border-radius: 100px;
  font-size: .78rem; font-weight: 600; line-height: 1.5;
  background: var(--bg-sunken); color: var(--text-soft);
}
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

/* --- uyari kutulari --- */

.flash {
  padding: .8rem 1rem; border-radius: var(--radius-sm); margin: 1rem 0;
  border: 1px solid var(--border); background: var(--bg-soft);
}
.flash-success { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.flash-error { background: var(--danger-soft); border-color: transparent; color: var(--danger); }

/* --- ana sayfa --- */

/* Arka plan gorseli BILEREK kullanilmiyor: fotograf uzerindeki metnin
   okunabilirligi ekran boyutuna gore degisiyor, sayfa agirlasiyor ve
   akademik ilan sitesinde stok gorsel amatorce duruyor. Kontrast bunun
   yerine duz zemin + ince desenle veriliyor -- ek dosya yuklenmiyor.

   Onceki hali `linear-gradient(var(--bg-soft), var(--bg))` idi: iki renk
   arasindaki fark 1.07:1, yani gozle secilemiyordu. */
.hero {
  position: relative;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--border);
  padding: clamp(2.25rem, 5vw, 3.5rem) 0 clamp(2rem, 4vw, 2.75rem);
  overflow: hidden;
}
/* Cok hafif nokta deseni: zeminin duz boyanmis gibi durmasini engeller,
   metnin arkasinda kalacak kadar soluk. Saf CSS, istek yok. */
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(
    circle at center,
    color-mix(in srgb, var(--text) 7%, transparent) 1px,
    transparent 1.6px
  );
  background-size: 22px 22px;
  mask-image: linear-gradient(105deg, transparent 38%, #000 100%);
  -webkit-mask-image: linear-gradient(105deg, transparent 38%, #000 100%);
  pointer-events: none;
}
.hero > .wrap { position: relative; }
.hero h1 { max-width: 22ch; margin-bottom: .6rem; }
.hero p.lede { font-size: 1.1rem; color: var(--text-soft); max-width: 60ch; }

.searchbar {
  display: flex; gap: .5rem; margin-top: 1.8rem; max-width: 720px; flex-wrap: wrap;
}
.searchbar input[type="search"] {
  flex: 1 1 260px; padding: .8rem 1rem; font: inherit;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}

.stat-row { display: flex; gap: 2.5rem; margin-top: 2rem; flex-wrap: wrap; }
.stat-num { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; display: block; }
.stat-label { font-size: .85rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: .06em; }

.section { padding: 3rem 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }

.cat-grid {
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.cat-card {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  padding: .85rem 1rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font-size: .93rem;
}
.cat-card:hover { border-color: var(--accent); text-decoration: none; }
.cat-card .count { color: var(--text-faint); font-size: .85rem; font-variant-numeric: tabular-nums; }

/* --- ilan listesi --- */

.layout {
  display: grid; gap: 2rem; padding: 2rem 0;
  grid-template-columns: 260px minmax(0, 1fr);
}
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

.filters { align-self: start; position: sticky; top: 78px; }
@media (max-width: 900px) { .filters { position: static; } }

.filter-group { border-bottom: 1px solid var(--border); padding: 1rem 0; }
.filter-group:first-child { padding-top: 0; }
.filter-group > legend,
.filter-title {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-faint); margin-bottom: .6rem;
  padding: 0;
}
fieldset.filter-group { border: 0; border-bottom: 1px solid var(--border); margin: 0; }

.check { display: flex; align-items: center; gap: .5rem; padding: .22rem 0; font-size: .9rem; cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }

.field { display: block; margin-bottom: .9rem; }
.field > span { display: block; font-size: .85rem; font-weight: 550; margin-bottom: .3rem; }
.field .hint { font-weight: 400; color: var(--text-faint); font-size: .8rem; }
input[type="text"], input[type="search"], input[type="url"], input[type="email"],
input[type="date"], input[type="password"], input[type="number"], select, textarea {
  width: 100%; padding: .55rem .7rem; font: inherit; font-size: .93rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}
textarea { resize: vertical; min-height: 110px; line-height: 1.55; }
.field-error input, .field-error textarea, .field-error select { border-color: var(--danger); }
.error-text { color: var(--danger); font-size: .84rem; margin-top: .25rem; display: block; }

.result-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}

.job-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }

.job-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 1.1rem 1.25rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.job-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.job-card h3 { margin-bottom: .3rem; font-size: 1.06rem; }
.job-card h3 a { color: var(--text); }
.job-card h3 a:hover { color: var(--accent); text-decoration: none; }

.job-meta {
  display: flex; flex-wrap: wrap; gap: .35rem .9rem;
  font-size: .875rem; color: var(--text-soft); margin-bottom: .55rem;
}
.job-meta .inst { font-weight: 550; color: var(--text); }
/* Eklenme tarihi ikincil bilgi: kurum/konum kadar one cikmasin, ama
   okunabilir kalsin (--text-faint AA'yi geciyor). */
.job-meta .posted { color: var(--text-faint); margin-left: auto; }
@media (max-width: 560px) { .job-meta .posted { margin-left: 0; } }
.job-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.job-excerpt { font-size: .92rem; color: var(--text-soft); margin: 0; }

/* --- aktif filtre rozetleri --- */

.chip-row {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  margin-bottom: 1.1rem;
}
.chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .3rem .5rem .3rem .7rem; border-radius: 100px;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font-size: .84rem; line-height: 1.3;
}
.chip span[aria-hidden] { color: var(--text-faint); font-size: 1.05em; line-height: 1; }
.chip:hover {
  border-color: var(--danger); color: var(--danger); text-decoration: none;
}
.chip:hover span[aria-hidden] { color: var(--danger); }
.chip-clear { font-size: .84rem; color: var(--text-soft); margin-left: .2rem; }

/* Yalnizca ekran okuyuculara gorunur metin */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.empty {
  text-align: center; padding: 4rem 1rem; border: 1px dashed var(--border);
  border-radius: var(--radius); color: var(--text-soft);
}

.pagination { display: flex; gap: .35rem; justify-content: center; margin: 2rem 0 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: .45rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .9rem; color: var(--text-soft); min-width: 38px; text-align: center;
}
.pagination a:hover { border-color: var(--accent); text-decoration: none; }
.pagination .current { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.pagination .gap { border: 0; }

/* --- ilan detayi --- */

.job-header { background: var(--bg-soft); border-bottom: 1px solid var(--border); padding: 2.2rem 0; }
.breadcrumb { font-size: .86rem; color: var(--text-faint); margin-bottom: .8rem; }
.breadcrumb a { color: var(--text-soft); }

.detail-layout {
  display: grid; gap: 2.5rem; padding: 2.5rem 0;
  grid-template-columns: minmax(0, 1fr) 300px;
}
@media (max-width: 900px) { .detail-layout { grid-template-columns: 1fr; } }

.prose { max-width: 72ch; }
.prose h2 { font-size: 1.2rem; margin-top: 2rem; }
.prose p { white-space: pre-line; }

/* Yan sutun BIR BUTUN olarak yapisir; kartlar tek tek yapistirilmaz.
   Kartlarin her birine `position: sticky` verilirse ust kart yerinde kalir,
   alttaki normal akista yukari kayar ve ustune biner -- paylasim dugmeleri
   sticky bilgi kartinin altinda kaybolur. Kapsayiciyi yapistirmak ikisinin
   birlikte hareket etmesini saglar.

   Yan sutun ekrandan uzunsa (uzun ilanlarda oluyor) yapisma calismaz;
   `max-height` + kendi kaydirmasi bu durumu kurtarir. */
.detail-layout > aside {
  /* align-self: start SART: grid ogeleri varsayilan olarak satir yuksekligine
     uzar (stretch); uzayan bir oge zaten "yapisik" gorunur ve sticky hicbir
     sey yapmaz. */
  align-self: start;
  position: sticky; top: 78px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  /* Kendi kaydirma cubugu cikinca icerik kenara yapismasin */
  scrollbar-width: thin;
}
.side-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 1.25rem;
}
@media (max-width: 900px) {
  .detail-layout > aside {
    position: static; max-height: none; overflow: visible;
  }
}
.side-card .btn { width: 100%; }

.kv { margin: 0; font-size: .9rem; }
.kv dt { color: var(--text-faint); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; margin-top: .9rem; }
.kv dd { margin: .15rem 0 0; }

/* --- paylasim --- */
.share-card { margin-top: 1.2rem; }
.share-title {
  margin: 0 0 .7rem; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-faint);
}
.share-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.share-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  font: inherit; font-size: .82rem; line-height: 1;
  padding: .45rem .7rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg-soft);
  color: var(--text-soft); cursor: pointer; text-decoration: none;
  transition: border-color .15s, color .15s;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.share-btn.copied { border-color: var(--ok); color: var(--ok); }
/* Simge dugmenin metin rengini miras alir (fill="currentColor"), bu yuzden
   acik/koyu tema veya hover icin ayri kural gerekmiyor. */
.share-icon { flex: none; display: block; }

/* --- harita --- */

.map-page { display: flex; flex-direction: column; height: calc(100vh - 62px); }
.map-bar {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .7rem 20px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.map-bar input[type="search"] { max-width: 260px; }
.map-bar select { width: auto; min-width: 150px; }
#map { flex: 1; min-height: 400px; background: var(--bg-sunken); }

.map-status { font-size: .875rem; color: var(--text-soft); margin-left: auto; }

.leaflet-popup-content { margin: .8rem 1rem; font-family: var(--font); }
.popup-title { font-weight: 650; font-size: .95rem; display: block; margin-bottom: .2rem; }
.popup-meta { font-size: .82rem; color: #5a6674; }
.popup-list { margin: .4rem 0 0; padding-left: 1.1rem; font-size: .85rem; }

/* --- tablolar (kurumlar + admin) --- */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--border); }
table.data th { background: var(--bg-soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); font-weight: 650; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--bg-soft); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* --- form sayfalari --- */

.narrow { max-width: 720px; margin: 0 auto; padding: 2.5rem 20px; }
.form-grid { display: grid; gap: 0 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .full { grid-column: 1 / -1; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice {
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  padding: .9rem 1.1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .92rem; margin-bottom: 1.5rem;
}

/* --- EuroSciVoc etiket secici --- */

.tp-wrap { position: relative; }

.tp-box {
  display: flex; flex-wrap: wrap; gap: .35rem; align-items: center;
  padding: .35rem .4rem; min-height: 40px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface);
}
.tp-box:focus-within { border-color: var(--accent); }

.tp-chips { display: contents; }

.tp-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .3rem .2rem .6rem; border-radius: 100px;
  background: var(--accent-soft); color: var(--accent);
  font-size: .84rem; font-weight: 550; white-space: nowrap;
}
.tp-chip-x {
  border: 0; background: none; cursor: pointer; padding: 0 .2rem;
  color: inherit; font-size: 1.05rem; line-height: 1; opacity: .65;
}
.tp-chip-x:hover { opacity: 1; }

.tp-input {
  flex: 1 1 140px; min-width: 120px;
  border: 0 !important; outline: none; padding: .25rem !important;
  background: transparent !important; font: inherit; font-size: .92rem;
  color: var(--text);
}

.tp-list {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0;
  margin: 0; padding: .25rem; list-style: none; max-height: 300px;
  overflow-y: auto; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}
.tp-option {
  padding: .45rem .6rem; border-radius: var(--radius-sm); cursor: pointer;
  display: flex; flex-direction: column; gap: .1rem;
}
.tp-option:hover, .tp-option.active { background: var(--accent-soft); }
.tp-option-name { font-size: .92rem; font-weight: 550; }
.tp-option-context { font-size: .78rem; color: var(--text-faint); }

.tp-help {
  display: flex; justify-content: space-between; gap: 1rem;
  font-size: .8rem; color: var(--text-faint); margin-top: .3rem;
}

/* Ilan kartlarindaki alan etiketleri */
.field-tag {
  display: inline-block; padding: .18rem .55rem; border-radius: 100px;
  font-size: .78rem; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
}
.field-tag:hover { text-decoration: none; filter: brightness(.96); }

/* --- footer --- */

.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); margin-top: 3rem; padding: 2.5rem 0; }
.footer-inner { display: grid; gap: 1.25rem; }
.footer-brand { font-weight: 700; margin: 0 0 .25rem; }
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: .92rem; }
.site-footer nav a { color: var(--text-soft); }

/* --- hata sayfasi --- */

.error-page { text-align: center; padding: 6rem 20px; }
.error-code { font-size: 4rem; font-weight: 700; color: var(--text-faint); line-height: 1; }
