/* Taner İklimlendirme - Mobile Stability Layer v1 | 2026-09-16
   Amaç: sabit header çakışması, düşük kontrast, yatay taşma ve mobil dock örtüşmesini önlemek.
   Sadece 1023px ve altı. */
@media (max-width: 1023px) {
  :root { --taner-mobile-header: 60px; --taner-mobile-dock-space: 92px; }

  html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  /* Tüm sayfalarda sabit menünün içerik üstüne binmesini engelle. */
  body,
  body.home-page {
    padding-top: var(--taner-mobile-header) !important;
    padding-bottom: var(--taner-mobile-dock-space) !important;
  }

  /* Mobil header her arka planda okunur ve stabil kalsın. */
  .navbar-premium,
  #navbar,
  body.home-page .navbar-premium,
  body.home-page #navbar,
  body.home-page .navbar-premium.navbar-scrolled,
  body.home-page #navbar.navbar-scrolled {
    top: 0 !important;
    height: var(--taner-mobile-header) !important;
    min-height: var(--taner-mobile-header) !important;
    background: #ffffff !important;
    border-bottom: 1px solid rgba(15,23,42,.08) !important;
    box-shadow: 0 4px 18px rgba(15,23,42,.08) !important;
  }

  .navbar-premium > .max-w-7xl,
  #navbar > .max-w-7xl {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    gap: 10px !important;
  }

  .logo-container-premium {
    min-width: 0 !important;
    max-width: calc(100% - 104px) !important;
  }
  .logo-premium-icon {
    flex: 0 0 auto !important;
  }
  .logo-container-premium .flex.flex-col {
    min-width: 0 !important;
  }
  .logo-container-premium .brand-text {
    font-size: 18px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }
  .logo-container-premium .flex.flex-col > span:last-child {
    font-size: 7px !important;
    letter-spacing: .12em !important;
    white-space: nowrap !important;
  }
  .navbar-actions {
    flex: 0 0 auto !important;
    gap: 8px !important;
  }

  main,
  main > section,
  main > article,
  article,
  .article-content {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  main > section:first-of-type {
    margin-top: 0 !important;
  }

  /* Koyu / görselli hero alanlarında kontrastı zorunlu kıl. */
  main > section:first-of-type[class*="bg-[#001D3D]"] h1,
  main > section:first-of-type[class*="bg-[#000d1a]"] h1,
  main > section:first-of-type[class*="-hero"] h1,
  main > section:first-of-type.cekmekoy-hero h1,
  main > section:first-of-type.huseyinli-hero h1,
  main > section:first-of-type.dudullu-hero h1,
  main > section:first-of-type.kadikoy-hero h1,
  main > section:first-of-type.catalmese-hero h1,
  main > section:first-of-type.eksioglu-hero h1,
  main > section:first-of-type.gungoren-hero h1,
  main > section:first-of-type.kartal-hero h1 {
    color: #ffffff !important;
    text-shadow: 0 2px 14px rgba(0,0,0,.30) !important;
  }

  main > section:first-of-type[class*="bg-[#001D3D]"] > div p,
  main > section:first-of-type[class*="bg-[#000d1a]"] > div p,
  main > section:first-of-type[class*="-hero"] > div p {
    color: rgba(255,255,255,.92) !important;
  }

  /* Uzun başlıklar iki/üç satırda dengeli kırılsın, taşmasın. */
  main > section:first-of-type h1,
  main h1.heading-hero {
    max-width: 100% !important;
    font-size: clamp(26px, 7.4vw, 34px) !important;
    line-height: 1.15 !important;
    letter-spacing: -.025em !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    text-wrap: balance;
  }

  main h2,
  main h3,
  main p,
  .article-content {
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }

  main p,
  .article-content p {
    line-height: 1.65 !important;
  }

  /* Grid/flex çocuklarının ebeveyni genişletmesini önle. */
  main .grid > *,
  main .flex > *,
  footer .grid > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  main img,
  main video,
  main iframe {
    display: block;
    max-width: 100% !important;
    height: auto;
  }

  /* Makale ve kart konteynerlerinde sağa kaymayı önle. */
  .article-content,
  main .prose,
  main [class*="max-w-"] {
    box-sizing: border-box !important;
  }
  .article-content {
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Geniş tablolar sayfayı taşırmak yerine kendi içinde kaydırılır. */
  main .overflow-x-auto {
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  main table {
    max-width: 100% !important;
  }

  /* CTA'larda yazı kırılması ve dokunma alanı. */
  main a[class*="btn"],
  main button,
  main [role="button"] {
    min-height: 44px;
    max-width: 100%;
  }

  /* Alt çağrı dock'u içeriği örtmeden simetrik dursun. */
  .global-mobile-dock {
    left: 8px !important;
    right: 8px !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    width: auto !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 380px) {
  .navbar-premium > .max-w-7xl,
  #navbar > .max-w-7xl {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  .logo-container-premium .brand-text { font-size: 16px !important; }
  .logo-container-premium .flex.flex-col > span:last-child { font-size: 6px !important; letter-spacing: .08em !important; }
  main > section:first-of-type h1,
  main h1.heading-hero { font-size: clamp(24px, 7.2vw, 30px) !important; }
}

@media (max-width: 850px) {
  .main-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
    box-sizing: border-box !important;
  }
  .main-container > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }
}

@media (max-width: 480px) {
  main .custom-table {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 1023px) {
  /* Koyu hero içindeki yarı saydam kartlar mobilde arka planla karışmasın. */
  main > section:first-of-type[class*="bg-[#001D3D]"] [class*="bg-white/5"],
  main > section:first-of-type[class*="bg-[#000d1a]"] [class*="bg-white/5"],
  main > section:first-of-type[class*="-hero"] [class*="bg-white/5"] {
    background: rgba(0, 29, 61, .84) !important;
    border-color: rgba(255,255,255,.20) !important;
  }
  main > section:first-of-type[class*="bg-[#001D3D]"] [class*="text-white/40"],
  main > section:first-of-type[class*="bg-[#001D3D]"] [class*="text-white/50"],
  main > section:first-of-type[class*="bg-[#000d1a]"] [class*="text-white/40"],
  main > section:first-of-type[class*="bg-[#000d1a]"] [class*="text-white/50"],
  main > section:first-of-type[class*="-hero"] [class*="text-white/40"],
  main > section:first-of-type[class*="-hero"] [class*="text-white/50"] {
    color: rgba(255,255,255,.88) !important;
  }
}
