/* ==========================================================================
   Aktif TV — Genel toparlama katmanı (style.css'ten sonra yüklenir)
   Tasarımı değiştirmez; okunabilirlik, dokunma hedefleri, taşma ve
   farklı ekran boyutlarında tutarlılık sağlar.
   ========================================================================== */

:root {
    --atv-font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, "Noto Color Emoji", "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
    --atv-focus: #1d9bf0;
    --atv-tap: 40px;
}

/* --- Temel tipografi ---------------------------------------------------- */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { text-wrap: balance; }
main p, main li, main h1, main h2, main h3, main blockquote,
.post-card, .article-body, .notification-row {
    overflow-wrap: break-word;
}

/* --- Medya hiçbir ekranda taşmasın ---------------------------------------- */
img, video, iframe, svg { max-width: 100%; }
video { height: auto; }

/* --- İkonlar: tutarlı hizalama ------------------------------------------- */
svg { flex-shrink: 0; }

/* --- Klavye erişimi: görünür odak çerçevesi ------------------------------ */
:focus-visible {
    outline: 2px solid var(--atv-focus);
    outline-offset: 2px;
    border-radius: 6px;
}
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }

/* --- Tablet (daraltılmış kenar menü): taşan alt bilgi yazısını gizle ---- */
@media (min-width: 721px) and (max-width: 1180px) {
    .side-credit { display: none; }
}

/* --- Mobil ---------------------------------------------------------------- */
@media (max-width: 720px) {
    /* iOS, 16px altındaki alanlara odaklanınca sayfayı yakınlaştırır */
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    select, textarea { font-size: 16px !important; }

    /* Alt menü: dokunma hedefi ve çentikli telefonlarda güvenli alan */
    .mobile-bottom-nav a, .mobile-bottom-nav button {
        min-height: var(--atv-tap);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .mobile-bottom-nav svg { width: 24px; height: 24px; }
}

/* Çok dar telefonlar (≤360px) */
@media (max-width: 360px) {
    body { overflow-x: hidden; }
}

/* Geniş ekranlar: çok uzun satırlar okunmasın */
@media (min-width: 1600px) {
    .article-body, .reader-content { max-width: 760px; }
}

/* --- Hareket hassasiyeti ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   Uygulama (PWA) yükleme penceresi
   ========================================================================== */
.atv-install {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 480px;
    margin: 0 auto;
    padding: 12px 12px 12px 14px;
    border: 1px solid var(--line, #e5e7eb);
    border-radius: 16px;
    background: var(--bg, #fff);
    color: var(--text, #111);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .18);
    font-family: var(--atv-font-ui);
    animation: atvInstallIn .28s ease-out;
}
@keyframes atvInstallIn { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.atv-install img { width: 44px; height: 44px; border-radius: 11px; object-fit: contain; background: #fff; flex: 0 0 auto; }
.atv-install-copy { flex: 1 1 auto; min-width: 0; }
.atv-install-copy strong { display: block; font-size: 15px; line-height: 1.3; }
.atv-install-copy span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.35; color: var(--muted, #6b7280); }
.atv-install-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.atv-install-go {
    min-height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: #e11d2e;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.atv-install-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted, #6b7280);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.atv-install-steps { margin: 8px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--text, #111); }
.atv-install-steps li + li { margin-top: 2px; }
@media (min-width: 721px) {
    .atv-install { left: auto; right: 24px; bottom: 24px; margin: 0; }
}
html.dark .atv-install, body.dark .atv-install { background: #16181c; border-color: #2f3336; color: #e7e9ea; }
html.dark .atv-install-steps, body.dark .atv-install-steps { color: #e7e9ea; }

#articlePreviewModal .article-preview-headline,#articlePreviewModal .article-preview-progress{display:none}
#articlePreviewModal .article-preview-close svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
/* ===================================================================
   Haber okuma modalı v2 (masaüstü / tablet ≥721px)
   Sade, ortalanmış okuma penceresi. İki kenardan sürüklenerek iki yana
   birlikte genişler; genişlik hatırlanır. Mobil alt sayfa davranışı aynı kalır.
   =================================================================== */
@media (min-width:721px){
  body.social-app #articlePreviewModal.article-preview-modal{
    padding:24px!important;
    align-items:center!important;
    justify-content:center!important;
    background:rgba(10,12,16,.52)!important;
    -webkit-backdrop-filter:blur(6px) saturate(120%)!important;
    backdrop-filter:blur(6px) saturate(120%)!important;
  }
  body.social-app #articlePreviewModal .article-preview-panel{
    width:min(780px,calc(100vw - 48px))!important;
    max-width:calc(100vw - 32px)!important;
    height:calc(100dvh - 48px)!important;
    max-height:1040px!important;
    border:1px solid color-mix(in srgb,var(--line) 80%,transparent)!important;
    border-radius:18px!important;
    background:var(--bg)!important;
    box-shadow:0 2px 6px rgba(0,0,0,.06),0 32px 90px rgba(0,0,0,.34)!important;
    overflow:visible!important; /* tutamaçlar kenarın dışına taşabilsin */
  }
  body.social-app #articlePreviewModal.open .article-preview-panel{animation:atvArticleIn .22s cubic-bezier(.2,.8,.2,1) both}
  @keyframes atvArticleIn{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:none}}

  /* Başlık çubuğu */
  body.social-app #articlePreviewModal .article-preview-head{
    position:relative!important;
    flex:0 0 56px!important;
    min-height:56px!important;
    padding:0 12px 0 22px!important;
    gap:12px!important;
    justify-content:space-between!important;
    border-bottom:1px solid var(--line)!important;
    border-radius:18px 18px 0 0!important;
    background:color-mix(in srgb,var(--bg) 92%,transparent)!important;
  }
  body.social-app #articlePreviewModal .article-preview-sticky-author{display:none!important}
  body.social-app #articlePreviewModal .article-preview-headline{
    display:block!important;
    flex:1 1 auto;
    min-width:0;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
    font-size:15px;
    font-weight:700;
    color:var(--text);
    opacity:0;
    transform:translateY(4px);
    transition:opacity .18s ease,transform .18s ease;
  }
  body.social-app #articlePreviewModal.article-headline-visible .article-preview-headline{opacity:1;transform:none}
  body.social-app #articlePreviewModal .article-preview-head .article-preview-tools{
    width:auto!important;
    flex:0 0 auto;
    gap:6px!important;
  }
  body.social-app #articlePreviewModal .article-preview-head .article-preview-tools button{
    width:36px!important;
    height:36px!important;
    border-radius:50%!important;
    background:transparent!important;
    color:var(--text)!important;
    border:1px solid transparent!important;
    font-size:16px!important;
    transition:background-color .15s ease,border-color .15s ease!important;
  }
  body.social-app #articlePreviewModal .article-preview-head .article-preview-tools button:hover{background:var(--soft)!important;border-color:var(--line)!important}
  body.social-app #articlePreviewModal .article-preview-head .article-preview-tools button:focus-visible{outline:2px solid #1d9bf0;outline-offset:2px}
  body.social-app #articlePreviewModal .article-preview-close svg{width:20px!important;height:20px!important;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
  body.social-app #articlePreviewModal .article-preview-progress{
    display:block;
    position:absolute;left:0;bottom:-1px;height:2px;width:0;
    background:linear-gradient(90deg,#1d9bf0,#7cc4ff);
    border-radius:0 2px 2px 0;
    transition:width .08s linear;
    pointer-events:none;
  }

  /* İçerik: geniş pencerede bile metin satırı okunaklı kalsın */
  body.social-app #articlePreviewModal .article-preview-content{
    border-radius:0 0 18px 18px!important;
    scroll-behavior:smooth;
    scrollbar-width:thin;
    scrollbar-color:color-mix(in srgb,var(--muted) 40%,transparent) transparent;
  }
  body.social-app #articlePreviewModal .article-preview-content::-webkit-scrollbar{width:8px}
  body.social-app #articlePreviewModal .article-preview-content::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--muted) 35%,transparent);border-radius:8px}
  body.social-app #articlePreviewModal .article-preview-content .article-reader{
    width:100%!important;
    max-width:none!important;
    padding:6px 0 28px!important;
  }
  body.social-app #articlePreviewModal .article-preview-content .article-reader>*{
    max-width:720px;
    margin-left:auto!important;
    margin-right:auto!important;
    padding-left:32px;
    padding-right:32px;
    box-sizing:border-box;
  }
  body.social-app #articlePreviewModal .article-preview-content .article-reader>h1{
    margin-top:18px!important;
    margin-bottom:14px!important;
    font-size:var(--reader-title-size,30px)!important;
    line-height:1.2!important;
    letter-spacing:-.015em;
    text-wrap:balance;
  }
  body.social-app #articlePreviewModal .article-preview-content .article-author{margin-top:14px!important}
  body.social-app #articlePreviewModal .article-preview-content .article-body{
    font-size:var(--reader-body-size,18px)!important;
    line-height:1.72!important;
  }
  body.social-app #articlePreviewModal .article-preview-content .article-body p{margin:0 0 1.05em}
  /* Görsel metin sütunundan biraz daha geniş olabilir */
  body.social-app #articlePreviewModal .article-preview-content .article-reader>.article-image,
  body.social-app #articlePreviewModal .article-preview-content .article-reader>.article-image-swipe-wrap,
  body.social-app #articlePreviewModal .article-preview-content .article-reader>.post-media-gallery{
    max-width:min(880px,calc(100% - 40px))!important;
    padding:0!important;
    border-radius:12px!important;
    background:transparent!important;
    overflow:hidden;
    margin-top:6px!important;
    margin-bottom:18px!important;
  }
  body.social-app #articlePreviewModal .article-preview-content .article-preview-light>.post-media-gallery{
    width:calc(100% - 40px)!important;
    max-width:880px!important;
    margin:4px auto 20px!important;
    padding:0!important;
    border-radius:12px!important;
    background:transparent!important;
  }
  body.social-app #articlePreviewModal .article-preview-content .article-preview-light>.post-media-gallery .article-image{
    width:100%!important;
    margin:0!important;
    border-radius:12px!important;
  }
  body.social-app #articlePreviewModal .article-preview-content .article-reader>.article-image{display:block;width:100%!important;min-height:0;background:var(--soft)}
  body.social-app #articlePreviewModal .article-preview-content .article-social-panel{
    max-width:720px!important;
    width:auto!important;
    margin:8px auto 0!important;
    padding-left:32px!important;
    padding-right:32px!important;
    border-top:1px solid var(--line);
  }

  /* Kenar tutamaçları: yalnızca üzerine gelince belirginleşir */
  body.social-app #articlePreviewModal .article-resize-handle{
    display:block!important;
    top:56px!important;
    bottom:18px!important;
    width:18px!important;
    z-index:12!important;
    cursor:ew-resize!important;
  }
  body.social-app #articlePreviewModal .article-resize-handle.is-right{right:-9px!important;left:auto!important}
  body.social-app #articlePreviewModal .article-resize-handle.is-left{left:-9px!important;right:auto!important}
  body.social-app #articlePreviewModal .article-resize-handle::after{content:none!important}
  body.social-app #articlePreviewModal .article-resize-handle::before{
    content:""!important;
    position:absolute!important;
    top:50%!important;left:50%!important;
    width:6px!important;height:56px!important;
    transform:translate(-50%,-50%)!important;
    border:0!important;
    border-radius:6px!important;
    background:color-mix(in srgb,var(--muted) 35%,transparent)!important;
    box-shadow:none!important;
    opacity:.55;
    transition:opacity .15s ease,background .15s ease,height .15s ease!important;
  }
  body.social-app #articlePreviewModal .article-resize-handle:hover::before,
  body.social-app.article-modal-resizing #articlePreviewModal .article-resize-handle::before{
    opacity:1;height:84px!important;background:#1d9bf0!important;
  }
  body.social-app #articlePreviewModal .article-swipe-guide{display:none!important}
}
@media (max-width:720px){
  body.social-app #articlePreviewModal .article-preview-headline,
  body.social-app #articlePreviewModal .article-preview-progress,
  body.social-app #articlePreviewModal .article-resize-handle{display:none!important}
}
@media (min-width:721px) and (max-height:620px){
  body.social-app #articlePreviewModal.article-preview-modal{padding:10px!important}
  body.social-app #articlePreviewModal .article-preview-panel{height:calc(100dvh - 20px)!important}
}
@media (min-width:721px) and (prefers-reduced-motion:reduce){
  body.social-app #articlePreviewModal.open .article-preview-panel{animation:none}
}

/* ---------- Sağ sütun: taşma ve "Kimi takip etmeli" kutusu ----------
   Sütun ekran yüksekliğinde sabit; içerik uzarsa kendi içinde kayar ama
   kaydırma çubuğu görünmez. Kutu sıkışmasın diye iç boşluklar ve başlık
   küçültüldü, "Takip et" ismin yanına alındı. */
body.social-app .right-rail{scrollbar-width:none;-ms-overflow-style:none;padding-bottom:32px!important;overscroll-behavior:contain}
body.social-app .right-rail::-webkit-scrollbar{width:0;height:0;display:none}
body.social-app .right-rail>h2{padding-left:0!important;padding-right:0!important}
body.social-app .rail-profile-suggestions{padding:14px 14px 10px!important;border-radius:16px!important;overflow:hidden}
body.social-app .rail-profile-suggestions>h2{margin:0 0 10px!important;padding:0!important;font-size:18px!important;font-weight:800!important;line-height:1.25!important;overflow-wrap:anywhere}
body.social-app .rail-profile-suggestions-list{gap:4px!important}
body.social-app .rail-profile-suggestions-list .article-discovery-profile-card{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;gap:8px!important;padding:6px 0!important}
body.social-app .rail-profile-suggestions-list .article-discovery-profile-link{min-width:0!important;column-gap:10px!important}
body.social-app .rail-profile-suggestions-list .article-discovery-profile-link>img{width:40px!important;height:40px!important}
body.social-app .rail-profile-suggestions-list .inline-follow-form{margin:0!important}
body.social-app .rail-profile-suggestions-list .follow-button{align-items:center!important;justify-content:center!important;min-height:30px!important;padding:0 12px!important;border-radius:999px!important;background:var(--text)!important;color:var(--bg)!important;font-size:12px!important;font-weight:700!important;white-space:nowrap!important;line-height:1!important}
body.social-app .rail-profile-suggestions-list .follow-button.is-following{background:transparent!important;color:var(--muted)!important;border:1px solid var(--line)!important}
body.social-app .rail-profile-suggestions .article-discovery-profile-more{display:block;margin-top:6px!important;padding:6px 0 2px!important;font-size:13px!important}

/* ---------- Abonelik sistemi kaldırıldı: kalan abonelik butonları ve tanıtımları gizli ---------- */
body.social-app .subscription-primary-button,
body.social-app .article-subscription-promo,
body.social-app .article-subscription-thanks{display:none!important}

/* ---------- Mobil alt çubuk: Keşfet kaldırıldı (4 sekme), ikonlar biraz büyük ---------- */
@media (max-width:720px){
  html body.social-app .mobile-bottom-nav,html body.social-app.video-mode .mobile-bottom-nav,html body.social-app:not(.x) .mobile-bottom-nav{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  body.social-app .mobile-bottom-nav .mobile-bottom-item>span svg{width:27px!important;height:27px!important}
  body.social-app .mobile-bottom-nav .mobile-bottom-item>span .mobile-bottom-avatar{width:29px!important;height:29px!important}
  body.social-app .mobile-bottom-nav .mobile-bottom-item>b{font-size:11px!important;margin-top:2px}
}
body.social-app .premium-channel-badge{display:none!important}
