/* 
   ============================================================
   TURKISH CHARACTER FONT FIX
   ============================================================
   
   This CSS file fixes font rendering issues for Turkish characters
   by implementing proper font stacks and OpenType features.
   
   Supported Turkish characters: ç, ð, ý, ö, þ, ü (+ uppercase versions)
   ============================================================
*/

/* Import fonts if not already loaded */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&subset=latin,latin-ext&display=swap');

/* ============== GLOBAL FONT FIXES ============== */

html {
    /* Ensure UTF-8 encoding */
    charset: utf-8;
 /* Set default language direction */
    direction: ltr;
    /* Optimize font rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    /* Primary: Inter (best for Turkish), Secondary: Poppins, Tertiary: Noto Sans (universal) */
    font-family: 'Inter', 'Poppins', 'Noto Sans', 'Segoe UI', 'Arial Unicode MS', sans-serif;
    /* Font features for proper character rendering */
    font-feature-settings: 
        "liga" 1,   /* Ligatures */
        "calt" 1,   /* Contextual alternates */
        "kern" 1,   /* Kerning */
    "ss01" 1;   /* Stylistic set 1 (cleaner forms) */
    /* Smooth font rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Text rendering optimization */
 text-rendering: optimizeLegibility;
    /* Line height for readability */
    line-height: 1.6;
    /* Letter spacing for clarity */
    letter-spacing: 0.3px;
    /* Ensure proper size adjustment */
    -webkit-text-size-adjust: 100%;
}

/* ============== HEADING FONTS ============== */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', 'Noto Sans', 'Segoe UI', sans-serif;
    font-feature-settings: "liga" 1, "calt" 1, "kern" 1, "ss01" 1;
    font-weight: 600;
    letter-spacing: -0.5px;
    /* Ensure proper rendering of Turkish characters in headings */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

/* ============== PARAGRAPH & TEXT ELEMENTS ============== */

p, span, a, li, label, small {
    font-family: 'Inter', 'Poppins', 'Noto Sans', 'Segoe UI', 'Arial Unicode MS', sans-serif;
    font-feature-settings: "liga" 1, "calt" 1, "kern" 1, "ss01" 1;
}

/* Specific fix for Turkish text */
.turkish-text,
[lang="tr"],
[lang="tr-TR"] {
    font-family: 'Inter', 'Poppins', 'Noto Sans', sans-serif;
    font-feature-settings: "liga" 1, "calt" 1, "kern" 1, "ss01" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============== FORM ELEMENTS ============== */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="number"],
textarea,
select,
button,
.btn {
    font-family: 'Inter', 'Poppins', 'Noto Sans', 'Segoe UI', 'Arial Unicode MS', sans-serif !important;
    font-feature-settings: "liga" 1, "calt" 1, "kern" 1, "ss01" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

input::placeholder,
textarea::placeholder {
    font-family: 'Inter', 'Poppins', 'Noto Sans', sans-serif;
 font-feature-settings: "liga" 1, "calt" 1, "kern" 1;
}

/* ============== NAVIGATION & MENU ELEMENTS ============== */

.navbar,
.nav,
.navbar-nav,
.nav-link,
.menu-item-has-children,
.nav-item,
.navigation a {
    font-family: 'Inter', 'Poppins', 'Noto Sans', 'Segoe UI', sans-serif;
    font-feature-settings: "liga" 1, "calt" 1, "kern" 1, "ss01" 1;
    -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============== LANGUAGE DROPDOWN & SELECTOR ============== */

.language-selector,
.lang-dropdown,
.language-switcher {
    font-family: 'Inter', 'Poppins', 'Noto Sans', sans-serif;
    font-feature-settings: "liga" 1, "calt" 1, "kern" 1;
}

/* ============== FOOTER ELEMENTS ============== */

footer,
.footer-section,
footer p,
footer a {
    font-family: 'Inter', 'Poppins', 'Noto Sans', 'Segoe UI', sans-serif;
    font-feature-settings: "liga" 1, "calt" 1, "kern" 1, "ss01" 1;
}

/* ============== SPECIAL TEXT RENDERING ============== */

/* For elements with Turkish special characters */
.with-turkish-chars {
    font-variant-ligatures: common-ligatures;
    font-kerning: auto;
    -webkit-font-feature-settings: "kern" on;
    -moz-font-feature-settings: "kern=1";
    -webkit-text-rendering: optimizeLegibility;
    text-rendering: optimizeLegibility;
}

/* ============== UTILITY CLASSES ============== */

/* Use these classes to ensure proper Turkish character rendering */
.turkish {
    font-family: 'Inter', 'Poppins', 'Noto Sans', 'Segoe UI', sans-serif !important;
    font-feature-settings: "liga" 1, "calt" 1, "kern" 1, "ss01" 1 !important;
}

.no-ligature {
    font-feature-settings: "liga" 0;
}

.with-kerning {
    font-kerning: auto;
    -webkit-font-feature-settings: "kern" 1;
 font-feature-settings: "kern" 1;
}

/* ============== RTL LANGUAGE SUPPORT ============== */

[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

/* ============== BROWSER-SPECIFIC FIXES ============== */

/* Webkit browsers (Chrome, Safari) */
@supports (-webkit-appearance: none) {
    body {
        -webkit-font-feature-settings: "liga" 1, "calt" 1, "kern" 1;
        -webkit-font-smoothing: antialiased;
        -webkit-text-rendering: optimizeLegibility;
    }
}

/* Firefox */
@-moz-document url-prefix() {
    body {
   -moz-font-feature-settings: "liga" on, "calt" on, "kern" on;
        -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
    }
}

/* ============== FONT WEIGHT VARIATIONS ============== */

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }

/* ============== PERFORMANCE OPTIMIZATION ============== */

/* Preload critical fonts to prevent FOUT (Flash of Unstyled Text) */
@font-face {
    font-family: 'Inter';
    src: url('https://fonts.gstatic.com/s/inter/v18/UcCO_p8bYj_qmMG4rPdVVFQ1bw.woff2') format('woff2');
    font-display: swap;
    font-weight: 400;
}

@font-face {
    font-family: 'Noto Sans';
    src: url('https://fonts.gstatic.com/s/notosans/v21/o-0IIpQlx3QUlC5A4PNr5VRQ.woff2') format('woff2');
    font-display: swap;
    font-weight: 400;
}

/* ============== FINAL SAFETY FALLBACK ============== */

/* If all else fails, use system fonts */
* {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    font-family: 'Inter', 'Poppins', 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
