/**
 * Haber detay sayfası — bağımsız layout
 * Site geneli: --max 1220px, layout-2col mantığı
 * Sol okuma alanı + sağ paneller dengeli oran
 */

/* ---- Sayfa zemin ---- */
body[data-page="article"] {
  background: var(--bg) !important;
}

body[data-page="article"] .article-page,
body[data-page="article"] main.article-hero {
  width: min(100% - 2rem, var(--max, 1220px));
  margin-inline: auto;
  padding-top: 1rem;
  padding-bottom: 2.5rem;
  box-sizing: border-box;
}

/* Breadcrumb sade */
body[data-page="article"] .article-page-crumb,
body[data-page="article"] .breadcrumb {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  width: auto !important;
  max-width: 100%;
  margin: 0 0 1rem !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  font-size: 0.82rem;
  color: var(--muted);
}
body[data-page="article"] .breadcrumb a {
  font-weight: 600;
  color: var(--muted);
}
body[data-page="article"] .breadcrumb a:hover {
  color: var(--red);
}

/* ---- ANA GRID: site layout-2col ile aynı dil, daha geniş yan sütun ---- */
body[data-page="article"] .article-page-grid,
body[data-page="article"] .article-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 400px !important;
  gap: 1.75rem !important;
  align-items: start !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
}

/* Eski flex kurallarını ez */
body[data-page="article"] .article-layout > .article-main,
body[data-page="article"] .article-layout > article.article-main,
body[data-page="article"] .article-main,
body[data-page="article"] .article-page-main {
  display: block !important;
  flex: unset !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
}

body[data-page="article"] .article-layout > aside.article-sidebar,
body[data-page="article"] .article-sidebar,
body[data-page="article"] .article-page-side {
  display: flex !important;
  flex-direction: column !important;
  flex: unset !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  position: sticky !important;
  top: calc(var(--header-h, 76px) + 0.85rem) !important;
  align-self: start !important;
  gap: 1rem !important;
  height: fit-content !important;
  max-height: calc(100vh - var(--header-h, 76px) - 1.4rem) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  z-index: 3;
  box-sizing: border-box;
}

/* ---- Sol: tek parça haber kartı ---- */
body[data-page="article"] .article-story {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
  margin: 0 0 1rem;
  box-shadow: 0 8px 24px rgba(15, 20, 25, 0.05);
}

body[data-page="article"] .article-header,
body[data-page="article"] .article-cover,
body[data-page="article"] .article-body,
body[data-page="article"] .article-lead {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  margin: 0 !important;
}

body[data-page="article"] .article-header {
  padding: 1.2rem 1.35rem 0.75rem !important;
  overflow: visible !important;
}
body[data-page="article"] .article-header::before {
  display: none !important;
}
body[data-page="article"] .article-header h1 {
  max-width: none !important;
  margin: 0.5rem 0 0.75rem !important;
  font-size: clamp(1.5rem, 2.8vw, 2.25rem) !important;
  line-height: 1.22 !important;
  letter-spacing: -0.03em !important;
  color: var(--ink);
}
body[data-page="article"] .article-header .cat-badge {
  box-shadow: none !important;
}
body[data-page="article"] .article-meta-bar {
  margin: 0 !important;
  padding: 0.65rem 0 0.85rem !important;
  border: 0 !important;
  border-top: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: transparent !important;
}
body[data-page="article"] .article-cover {
  width: 100%;
  line-height: 0;
  background: color-mix(in srgb, var(--bg) 50%, var(--surface));
}
body[data-page="article"] .article-cover img {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: min(48vh, 460px) !important;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0 !important;
  box-shadow: none !important;
}
body[data-page="article"] .article-caption {
  margin: 0;
  padding: 0.5rem 1.35rem 0;
  font-size: 0.8rem;
  color: var(--muted);
}
body[data-page="article"] .article-lead {
  padding: 1rem 1.35rem 0.25rem !important;
  font-size: 1.05rem !important;
  line-height: 1.6 !important;
  color: var(--ink-2) !important;
  font-weight: 500 !important;
  max-width: none !important;
}
body[data-page="article"] .article-lead:empty {
  display: none !important;
  padding: 0 !important;
}
body[data-page="article"] .article-body {
  padding: 0.85rem 1.35rem 1.4rem !important;
  font-size: 1.08rem !important;
  line-height: 1.8 !important;
  color: var(--ink-2) !important;
}
body[data-page="article"] .article-body img {
  border-radius: 12px !important;
  box-shadow: none !important;
  max-height: min(60vh, 500px);
}

/* Alt bloklar (araçlar / yorum / ilgili) */
body[data-page="article"] .article-actions,
body[data-page="article"] .comments,
body[data-page="article"] .related-section,
body[data-page="article"] .article-reactions {
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  background: var(--surface) !important;
  box-shadow: none !important;
  margin-top: 0.9rem !important;
}
body[data-page="article"] .article-actions {
  padding: 0.6rem 0.85rem !important;
}
body[data-page="article"] .comments,
body[data-page="article"] .related-section,
body[data-page="article"] .article-reactions {
  padding: 1.1rem 1.2rem !important;
}
body[data-page="article"] .article-tags {
  margin: 0.75rem 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* ---- Sağ panel: sol ile aynı görsel dil, daha dolgun ---- */
body[data-page="article"] .article-side-panel {
  display: flex !important;
  flex-direction: column !important;
  gap: 1rem !important;
  width: 100% !important;
}

body[data-page="article"] .article-side-card {
  width: 100% !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  background: var(--surface) !important;
  box-shadow: 0 8px 24px rgba(15, 20, 25, 0.05) !important;
  overflow: hidden;
}

/* Trend kartı */
body[data-page="article"] .article-side-popular {
  color: var(--ink) !important;
  background:
    radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--red) 14%, transparent), transparent 58%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, var(--bg)), var(--surface)) !important;
}
body[data-page="article"] .article-side-popular::before {
  display: none !important;
}
body[data-page="article"] .article-side-popular-head {
  padding: 1.15rem 1.15rem 0.7rem !important;
}
body[data-page="article"] .article-side-popular-head .article-side-kicker {
  color: var(--red) !important;
  font-size: 0.72rem !important;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
body[data-page="article"] .article-side-popular-head h2 {
  margin: 0.35rem 0 0.35rem !important;
  color: var(--ink) !important;
  font-family: var(--font) !important;
  font-size: 1.35rem !important;
  font-weight: 900 !important;
  line-height: 1.15 !important;
  letter-spacing: -0.03em;
}
body[data-page="article"] .article-side-popular-head p {
  margin: 0 !important;
  color: var(--muted) !important;
  font-size: 0.9rem !important;
  line-height: 1.45 !important;
}

body[data-page="article"] .article-side-popular-list {
  display: grid !important;
  gap: 0.7rem !important;
  padding: 0 0.95rem 1rem !important;
}

/* Popüler satırlar */
body[data-page="article"] .article-popular-link {
  display: grid !important;
  grid-template-columns: 42px 96px minmax(0, 1fr) !important;
  gap: 0.75rem !important;
  align-items: center !important;
  min-width: 0;
  padding: 0.7rem !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  background: color-mix(in srgb, var(--bg) 55%, var(--surface)) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
  text-decoration: none !important;
}
body[data-page="article"] .article-popular-link.is-lead {
  grid-template-columns: 1fr !important;
  padding: 0.75rem !important;
}
body[data-page="article"] .article-popular-link:hover {
  border-color: color-mix(in srgb, var(--red) 35%, var(--line)) !important;
  background: var(--surface) !important;
  transform: none !important;
}

body[data-page="article"] .article-popular-rank {
  display: grid !important;
  place-items: center;
  width: 42px !important;
  height: 42px !important;
  border-radius: 12px !important;
  background: var(--red) !important;
  color: #fff !important;
  font-size: 0.9rem !important;
  font-weight: 900 !important;
  box-shadow: none !important;
}
body[data-page="article"] .article-popular-link.is-lead .article-popular-rank {
  position: absolute !important;
  top: 0.85rem !important;
  left: 0.85rem !important;
  z-index: 2;
  width: 44px !important;
  height: 44px !important;
}

body[data-page="article"] .article-popular-media {
  display: block !important;
  width: 96px !important;
  aspect-ratio: 4 / 3 !important;
  border-radius: 12px !important;
  overflow: hidden;
  background: var(--bg);
}
body[data-page="article"] .article-popular-link.is-lead .article-popular-media {
  width: 100% !important;
  aspect-ratio: 16 / 9 !important;
  border-radius: 12px !important;
}
body[data-page="article"] .article-popular-media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

body[data-page="article"] .article-popular-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
body[data-page="article"] .article-popular-copy em {
  color: var(--red) !important;
  font-size: 0.72rem !important;
  font-style: normal !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
body[data-page="article"] .article-popular-copy strong {
  color: var(--ink) !important;
  font-size: 0.98rem !important;
  line-height: 1.38 !important;
  font-weight: 800 !important;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
body[data-page="article"] .article-popular-link.is-lead .article-popular-copy strong {
  font-size: 1.08rem !important;
  line-height: 1.32 !important;
}
body[data-page="article"] .article-popular-link.is-lead .article-popular-copy {
  padding-top: 0.55rem;
}

/* Son haberler paneli */
body[data-page="article"] .article-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.05rem 1.15rem 0.7rem !important;
  background: color-mix(in srgb, var(--bg) 40%, var(--surface)) !important;
  border-bottom: 1px solid var(--line);
}
body[data-page="article"] .article-side-head span {
  font-size: 1.05rem !important;
  font-weight: 900 !important;
  color: var(--ink);
  letter-spacing: -0.02em;
}
body[data-page="article"] .article-side-all {
  font-size: 0.82rem !important;
  font-weight: 700;
  color: var(--red);
  white-space: nowrap;
}
body[data-page="article"] .article-side-news {
  display: grid !important;
  gap: 0.65rem !important;
  padding: 0.85rem 0.95rem 1rem !important;
}
body[data-page="article"] .article-side-link {
  display: grid !important;
  grid-template-columns: 108px minmax(0, 1fr) !important;
  gap: 0.8rem !important;
  align-items: center !important;
  min-height: 84px;
  padding: 0.55rem !important;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 45%, var(--surface));
  text-decoration: none !important;
  color: var(--ink) !important;
  transition: border-color 0.15s ease, background 0.15s ease;
}
body[data-page="article"] .article-side-link:hover {
  border-color: color-mix(in srgb, var(--red) 35%, var(--line));
  background: var(--surface);
}
body[data-page="article"] .article-side-thumb {
  display: block !important;
  width: 108px !important;
  height: 76px !important;
  border-radius: 12px !important;
  overflow: hidden;
  background: var(--bg);
  flex-shrink: 0;
}
body[data-page="article"] .article-side-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
body[data-page="article"] .article-side-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
body[data-page="article"] .article-side-copy span {
  color: var(--red) !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
body[data-page="article"] .article-side-copy strong {
  color: var(--ink) !important;
  font-size: 0.98rem !important;
  line-height: 1.38 !important;
  font-weight: 800 !important;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body[data-page="article"] .article-sidebar .widget-ad {
  width: 100%;
}

/* Dark */
[data-theme="dark"] body[data-page="article"] .article-story,
[data-theme="dark"] body[data-page="article"] .article-side-card,
[data-theme="dark"] body[data-page="article"] .article-actions,
[data-theme="dark"] body[data-page="article"] .comments,
[data-theme="dark"] body[data-page="article"] .related-section {
  background: var(--surface) !important;
  border-color: var(--line) !important;
}
[data-theme="dark"] body[data-page="article"] .article-popular-link,
[data-theme="dark"] body[data-page="article"] .article-side-link {
  background: color-mix(in srgb, var(--bg) 55%, var(--surface)) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}
[data-theme="dark"] body[data-page="article"] .article-popular-copy strong,
[data-theme="dark"] body[data-page="article"] .article-side-copy strong {
  color: var(--ink) !important;
}

/* Responsive: tablet */
@media (max-width: 1100px) {
  body[data-page="article"] .article-page-grid,
  body[data-page="article"] .article-layout {
    grid-template-columns: minmax(0, 1fr) 340px !important;
    gap: 1.25rem !important;
  }
  body[data-page="article"] .article-popular-link {
    grid-template-columns: 38px 84px minmax(0, 1fr) !important;
  }
  body[data-page="article"] .article-side-link {
    grid-template-columns: 96px minmax(0, 1fr) !important;
  }
  body[data-page="article"] .article-side-thumb {
    width: 96px !important;
    height: 68px !important;
  }
}

/* Responsive: mobil — yan panel alta, tam genişlik */
@media (max-width: 900px) {
  body[data-page="article"] .article-page-grid,
  body[data-page="article"] .article-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.15rem !important;
  }
  body[data-page="article"] .article-layout > aside.article-sidebar,
  body[data-page="article"] .article-sidebar,
  body[data-page="article"] .article-page-side {
    position: static !important;
    top: auto !important;
    max-height: none !important;
    overflow: visible !important;
    width: 100% !important;
  }
  body[data-page="article"] .article-side-panel {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem !important;
  }
}
@media (max-width: 640px) {
  body[data-page="article"] .article-side-panel {
    grid-template-columns: 1fr !important;
  }
  body[data-page="article"] .article-header {
    padding: 1rem 1rem 0.55rem !important;
  }
  body[data-page="article"] .article-header h1 {
    font-size: clamp(1.35rem, 6vw, 1.75rem) !important;
  }
  body[data-page="article"] .article-lead,
  body[data-page="article"] .article-body {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  body[data-page="article"] .article-cover img {
    max-height: min(40vh, 300px) !important;
  }
  body[data-page="article"] .article-meta-bar {
    flex-direction: column;
    align-items: flex-start !important;
  }
  body[data-page="article"] .reader-tools {
    margin-left: 0 !important;
  }
}
