/* ============================================================
   BÖLGEMİZ — panel verisiyle sürülen kısımlar
   (bkz. app/Views/partials/bolgemiz_bolumu.php + js/custom/bolgemiz.js)

   Bölümün yerleşimi ve temel görünümü daka.css'teki .bz-* kurallarından
   gelir; burada YALNIZCA veriye bağlı davranış tanımlanır:
   choropleth boyama, paletler, arama paneli ve animasyonlar.

   Panelde veri yokken hiçbir kural devreye girmez — iller SVG'deki kendi
   renklerini korur.
   ============================================================ */

/* ---- Paletler: aranan göstergenin birimine göre ----
   Renk hesabı CSS'te; JS yalnız --yogunluk değerini yazar. Böylece palet
   değişimi tek sınıfla olur ve fill geçişiyle kendiliğinden yumuşar. */
.bz-section.palet-miktar { --ton-acik: #cfe9ec; --ton-koyu: #0f6d78; }
.bz-section.palet-oran   { --ton-acik: #fde8c9; --ton-koyu: #d9730d; }
.bz-section.palet-genel  { --ton-acik: #e5dcf5; --ton-koyu: #5b21b6; }

/* ---- Choropleth ----
   CSS kuralı, path'teki fill ÖZNİTELİĞİNİ ezer; sınıf kalkınca il
   kendi özgün rengine geri döner. */
.bz-il .bz-sekil path {
  transition: fill .55s cubic-bezier(.22, .61, .36, 1), opacity .55s ease;
}

.bz-il.veri-var .bz-sekil path {
  fill: color-mix(in oklab,
        var(--ton-acik, #cfe9ec) calc((1 - var(--yogunluk, 0)) * 100%),
        var(--ton-koyu, #0f6d78) calc(var(--yogunluk, 0) * 100%));
}

/* color-mix yoksa PHP/JS'in hesapladığı hazır ton kullanılır */
@supports not (color: color-mix(in oklab, red 50%, blue)) {
  .bz-il.veri-var .bz-sekil path { fill: var(--ton-hesaplanan, #0f6d78); }
}

/* Arama yapıldı ama bu ilde veri yok: soluk kalsın */
.bz-section.bz-arama-var .bz-il:not(.veri-var) .bz-sekil path { opacity: .45; }

/* Sonuç satırı/öne çıkan kart üzerine gelince ilgili il vurgulanır */
.bz-il.vurgu .bz-sekil,
.bz-il.secili .bz-sekil {
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .35));
}

/* ---- Odak (klavye) göstergesi ----
   Her il, viewBox'ı tüm haritayı kaplayan AYRI bir <svg> (role="button",
   tabindex="0"). Tarayıcının varsayılan odak halkası bu görünmez KUTUYU
   çiziyor; ekranda ilin çok ötesine taşan dikey/yatay çizgiler olarak
   görünüyordu. Halka kapatılır, yerine ŞEKLİN KENDİSİNİ saran bir
   gösterge konur: kalınlaşan kontur + altın hâle.

   :focus-visible kullanılır — fare tıklamasında hiçbir şey çizilmez,
   klavyeyle gezinende gösterge tam görünür. */
.bz-il:focus { outline: none; }

.bz-il:focus-visible { outline: none; }

.bz-il:focus-visible .bz-sekil {
  filter: drop-shadow(0 0 2px #ffffff) drop-shadow(0 0 6px var(--daka-gold, #E8A020));
}

.bz-il:focus-visible .bz-sekil path {
  stroke: var(--daka-gold, #E8A020);
  stroke-width: 6;
}

@media (prefers-reduced-motion: reduce) {
  .bz-il:focus-visible .bz-sekil { transition: none; }
}

/* Harita güncellendi nabzı — transform-box ZORUNLU, yoksa şekil
   SVG kökenine göre ölçeklenip ekrandan uçar */
@keyframes bz-il-nabiz {
  0%   { transform: none }
  45%  { transform: scale(1.035) }
  100% { transform: none }
}

.bz-il .bz-sekil {
  transform-box: fill-box;
  transform-origin: center;
}

.bz-il.guncellendi .bz-sekil { animation: bz-il-nabiz .5s ease both; }

/* ---- Kart eklentileri (panel türleri) ---- */
.bz-stat-ikon {
  font-size: 30px;
  line-height: 1;
  color: var(--bz-tur-renk, #2A8F82);
}

.bz-stat-adet {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  color: var(--bz-tur-renk, #2A8F82);
  opacity: .85;
}

.bz-stat-card { position: relative; }

/* ---- Otomatik tamamlama ---- */
.bz-search { position: relative; }

.bz-oneri {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  max-height: 260px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(8, 20, 45, .22);
}

.bz-oneri[hidden] { display: none; }

.bz-oneri li { margin: 0; }

.bz-oneri button {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #24323c;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}

.bz-oneri button:hover,
.bz-oneri button[aria-selected="true"] { background: #eef5f6; }

.bz-oneri button span {
  flex-shrink: 0;
  font-size: 11.5px;
  color: #6b7b86;
}

/* ---- Ölçek (legend) ---- */
.bz-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, .9);
}

.bz-legend[hidden] { display: none; }

.bz-legend-serit {
  flex: 1 1 auto;
  min-width: 90px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--ton-acik, #cfe9ec), var(--ton-koyu, #0f6d78));
}

.bz-legend-birim { opacity: .8; }

/* ---- Arama sonuç paneli ---- */
.bz-panel {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 10px 30px rgba(8, 20, 45, .18);
  color: #24323c;
}

.bz-panel[hidden] { display: none; }

.bz-sonuc-ozet { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.bz-sonuc-bos  { color: #6b7b86; font-weight: 500; }

.bz-sonuc-liste {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bz-sonuc-satir a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f4f7f8;
  color: inherit;
  text-decoration: none;
  transition: background .2s ease, transform .2s ease;
}

.bz-sonuc-satir a:hover { background: #e7eff1; transform: translateY(-1px); }
.bz-sonuc-satir strong  { display: block; font-size: 14px; line-height: 1.35; }

.bz-sonuc-kunye {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: #6b7b86;
}

/* ---- Öneri çipleri (sonuçsuz arama) ---- */
.bz-oneri-cipler {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.bz-cip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #d6e0e3;
  border-radius: 999px;
  background: #ffffff;
  color: #24323c;
  font-size: 13px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}

.bz-cip:hover { background: #eef5f6; border-color: #b9cdd2; }
.bz-cip span  { font-size: 11px; color: #6b7b86; }

/* ---- İl paneli (haritada bir il tıklanınca) ---- */
.bz-il-panel { margin-top: 14px; padding-top: 14px; border-top: 1px solid #e2eaec; }

.bz-il-panel-bas {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.bz-il-panel-bas h3 { margin: 0; font-size: 16px; font-weight: 700; }

.bz-il-panel-kapat {
  margin-left: auto;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #eef2f4;
  color: #24323c;
  cursor: pointer;
}

.bz-gosterge-liste {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.bz-gosterge {
  padding: 9px 11px;
  border-radius: 10px;
  background: #f4f7f8;
}

.bz-gosterge-ad    { display: block; font-size: 12px; color: #6b7b86; }
.bz-gosterge-deger { display: block; font-size: 18px; font-weight: 700; line-height: 1.2; }
.bz-gosterge-birim { font-size: 12px; font-weight: 500; color: #6b7b86; }

/* ---- Öne çıkan çalışmalar ---- */
.bz-one-cikan {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.bz-oc-kart {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, .94);
  color: #24323c;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(8, 20, 45, .16);
  transition: transform .25s ease, box-shadow .25s ease;
}

.bz-oc-kart:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(8, 20, 45, .24); }

.bz-oc-gorsel { display: block; line-height: 0; }
.bz-oc-gorsel img { width: 100%; height: 110px; object-fit: cover; display: block; }

/* Kapak yoksa tür rengiyle düz yer tutucu (kırık görsel basılmaz).
   110px'lik renkli blok kart listesinde çok yer kaplıyordu; %70 küçülüp
   kartın üstünde ince bir tür şeridine döndü. */
.bz-oc-gorsel--bos { height: 33px; background: var(--bz-tur-renk, #2A8F82); opacity: .85; }

.bz-oc-govde { display: block; padding: 11px 13px 14px; }

.bz-oc-rozet {
  display: inline-block;
  margin-bottom: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bz-tur-renk, #2A8F82);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .03em;
}

.bz-oc-baslik { display: block; font-size: 14px; line-height: 1.35; }
.bz-oc-kunye  { display: block; margin-top: 4px; font-size: 12px; color: #6b7b86; }

/* ---- Bölüm belirme animasyonu ---- */
@keyframes bz-belir {
  from { opacity: 0; transform: translateY(24px) }
  to   { opacity: 1; transform: none }
}

@keyframes bz-il-belir {
  from { opacity: 0; transform: scale(.94) }
  to   { opacity: 1; transform: none }
}

.bz-section.gorunur .bz-il .bz-sekil {
  animation: bz-il-belir .6s cubic-bezier(.22, .61, .36, 1) both;
}

.bz-section.gorunur #mus     .bz-sekil { animation-delay: .05s }
.bz-section.gorunur #bitlis  .bz-sekil { animation-delay: .13s }
.bz-section.gorunur #van     .bz-sekil { animation-delay: .21s }
.bz-section.gorunur #hakkari .bz-sekil { animation-delay: .29s }

.bz-section.gorunur .bz-panel:not([hidden]),
.bz-section.gorunur .bz-one-cikan {
  animation: bz-belir .7s cubic-bezier(.22, .61, .36, 1) both;
}

/* ---- Hareket azaltma ---- */
@media (prefers-reduced-motion: reduce) {
  .bz-section *,
  .bz-il .bz-sekil,
  .bz-il .bz-sekil path {
    animation: none !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 767.98px) {
  .bz-panel { padding: 14px; }
  .bz-legend { font-size: 11px; }
}

/* ============================================================
   ÇALIŞMA DETAYI — /bolgemiz/{slug}
   (pages/bolge_detay.php; bu dosya o sayfada da yükleniyor)

   Belge satırları doküman kütüphanesiyle ORTAK (.dkl-* → icsayfa.css);
   burada yalnız detay sayfasına özgü parçalar tanımlanır.
   ============================================================ */

/* Kapak: taşmayı engelleyen taban kural (Sayfalar modülündeki .ic-kapak
   ile aynı davranış; sayfa.css bu sayfada yüklenmiyor) */
.ic-kapak {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
  border-radius: 12px;
  margin-block-end: 20px;
}

/* Kapak belgeye bağlıysa tıklanabilir olduğu belli olsun */
.bz-kapak-bag {
  display: block;
  border-radius: 12px;
  transition: transform .22s ease, box-shadow .22s ease;
}

.bz-kapak-bag:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 35, 70, .14);
}

.bz-kapak-bag:focus-visible {
  outline: 2px solid var(--daka-gold, #e8a020);
  outline-offset: 3px;
}

.ic-ozet {
  margin: 0 0 18px;
  font-size: 15.5px;
  line-height: 1.7;
  color: #475569;
}

/* Künye: etiket/değer çiftleri iki sütunlu ızgarada */
.ic-kunye {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
  margin: 0 0 24px;
  padding: 16px 18px;
  border: 1px solid var(--daka-border, #e2e8f0);
  border-radius: 12px;
  background: #f8fafc;
}

.ic-kunye dt {
  font-size: 12.5px;
  font-weight: 700;
  color: #64748b;
}

.ic-kunye dd {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--daka-dark, #1e293b);
}

.ic-alt-baslik {
  margin: 26px 0 14px;
  padding-bottom: 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--daka-dark, #1e293b);
  border-bottom: 1px solid var(--daka-border, #e2e8f0);
}

/* "Benzer dokümanlar: Araştırmalar ve Analizler" — belgenin kategori sayfası */
.bz-benzer {
  margin: 12px 0 0;
  font-size: 13.5px;
  color: #64748b;
}

.bz-benzer a {
  margin-inline-start: 6px;
  font-weight: 700;
  color: var(--daka-primary, #2D7CB5);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.bz-benzer a:hover { border-bottom-color: currentColor; }

@media (max-width: 575.98px) {
  .ic-kunye { grid-template-columns: 1fr; gap: 2px 0; }
  .ic-kunye dd { margin-block-end: 8px; }
}

/* ============================================================
   İL HALKALARI  —  bz-halka* (bkz. js/custom/bolgemiz.js)

   Haritada bir ile tıklanınca, o ilin öne çıkan göstergeleri
   (Config\Bolgemiz::$halkalar) halka olarak buraya basılır.
   Eskiden aynı tıklama haritanın altına uzun bir tablo açıyordu;
   tablo artık "Detaylı bilgi" halkasının açtığı pencerede.

   Halkalar satırın ORTASINDAN çıkıp kendi yerlerine süzülür:
   yatay başlangıç kayması --bz-x'i JS yerleşimi ölçtükten sonra
   yazar, sıra gecikmesi --gecikme'den gelir.
   ============================================================ */
.bz-halkalar {
  --bz-halka-renk: #2a6b7f;
  margin-top: 22px;
}

.bz-halka-bas {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}

.bz-halka-il {
  margin: 0;
  font-family: 'Saira', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #ffffff;
}

.bz-halka-kapat {
  margin-inline-start: auto;
  inline-size: 30px;
  block-size: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #ffffff;
  font-size: 12px;
  cursor: pointer;
  transition: background-color .2s ease;
}

.bz-halka-kapat:hover { background: rgba(255, 255, 255, .28); }
.bz-halka-kapat:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }

.bz-halka-satir {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 18px 22px;
}

/* ---- Tek halka ---- */
.bz-halka {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 132px;
  block-size: 132px;
  flex: 0 0 auto;
  padding: 0;
  /* Dairenin dış beyaz çeperi — 2px'ten 3px'e çıkarıldı */
  border: 3px solid color-mix(in srgb, var(--bz-halka-renk) 45%, #ffffff);
  border-radius: 50%;
  /* Zeminde fotoğraf var: dolgu yeterince opak olmalı, yoksa sayı
     dağın dokusuna karışıyor. Gölge halkayı zeminden ayırır. */
  background: color-mix(in srgb, var(--bz-halka-renk) 62%, #06212c);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .30);
  color: #ffffff;
  text-align: center;
  /* Giriş animasyonu: satır ortasından süzülerek yerine oturur */
  opacity: 0;
}

/* Sınıf JS tarafından, ölçüm bittikten sonra eklenir */
.bz-halkalar--gir .bz-halka {
  animation: bz-halka-suzul .72s cubic-bezier(.22, .61, .36, 1) both;
  animation-delay: var(--gecikme, 0ms);
}

@keyframes bz-halka-suzul {
  from {
    opacity: 0;
    transform: translate(var(--bz-x, 0), -170px) scale(.35);
  }
  60% { opacity: 1; }
  to {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

/* ---- Ripple: halkadan dışa açılan iki dalga ---- */
.bz-halka-dalga {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--bz-halka-renk);
  opacity: 0;
  pointer-events: none;
}

.bz-halkalar--gir .bz-halka-dalga {
  animation: bz-dalga 2.8s cubic-bezier(.22, .61, .36, 1) infinite;
  /* Dalga, halka yerine oturduktan SONRA başlar */
  animation-delay: calc(var(--gecikme, 0ms) + 720ms);
}

.bz-halkalar--gir .bz-halka-dalga--gec { animation-delay: calc(var(--gecikme, 0ms) + 2120ms); }

@keyframes bz-dalga {
  0%   { opacity: .55; transform: scale(1); }
  70%  { opacity: 0;   transform: scale(1.45); }
  100% { opacity: 0;   transform: scale(1.45); }
}

/* ---- Halka içi ---- */
.bz-halka-ic {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 12px;
  line-height: 1.15;
}

.bz-halka-deger {
  font-family: 'Saira', 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

/* 1.112.013 gibi uzun sayılar halkaya sığsın */
.bz-halka-deger--uzun { font-size: 18px; }
.bz-halka-deger--metin { font-size: 15px; font-weight: 600; }

.bz-halka-birim {
  font-size: 11px;
  font-weight: 600;
  opacity: .8;
}

.bz-halka-etiket {
  margin-top: 3px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  opacity: .92;
}

/* ---- "Detaylı bilgi" halkası ---- */
.bz-halka--detay {
  cursor: pointer;
  border-style: dashed;
  background: color-mix(in srgb, var(--bz-halka-renk) 42%, #000000);
  transition: background-color .25s ease, transform .25s ease;
}

.bz-halka--detay:hover {
  background: color-mix(in srgb, var(--bz-halka-renk) 72%, #000000);
  transform: translateY(-3px);
}

.bz-halka--detay:focus-visible { outline: 2px solid #ffffff; outline-offset: 3px; }

.bz-halka--detay .ki-duotone {
  font-size: 30px;
  margin-bottom: 5px;
  color: #ffffff;
}

/* ---- Ayrıntı penceresi ---- */
.bz-detay {
  inline-size: min(900px, 92vw);
  max-inline-size: none;
  max-block-size: 86vh;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #ffffff;
  overflow: visible;
}

.bz-detay::backdrop { background: rgba(9, 20, 40, .78); }

.bz-detay-govde {
  max-block-size: 86vh;
  overflow-y: auto;
  padding: 22px 24px;
  border-radius: 16px;
}

/* Pencere içindeki panel kendi çerçevesini getirmesin */
.bz-detay-govde .bz-il-panel { margin: 0; padding: 0; border: 0; background: transparent; }

.bz-detay-kapat {
  position: absolute;
  inset-block-start: -46px;
  inset-inline-end: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 36px;
  block-size: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  transition: background-color .2s ease;
}

.bz-detay-kapat:hover { background: rgba(255, 255, 255, .32); }
.bz-detay-kapat:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }

@media (max-width: 767.98px) {
  .bz-halka { inline-size: 116px; block-size: 116px; }
  .bz-halka-deger { font-size: 20px; }
  .bz-halka-deger--uzun { font-size: 15px; }
  .bz-halka-satir { gap: 14px; }
  .bz-detay-kapat { inset-block-start: 8px; inset-inline-end: 8px; background: rgba(0, 0, 0, .55); }
}

@media (prefers-reduced-motion: reduce) {
  .bz-halkalar--gir .bz-halka { animation: none; opacity: 1; }
  .bz-halkalar--gir .bz-halka-dalga { animation: none; }
  .bz-halka--detay:hover { transform: none; }
}
