/* =========================================================
   OncoNews Hub — стили
   Палитра: спокойный медицинский teal + тёплый акцент,
   характерная лента (рибон) как отсылка к онко-осведомлённости.
   ========================================================= */

:root {
  --bg: #f6f8f9;
  --surface: #ffffff;
  --text: #17242b;
  --text-muted: #5b6b72;
  --border: #e4e9eb;
  --primary: #0f6e6e;
  --primary-dark: #0a4f4f;
  --primary-light: #e5f3f2;
  --accent: #d46a86;      /* лента онко-осведомлённости — розовато-лиловый */
  --accent-dark: #b84f6b;
  --accent-light: #fbeaef;
  --success: #2f8f5b;
  --shadow-sm: 0 1px 3px rgba(15, 40, 40, 0.06);
  --shadow-md: 0 6px 20px rgba(15, 40, 40, 0.08);
  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15.5px;
  line-height: 1.55;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: inherit; text-decoration: none; }

/* ---------- topbar ---------- */
.topbar {
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  color: #eafdfa;
  font-size: 12.5px;
}
.topbar-inner { padding: 6px 20px; text-align: center; }

/* ---------- header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 20px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 21px;
  color: var(--primary-dark);
  white-space: nowrap;
}
.logo-icon { font-size: 22px; }
.logo .accent { color: var(--accent); }

.search-form {
  flex: 1;
  display: flex;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.search-form input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  color: var(--text);
}
.search-form button {
  border: none;
  background: var(--primary);
  color: #fff;
  padding: 0 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.search-form button:hover { background: var(--primary-dark); }

.header-nav a {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 8px;
}
.header-nav a:hover { background: var(--primary-light); color: var(--primary-dark); }

.category-nav {
  background: var(--primary-dark);
  overflow-x: auto;
}
.category-nav-inner {
  display: flex;
  gap: 4px;
  white-space: nowrap;
  padding: 0 20px;
}
.category-nav a {
  display: inline-block;
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: #cfeaea;
  border-bottom: 3px solid transparent;
}
.category-nav a:hover { color: #fff; }
.category-nav a.active {
  color: #fff;
  border-bottom-color: var(--accent);
}

/* ---------- flash ---------- */
.flash-stack { margin: 20px 0 0; }
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
}
.flash-success { background: #e6f7ee; color: var(--success); }
.flash-error { background: #fdeaea; color: #b03434; }

/* ---------- layout ---------- */
.main-content { padding: 28px 20px 60px; min-height: 60vh; }

.page-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
}
@media (max-width: 900px) {
  .page-grid { grid-template-columns: 1fr; }
}

/* ---------- featured hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 26px;
}
@media (max-width: 720px) { .hero { grid-template-columns: 1fr; } }

.hero-media {
  background: linear-gradient(135deg, var(--primary-light), #dff1ee);
  min-height: 260px;
  position: relative;
  overflow: hidden;
}
.hero-media img {
  width: 100%; height: 100%; object-fit: cover; min-height: 260px;
}
.hero-media .no-image {
  display: flex; align-items: center; justify-content: center;
  height: 100%; min-height: 260px; font-size: 64px; opacity: 0.35;
}
.hero-body { padding: 28px 30px; display: flex; flex-direction: column; justify-content: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
  width: fit-content; margin-bottom: 14px;
}
.hero-title {
  font-family: 'Merriweather', serif;
  font-size: 26px; line-height: 1.3; font-weight: 700;
  margin: 0 0 12px;
}
.hero-title a:hover { color: var(--primary); }
.hero-summary { color: var(--text-muted); margin: 0 0 16px; font-size: 15px; }
.hero-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); }
.source-pill {
  background: var(--primary-light); color: var(--primary-dark);
  padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 12px;
}

/* ---------- section title ---------- */
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 30px 0 16px;
}
.section-title h2 { font-size: 19px; margin: 0; }
.section-title .ribbon { color: var(--accent); margin-right: 6px; }

/* ---------- article list / cards ---------- */
.article-list { display: flex; flex-direction: column; gap: 14px; }

.article-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s ease, transform .15s ease;
}
.article-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
@media (max-width: 560px) {
  .article-card { grid-template-columns: 92px 1fr; }
}

.article-thumb {
  width: 150px; height: 104px; border-radius: 10px; overflow: hidden;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
@media (max-width: 560px) { .article-thumb { width: 92px; height: 78px; } }
.article-thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-thumb .placeholder { font-size: 30px; opacity: 0.4; }

.article-body { min-width: 0; }
.article-cat {
  display: inline-block;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
  color: var(--primary); margin-bottom: 6px;
}
.article-title {
  font-size: 16.5px; font-weight: 700; margin: 0 0 6px; line-height: 1.35;
}
.article-title a:hover { color: var(--primary); }
.article-summary {
  font-size: 13.8px; color: var(--text-muted); margin: 0 0 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-meta {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); flex-wrap: wrap;
}
.badge-new {
  background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px; text-transform: uppercase;
}
.dot::before { content: "·"; margin: 0 2px; }
.source-link { font-weight: 700; color: var(--primary-dark); }
.external-icon { opacity: .55; }

/* ---------- sidebar ---------- */
.sidebar-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.sidebar-box h3 {
  font-size: 14px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--text-muted); margin: 0 0 14px;
}
.sidebar-cat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sidebar-cat-list a {
  display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 8px; font-size: 14px; font-weight: 600;
}
.sidebar-cat-list a:hover { background: var(--primary-light); color: var(--primary-dark); }
.sidebar-cat-list .count { color: var(--text-muted); font-weight: 500; }

.live-indicator {
  display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-muted);
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 rgba(47,143,91, 0.5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47,143,91,.5); }
  70% { box-shadow: 0 0 0 8px rgba(47,143,91,0); }
  100% { box-shadow: 0 0 0 0 rgba(47,143,91,0); }
}
.stat-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.stat-row:last-child { border-bottom: none; }
.stat-row b { color: var(--primary-dark); }

/* ---------- pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; font-weight: 700; font-size: 14px;
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.pagination a:hover { background: var(--primary-light); color: var(--primary-dark); }
.pagination .current { background: var(--primary); color: #fff; }

/* ---------- page header (category/search/about) ---------- */
.page-header { margin-bottom: 10px; }
.page-header h1 { font-size: 26px; margin: 0 0 6px; font-family: 'Merriweather', serif; }
.page-header p { color: var(--text-muted); margin: 0; }

.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
  background: var(--surface); border-radius: var(--radius);
}
.empty-state .emoji { font-size: 42px; margin-bottom: 12px; }

/* ---------- about page ---------- */
.about-hero {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff; border-radius: var(--radius); padding: 40px 34px; margin-bottom: 28px;
}
.about-hero h1 { font-family: 'Merriweather', serif; font-size: 28px; margin: 0 0 12px; }
.about-hero p { max-width: 720px; opacity: .92; }

.how-it-works { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 24px 0 36px; }
@media (max-width: 800px) { .how-it-works { grid-template-columns: 1fr 1fr; } }
.step-card {
  background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
}
.step-num {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent-light); color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 800; margin-bottom: 10px;
}
.step-card h4 { margin: 0 0 6px; font-size: 15px; }
.step-card p { margin: 0; font-size: 13.5px; color: var(--text-muted); }

.sources-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.sources-table th, .sources-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.sources-table th { background: var(--primary-light); color: var(--primary-dark); font-size: 12.5px; text-transform: uppercase; }
.tag-lang { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--bg); font-weight: 700; }

/* ---------- admin ---------- */
.admin-wrap { max-width: 960px; margin: 40px auto; }
.admin-card { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.login-box { max-width: 380px; margin: 80px auto; background: var(--surface); padding: 32px; border-radius: var(--radius); box-shadow: var(--shadow-md); }
.login-box h1 { font-size: 20px; margin-top: 0; }
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--text-muted); }
.form-field input { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); font-family: inherit; font-size: 14px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; background: var(--primary); color: #fff;
  border: none; padding: 10px 18px; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 14px;
}
.btn:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--primary-dark); border: 1px solid var(--primary); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.admin-table th { color: var(--text-muted); text-transform: uppercase; font-size: 11.5px; }
.status-pill { padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.status-success { background: #e6f7ee; color: var(--success); }
.status-error { background: #fdeaea; color: #b03434; }
.status-running { background: #fff6e0; color: #a67300; }

/* footer */
.site-footer { background: #0d3535; color: #cfe4e0; margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: 28px; padding: 40px 20px 20px; }
@media (max-width: 800px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
.footer-logo { color: #fff; margin-bottom: 12px; }
.footer-desc { font-size: 13px; line-height: 1.6; opacity: .85; }
.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; margin: 0 0 12px; color: #8fc9c1; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-col a { font-size: 13.5px; opacity: .9; }
.footer-col a:hover { opacity: 1; text-decoration: underline; }
.footer-disclaimer { font-size: 12.5px; opacity: .75; line-height: 1.6; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 14px 0; text-align: center; font-size: 12.5px; opacity: .7; }


/* ═══════════════════════════════════════════════════════════════
   Google Translate автоперевод EN→RU
   ═══════════════════════════════════════════════════════════════ */
.gt-bar {
  display: none;
  background: oklch(97% 0.007 240);
  border-bottom: 1px solid oklch(91% 0.012 240);
  font-size: 12px;
  line-height: 1.4;
}
.gt-bar--on { display: block; }
.gt-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 6px;
  flex-wrap: wrap;
}
.gt-bar-note {
  display: flex;
  align-items: center;
  gap: 5px;
  color: oklch(46% 0.02 240);
}
.gt-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gt-full-btn {
  background: none;
  border: 1px solid oklch(76% 0.04 240);
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
  color: oklch(36% 0.06 240);
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.gt-full-btn:hover {
  background: oklch(93% 0.014 240);
  border-color: oklch(60% 0.09 240);
}
#gt-widget { display: none; }
.badge-lang {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  background: oklch(92% 0.06 240);
  color: oklch(38% 0.12 240);
  border-radius: 3px;
  padding: 1px 5px;
  vertical-align: middle;
  margin-right: 3px;
}

/* ═══════════════════════════════════════════════════════════════
   Счетчик посещений
   ═══════════════════════════════════════════════════════════════ */
.views-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
  padding: 8px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.views-counter #visits {
  font-weight: 700;
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
}
