/* ==========================================================================
   NO SUBTITLE — COMPREHENSIVE MOBILE OPTIMIZATION SYSTEM (mobile.css)
   Keskin neo-brutalist estetik, mobil tabanlı sabit alt menü (bottom navigation),
   sıfır metin taşması, kusursuz hizalama ve akıcı dokunmatik deneyim.
   ========================================================================== */

/* ── 1. KATI TAŞMA VE SIFIRLAMA KURALLARI (ANTI-OVERFLOW RESET) ── */
*, *::before, *::after {
  box-sizing: border-box !important;
  border-radius: 0 !important;
}

html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  position: relative;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* Tüm metinlerin ekrandan taşmasını ve kelime patlamalarını %100 engelle */
h1, h2, h3, h4, h5, h6,
p, span, a, label, li, blockquote, dt, dd,
.neo-heading, .neo-title, .hero-title, .page-hero h1 {
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
  max-width: 100% !important;
}

/* Linkler ve e-posta adresleri gibi uzun tek parça metinler */
a[href^="mailto:"],
a[href^="http://"],
a[href^="https://"],
.break-all {
  word-break: break-all !important;
}

/* Medya elemanlarının konteynerı taşırmasını engelle */
img, video, embed, object, canvas, svg {
  max-width: 100% !important;
  height: auto;
  display: block;
}

iframe {
  max-width: 100%;
}

/* Flipbook / Reader Modal Iframe Düzeltmesi */
#flipbook-wrapper,
#flipbook-container {
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  flex: 1 1 auto !important;
  display: flex !important;
}

#flipbook-container iframe {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  border: 0 !important;
  outline: none !important;
  display: block !important;
}

/* ── 2. DOKUNMATİK HEDEFLER & ERİŞİLEBİLİRLİK ── */
button, a, input, select, textarea {
  touch-action: manipulation;
}

.lang-btn, #menu-btn, .filter-tab, .modal-close, .ep-close {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── 3. MOBİL SABİT ALT MENÜ (MOBILE-ONLY BOTTOM NAVIGATION) ── */
/* Masaüstü ekranlarda tamamen gizli */
.neo-bottom-nav {
  display: none !important;
}

/* 767px ve altı mobil ekranlar */
@media (max-width: 767px) {
  .neo-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: calc(58px + max(6px, env(safe-area-inset-bottom, 0px))) !important;
    padding-bottom: max(6px, env(safe-area-inset-bottom, 0px)) !important;
    background: #0A0A0A !important;
    border-top: 3px solid #E10600 !important;
    box-shadow: 0 -4px 0 #0A0A0A !important;
    z-index: 9999 !important;
    align-items: stretch !important;
    justify-content: space-around !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    overflow: hidden !important;
  }

  .neo-bottom-nav .bottom-nav-item {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    padding: 6px 2px !important;
    text-decoration: none !important;
    color: #F5F0E6 !important;
    font-family: 'Space Mono', 'JetBrains Mono', monospace !important;
    font-size: 9.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    position: relative !important;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .neo-bottom-nav .bottom-nav-item i {
    font-size: 17px !important;
    line-height: 1 !important;
    transition: transform 0.15s ease, color 0.15s ease !important;
  }

  .neo-bottom-nav .bottom-nav-item span {
    font-size: 9px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    display: block !important;
  }

  /* Aktif Menü Sekmesi */
  .neo-bottom-nav .bottom-nav-item.active {
    color: #E10600 !important;
    background: rgba(225, 6, 0, 0.12) !important;
  }

  .neo-bottom-nav .bottom-nav-item.active::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 15% !important;
    right: 15% !important;
    height: 3px !important;
    background: #E10600 !important;
  }

  .neo-bottom-nav .bottom-nav-item.active i {
    transform: translateY(-1px) !important;
    color: #E10600 !important;
  }

  .neo-bottom-nav .bottom-nav-item:active {
    transform: scale(0.92) !important;
    background: rgba(225, 6, 0, 0.25) !important;
  }

  /* Sayfa içeriklerinin ve footer'ın alt menü altında kalmasını önle */
  body {
    padding-bottom: calc(68px + max(8px, env(safe-area-inset-bottom, 0px))) !important;
  }

  /* Başa Dön butonunu alt menünün hemen üstüne güvenle konumlandır */
  #neo-back-to-top {
    bottom: calc(72px + max(8px, env(safe-area-inset-bottom, 0px))) !important;
    right: 1rem !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 1.1rem !important;
    z-index: 9990 !important;
  }
}

/* ── 4. MOBİL NAVBAR & ÜST MENÜ ── */
@media (max-width: 767px) {
  #navbar {
    padding-left: max(1rem, env(safe-area-inset-left)) !important;
    padding-right: max(1rem, env(safe-area-inset-right)) !important;
  }

  #mobile-menu {
    border-radius: 0 !important;
    background: #0A0A0A !important;
    box-shadow: 0 8px 0 #0A0A0A !important;
    border: 3px solid #0A0A0A !important;
    border-top: 4px solid #E10600 !important;
    overflow: hidden !important;
    transition: max-height 0.25s linear, opacity 0.2s linear !important;
  }

  #mobile-menu.open {
    max-height: 480px !important;
    opacity: 1 !important;
  }

  #mobile-menu:not(.open) {
    max-height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  #mobile-menu ul li a {
    padding: 0.85rem 0.75rem !important;
    font-size: 0.9rem !important;
    font-family: 'Space Mono', monospace !important;
    text-transform: uppercase !important;
    letter-spacing: 0.15em !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-bottom: 1px solid #262626 !important;
    color: #F5F0E6 !important;
  }

  #mobile-menu ul li a:active,
  #mobile-menu ul li a:hover {
    background: rgba(225, 6, 0, 0.15) !important;
    color: #E10600 !important;
  }
}

/* ── 5. BAŞLIK VE METİN HİZALAMA KONTROLLERİ (MOBİL) ── */
@media (max-width: 767px) {
  /* Sayfa Üst Başlıkları (Hero) */
  .page-hero {
    padding-top: calc(5.5rem + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: 2.75rem !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
    overflow: hidden !important;
    clip-path: none !important;
    border-bottom: 4px solid #0A0A0A !important;
  }

  .page-hero h1 {
    font-size: clamp(2rem, 9.5vw, 3.2rem) !important;
    line-height: 1.05 !important;
    letter-spacing: -0.02em !important;
  }

  .page-hero p {
    font-size: 0.95rem !important;
    margin-top: 0.75rem !important;
    line-height: 1.5 !important;
  }

  /* Ana Sayfa Hero */
  .hero-clip {
    clip-path: none !important;
    padding-top: calc(5.5rem + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: 3.5rem !important;
    min-height: auto !important;
    border-bottom: 4px solid #0A0A0A !important;
    overflow: hidden !important;
  }

  .hero-title {
    font-size: clamp(2.1rem, 11vw, 3.8rem) !important;
    letter-spacing: -0.03em !important;
    line-height: 0.98 !important;
  }

  .hero-chevron {
    display: none !important;
  }

  /* Genel Bölüm Başlıkları (h2, h3) */
  h2, .neo-card h2, section h2 {
    font-size: clamp(1.45rem, 6.5vw, 2.3rem) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.02em !important;
  }

  h3, .neo-card h3 {
    font-size: clamp(1.15rem, 4.8vw, 1.55rem) !important;
    line-height: 1.25 !important;
  }

  /* Rozet ve Etiketler */
  .neo-section-tag {
    font-size: 0.7rem !important;
    letter-spacing: 0.12em !important;
  }

  .pill {
    max-width: 100% !important;
    white-space: normal !important;
  }

  /* Arka Plan Watermark Taşmasını Önle */
  .neo-watermark {
    max-width: 100vw !important;
    overflow: hidden !important;
    pointer-events: none !important;
    opacity: 0.02 !important;
    font-size: clamp(4rem, 20vw, 10rem) !important;
  }
}

/* ── 6. BÖLÜM DOLGULARI VE BOŞLUKLAR (RESPONSIVE SPACING) ── */
@media (max-width: 767px) {
  .py-28 { padding-top: 3.25rem !important; padding-bottom: 3.25rem !important; }
  .py-24 { padding-top: 2.75rem !important; padding-bottom: 2.75rem !important; }
  .py-20 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
  .py-16 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
  .py-14 { padding-top: 1.75rem !important; padding-bottom: 1.75rem !important; }
  .py-10 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }

  .px-6, .px-5 {
    padding-left: max(1rem, env(safe-area-inset-left)) !important;
    padding-right: max(1rem, env(safe-area-inset-right)) !important;
  }

  /* Konteynerların genişliği %100'ü geçemez */
  .max-w-7xl,
  .max-w-6xl,
  .max-w-5xl,
  .max-w-4xl,
  .max-w-3xl,
  .max-w-2xl,
  .max-w-xl {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* ── 7. KARTLAR VE GÖLGE DENGESİ (ZERO HORIZONTAL BLEED) ── */
@media (max-width: 767px) {
  /* Ekranın dışına taşmayı önlemek için sert gölgeleri mobilde 4px ile sınırla */
  .neo-card,
  .member-card,
  .feature-card,
  .stat-card,
  .event-card,
  .social-card,
  .timeline-card,
  [class*="shadow-[8px_8px_0"],
  [class*="shadow-[6px_6px_0"] {
    box-shadow: 4px 4px 0 #0A0A0A !important;
    max-width: 100% !important;
    border-width: 3px !important;
  }

  .neo-card,
  .feature-card,
  .event-card,
  .social-card {
    padding: 1.25rem !important;
  }

  .member-card {
    padding: 1.25rem 1rem !important;
    text-align: center !important;
  }

  .mag-card {
    padding: 0 !important;
    border: 3px solid #0A0A0A !important;
    box-shadow: 4px 4px 0 #0A0A0A !important;
    max-width: 100% !important;
  }

  .card-icon {
    width: 44px !important;
    height: 44px !important;
    margin-bottom: 0.75rem !important;
  }
}

/* ── 8. GRİD VE SÜTUN DÜZENLERİ (TEK SÜTUN GEÇİŞİ) ── */
@media (max-width: 640px) {
  .grid.md\:grid-cols-3,
  .grid.sm\:grid-cols-2.lg\:grid-cols-3,
  .grid.md\:grid-cols-4,
  #events-grid,
  .member-grid,
  .magazine-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  /* İstatistikler 2'li düzen */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.85rem !important;
  }

  .stat-card {
    padding: 1.1rem 0.5rem !important;
  }

  .stat-card p[id^="stat-val"] {
    font-size: 1.85rem !important;
  }

  /* Sosyal Medya 2'li düzen */
  .social-grid,
  .grid.grid-cols-1.sm\:grid-cols-2.lg\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.85rem !important;
  }

  .social-card {
    padding: 1rem 0.5rem !important;
  }

  .social-icon {
    width: 42px !important;
    height: 42px !important;
    font-size: 1.2rem !important;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .magazine-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ── 9. BUTONLAR & CTA ELEMANLARI (TAM GENİŞLİK VE ESNEKLİK) ── */
@media (max-width: 520px) {
  .hero-actions,
  .cta-actions,
  .modal-actions {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.75rem !important;
  }

  .hero-actions a,
  .cta-actions a,
  .hero-actions button,
  .cta-actions button,
  .neo-btn,
  .btn-neo {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .cta-band h2 {
    font-size: clamp(1.6rem, 7.5vw, 2.2rem) !important;
  }
}

/* ── 10. FİLTRE SEKMELERİ (MOBİL YATAY KAYDIRMA VE HİZALAMA) ── */
@media (max-width: 520px) {
  .filter-tabs-wrapper {
    overflow-x: auto !important;
    white-space: nowrap !important;
    padding-bottom: 0.5rem !important;
    -webkit-overflow-scrolling: touch !important;
    justify-content: center !important;
    gap: 0.4rem !important;
    width: 100% !important;
  }

  .filter-tab {
    padding: 0.5rem 0.85rem !important;
    font-size: 0.75rem !important;
    flex-shrink: 0 !important;
    border: 2px solid #0A0A0A !important;
    box-shadow: 2px 2px 0 #0A0A0A !important;
  }
}

/* ── 11. ÖNE ÇIKAN DERGİ BLOĞU (MOBİL HİZALAMA) ── */
@media (max-width: 767px) {
  #featured-cover-trigger {
    width: 180px !important;
    margin: 0 auto !important;
  }

  .-mt-8 {
    margin-top: -1rem !important;
  }
}

/* ── 12. MODALLAR VE POPUP'LAR (MOBİL KORUMASI) ── */
#events-popup,
.gallery-content,
.modal-content,
#reader-modal .modal-container {
  border-radius: 0 !important;
  border: 3px solid #0A0A0A !important;
  box-shadow: 4px 4px 0 #0A0A0A !important;
  max-width: calc(100vw - 2rem) !important;
  width: 100% !important;
}

@media (max-width: 520px) {
  #events-popup {
    margin: 1rem !important;
  }

  .ep-header { padding: 1rem 1.1rem 0.85rem !important; }
  .ep-title { font-size: 1.2rem !important; }
  .ep-body { padding: 0.9rem 1.1rem !important; font-size: 0.88rem !important; }
  .ep-footer {
    padding: 0.9rem 1.1rem 1.1rem !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
  }

  .ep-btn-primary, .ep-btn-ghost {
    width: 100% !important;
    text-align: center !important;
    padding: 0.8rem 1rem !important;
    justify-content: center !important;
    border: 3px solid #0A0A0A !important;
    box-shadow: 3px 3px 0 #0A0A0A !important;
  }

  #member-modal .modal-content {
    margin: 1rem auto !important;
    padding: 1.25rem !important;
    max-width: calc(100vw - 2rem) !important;
  }

  #modal-avatar {
    width: 120px !important;
    height: 120px !important;
    font-size: 2.6rem !important;
    border: 3px solid #0A0A0A !important;
  }
}

/* ── 13. DOKUNMATİK EKRAN BASILMA HİSSİ (TACTILE FEEDBACK) ── */
@media (hover: none) {
  .neo-btn:active,
  .btn-neo:active,
  button:active,
  .filter-tab:active,
  .social-card:active {
    transform: translate(2px, 2px) !important;
    box-shadow: 2px 2px 0 #0A0A0A !important;
  }
}

/* ── 14. NEO-TAPE (WASHi BANT) MOBİL VE GENEL KORUMA ── */
.neo-tape {
  width: auto !important;
  min-width: 80px !important;
  max-width: 90% !important;
  white-space: nowrap !important;
  padding: 0 12px !important;
  font-size: 0.64rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}

