/* base.css — reset + tipografi + layout primitives.
   MOBİL-ÖNCELİKLİ: temel stiller mobil için; min-width ile yukarı genişler. */

/* --- Reset (hafif) --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
/* Yatay taşma ASLA: html + body birlikte kırpar (off-canvas/fixed öğeler de
   dahil; tek başına body yetmez çünkü position:fixed öğeleri body'yi aşar). */
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  font-family: var(--font-body);
  font-weight: var(--fw-body);
  /* Mobilde gövde 16px (okunabilirlik); md+ üstünde 15px tabana iner. */
  font-size: 0.875rem; /* 14px — gerçek site 13px; okunabilirlik için 1px üstte */
  line-height: var(--lh-normal);
  color: var(--color-muted);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Sticky footer: içerik az olsa da footer en altta kalsın. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
/* Ana içerik boşluğu doldurur → footer havaya kalkmaz. */
#main { flex: 1 0 auto; }
img, picture, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul, ol { list-style: none; padding: 0; }

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

/* --- Başlıklar (Lexend) — gerçek mamakutusu skalası: kompakt, 500 ağırlık.
   Bölüm başlıkları 18px (fs-500), sayfa başlığı (h1) daha büyük. --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-medium); /* 500 — gerçek sitede başlıklar 500 */
  line-height: var(--lh-tight);
  color: var(--color-text);
}
h1 { font-size: var(--fs-600); }   /* 22px (md+ 28px) */
h2 { font-size: var(--fs-500); }   /* 18px — gerçek bölüm başlığı */
h3 { font-size: 1rem; }            /* 16px */

/* --- Erişilebilirlik: görünür klavye focus --- */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--color-primary); color: var(--color-on-primary);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius);
}
.skip-link:focus { left: var(--space-2); top: var(--space-2); }

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

/* --- Layout primitives --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-3);
}
.section { padding-block: var(--space-5); }
.section--tint { background: var(--color-surface-tint); }
.section--surface { background: var(--color-surface); }

/* Responsive grid (mobil 1 sütun → genişledikçe artar) */
.grid { display: grid; gap: var(--space-3); }
.grid--products { grid-template-columns: repeat(2, 1fr); }

/* Yardımcı dokunma alanı: küçük ikon butonları min 44px */
.tap { min-width: var(--tap-min); min-height: var(--tap-min);
  display: inline-flex; align-items: center; justify-content: center; }

/* Küçük boşluk yardımcıları (tekrar eden margin'leri token'a bağlar) */
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }

/* --- Masaüstü genişlemeleri --- */
@media (min-width: 768px) {
  h1 { font-size: var(--fs-700); }   /* 28px — sayfa/ürün başlığı */
  /* h2 18px kalır (gerçek site bölüm başlıkları), h3 16px kalır */
  .section { padding-block: var(--space-6); }
  .grid--products { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .grid--products { grid-template-columns: repeat(4, 1fr); }
}

/* --- Hareket azaltma --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
