/* =====================================================================
   Boyut ve yerleşim kuralları — RENK İÇERMEZ.
   Yazı tipleri, yazı boyutları, satır yükseklikleri, aralıklar, dokunma
   hedefleri ve genişlik sınırları. Renkleri (yazı, zemin, kenarlık) her
   proje kendi stil dosyasında verir.

   Yükleme sırası:  fonts.css  →  kurallar.css  →  projenin kendi CSS'i
   Ekran sınıfları: Compact 0–599 · Medium 600–839 · Expanded 840+ · ızgara en fazla 1200
   ===================================================================== */

:root {
  /* Aralık ölçeği (4'ün katları) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Köşe yuvarlaklığı */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;

  /* Sabit ölçüler */
  --size-button-height: 48px;
  --size-button-height-sm: 40px;
  --size-input-height: 48px;
  --size-input-height-compact: 44px;   /* telefonda form alanı */
  --size-touch-target-min: 48px;
  --size-icon-sm: 16px;
  --size-icon-md: 24px;
  --size-icon-lg: 32px;
  --size-app-bar-height: 64px;         /* üst çubuk, 840+ */
  --size-app-bar-height-compact: 56px; /* üst çubuk, telefon ve tablet */
  --size-bottom-nav-height: 56px;      /* alt sekme çubuğu, yalnız telefon */
  --size-logo-height: 44px;            /* 840+ */
  --size-logo-height-compact: 36px;
  --size-dialog-width: 560px;

  /* Genişlik sınırları */
  --layout-content-max-width: 840px;
  --layout-grid-max-width: 1200px;
  --layout-form-max-width: 480px;
  --layout-button-max-width: 400px;
  --layout-readable-max-width: 680px;
  --layout-hero-max-height: 576px;
  --layout-gutter: 16px;               /* kenar boşluğu, telefon */

  /* Yazı tipleri */
  --font-heading: Manrope, Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --weight-heading: 600;
  --weight-strong: 600;
  --weight-medium: 500;
  --weight-body: 400;

  /* Yazı ölçeği — telefon (0–599). Boyutlar rem; kök font-size'a dokunulmaz. */
  --type-display-lg: 1.625rem;  /* 26 */
  --type-display: 1.4375rem;    /* 23 */
  --type-title-lg: 1.25rem;     /* 20 */
  --type-title: 1.125rem;       /* 18 */
  --type-body-lg: 1.125rem;     /* 18 */
  --type-body: 1rem;            /* 16 */
  --type-body-sm: 0.875rem;     /* 14 */
  --type-caption: 0.75rem;      /* 12 */

  /* Satır yüksekliği — birimsiz; yazı büyüdükçe oran küçülür */
  --leading-display-xl: 1.15;
  --leading-display-lg: 1.15;
  --leading-display: 1.2;
  --leading-title-lg: 1.25;
  --leading-title: 1.3;
  --leading-body: 1.5;

  /* Hareket */
  --motion-fast: 200ms;
  --motion-base: 240ms;
  --motion-easing: cubic-bezier(.2, 0, 0, 1);
}

/* 600+ : yalnız başlıklar bir kademe büyür; metin boyutları aynı kalır */
@media (min-width: 600px) {
  :root {
    --type-display-lg: 1.8125rem; /* 29 */
    --type-display: 1.625rem;     /* 26 */
    --type-title-lg: 1.4375rem;   /* 23 */
    --type-title: 1.25rem;        /* 20 */
  }
}

/* 840+ : hero başlığı ve geniş kenar boşluğu */
@media (min-width: 840px) {
  :root {
    --type-display-xl: 2rem;      /* 32 */
    --layout-gutter: 32px;
  }
}

/* ---------- Temel ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--type-body);
  font-weight: var(--weight-body);
  line-height: var(--leading-body);
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: var(--weight-heading); margin: 0 0 var(--space-md); text-wrap: balance; }
h1 { font-size: var(--type-display-lg); line-height: var(--leading-display-lg); }
h2 { font-size: var(--type-display);    line-height: var(--leading-display); }
h3 { font-size: var(--type-title-lg);   line-height: var(--leading-title-lg); }
h4 { font-size: var(--type-title);      line-height: var(--leading-title); }
p { text-wrap: pretty; }
[lang] { hyphens: auto; }
img { max-width: 100%; height: auto; }

/* Hero başlığı: telefonda display-lg, 840'tan itibaren display-xl */
.hero-title { font-size: var(--type-display-lg); line-height: var(--leading-display-xl); }
@media (min-width: 840px) { .hero-title { font-size: var(--type-display-xl); } }

/* ---------- Yazı kademeleri (sınıf olarak) ---------- */
.text-display-lg { font-size: var(--type-display-lg); line-height: var(--leading-display-lg); }
.text-display    { font-size: var(--type-display);    line-height: var(--leading-display); }
.text-title-lg   { font-size: var(--type-title-lg);   line-height: var(--leading-title-lg); }
.text-title      { font-size: var(--type-title);      line-height: var(--leading-title); }
.text-body-lg    { font-size: var(--type-body-lg);    line-height: var(--leading-body); }
.text-body       { font-size: var(--type-body);       line-height: var(--leading-body); }
.text-body-sm    { font-size: var(--type-body-sm);    line-height: var(--leading-body); }  /* alt yazı, açıklama */
.text-caption    { font-size: var(--type-caption);    line-height: var(--leading-body); }  /* dipnot, tarih */
.tabular         { font-variant-numeric: tabular-nums; }                                   /* fiyat ve sayılar */

/* ---------- Kapsayıcılar ---------- */
.container       { width: 100%; max-width: calc(var(--layout-content-max-width) + 2 * var(--layout-gutter)); margin-inline: auto; padding-inline: var(--layout-gutter); }
.container--grid { max-width: calc(var(--layout-grid-max-width) + 2 * var(--layout-gutter)); }
.readable        { max-width: var(--layout-readable-max-width); }
.form            { max-width: var(--layout-form-max-width); }
.section         { padding-block: var(--space-2xl); }                    /* bölümler arası: 48 */
@media (min-width: 600px) { .section { padding-block: var(--space-3xl); } } /* 64 */

/* ---------- Üst çubuk ve menü ---------- */
.app-bar         { height: var(--size-app-bar-height-compact); display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); padding-inline: var(--layout-gutter); padding-top: env(safe-area-inset-top); }
.app-bar__logo   { height: var(--size-logo-height-compact); width: auto; }
@media (min-width: 840px) {
  .app-bar       { height: var(--size-app-bar-height); }
  .app-bar__logo { height: var(--size-logo-height); }
}
/* Üst menü öğesi (840+): tek satır, 14 px / 600, 48 px tıklama yüksekliği */
.nav-link        { display: inline-flex; align-items: center; min-height: var(--size-touch-target-min); padding-inline: 12px; border-radius: var(--radius-sm); font-size: var(--type-body-sm); font-weight: var(--weight-strong); white-space: nowrap; text-decoration: none; }
/* Açılır (hamburger) menü: başlık 18 px, satırlar 16 px / 500, 48 px yüksek */
.drawer-title    { font-family: var(--font-heading); font-size: var(--type-title); font-weight: 700; }
.drawer-link     { display: flex; align-items: center; justify-content: space-between; min-height: var(--size-touch-target-min); padding-inline: 12px; border-radius: var(--radius-md); font-size: var(--type-body); font-weight: var(--weight-medium); text-decoration: none; }
/* Alt sekme çubuğu (yalnız telefon): 56 px, 24 px simge, 12 px yazı */
.tab-bar         { display: flex; align-items: center; justify-content: space-around; height: var(--size-bottom-nav-height); padding-bottom: env(safe-area-inset-bottom); }
.tab-item        { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 64px; min-height: var(--size-touch-target-min); font-size: var(--type-caption); font-weight: var(--weight-medium); text-decoration: none; }
.tab-item[aria-current="page"] { font-weight: var(--weight-strong); }
@media (min-width: 600px) { .tab-bar { display: none; } }
/* Alt bilgi: bağlantılar 14 px, telif satırı 12 px */
.footer-link     { font-size: var(--type-body-sm); }
.footer-note     { font-size: var(--type-caption); }

/* ---------- Düğme: yazısı kadar geniş, sabit yükseklik ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm);
  width: auto; max-width: var(--layout-button-max-width); flex: none; align-self: flex-start; justify-self: start;
  min-height: var(--size-button-height); padding: 0 var(--space-md);
  font: inherit; font-size: var(--type-body); font-weight: var(--weight-strong); line-height: 1.5; white-space: nowrap;
  border: 1px solid transparent; border-radius: var(--radius-md); cursor: pointer; text-decoration: none;
}
.btn--sm         { min-height: var(--size-button-height-sm); padding: 0 12px; font-size: var(--type-body-sm); line-height: 1.4; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-row         { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-sm); } /* sığmayan alt satıra geçer */
/* Yalnız simgeli düğme: 24 px simge, 48 px dokunma alanı */
.icon-btn        { display: inline-flex; align-items: center; justify-content: center; min-width: var(--size-touch-target-min); min-height: var(--size-touch-target-min); border: 0; border-radius: var(--radius-md); background: transparent; color: inherit; cursor: pointer; }

/* ---------- Form alanı: etiket üstte, 48 px (telefonda 44 px) ---------- */
.label           { display: block; margin-bottom: var(--space-xs); font-size: var(--type-body-sm); font-weight: var(--weight-strong); }
.input {
  width: 100%; min-height: var(--size-input-height); padding: 0 var(--space-md);
  font: inherit; font-size: max(16px, var(--type-body));   /* 16 px'in altında iPhone alana dokununca yakınlaştırır */
  line-height: 1.5; border: 1px solid; border-radius: var(--radius-md);
}
textarea.input   { padding-block: 10px; min-height: 144px; resize: vertical; }
@media (max-width: 599.98px) {
  .input         { min-height: var(--size-input-height-compact); }
  textarea.input { min-height: 116px; }
}
.field-error     { min-height: calc(var(--type-body-sm) * 1.4); font-size: var(--type-body-sm); } /* hata satırının yeri ayrılır */

/* ---------- Kart ve etiket ---------- */
.card            { border: 1px solid; border-radius: var(--radius-lg); padding: var(--space-lg); }
.card--sm        { padding: 20px; }
.chip            { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: 32px; padding-inline: var(--space-sm); border: 1px solid; border-radius: var(--radius-sm); font-size: var(--type-body-sm); font-weight: var(--weight-medium); line-height: 1.4; }

/* ---------- Simge ---------- */
.icon            { width: var(--size-icon-md); height: var(--size-icon-md); flex: none; }
.icon--16        { width: var(--size-icon-sm); height: var(--size-icon-sm); }
.icon--32        { width: var(--size-icon-lg); height: var(--size-icon-lg); }

/* ---------- Güvenli alan (çentikli telefonlar) ---------- */
.pt-safe         { padding-top: env(safe-area-inset-top); }
.pb-safe         { padding-bottom: env(safe-area-inset-bottom); }

/* ---------- Hareket ---------- */
@media (prefers-reduced-motion: no-preference) {
  .btn, .icon-btn, .chip, .tab-item, .input { transition: transform var(--motion-fast) var(--motion-easing), background-color var(--motion-fast) var(--motion-easing), border-color var(--motion-fast) var(--motion-easing); }
  .btn:active, .icon-btn:active, .chip:active, .tab-item:active { transform: scale(.97); }   /* basılınca hafifçe küçülür */
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
