/**
 * FAZ 2 — Native app mobile UX + okuma kurtarma (≤1024px)
 * Otorite: layout-fix 2-kolon çakışmasını mobilde geçersiz kılar.
 */

@media (max-width: 1024px) {
  html,
  body.kh-layout-elite,
  body.kh-v45 {
    overflow-x: hidden !important;
    max-width: 100vw;
  }

  /* Mobilde tek kolon — 320px sidebar kolonu ASLA kalmamalı */
  body.kh-layout-elite.kh-has-premium-sidebar .site.grid-container > #content.kh-layout-shell,
  body.kh-layout-elite.kh-has-premium-sidebar .kh-layout-shell,
  body.kh-layout-elite.kh-has-premium-sidebar #content.kh-layout-shell,
  body.kh-layout-elite .site.grid-container > #content.kh-layout-shell,
  body.kh-layout-elite .kh-layout-shell,
  body.kh-layout-elite #content.kh-layout-shell {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto;
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    gap: 20px !important;
    box-sizing: border-box;
  }

  body.kh-layout-elite .kh-layout-shell__main,
  body.kh-layout-elite #kh-layout-main,
  body.kh-layout-elite #primary,
  body.kh-layout-elite .content-area,
  body.kh-layout-elite .site-main,
  body.kh-layout-elite .kh-v3-main,
  body.kh-layout-elite .kh-v3-article,
  body.kh-layout-elite.kh-layout-article .kh-layout-shell__main,
  body.kh-layout-elite.kh-single-elite .kh-layout-shell__main {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box;
  }

  /* Shell grid: mobile-layout-shell.css — sidebar altta / single gizli */

  /* Okuma gövdesi — Medium akıcılığı */
  body.kh-layout-elite.kh-layout-article .kh-article__reading,
  body.kh-layout-elite.kh-layout-article .entry-content,
  body.kh-single-elite .kh-article__reading--elite,
  body.kh-single-elite .entry-content,
  body.kh-single-elite .kh-v3-article .entry-content {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    font-size: 17px !important;
    line-height: 1.8 !important;
    word-break: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    hyphens: auto;
  }

  body.kh-single-elite .kh-article__reading--elite p,
  body.kh-single-elite .entry-content p,
  body.kh-single-elite .kh-article__reading--elite li,
  body.kh-single-elite .entry-content li,
  body.kh-single-elite .kh-article__reading--elite blockquote {
    max-width: 100% !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
  }

  body.kh-single-elite .kh-article__reading--elite img,
  body.kh-single-elite .entry-content img {
    max-width: 100% !important;
    height: auto;
  }

  body.kh-single-elite.kh-article-page .kh-article-header {
    width: 100%;
    max-width: 100%;
    padding: 18px 14px;
    margin-bottom: 18px;
    box-sizing: border-box;
  }

  body.kh-single-elite .kh-article-header__title {
    font-size: clamp(1.35rem, 5.5vw, 1.85rem);
    line-height: 1.25;
    word-break: normal !important;
  }

  /* Ana sayfa — tam genişlik vitrin */
  .kh-home,
  .kh-shell--v4,
  .kh-section,
  .kh-section--latest-cards,
  .kh-vitrin-grid,
  .kh-latest-cards {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .kh-latest-pro-card,
  .kh-latest-pro-card__link,
  .kh-card--glass,
  .kh-card--glass .kh-card__link {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .kh-latest-pro-card__title,
  .kh-card__title {
    word-break: normal !important;
    overflow-wrap: break-word !important;
  }

  .kh-netflix-hero {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px;
    width: 100%;
  }

  .kh-netflix-hero__main {
    min-height: 200px;
    width: 100%;
  }

  .kh-netflix-hero__side {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 12px;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    scrollbar-width: none;
  }

  .kh-netflix-hero__side::-webkit-scrollbar {
    display: none;
  }

  .kh-netflix-hero__mini {
    flex: 0 0 min(72vw, 280px);
    scroll-snap-align: start;
    min-height: 120px;
  }

  /* App-like alt navigasyon */
  .kh-bottom-nav {
    display: flex !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    justify-content: space-around;
    align-items: stretch;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    background: rgba(8, 12, 24, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
  }

  body.kh-has-bottom-nav {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .kh-bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 48px;
    padding: 4px 6px;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 12px;
    transition: color 0.2s ease, background 0.2s ease;
  }

  .kh-bottom-nav__item svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
  }

  .kh-bottom-nav__item.is-active,
  .kh-bottom-nav__item:hover,
  .kh-bottom-nav__item:focus-visible {
    color: #00d4ff;
    background: rgba(59, 130, 246, 0.18);
  }

  .kh-bottom-nav__item span {
    max-width: 72px;
    text-align: center;
    line-height: 1.2;
  }
}

@media (max-width: 560px) {
  .kh-vitrin-grid,
  .kh-latest-cards {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
}

@media (min-width: 1025px) {
  .kh-bottom-nav {
    display: none !important;
  }

  body.kh-has-bottom-nav {
    padding-bottom: 0 !important;
  }
}
