/* ======================================================
   Modern Premium CSS Design System for News Media
   AdSense Maximum Revenue Optimized Layout
   ====================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #f59e0b;
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --ad-bg: rgba(30, 41, 59, 0.7);
  --ad-border: #475569;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --ad-bg: #f1f5f9;
  --ad-border: #cbd5e1;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

/* Header & Nav */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--text-main);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}

/* Layout Container */
.main-layout {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
}

@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* Hero Article */
.hero-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  aspect-ratio: 16 / 9;
  max-height: 440px;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem;
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.95));
}

.category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.hero-title {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

.hero-title a {
  color: inherit;
  text-decoration: none;
}

/* News Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  background: var(--bg-card-hover);
}

.news-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  object-position: center;
  display: block;
}

.news-card-content {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

.news-card-title a {
  color: var(--text-main);
  text-decoration: none;
}

.news-card-summary {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-meta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* AdSense Slot Styles */
.adsense-container {
  background: var(--ad-bg);
  border: 1px dashed var(--ad-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1.5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.adsense-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.adsense-placeholder {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.adsense-placeholder i {
  font-size: 1.5rem;
  margin-bottom: 0.3rem;
  color: var(--accent);
}

.adsense-sidebar {
  position: sticky;
  top: 90px;
}

/* Sidebar Widgets */
.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  margin-bottom: 1.5rem;
}

.widget-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.popular-list {
  list-style: none;
}

.popular-item {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.popular-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border: none;
}

.popular-rank {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
  min-width: 20px;
}

.popular-info a {
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Article Detail Page */
.article-header {
  margin-bottom: 2rem;
}

.article-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 1rem 0;
}

.article-meta {
  display: flex;
  gap: 1.5rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  align-items: center;
}

.article-featured-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 480px;
  height: auto;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
  display: block;
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-main);
}

.article-body h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  padding-left: 0.8rem;
  border-left: 4px solid var(--primary);
}

.article-body h3 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.8rem;
}

.article-body p {
  margin-bottom: 1.2rem;
}

.key-points-list {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.2rem 1.5rem 1.2rem 2.5rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
}

/* Insights & FAQ Box */
.insights-box {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(245, 158, 11, 0.1));
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 2rem 0;
}

.insights-box h3 {
  color: var(--primary);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.faq-section {
  margin: 2rem 0;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 0.8rem;
  overflow: hidden;
}

.faq-question {
  padding: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-answer {
  padding: 0 1rem 1rem 1rem;
  color: var(--text-muted);
}

/* Tags */
.article-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.tag-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.8rem;
}

/* Footer */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 3rem 1.5rem 2rem;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Search Bar & Category Filter */
.search-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.category-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.3rem;
}

.tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab-btn:hover, .tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.search-box {
  display: flex;
  gap: 0.5rem;
}

.search-input {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  outline: none;
}

.search-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
