/* critical.css — Pre-paint guard sheet.
   ---------------------------------------------------------------------------
   header.php tüm "kritik" CSS'leri (layout.css + component CSS'ler dahil) SYNC
   yüklediği için bu dosyada ARTIK skeleton/override kuralı tutmuyoruz; aynı
   selector'ları layout/topbar/hero/work-types/job-card dosyaları zaten ayarlıyor
   ve cascade'de hemen sonra yüklenip critical'ı eziyordu (örnek: .feed-list
   flex vs grid, .feed-toolbar__panel flex vs grid — display sıçraması).

   Bu dosyanın TEK işi şu olarak kaldı:
     1. :root CSS değişkenleri (component CSS'lerden ÖNCE okunmalı)
     2. body/html reset + skip-link
     3. Preloader (HTML/CSS-only splash)
     4. AdSense + ad-banner wrapper (bunlar için dedike CSS yok)
     5. Async-CSS pre-paint guard (modal/toast/footer.css gelene kadar flash önle)
     6. View Transitions API + reduced-motion + content-visibility perf
     7. Landscape orientation + pointer:coarse spot fix'leri

   Hedef: LCP < 2.5s. CSP-temiz (inline <style> yok). */

:root {
    color-scheme: light dark;
    --brand-navy: #0b2347;
    --brand-green: #1ab769;
    --bg: #f9fbfc;
    --panel: #ffffff;
    --text: #0b2347;
    --muted: #4b5563;
    --border: rgba(11, 35, 71, 0.06);
    --radius-md: 0.875rem;
    --radius-lg: 1.125rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
}

html[data-theme="dark"] {
    --bg: #030914;
    --panel: #0b1528;
    --text: #f8fafc;
    --muted: #94a3b8;
    --brand-green: #10b981;
    --border: rgba(148, 163, 184, 0.08);
}

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

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

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; padding: 0; }

/* Skip-to-content — kritik (Tab odağında hemen görünmeli) */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 9999;
}
.skip-link:focus,
.skip-link:focus-visible {
    position: fixed;
    left: 12px;
    top: 12px;
    width: auto;
    height: auto;
    padding: 10px 16px;
    background: #ffffff;
    color: #0b2347;
    border: 2px solid var(--brand-green);
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9375rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    outline: none;
}
html[data-theme="dark"] .skip-link:focus,
html[data-theme="dark"] .skip-link:focus-visible {
    background: #0b2347;
    color: #ffffff;
}

/* NOT: Eskiden burada .feed-shell, .topbar, .hero, .work-types(__grid),
   .feed-toolbar(__panel), .feed-list, .feed-card, .feed-empty için "iskelet"
   kuralları vardı. header.php artık layout.css + component CSS'leri SYNC
   yüklediği için tüm bu kurallar cascade'de hemen ezildiğinden ölü koddu;
   bir kısmı da çakışıyordu (display:flex vs grid sıçraması). Tek sahibi
   layout.css ve assets/css/components/*.css. */

/* Preloader — markalı splash. body.loading-locked YOK → kullanıcı scroll
   engellenmiyor. CSS animasyonuyla ~1.4 sn'de fade-out olur; JS başarısız
   olsa bile sıkışma imkânsız. CSP-temiz, inline-style/script kullanmaz. */
#site-preloader {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 30% 20%, rgba(26, 183, 105, 0.18) 0%, transparent 55%),
        radial-gradient(circle at 70% 80%, rgba(11, 132, 255, 0.14) 0%, transparent 55%),
        linear-gradient(135deg, #0b2347 0%, #0a1d3b 60%, #081832 100%);
    animation: site-preloader-autohide 0.45s ease-out 1.05s forwards;
    will-change: opacity;
}
#site-preloader__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 4px 8px;
    animation: site-preloader-rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
#site-preloader__badge {
    position: relative;
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    background: linear-gradient(140deg, #1ab769 0%, #128f55 100%);
    box-shadow:
        0 14px 32px rgba(11, 35, 71, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.06) inset,
        0 0 28px rgba(26, 183, 105, 0.35);
    animation: site-preloader-pulse 1.6s ease-in-out infinite;
}
#site-preloader__badge svg {
    width: 44px;
    height: 44px;
    fill: #ffffff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}
#site-preloader__ring {
    position: absolute;
    inset: -8px;
    border-radius: 26px;
    border: 2px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.9);
    border-right-color: rgba(255, 255, 255, 0.25);
    animation: site-preloader-spin 1s linear infinite;
}
#site-preloader__brand {
    color: #ffffff;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
    font-size: 0.9375rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: center;
    opacity: 0.92;
}
#site-preloader__bar {
    position: relative;
    width: 168px;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
#site-preloader__bar span {
    position: absolute;
    inset: 0;
    width: 40%;
    background: linear-gradient(90deg, transparent, #1ab769 35%, #4ade80 65%, transparent);
    border-radius: inherit;
    animation: site-preloader-bar 1.1s ease-in-out infinite;
}
@keyframes site-preloader-spin {
    to { transform: rotate(360deg); }
}
@keyframes site-preloader-pulse {
    0%, 100% { transform: scale(1);    box-shadow: 0 14px 32px rgba(11, 35, 71, 0.55), 0 0 0 1px rgba(255,255,255,0.06) inset, 0 0 28px rgba(26, 183, 105, 0.35); }
    50%      { transform: scale(0.96); box-shadow: 0 12px 26px rgba(11, 35, 71, 0.50), 0 0 0 1px rgba(255,255,255,0.06) inset, 0 0 18px rgba(26, 183, 105, 0.55); }
}
@keyframes site-preloader-bar {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(320%);  }
}
@keyframes site-preloader-rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0);   }
}
@keyframes site-preloader-autohide {
    to { opacity: 0; visibility: hidden; pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) {
    #site-preloader__badge,
    #site-preloader__ring,
    #site-preloader__bar span,
    #site-preloader__card { animation: none; }
}


/* AdSense üst alan — CSP-temiz (inline style yok). AdSense kodunun kendisi
   inline script içerir; CSP'ye Google host'ları + 'unsafe-inline' eklenmeden
   tarayıcı bloklar. Wrapper sadece görsel iskelet sağlar. */
.adsense-wrapper {
    margin: 15px auto;
    max-width: 1200px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e293b;
}
.adsense-header-wrapper { min-height: 90px; }
.adsense-sidebar-wrapper { min-height: 250px; }
.adsense-inside-job-wrapper { min-height: 250px; }

/* Banner ad slot — CSP-temiz, lazy-load + label.
   Boyut sınırı: görsel ne kadar büyük yüklenirse yüklensin, slot leaderboard
   yüksekliğinde kalır (mobilde ~110px, masaüstünde ~140px). Aksi halde dikey
   bir görsel width:100% ile tüm ekranı kaplıyordu. */
.ad-banner-slot {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4) 0;
    width: 100%;
    max-width: 728px;
    margin: 0 auto;
}
.ad-banner {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--panel);
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.ad-banner:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
.ad-banner__img {
    width: 100%;
    height: auto;
    max-height: 110px;
    object-fit: cover;
    display: block;
}
@media (min-width: 768px) {
    .ad-banner__img { max-height: 140px; }
}
.ad-banner__label {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(11, 35, 71, 0.78);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* NOT: 720px / 480px / 380px mobil polish blokları kaldırıldı —
   .topbar/.feed-shell/.hero/.work-types/.feed-toolbar mobil padding'leri ve
   .work-types__grid 2x2 düzeni assets/css/responsive.css ve
   assets/css/components/work-types.css içinde aynı breakpoint'lerle zaten
   ayarlanıyor; iki kaynaktan yönetilen padding'ler bug üretiyordu. Burada
   sadece BAŞKA HİÇBİR DOSYADA tanımlı olmayan landscape ve pointer:coarse
   spot kuralları kaldı. */

/* Yatay-yön (landscape) telefonda alt çubukla hero çakışmasın */
@media (max-width: 920px) and (orientation: landscape) {
    .hero { padding-bottom: var(--space-3); }
    .feed-list { padding-bottom: calc(var(--space-4) + 64px); }
}

/* Touch hedef garantisi — pointer:coarse cihazlarda dokunulabilir
   her şeyin WCAG min hedef boyutu. .feed-filter-chip için son söz
   style.css/responsive.css'te (48px !important); burada sadece
   responsive.css'in dokunmadığı spotlar. */
@media (pointer: coarse) {
    .work-type-card { min-height: 88px; }
    .hero-cta, .hero-ghost { min-height: 48px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODERN PERFORMANS (2024-2026)
   - content-visibility: auto → off-screen feed kartlarını tarayıcı render
     etmez, layout maliyeti sıfırlanır. Uzun listelerde LCP ve scroll-INP
     dramatik düşer. contain-intrinsic-size CLS önler.
   - View Transitions API → tema değişiminde sert flip yerine yumuşak crossfade.
     Desteklemeyen tarayıcılarda no-op (zarafetle düşer).
   - CSS containment → paint izolasyonu (komşu element repaint'i sınırlanır).
   ═══════════════════════════════════════════════════════════════════════════ */

.feed-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 280px;
    contain: layout paint style;
}
.feed-list {
    /* Sticky aday: viewport altı kartlar için optimize edilmiş paint sınırı */
    contain: layout style;
}
.work-types,
.feed-toolbar {
    contain: layout style;
}

/* View Transition: tema değişimi yumuşak crossfade.
   Sadece kök-element transition'ı; perf maliyeti ihmal edilebilir. */
@view-transition { navigation: none; }
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.32s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
::view-transition-old(root) {
    animation-name: vt-fade-out;
}
::view-transition-new(root) {
    animation-name: vt-fade-in;
}
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in  { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root) { animation: none; }
}

/* CSP-safe animation classes */
.is-hiding-animated {
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.5s ease, visibility 0.5s ease !important;
}
.d-none {
    display: none !important;
}

/* Async-CSS pre-paint guard: modal.css, footer.css gelene kadar bu bileşenler
   browser default ile görünür kalıyordu → suggest-modal flash, more-sheet flash.
   Aşağıdaki kurallar default'u sıfırlar; bileşen CSS'i geldiğinde active/is-open
   sınıflarıyla yine açılır. */
.modal-overlay:not(.active) {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none;
}
.more-sheet[hidden],
.more-sheet:not(.is-open) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.toast.is-hidden,
.toast:not(.show) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
