/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --border: #e5e7eb;
  --accent: #dc2626;
  --accent-hover: #b91c1c;
  --accent-soft: #fef2f2;
  --blue: #2563eb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --transition: 0.15s ease;
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', var(--font);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== HEADER ===== */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.92);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 32px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.logo-mark {
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 1px;
  padding: 6px 8px;
  border-radius: 6px;
  line-height: 1;
}
.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  color: var(--text);
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}
.nav-link:hover { color: var(--text); background: var(--bg); }

.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.dropdown-item {
  display: block;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-2);
  border-radius: 6px;
  transition: background var(--transition);
}
.dropdown-item:hover { background: var(--bg); color: var(--text); }
.chevron { font-size: 0.7rem; opacity: 0.5; }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 12px; }

.search-compact {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  overflow: hidden;
  transition: border-color var(--transition);
}
.search-compact:focus-within { border-color: var(--accent); }
.search-compact input {
  border: none;
  background: none;
  padding: 8px 16px;
  font-size: 0.85rem;
  width: 180px;
  outline: none;
  font-family: inherit;
}
.search-compact button {
  border: none;
  background: none;
  padding: 8px 12px 8px 0;
  cursor: pointer;
  color: var(--text-3);
  display: flex;
}
.search-compact button:hover { color: var(--accent); }

.nav-toggle {
  display: none;
  border: none;
  background: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}

/* ===== PILLS / BADGES ===== */
.pill {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 4px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-radius: 100px;
}
.pill-sm { padding: 3px 10px; font-size: 0.65rem; }
.pill-xs { padding: 2px 8px; font-size: 0.6rem; }

/* ===== HERO SECTION ===== */
.hero-section { margin: 24px 0 48px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  min-height: 420px;
}
.hero-main {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
}
.hero-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #1f2937;
  transition: transform 0.4s ease;
}
.hero-main:hover .hero-image { transform: scale(1.03); }
.hero-overlay {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
  color: #fff;
}
.hero-overlay h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 12px;
}
.hero-meta { font-size: 0.8rem; opacity: 0.7; margin-top: 8px; }

.hero-side { display: flex; flex-direction: column; gap: 16px; }
.hero-side-card {
  flex: 1;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
}
.hero-side-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #1f2937;
  transition: transform 0.4s ease;
}
.hero-side-card:hover .hero-side-image { transform: scale(1.03); }
.hero-side-overlay {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 80%);
  color: #fff;
}
.hero-side-overlay h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 8px;
}

/* ===== SECTIONS ===== */
.section { margin: 48px 0; }
.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  white-space: nowrap;
}
.section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ===== CARD GRID ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.card-img {
  height: 180px;
  background-size: cover;
  background-position: center;
  background-color: #f3f4f6;
  position: relative;
}
.card-img .pill {
  position: absolute;
  top: 12px;
  left: 12px;
}
.card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-body h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--text);
}
.card-body p {
  font-size: 0.835rem;
  color: var(--text-2);
  line-height: 1.55;
  flex: 1;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.meta-dot { opacity: 0.4; }

/* ===== CATEGORY CHIPS ===== */
.cat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cat-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  transition: all var(--transition);
}
.cat-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.cat-chip-count {
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.7rem;
  color: var(--text-3);
  font-weight: 600;
}

/* ===== TRENDING ===== */
.trending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
}
.trending-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}
.trending-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.trending-rank {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--border);
  line-height: 1;
  min-width: 40px;
}
.trending-card:hover .trending-rank { color: var(--accent); }
.trending-card h4 {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 6px 0 4px;
  color: var(--text);
}
.trending-date { font-size: 0.72rem; color: var(--text-3); }

/* ===== ARTICLE PAGE ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-3);
  margin: 24px 0 20px;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .current { color: var(--text-2); }

.article-page { max-width: 780px; margin: 0 auto; }
.article-head { margin-bottom: 32px; }
.article-head h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 16px 0;
  letter-spacing: -0.5px;
}
.article-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-2);
}
.article-info a { color: var(--blue); }

.article-hero {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
}

/* ===== PROSE (Article Content) ===== */
.prose {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text);
}
.prose h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 40px 0 16px;
  letter-spacing: -0.3px;
}
.prose h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 32px 0 12px;
}
.prose p { margin-bottom: 18px; }
.prose ul, .prose ol {
  margin: 18px 0;
  padding-left: 24px;
}
.prose li { margin-bottom: 8px; }
.prose strong { font-weight: 600; }
.prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2);
  font-style: italic;
}

/* Comparison tables (GEO) */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.9rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.prose thead th {
  background: var(--text);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.prose tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.prose tbody tr:nth-child(even) { background: #f9fafb; }
.prose tbody tr:hover { background: var(--accent-soft); }
.prose tbody td:first-child { font-weight: 600; }

/* Share bar */
.share-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 40px 0;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-2);
}
.share-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--surface);
  cursor: pointer;
  color: var(--text-2);
  font-family: inherit;
  text-decoration: none;
  transition: all var(--transition);
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ===== PAGE TITLE ===== */
.page-title { margin: 32px 0; }
.page-title h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin: 8px 0;
}
.page-title p { color: var(--text-2); }
.result-count { margin-top: 12px; color: var(--text-2); font-size: 0.9rem; }

/* Search full */
.search-full {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  max-width: 520px;
}
.search-full input {
  flex: 1;
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 1rem;
  outline: none;
  font-family: inherit;
  transition: border-color var(--transition);
}
.search-full input:focus { border-color: var(--accent); }
.search-full button {
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition);
}
.search-full button:hover { background: var(--accent-hover); }

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
  font-size: 1rem;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 40px 0;
}
.page-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--surface);
  color: var(--text-2);
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== FOOTER ===== */
.footer {
  margin-top: 64px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 40px 0 32px;
  gap: 40px;
}
.footer-brand p {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-3);
  line-height: 1.5;
}
.footer-nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-nav a {
  font-size: 0.85rem;
  color: var(--text-2);
  font-weight: 500;
  transition: color var(--transition);
}
.footer-nav a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-3);
}
.footer-dot { opacity: 0.4; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; min-height: auto; }
  .hero-main { min-height: 300px; }
  .hero-side { flex-direction: row; }
  .hero-side-card { min-height: 180px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav { display: none; }
  .nav.open { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px; box-shadow: var(--shadow-lg); }
  .nav-toggle { display: block; }
  .nav-dropdown-menu { position: static; box-shadow: none; border: none; padding-left: 12px; display: block; }

  .search-compact input { width: 120px; }
  .hero-side { flex-direction: column; }
  .card-grid { grid-template-columns: 1fr; }
  .trending-grid { grid-template-columns: 1fr; }

  .article-head h1 { font-size: 1.6rem; }
  .footer-top { flex-direction: column; gap: 24px; }
}
