﻿@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f4;
  --text: #202124;
  --muted: #5f6368;
  --border: #e0e3eb;
  --accent: #1a73e8;
  --accent-strong: #0b57d0;
  --chip: #e8f0fe;
  --shadow: 0 1px 2px rgba(60,64,67,0.1), 0 10px 30px rgba(60,64,67,0.12);
  --radius: 18px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--text);
  background: #ffffff;
  min-height: 100vh;
}
html { scroll-behavior: smooth; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 4px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.brand-mark {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 14px;
}
.brand-mark--initial {
  background: linear-gradient(135deg, #1a73e8, #4f8df4);
  color: #fff;
}
.brand-mark.has-logo {
  background: #fff;
  border: 1px solid var(--border);
}
.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}
.brand-text { font-size: 18px; letter-spacing: 0.2px; }
.brand-sub { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 4px; }

.searchbar {
  flex: 1;
  max-width: 680px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.searchbar:focus-within {
  border-color: #c7d1f7;
  box-shadow: 0 6px 18px rgba(26,115,232,0.1);
}
.searchbar input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: 14px;
  color: var(--text);
}

.icon svg,
.icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon { color: var(--muted); display: inline-flex; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}
.icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}
.icon-btn--ghost { color: var(--muted); }

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #202124;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-row {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px 4px;
  border-top: 1px solid var(--border);
}
.nav-primary,
.nav-secondary {
  display: flex;
  align-items: center;
  gap: 18px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav-primary::-webkit-scrollbar,
.nav-secondary::-webkit-scrollbar { display: none; }
.nav-primary a {
  padding: 10px 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.nav-primary a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.nav-secondary {
  margin-top: 6px;
  gap: 16px;
}
.nav-secondary a {
  padding: 6px 0;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.nav-secondary a.active { color: var(--accent-strong); font-weight: 600; }

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 20px 48px;
}
.section { margin-top: 18px; }
.section[id] { scroll-margin-top: 140px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.section-actions { display: flex; align-items: center; gap: 10px; }
.section-title {
  margin: 0;
  font-size: 24px;
}
.section-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.ghost-link {
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
}
.arrow-link {
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
}
.ghost-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.ghost-btn:hover { border-color: #c7d1f7; color: var(--accent-strong); }
.ghost-btn.is-active {
  background: var(--chip);
  border-color: #c7d1f7;
  color: var(--accent-strong);
}
.ghost-btn--sm { padding: 6px 10px; font-size: 12px; }

.mini-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px 12px;
  min-width: 210px;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: center;
  box-shadow: var(--shadow);
}
.weather-card { max-width: 240px; }
.weather-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.weather-icon svg { width: 44px; height: 44px; }
.weather-content { display: grid; gap: 2px; }
.weather-location { font-size: 12px; color: var(--muted); font-weight: 600; }
.weather-temp-row { display: flex; align-items: baseline; gap: 4px; }
.weather-temp { font-size: 22px; font-weight: 700; color: var(--text); }
.weather-unit { font-size: 12px; color: var(--muted); font-weight: 600; }
.weather-desc { font-size: 11px; color: var(--muted); }
.mini-title { color: var(--muted); font-size: 12px; }
.mini-value { font-size: 20px; font-weight: 700; }
.mini-sub { font-size: 12px; color: var(--muted); }

.summary-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-top: 16px;
}
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.section-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.kicker-title { font-weight: 600; }
.kicker-link { font-size: 13px; color: var(--accent); font-weight: 600; }

.popular-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  align-items: start;
}
.popular-main { display: flex; flex-direction: column; gap: 10px; }
.popular-media {
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-2);
  min-height: 200px;
}
.popular-media img { width: 100%; height: 100%; object-fit: cover; }
.popular-body { display: flex; flex-direction: column; gap: 8px; }
.popular-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.popular-title a:hover { color: var(--accent-strong); }
.popular-side { display: grid; gap: 12px; align-content: start; }
.popular-item { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.popular-item:last-child { padding-bottom: 0; border-bottom: 0; }

.story-list { display: grid; gap: 12px; }
.story-row {
  display: grid;
  grid-template-columns: 1fr 76px;
  gap: 12px;
  align-items: center;
}
.story-row--wide { grid-template-columns: 1fr 88px; }
.story-row--compact { grid-template-columns: 1fr 64px; }
.story-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
}
.story-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.story-source { font-weight: 600; color: #374151; }
.dot { color: #9aa0a6; }
.source-fav { width: 16px; height: 16px; border-radius: 4px; }
.story-thumb {
  width: 100%;
  height: 76px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
}
.story-row--wide .story-thumb { height: 88px; }
.story-row--compact .story-thumb { height: 64px; }
.story-thumb img { width: 100%; height: 100%; object-fit: cover; }

.news-list { display: grid; gap: 14px; }
.news-card {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.news-card--row { grid-template-columns: 1fr 200px; }
.news-body { display: flex; flex-direction: column; gap: 8px; }
.news-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.news-title a:hover { color: var(--accent-strong); }
.news-excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-media {
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-2);
  min-height: 120px;
}
.news-media img { width: 100%; height: 100%; object-fit: cover; }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 12px;
}
.chip--ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}

.filter-bar { margin: 10px 0; }
.filter-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-input {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.filter-input input {
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  min-width: 180px;
  color: var(--text);
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 12px;
}
.topic-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.topic-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.topic-title { font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.topic-dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
.topic-list { display: grid; gap: 12px; }
.topic-row { display: grid; grid-template-columns: 1fr 72px; gap: 12px; align-items: center; }
.topic-row-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 12px;
}
.source-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.source-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.source-title { font-weight: 700; }
.source-title:hover { color: var(--accent-strong); }
.source-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.source-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: cover;
  background: #fff;
}
.source-logo-fallback {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.source-list { display: grid; gap: 12px; }
.source-row { display: grid; grid-template-columns: 1fr 72px; gap: 12px; align-items: center; }
.source-row-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}
.content-grid--article { grid-template-columns: minmax(0, 1fr) 320px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.panel-title { font-weight: 700; margin-bottom: 12px; }
.panel-group { padding: 10px 0; border-top: 1px solid var(--border); }
.panel-group:first-of-type { border-top: 0; padding-top: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-name { font-weight: 600; }
.panel-row {
  display: grid;
  grid-template-columns: 1fr 60px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.panel-row:last-child { border-bottom: 0; }
.panel-row-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.panel-thumb {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
}
.panel-thumb img { width: 100%; height: 100%; object-fit: cover; }
.panel-links { display: flex; flex-wrap: wrap; gap: 8px; }
.panel-link {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.panel-link:hover { border-color: #c7d1f7; color: var(--accent-strong); }

.media-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 600;
  width: fit-content;
}
.thumb-placeholder {
  width: 100%;
  height: 100%;
  background: #dfe3eb;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-embed {
  margin: 14px 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.media-embed iframe,
.media-embed video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  display: block;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.article-title { margin: 6px 0 10px; font-size: 28px; line-height: 1.25; }
.article-excerpt { margin: 0 0 16px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.article-hero { width: 100%; border-radius: 16px; margin: 10px 0 16px; }
.article-meta { color: var(--muted); font-size: 13px; display: flex; gap: 8px; }

.content-body { line-height: 1.7; font-size: 15px; }
.content-body p { margin: 0 0 12px; }
.content-body h2,
.content-body h3,
.content-body h4 { margin: 16px 0 8px; }
.content-body img { max-width: 100%; height: auto; border-radius: 12px; }

.empty-state {
  border: 1px dashed var(--border);
  background: var(--surface-2);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
}

.pagination { list-style: none; display: flex; gap: 8px; padding: 0; margin: 16px 0; }
.page-item { }
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  min-width: 36px;
}
.page-item.active .page-link {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.d-flex { display: flex; }
.justify-content-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.my-4 { margin-top: 16px; margin-bottom: 16px; }

@media (max-width: 1100px) {
  .summary-grid { grid-template-columns: 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .content-grid--article { grid-template-columns: 1fr; }
  .topic-grid, .source-grid { grid-template-columns: 1fr 1fr; }
  .news-card, .news-card--row { grid-template-columns: 1fr 160px; }
}

@media (max-width: 900px) {
  .topbar-inner { flex-wrap: wrap; }
  .searchbar { order: 3; width: 100%; max-width: none; }
  .nav-row { padding: 0 16px 6px; }
  .page { padding: 16px; }
  .popular-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .top-actions { margin-left: auto; }
  .brand-sub { display: none; }
  .news-card, .news-card--row { grid-template-columns: 1fr; }
  .news-media { min-height: 180px; }
  .news-card .news-media { order: -1; }
  .topic-grid, .source-grid { grid-template-columns: 1fr; }
  .story-row, .story-row--wide, .story-row--compact { grid-template-columns: 1fr 64px; }
  .filter-form { width: 100%; }
  .filter-input { width: 100%; }
  .filter-input input { width: 100%; min-width: 0; }
}
