/**
 * Sanal Müdür – Tüm sayfalar ve bölümler için mobil/tablet uyumluluk
 * Hiçbir mevcut davranışı bozmadan eklenir.
 */

/* Genel: taşmayı önle, dokunma hedefleri */
/* Not: overflow-x hem html hem body'de olunca bazı tarayıcılarda çift dikey scrollbar oluşur; yatay taşma sadece kökte kesilir. */
html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
body {
  min-width: 0;
}
img, video, iframe, object, embed {
  max-width: 100%;
  height: auto;
}

/* Navbar: tüm genişliklerde düzgün sarmalama */
nav .max-w-7xl {
  flex-wrap: wrap;
  gap: 0.5rem;
}
nav .sanal-logo-link {
  min-width: 0;
}
.logo-kobi {
  white-space: nowrap;
}
@media (max-width: 767px) {
  nav .logo-line-2 { font-size: 0.65rem; }
  nav .logo-kobi { display: none; }
  nav .flex.items-center.gap-3 {
    gap: 0.5rem !important;
  }
}

/* Bölümler: padding ve başlık boyutları */
section {
  box-sizing: border-box;
}
@media (max-width: 1023px) {
  section {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  .max-w-7xl {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}
@media (max-width: 767px) {
  section.py-12.md\:py-24,
  section[class*="py-12"],
  section[class*="py-24"] {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }
  h1, .text-4xl, .text-5xl, .text-6xl {
    font-size: 1.75rem !important;
    line-height: 1.25 !important;
  }
  h2.text-4xl, h2.text-5xl, h2.text-6xl,
  .text-4xl.md\:text-6xl,
  .text-3xl.md\:text-5xl {
    font-size: 1.5rem !important;
    line-height: 1.3 !important;
  }
  .text-3xl.md\:text-5xl { font-size: 1.375rem !important; }
  .hero-title,
  .text-4xl.md\:text-5xl {
    font-size: 1.5rem !important;
  }
  .hero-title .glow-text,
  .text-5xl, .text-6xl {
    font-size: 1.75rem !important;
  }
  .glass-card.p-10 {
    padding: 1.5rem !important;
  }
  .glass-card.p-8 {
    padding: 1.25rem !important;
  }
  .glass-card.rounded-\[2\.5rem\] {
    border-radius: 1.5rem !important;
  }
}
@media (max-width: 479px) {
  section {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  h2 {
    font-size: 1.25rem !important;
  }
}

/* Grid'ler: mobilde tek sütun (Tailwind md: zaten var, sabit grid'ler için) */
@media (max-width: 767px) {
  .grid.md\:grid-cols-2 > *,
  .grid.md\:grid-cols-3 > *,
  .grid.md\:grid-cols-4 > *,
  .grid.sm\:grid-cols-2 > * {
    min-width: 0;
  }
  .grid:not([class*="grid-cols-"]) {
    grid-template-columns: 1fr;
  }
}

/* Butonlar ve CTA */
@media (max-width: 767px) {
  .hero-buttons,
  .flex.gap-4.flex-wrap {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-buttons button,
  .hero-buttons a,
  .flex.gap-4 a[class*="rounded"],
  a[class*="px-6"][class*="py-3"] {
    width: 100%;
    justify-content: center;
    text-align: center;
    touch-action: manipulation; /* çift dokunma zoom gecikmesini azaltır */
  }
  .mobile-menu-btn {
    touch-action: manipulation;
  }
}

/* Modal: küçük ekranda tam genişlik ve kaydırma */
@media (max-width: 767px) {
  .modal-content,
  .glass-card.max-w-4xl,
  .glass-card.max-w-2xl {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0.5rem;
    max-height: calc(100vh - 1rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  #howItWorksModal .p-8.md\:p-16,
  #hemenBaslaModal .p-6.md\:p-10 {
    padding: 1rem !important;
  }
  #howItWorksModal .grid.md\:grid-cols-3 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Form: mobilde tek sütun */
@media (max-width: 767px) {
  form .grid.md\:grid-cols-2,
  form .grid.md\:grid-cols-2 > * {
    grid-template-columns: 1fr !important;
    max-width: 100%;
  }
  input, select, textarea {
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* Tablolar: yatay kaydırma */
table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table thead,
table tbody {
  display: table;
  width: 100%;
  min-width: 320px;
}

/* Projeler sayfası (ek uyumluluk) */
@media (max-width: 767px) {
  .sm-projeler-page {
    padding: 1.5rem 0.75rem 2rem !important;
  }
  .sm-projeler-header .sm-projeler-heading {
    font-size: 1.5rem !important;
  }
  .sm-projeler-sub {
    font-size: 0.875rem !important;
  }
  .projeler-sim-wrap,
  .projeler-sim-inner {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    font-size: 0.75rem !important;
  }
  main.projeler-main {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
}
@media (max-width: 479px) {
  .sm-proje-card-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .sm-proje-card-actions .sm-proje-card-cta,
  .sm-proje-card-actions .sm-proje-card-whatsapp {
    text-align: center;
    justify-content: center;
  }
}

/* Preloader: mobilde küçült */
@media (max-width: 767px) {
  #preloader .loader-frame {
    padding: 1.5rem 1.25rem !important;
  }
  #preloader .loader-neural-box {
    width: 100px !important;
    height: 100px !important;
  }
  #preloader .loader-name {
    font-size: 1rem !important;
    letter-spacing: 2px !important;
  }
  #preloader .loader-progress-wrap {
    width: 200px !important;
  }
}

/* Referans marquee: mobilde daha yavaş / daha az gap */
@media (max-width: 767px) {
  .marquee-track {
    gap: 2rem;
  }
  .marquee-wrapper {
    mask-image: linear-gradient(90deg, transparent 0%, black 5%, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 5%, black 95%, transparent 100%);
  }
}

/* Video container (hero / bölüm videoları) */
.video-container {
  max-width: 100%;
}
@media (max-width: 767px) {
  .video-container {
    border-radius: 1rem;
  }
}

/* Section divider SVG */
.section-divider svg {
  max-width: 100%;
  height: auto;
}

/* Arka plan blob'ları: mobilde daha küçük (performans) */
@media (max-width: 767px) {
  .fixed.top-0.left-0 .absolute.w-\[280px\],
  .fixed.top-0.left-0 .absolute.w-\[420px\],
  .fixed.top-0.left-0 .absolute.w-\[600px\],
  .float-animation {
    max-width: 90vw;
  }
}

/* SİSTEM DURUMU butonu: çok küçük ekranda metni kısalt veya gizle */
@media (max-width: 479px) {
  button .uppercase.tracking-tighter {
    font-size: 0.65rem !important;
  }
}

/* Genel: tüm section ve container'ların taşmaması */
section .max-w-7xl,
.sm-projeler-container,
.projeler-content-wrap {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* Dark mode: değişiklik yok, sadece taşma kuralları geçerli */
html.dark img,
html.dark video,
html.dark iframe {
  max-width: 100%;
}

/* --- WordPress gövdesi + Sanal Müdür blog (taşma, uzun URL) — mevcut düzeni bozmaz --- */
.entry-content,
.wp-block-post-content,
.post-content,
article .entry-content,
.sm-blog-entry,
.sm-single-post-body,
.sm-blog-prose {
  max-width: 100%;
  box-sizing: border-box;
}
.entry-content a,
.sm-blog-rich-section a,
.sm-blog-rich-section p,
.sm-blog-entry a,
.sm-single-post-body a,
.sm-blog-prose a {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.entry-content pre,
.entry-content code,
.sm-blog-rich-section pre,
.sm-blog-entry pre,
.sm-single-post-body pre {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
svg {
  max-width: 100%;
  height: auto;
}
picture {
  display: block;
  max-width: 100%;
}

/* Çentikli ekranlarda yatay güvenli alan (içerik kesilmesin) */
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
}
