/* ==========================================================================
 * T4615-G-11 & G-14 (13.11.2026 22:55 TSI)
 * Dosya: assets/css/t4615_g11_g14_390_768_1280_koyu_tema.css (YENI DOSYA)
 * Kapsam:
 *   - G-11: 390px, 768px ve 1280px genisliklerde kirpilma (clipping),
 *     yatay tasma (100vw scrollbar tasmasi), yapisik ust baslik (sticky header)
 *     altinda baslik kalmasi ve sabit alt cubuk / asistan / yardim kutusu
 *     ortusme (overlap) duzeltmesi.
 *   - G-14: Koyu tema ([data-theme*="dark"], [data-bs-theme="dark"],
 *     html.dark, body.dark-mode, .theme-dark) WCAG 2.1 AA (>= 4.5:1 metin,
 *     >= 3.0:1 bilesen siniri) kontrast garantisi.
 * ========================================================================== */

/* --- G-11 GENEL KUTU MODELI, GÖRSEL KORUMA VE KATMAN (Z-INDEX) DISIPLINI --- */
html {
  max-width: 100%;
  overflow-x: clip;
  scroll-padding-top: 88px;
}

body {
  max-width: 100%;
  overflow-x: clip;
}

/* Flex ve Grid cocuklarinda uzun baslik/URL/7-dil metni kirpilmasini onle */
header *,
nav *,
main *,
.gm-card,
.tc-card,
.fd-cards-grid > *,
#service-hub-grid > *,
.slider-section * {
  min-width: 0;
}

/* Kesilmeyen logo ve medya kurali (%100 seffaf logo + object-fit: contain) */
.logo img,
.navbar-brand img,
.gm-logo-transparent img,
.site-header img[src*="logo"] {
  object-fit: contain !important;
  max-width: 100%;
  height: auto;
}

/* Yapisik ust bar altinda anchor (#haberler, #hal, #rehber, #form) kaybolmasin */
section[id],
article[id],
div[id],
main h1,
main h2 {
  scroll-margin-top: 92px;
}

/* Z-Index hiyerarsisi: modal (1050) > sticky header (900) > alt bar (800) > sayfa ici asistan (5) */
.gm-modal-backdrop.is-open,
.modal.show {
  z-index: 1050 !important;
}

.site-sticky-header,
header.site-header {
  position: relative;
  z-index: 900;
}

.bottom-nav,
.fd-bottom-nav,
.tc-bnav {
  z-index: 800 !important;
}

/* --- G-11 KIRILIM 1: 1280px (1025px - 1366px Küçük Masaüstü / Dizüstü) --- */
@media (min-width: 1025px) and (max-width: 1366px) {
  .container,
  .gm-container,
  .tc-wrap,
  .ot-wrap,
  .site-container,
  main {
    max-width: min(1240px, calc(100% - 32px)) !important;
    box-sizing: border-box !important;
  }

  header.site-header > .container,
  .fd-header-banner-7dil {
    flex-wrap: wrap !important;
    gap: 8px 12px !important;
    overflow: visible !important;
    max-height: none !important;
  }

  header.site-header nav[aria-label*="Ana Kategori"] {
    flex-wrap: wrap !important;
    gap: 8px 14px !important;
  }

  #service-hub-grid.gm-grid--cards {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }

  .tc-grid {
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr) !important;
    gap: 16px !important;
  }

  .tc-grid > .tc-span2 {
    grid-column: 1 / 2;
  }
}

/* --- G-11 KIRILIM 2: 768px (481px - 1024px Tablet Dikey / Yatay) --- */
@media (min-width: 481px) and (max-width: 1024px) {
  .container,
  .gm-container,
  .tc-wrap,
  .ot-wrap {
    max-width: 100% !important;
    padding-inline: 16px !important;
    box-sizing: border-box !important;
  }

  .tc-grid,
  .fd-cards-grid,
  #service-hub-grid.gm-grid--cards {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }

  .tc-grid > .tc-span2,
  .tc-grid > aside {
    grid-column: 1 / -1 !important;
  }

  /* Sabit alt bar varsa son icerik blogunun ustunu ortmesin */
  body:has(.tc-bnav) main,
  body:has(.bottom-nav) main,
  main:last-of-type {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Yuzen sohbet/yardim kutulari 768px'te form veya alt menuyu kapatmasin */
  #kim-bot-embed,
  .fzv-asistan,
  [id*="yardim-panel"],
  [class*="yardim-panel"] {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 14px 0 !important;
    z-index: 5 !important;
  }
}

/* --- G-11 KIRILIM 3: 390px (<= 480px Dar ve Standart Mobil) --- */
@media (max-width: 480px) {
  .container,
  .gm-container,
  .tc-wrap,
  .ot-wrap,
  .ie-front .ie-card {
    max-width: 100% !important;
    padding-inline: 12px !important;
    box-sizing: border-box !important;
  }

  .tc-grid,
  .fd-cards-grid,
  #service-hub-grid.gm-grid--cards,
  .gm-category-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  h1, .h1 {
    font-size: clamp(1.25rem, 5.2vw, 1.55rem) !important;
    line-height: 1.28 !important;
    overflow-wrap: anywhere !important;
  }

  h2, .h2 {
    font-size: clamp(1.0625rem, 4.4vw, 1.3rem) !important;
    line-height: 1.32 !important;
    overflow-wrap: anywhere !important;
  }

  /* 390px'te alt sabit bar + cerez cubugu cift katman ortusmesini engelle */
  main:last-of-type,
  footer:last-of-type {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
  }

  #kim-bot-embed,
  .fzv-asistan,
  [id*="yardim-panel"],
  [class*="yardim-panel"],
  [class*="floating-widget"] {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 12px 0 18px !important;
    z-index: 5 !important;
  }
}

/* ==========================================================================
 * G-14: KOYU TEMA (DARK MODE) WCAG 2.1 AA / AAA KONTRAST SISTEMI
 * Kapsam: [data-theme*="dark"], [data-bs-theme="dark"], html.dark,
 *         body.dark-mode, .theme-dark
 * ========================================================================== */
:is([data-theme*="dark"], [data-bs-theme="dark"], html.dark, body.dark-mode, .theme-dark) {
  --fd-dm-bg: #0B1120;          /* L=0.0097 */
  --fd-dm-surface: #1E293B;     /* L=0.0296 */
  --fd-dm-elevated: #273549;    /* L=0.0410 */
  --fd-dm-text: #F8FAFC;        /* #F8FAFC on #0B1120 = 16.4:1; on #1E293B = 12.1:1 */
  --fd-dm-subtext: #CBD5E1;     /* #CBD5E1 on #1E293B = 8.4:1  (AAA) */
  --fd-dm-muted: #94A3B8;       /* #94A3B8 on #0B1120 = 6.2:1; on #1E293B = 4.6:1 (AA) */
  --fd-dm-border: #64748B;      /* UI bilesen siniri >= 3.0:1 */
  --fd-dm-link: #93C5FD;        /* #93C5FD on #1E293B = 7.4:1  (AAA) */
  --fd-dm-primary-bg: #F59E0B;  /* #0F172A on #F59E0B = 9.0:1  (AAA) */
  --fd-dm-primary-fg: #0F172A;
  --fd-dm-focus: #60A5FA;       /* #60A5FA on #0B1120 = 7.5:1 */
}

:is([data-theme*="dark"], [data-bs-theme="dark"], html.dark, body.dark-mode, .theme-dark),
:is([data-theme*="dark"], [data-bs-theme="dark"], html.dark, body.dark-mode, .theme-dark) body,
:is([data-theme*="dark"], [data-bs-theme="dark"], html.dark, body.dark-mode, .theme-dark) body.gm-page-shell,
:is([data-theme*="dark"], [data-bs-theme="dark"], html.dark, body.dark-mode, .theme-dark) body.ft-safe-body {
  background-color: #0B1120 !important;
  color: #F8FAFC !important;
}

/* Kartlar, Ust Seritler ve Modal Kutular */
:is([data-theme*="dark"], [data-bs-theme="dark"], html.dark, body.dark-mode, .theme-dark) :is(
  .gm-card,
  .tc-card,
  .ie-card,
  .spor-card,
  .ot-card,
  .gm-modal-dialog,
  main.gm-logical-container,
  header.site-header,
  body.gm-page-shell header[role="banner"],
  .fd-header-banner-7dil
) {
  background-color: #1E293B !important;
  color: #F8FAFC !important;
  border-color: #64748B !important;
}

/* Basliklar ve Ikincil Metinler */
:is([data-theme*="dark"], [data-bs-theme="dark"], html.dark, body.dark-mode, .theme-dark) :is(
  h1, h2, h3, h4,
  #service-hub-grid .gm-card h2,
  body.gm-page-shell #main-content h1,
  body.ft-safe-body main.gm-logical-container h1,
  .ie-form > label:not(.ie-bal):not(.ie-onay)
) {
  color: #F8FAFC !important;
}

:is([data-theme*="dark"], [data-bs-theme="dark"], html.dark, body.dark-mode, .theme-dark) :is(
  p, li, small,
  .gm-lead,
  #service-hub-grid .gm-card p,
  body.ft-safe-body main.gm-logical-container p,
  .tc-meta,
  .tc-empty,
  .fd-header-banner-7dil .fd-hb-slogan,
  .fd-header-banner-7dil .fd-hb-slogan strong
) {
  color: #CBD5E1 !important;
}

/* Baglantilar */
:is([data-theme*="dark"], [data-bs-theme="dark"], html.dark, body.dark-mode, .theme-dark) a:not(.gm-btn):not(.fz-th-btn):not([hreflang]) {
  color: #93C5FD !important;
}

/* 7-Dil Secici Rozetleri (Koyu Temada AA/AAA) */
:is([data-theme*="dark"], [data-bs-theme="dark"], html.dark, body.dark-mode, .theme-dark) :is(
  .fd-header-banner-7dil .fd-hb-lang-switcher a[hreflang]:not([aria-current="true"]),
  header.site-header nav[aria-label*="7 Dil"] a[hreflang]:not([aria-current="true"]):not(.btn-primary)
) {
  background-color: #0F172A !important;
  color: #F8FAFC !important;
  border: 1px solid #94A3B8 !important;
}

:is([data-theme*="dark"], [data-bs-theme="dark"], html.dark, body.dark-mode, .theme-dark) :is(
  .fd-header-banner-7dil .fd-hb-lang-switcher a[hreflang][aria-current="true"],
  header.site-header nav[aria-label*="7 Dil"] a[hreflang][aria-current="true"],
  header.site-header nav[aria-label*="7 Dil"] a.btn-primary[hreflang]
) {
  background-color: #F59E0B !important;
  color: #0F172A !important;
  border: 1px solid #F59E0B !important;
}

/* Koyu Tema Form Alanlari ve Placeholder Kontrasti (KRITIK: #0F172A uzerine #0F172A engellendi!) */
:is([data-theme*="dark"], [data-bs-theme="dark"], html.dark, body.dark-mode, .theme-dark) :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select,
  textarea
) {
  background-color: #0F172A !important;
  color: #F8FAFC !important;
  border: 1.5px solid #94A3B8 !important;
}

:is([data-theme*="dark"], [data-bs-theme="dark"], html.dark, body.dark-mode, .theme-dark) :is(
  input::placeholder,
  textarea::placeholder
) {
  color: #CBD5E1 !important;
  opacity: 1 !important;
}

:is([data-theme*="dark"], [data-bs-theme="dark"], html.dark, body.dark-mode, .theme-dark) .ie-form label.ie-onay {
  background-color: #0F172A !important;
  color: #E2E8F0 !important;
  border-color: #64748B !important;
}

/* Koyu Tema Butonlar */
:is([data-theme*="dark"], [data-bs-theme="dark"], html.dark, body.dark-mode, .theme-dark) :is(
  #service-hub-grid .gm-btn--primary,
  body.ft-safe-body a.fz-th-btn,
  .ie-form button[type="submit"]
) {
  background-color: #F59E0B !important;
  color: #0F172A !important;
  border-color: #F59E0B !important;
}

:is([data-theme*="dark"], [data-bs-theme="dark"], html.dark, body.dark-mode, .theme-dark) #service-hub-grid .gm-btn--secondary {
  background-color: #0F172A !important;
  color: #F8FAFC !important;
  border-color: #94A3B8 !important;
}

/* Koyu Tema Durum Kutulari (Hata / Uyari / Basari — WCAG AA >= 6.8:1) */
:is([data-theme*="dark"], [data-bs-theme="dark"], html.dark, body.dark-mode, .theme-dark) .ie-sonuc.kotu {
  background-color: #450A0A !important;
  color: #FECACA !important;
  border-color: #F87171 !important;
}

:is([data-theme*="dark"], [data-bs-theme="dark"], html.dark, body.dark-mode, .theme-dark) .ie-sonuc.uyari {
  background-color: #451A03 !important;
  color: #FDE68A !important;
  border-color: #FBBF24 !important;
}

:is([data-theme*="dark"], [data-bs-theme="dark"], html.dark, body.dark-mode, .theme-dark) .ie-sonuc.iyi {
  background-color: #052E16 !important;
  color: #BBF7D0 !important;
  border-color: #4ADE80 !important;
}

/* Koyu Tema Klavye Odak Halkasi */
:is([data-theme*="dark"], [data-bs-theme="dark"], html.dark, body.dark-mode, .theme-dark) :is(
  a:focus-visible,
  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible,
  summary:focus-visible
) {
  outline: 3px solid #60A5FA !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.28) !important;
}
