/* ==========================================================================
   Temel: fontlar, sıfırlama, tipografi, erişilebilirlik
   Sadece tokens.css değerleri kullanılır.
   ========================================================================== */

/* --------------------------------------------------------------- Fontlar
   woff2, self-host, OFL. Sadece kullanılan ağırlıklar:
   Source Serif 4: 300, 400, 400 italik · IBM Plex Sans: 400, 500
   Türkçe set: fontsource latin + latin-ext dosyaları birleştirilip subset edildi (tools/subset-fonts.py);
   ağırlık başına tek dosya. Set dışındaki karakter (ör. →) yedek fonttan gelir. */

@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-weight: 300; font-display: swap;
  src: url(../fonts/source-serif-4-300-normal-tr.woff2) format("woff2");
}
@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/source-serif-4-400-normal-tr.woff2) format("woff2");
}
@font-face {
  font-family: "Source Serif 4"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(../fonts/source-serif-4-400-italic-tr.woff2) format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/ibm-plex-sans-400-normal-tr.woff2) format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/ibm-plex-sans-500-normal-tr.woff2) format("woff2");
}

/* ------------------------------------------------------------- Sıfırlama */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-kerning: normal;
  font-synthesis: style;           /* kalın serif sentezlenmez */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { flex: 1 0 auto; }
main:focus { outline: none; }

img, picture, svg, video { display: block; max-width: 100%; height: auto; }

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

:where(ul[role="list"], ol[role="list"]) { list-style: none; margin: 0; padding: 0; }

/* ------------------------------------------------------------- Tipografi */

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 300;
  line-height: var(--lh-head);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: var(--tracking-display); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 400; }

p { margin: 0 0 1em; }

strong, b { font-weight: 500; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

abbr[title] { text-decoration: none; }

.label {
  display: block;
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-soft);
}

.lead {
  font-family: var(--font-serif);
  font-size: var(--fs-lead);
  font-weight: 300;
  line-height: 1.45;
  max-width: var(--text-w);
}

.text-link { text-decoration: underline; }

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

/* ------------------------------------------------------ Erişilebilirlik */

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--s-1);
  left: var(--s-1);
  z-index: 100;
  padding: var(--s-1) var(--s-2);
  background: var(--ink);
  color: var(--paper);
  font-size: var(--fs-small);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.error-details {
  overflow: auto;
  max-width: 100%;
  padding: var(--s-2);
  background: var(--stone);
  font-size: var(--fs-small);
  white-space: pre-wrap;
}

/* ------------------------------------------------------------- Görseller
   img() çıktısı (app/image.php). Oran kutuda (aspect-ratio), görsel
   object-fit: cover + odak noktası (object-position, satır içi). */

.media {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--ratio, auto);
  background: var(--stone);
}
.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media--auto img { height: auto; }

@media (min-width: 64em) {
  .media { aspect-ratio: var(--ratio-lg, var(--ratio, auto)); }
}
