/* CSS Variables */
:root {
  --primary: #2c5f8d;
  --primary-dark: #1a3a54;
  --primary-light: #4a8bc2;
  --text: #1a1a2e;
  --text-light: #666;
  --bg: #ffffff;
  --bg-alt: #f8f9fa;
  --header-bg: #1a1a2e;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg-alt);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

/* Header */
header {
  background-color: var(--header-bg);
  color: white;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.logo {
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--primary-light);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav a {
  color: white;
  font-weight: 500;
  transition: color 0.3s;
}

nav a:hover {
  color: var(--primary-light);
}

/* Main Content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

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

/* Hero Section */
.hero {
  position: relative;
  height: 500px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 3rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3rem;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  color: white;
}

.hero-content .category-badge {
  display: inline-block;
  margin-bottom: 0.75rem;
}

.hero-content h1 {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.hero-content .excerpt {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.9);
  max-width: 700px;
}

/* Content Layout */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  margin-bottom: 3rem;
}

/* Article Grid */
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

/* Article Card */
.article-card {
  background: var(--bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.article-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.article-card-content {
  padding: 1.5rem;
}

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

.article-card h3 {
  font-size: 1.25rem;
  margin: 0.75rem 0 0.5rem;
  line-height: 1.4;
  color: var(--text);
}

.article-meta {
  color: var(--text-light);
  font-size: 0.875rem;
}

.article-excerpt {
  margin-top: 0.75rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
}

.sidebar-widget {
  background: var(--bg);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 2rem;
}

.sidebar-widget h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text);
  border-bottom: 3px solid var(--primary);
  padding-bottom: 0.5rem;
}

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

.trending-item {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--bg-alt);
}

.trending-item:last-child {
  border-bottom: none;
}

.trending-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.trending-item h4 {
  font-size: 0.95rem;
  line-height: 1.4;
  font-weight: 600;
}

.trending-item:hover h4 {
  color: var(--primary);
}

/* Category Page */
.category-header {
  text-align: center;
  padding: 3rem 0;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  border-radius: 12px;
  margin-bottom: 3rem;
}

.category-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.category-header p {
  font-size: 1.125rem;
  opacity: 0.9;
}

/* Article Page */
.article-header {
  max-width: 800px;
  margin: 0 auto 2rem;
  text-align: center;
}

.article-header h1 {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 1rem;
  font-weight: 700;
}

.article-header .article-meta {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.article-image {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 2rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.article-image img {
  width: 100%;
  height: auto;
}

.article-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.125rem;
  line-height: 1.8;
}

.article-content p {
  margin-bottom: 1.5rem;
}

.article-content a {
  color: var(--primary);
  text-decoration: underline;
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--primary);
  font-weight: 600;
}

.back-link:hover {
  text-decoration: underline;
}

/* Related Articles */
.related-articles {
  max-width: 800px;
  margin: 4rem auto 0;
  padding-top: 3rem;
  border-top: 2px solid var(--bg-alt);
}

.related-articles h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* Footer */
footer {
  background-color: var(--header-bg);
  color: white;
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

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

.footer-section h4 {
  margin-bottom: 1rem;
  color: var(--primary-light);
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: rgba(255,255,255,0.7);
  transition: color 0.3s;
}

.footer-section a:hover {
  color: white;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  nav ul {
    gap: 1rem;
    font-size: 0.9rem;
  }

  .hero {
    height: 400px;
  }

  .hero-content h1 {
    font-size: 1.75rem;
  }

  .hero-content .excerpt {
    font-size: 1rem;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .category-header h1 {
    font-size: 2rem;
  }

  .article-header h1 {
    font-size: 2rem;
  }

  .article-content {
    font-size: 1rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  header .container {
    flex-direction: column;
    gap: 1rem;
  }

  nav ul {
    gap: 0.75rem;
  }

  .hero-content {
    padding: 1.5rem;
  }

  .hero-content h1 {
    font-size: 1.5rem;
  }
}
