/* ============================================================
 * oylarim.com — Mobil tasarım override'ları
 * Tüm sayfa-bağımsız mobil kurallar burada toplanır.
 * site.css ve secim2028.css'ten SONRA yüklenir → istediği şeyi override eder.
 * ============================================================ */

/* iOS Safari için tap-highlight'ı yumuşat */
html {
  -webkit-tap-highlight-color: rgba(30,58,138,0.15);
}

/* Yatay scroll engelle (root-level) */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Min. dokunma alanı: WCAG 2.1 AAA = 44x44px */
@media (pointer: coarse) {
  .btn, .btn-primary, .btn-secondary, .btn-ghost,
  .nav-drawer-link, .site-nav-desktop a,
  .quick-vote-row, .party-vote-btn,
  .iys-check input,
  .vote-cand,
  .ed-section-strip a,
  .s28-mobilebar, .s28-cta-ghost {
    min-height: 44px;
  }
}

/* ============================================================
 * ≤ 920px — tablet to large mobile
 * ============================================================ */
@media (max-width: 920px) {

  /* Container padding compress */
  .container, .container--wide {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* Header tighter, burger görünür */
  .site-header { height: 56px; }
  .site-header .inner { height: 56px; gap: 8px; }
  .site-header-mark { display: none; }      /* "Civic Press" mark gizle */
  .site-nav-desktop { display: none; }       /* burger drawer'a düş */
  .nav-burger { display: flex !important; align-items: center; justify-content: center; }

  /* Hero v6 — magazine cover */
  .hero { padding: 22px 0 32px !important; }
  .hero-cover {
    grid-template-columns: 1fr !important;
    gap: 22px !important;
  }
  .hero-headline {
    font-size: clamp(28px, 8.5vw, 38px) !important;
    line-height: 1.08 !important;
  }
  .hero-strap {
    font-size: clamp(14px, 4vw, 17px) !important;
    margin-top: 12px !important;
  }
  .hero-lede {
    font-size: 13.5px !important;
    line-height: 1.6 !important;
  }
  .hero-ctas { flex-direction: column; gap: 10px !important; }
  .hero-ctas .btn { width: 100%; justify-content: center; }

  .hero-side { display: none; }              /* mobilde editör notu gizle, hero hafifsin */
  .hero-front-divider { margin: 24px 0 14px !important; }
  .hero-front-divider span { font-size: 11px !important; }

  /* Ön sayfa 3-kart grid → stack */
  .ed-front {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .ed-front-card { padding: 18px !important; }
  .ed-front-tag { font-size: 10px !important; }
  .ed-front-head { font-size: 19px !important; }

  /* Section heads */
  .ed-headline, .ed-headline.ed-headline-section {
    font-size: clamp(24px, 6vw, 32px) !important;
  }
  .ed-headline-sm {
    font-size: 13px !important;
    line-height: 1.5 !important;
  }
  .ed-kicker {
    font-size: 10.5px !important;
    letter-spacing: 0.14em !important;
  }
  .ed-byline {
    font-size: 11.5px !important;
    flex-wrap: wrap !important;
  }

  /* Section-strip nav (chip row) horizontal scroll */
  .ed-section-strip {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    margin-bottom: 14px !important;
  }
  .ed-section-strip::-webkit-scrollbar { display: none; }
  .ed-section-strip a {
    flex-shrink: 0;
    padding: 8px 14px !important;
    font-size: 12.5px !important;
  }

  /* Footer */
  .site-footer { padding: 40px 0 28px !important; }
  .site-footer .grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 24px 20px !important;
    margin-bottom: 24px !important;
  }
  .site-footer h5 { font-size: 12px !important; margin-bottom: 12px !important; }
  .site-footer a { font-size: 13px !important; padding: 5px 0 !important; }
  .site-footer .bot {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px !important;
    text-align: left;
    font-size: 12px !important;
  }
}

/* ============================================================
 * ≤ 640px — phone portrait
 * ============================================================ */
@media (max-width: 640px) {

  /* Hero — tek sütun, ekstra sıkı */
  .hero { padding: 18px 0 26px !important; }
  .hero-headline {
    font-size: clamp(26px, 9vw, 34px) !important;
  }
  .hero-strap { font-size: 14.5px !important; }
  .hero-lede { font-size: 13px !important; }
  .hero-ctas .btn { padding: 13px 16px !important; font-size: 13.5px !important; }

  /* Magazine front-page */
  .ed-front-card { padding: 16px !important; }
  .ed-front-tag { font-size: 9.5px !important; padding: 3px 8px !important; }
  .ed-front-head { font-size: 17px !important; }
  .ed-front-body { font-size: 12.5px !important; }

  /* Section spacing */
  .section { padding: 28px 0 !important; }
  .section-head { margin-bottom: 22px !important; }

  /* Drawer link target sized */
  .nav-drawer-link {
    padding: 14px 18px !important;
    font-size: 15px !important;
  }
  .nav-drawer-section { padding: 14px 18px 6px !important; font-size: 10px !important; }

  /* Kategori sayfası ed-front grid → tek sütun */
  .ed-list-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .ed-card { padding: 16px !important; }
  .ed-card h3 { font-size: 16px !important; }

  /* Footer 1-col */
  .site-footer .grid {
    grid-template-columns: 1fr !important;
    gap: 22px !important;
  }
  .site-footer .grid > div:first-child { text-align: center; }
  .site-footer .social { justify-content: center; }
}

/* ============================================================
 * ≤ 380px — small phone (iPhone SE etc.)
 * ============================================================ */
@media (max-width: 380px) {
  .container, .container--wide {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .hero-headline { font-size: 24px !important; }
  .hero-strap { font-size: 13px !important; }
  .hero-lede { font-size: 12.5px !important; }
  .hero-ctas .btn { padding: 12px 14px !important; font-size: 13px !important; }

  .ed-front-head { font-size: 16px !important; }
  .section-head h2 { font-size: 19px !important; }

  /* Quick vote rows (secim2028) */
  .quick-vote { padding: 14px 12px !important; }
  .quick-vote-q { font-size: 14.5px !important; }
  .quick-vote-row { padding: 8px 10px !important; gap: 8px !important; }
  .qv-name strong { font-size: 12.5px !important; }
  .qv-name small { font-size: 10.5px !important; }
  .qv-pct { font-size: 12.5px !important; }
}

/* ============================================================
 * Touch-active state — feedback on tap
 * ============================================================ */
@media (hover: none) {
  .btn:active,
  .btn-primary:active,
  .btn-secondary:active,
  .ed-front-card:active,
  .ed-card:active,
  .quick-vote-row:active:not([disabled]),
  .nav-drawer-link:active {
    opacity: 0.85;
    transform: scale(0.985);
  }
  .ed-front-card, .ed-card, .btn, .nav-drawer-link {
    transition: opacity 100ms, transform 100ms;
  }
}

/* ============================================================
 * Modal — secim2028 hızlı oy
 * (qv-modal CSS zaten secim2028.css'te, sadece edge case'leri sağlamlaştır)
 * ============================================================ */
@media (max-width: 480px) {
  .qv-modal-card { max-height: 96vh !important; }
  .qv-modal-head { padding: 14px 16px !important; }
  .qv-modal-avatar { width: 40px !important; height: 40px !important; font-size: 14px !important; }
  .qv-modal-cand-line { font-size: 15px !important; }
  .qv-modal-body { padding: 14px 16px 18px !important; }
  .qv-step-title { font-size: 17px !important; }
  .qv-step-desc { font-size: 12.5px !important; margin-bottom: 14px !important; }
  .qv-otp-grid { gap: 5px !important; }
  .qv-otp-grid input {
    padding: 11px 0 !important;
    font-size: 18px !important;
  }
  .qv-phone-cc { padding: 11px 12px !important; font-size: 13.5px !important; }
  .qv-phone-input input { padding: 11px 12px !important; font-size: 16px !important; }
}

/* ============================================================
 * Safe-area inset (notch'lu cihazlar)
 * ============================================================ */
@supports (padding: env(safe-area-inset-bottom)) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .nav-drawer {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .qv-modal-card {
    padding-bottom: max(env(safe-area-inset-bottom), 18px);
  }
}

/* ============================================================
 * Prefer-reduced-motion accessibility
 * ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
