/* ==========================================================================
   Temel: sıfırlama, tipografi, odak, hareket tercihi, yardımcı sınıflar
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 14px;
  scrollbar-gutter: stable;
  hanging-punctuation: first last;
}

body {
  margin: 0;
  min-height: 100dvh;
  font: 400 var(--fs-14) / 1.5 var(--font-sans);
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--doku);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: anywhere;
}

img, svg, video, canvas { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
/* İkon: Material Symbols Outlined (js/ikonlar.js); boyut font-size ile verilir */
.ikon {
  font-family: var(--ik-aile); font-weight: 400; font-style: normal; line-height: 1; letter-spacing: normal; text-transform: none;
  display: inline-block; width: 1em; height: 1em; overflow: hidden; flex: none; white-space: nowrap; direction: ltr; vertical-align: -0.2em;
  font-feature-settings: "liga"; -webkit-font-smoothing: antialiased; user-select: none;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;
}
.ikon.dolu { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 20; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled, [aria-disabled="true"] { cursor: not-allowed; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
p { margin: 0 0 .75em; }
h1, h2, h3, h4 { margin: 0; font-family: var(--f-baslik); font-weight: 650; line-height: 1.2; text-wrap: balance; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
th { font-weight: 600; text-align: left; }
dialog { color: inherit; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
code, kbd, samp, pre { font-family: var(--font-mono); font-size: .93em; }
pre { margin: 0; white-space: pre-wrap; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
summary { cursor: pointer; }
[hidden] { display: none !important; }

::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); }
/* Yer tutucu: tüm alanlarda --text-3 (AA); Firefox'un varsayılan .54 saydamlığı kontrastı yarıya indiriyordu */
::placeholder { color: var(--text-3); opacity: 1; }

/* ---------- odak: 2px vurgu + 2px boşluk (WCAG 2.2 görünür odak) ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-1);
}
/* Programla odaklanan kaplar (sayfa başlığı, main, sekme paneli) halka göstermez; J/K ile gezilen liste öğeleri
   (tabindex=-1 alabilir) göstermeli — yoksa klavyeyle nerede olduğunuz görünmüyordu. */
[tabindex="-1"]:where(:not([data-klavye-oge])):focus-visible { outline: none; }
.odak-ic:focus-visible { outline-offset: -2px; }

/* ---------- kaydırma çubuğu ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--border-guclu) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-guclu); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- tipografi yardımcıları ---------- */
.serif { font-family: var(--font-serif); font-weight: 650; letter-spacing: -.005em; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.rakam { font-variant-numeric: tabular-nums; }
.kucuk-baslik {
  font-size: var(--fs-12);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.metin-2 { color: var(--text-2); }
.metin-3 { color: var(--text-3); }
.metin-12 { font-size: var(--fs-12); }
.metin-13 { font-size: var(--fs-13); }
.metin-16 { font-size: var(--fs-16); }
.kalin { font-weight: 600; }
.tek-satir { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.iki-satir { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sampanya { color: var(--champagne-text); }
.basari-metin { color: var(--success); }
.uyari-metin { color: var(--warning); }
.tehlike-metin { color: var(--danger); }

kbd, .tus {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font: 500 11px/1 var(--font-mono);
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border-guclu);
  border-bottom-width: 2px;
  border-radius: 5px;
}

/* ---------- yerleşim yardımcıları ---------- */
.yigin { display: flex; flex-direction: column; gap: var(--bosluk, 12px); }
.satir { display: flex; align-items: center; gap: var(--bosluk, 8px); min-width: 0; }
.satir.sar { flex-wrap: wrap; }
.satir.uclar { justify-content: space-between; }
.esnek { flex: 1 1 auto; min-width: 0; }
.it-sag { margin-left: auto; }
.gorunmez {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- içeriğe atla ---------- */
.atla {
  position: fixed;
  top: 10px; left: 10px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--r-2);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--t-orta) var(--egri);
}
.atla:focus-visible { transform: none; color: var(--on-accent); }

/* ---------- süs: şampanya kıl çizgi + elmas ---------- */
.sus-cizgi {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 8px;
  color: var(--champagne);
}
.sus-cizgi::before {
  content: "";
  width: 6px; height: 6px;
  flex: none;
  transform: rotate(45deg);
  background: currentColor;
}
.sus-cizgi::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, currentColor, color-mix(in srgb, currentColor 0%, transparent) 70%);
}

/* ---------- hareket tercihi ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- zorunlu renk (Windows yüksek karşıtlık) ---------- */
@media (forced-colors: active) {
  :focus-visible { outline: 2px solid CanvasText; }
  .anahtar-iz { border: 1px solid CanvasText; }
}

/* ---------- mobil (≤759 px): kesme yardımcıları kesmez, sarar ---------- */
@media (max-width: 759px) {
  .tek-satir { white-space: normal; overflow: visible; text-overflow: clip; }
  .iki-satir { display: block; -webkit-line-clamp: unset; overflow: visible; }
  /* yalnız düğmelerden oluşan satır sığmayınca alta iner (düğmeler sıkışıp etiketleri harf harf kırılmasın) */
  .satir:not(:has(> :not(.dugme))) { flex-wrap: wrap; }
}
