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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f7fa;
}

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

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

a {
  color: #4a90e2;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #357abd;
}

/* ========================================
   Header
   ======================================== */
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  color: white;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.nav a:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
  padding: 4rem 0;
}

.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
  padding: 3rem 0;
}

.content-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.widget {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.widget h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: #333;
  border-bottom: 2px solid #667eea;
  padding-bottom: 0.5rem;
}

.widget ul {
  list-style: none;
}

.widget ul li {
  margin-bottom: 0.8rem;
}

.widget ul li a {
  color: #555;
  display: block;
  padding: 0.5rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.widget ul li a:hover {
  background-color: #f0f4ff;
  color: #667eea;
  padding-left: 1rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: #e3f2fd;
  color: #1976d2;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.tag:hover {
  background: #1976d2;
  color: white;
  transform: translateY(-2px);
}

/* ========================================
   Blog Posts
   ======================================== */
.blog-posts {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.blog-post {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.blog-post:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.post-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

.post-content {
  padding: 2rem;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #666;
}

.post-date {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.post-category {
  background: #e3f2fd;
  color: #1976d2;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
}

.featured-badge {
  background: linear-gradient(135deg, #ff6b6b, #ff8e53);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.post-title {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #222;
  line-height: 1.3;
}

.post-excerpt {
  color: #555;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.read-more {
  display: inline-block;
  color: #667eea;
  font-weight: 600;
  padding: 0.7rem 1.5rem;
  border: 2px solid #667eea;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.read-more:hover {
  background: #667eea;
  color: white;
  transform: translateX(5px);
}

/* ========================================
   Featured Post with Widget
   ======================================== */
.featured-post {
  border: 3px solid #ff6b6b;
  position: relative;
}

.featured-post::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #ff6b6b, #ff8e53, #ffd93d, #6bcf7f);
}

.quiz-widget-wrapper {
  margin: 2rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 12px;
  border: 2px dashed #667eea;
}

.quiz-intro {
  text-align: center;
  margin-bottom: 1.5rem;
}

.quiz-intro h3 {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 0.5rem;
}

.quiz-intro p {
  color: #666;
  font-size: 1.1rem;
}

#blog-quiz-widget {
  background: white;
  border-radius: 8px;
  min-height: 400px;
  padding: 1rem;
}

.post-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0e0e0;
}

.post-footer p {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.page-link {
  padding: 0.7rem 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  color: #555;
  font-weight: 500;
  transition: all 0.3s ease;
}

.page-link:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.page-link.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

/* ========================================
   Footer
   ======================================== */
.footer {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  margin-bottom: 1rem;
  color: white;
  font-size: 1.2rem;
}

.footer-section p {
  line-height: 1.8;
  color: #bdc3c7;
}

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

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

.footer-section ul li a {
  color: #bdc3c7;
  transition: color 0.3s ease;
}

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

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  padding: 0.5rem 1rem;
  background: #34495e;
  color: #ecf0f1;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.social-links a:hover {
  background: #667eea;
  color: white;
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #34495e;
  color: #95a5a6;
}

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

  .sidebar {
    order: 2;
  }

  .blog-posts {
    order: 1;
  }

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

  .nav {
    flex-wrap: wrap;
    gap: 1rem;
  }
}

@media (max-width: 640px) {
  .hero h2 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .post-title {
    font-size: 1.4rem;
  }

  .post-content {
    padding: 1.5rem;
  }

  .quiz-widget-wrapper {
    padding: 1rem;
  }

  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  .nav {
    justify-content: center;
  }
}
