/* Sıfırlama, tipografi ve mobil dokunma davranışı */

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

* { margin: 0; }

/* Tarayıcının [hidden] için verdiği display:none, sınıf seçicilerinden
   (.loader { display: grid } gibi) daha düşük öncelikli. Gizlenmesi
   gereken paneller görünür kalmasın diye burada kesinleştiriliyor. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  overscroll-behavior: none;          /* tarayıcı "aşağı çekip yenile" hareketini kapat */
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;                    /* uygulama kabuğu; kaydırma panel içinde */
  position: fixed;
  inset: 0;
  width: 100%;
  /* Mavi dokunma parlaması ve istem dışı metin seçimi araç içinde rahatsız edici */
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

h1, h2, h3, h4 { font-weight: 650; line-height: 1.25; letter-spacing: -0.015em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;          /* çift dokunuşla yakınlaştırmayı engelle */
}

input { -webkit-appearance: none; appearance: none; }
input::-webkit-search-cancel-button { display: none; }

ul, ol { list-style: none; padding: 0; }

svg { display: block; flex: none; }

b, strong { font-weight: 650; }

small { font-size: 0.72rem; }

/* Sayı gösterimlerinde rakam genişliği sabit olmalı — hız değişirken zıplamasın */
.num, .speedo__value, .navbar__stat b, .hazard__dist, .corridor-card__stats b {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Klavyeyle gezinme görünür kalsın, dokunmada görünmesin */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection { background: var(--accent); color: var(--accent-ink); }

/* İnce kaydırma çubuğu (masaüstü) */
.sheet__body, .detail { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.sheet__body::-webkit-scrollbar, .detail::-webkit-scrollbar { width: 5px; }
.sheet__body::-webkit-scrollbar-thumb, .detail::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: var(--r-full);
}

/* Ekran okuyucuya özel metin */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Hareket duyarlılığı olan kullanıcılar için animasyonları kapat */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* MapLibre'in kendi arayüzü uygulamanın diline uyduruluyor */
.maplibregl-ctrl-bottom-left { display: none; }
.maplibregl-canvas { outline: none; }

/* Harita künyesi mobilde yüzen sekme çubuğunun arkasında kalıyordu */
.maplibregl-ctrl-bottom-right {
  bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--s4));
  transition: bottom var(--dur) var(--ease);
}
body.is-navigating .maplibregl-ctrl-bottom-right { bottom: 0; }
@media (min-width: 1024px) {
  .maplibregl-ctrl-bottom-right { bottom: 0; }
}
.maplibregl-ctrl-attrib {
  background: rgba(255, 255, 255, 0.55) !important;
  border-radius: 8px 0 0 0;
  font-size: 10px !important;
  opacity: 0.5;
  transition: opacity var(--dur) var(--ease);
}
.maplibregl-ctrl-attrib:hover { opacity: 1; }
.maplibregl-ctrl-attrib, .maplibregl-ctrl-attrib a { color: var(--text-dim) !important; }
body.is-navigating .maplibregl-ctrl-attrib { background: rgba(0, 0, 0, 0.45) !important; }

/* Uygulama kabuğu sabit; yakınlaştırma ve yatay kaydırma haritaya ait.
   Sayfanın kendisi hiçbir yöne oynamamalı. */
html, body {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  max-width: 100vw;
}
#map { touch-action: none; }   /* harita kendi jestlerini yönetiyor */

/* Kaydırılabilir alanlar yalnızca dikey */
.panel__body, .sheet__scroll, .sidebar__list, .picker__list { touch-action: pan-y; }
.chips, .filters { touch-action: pan-x; }
