
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
  color: #1a1a1a;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.1), transparent);
  pointer-events: none;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  position: relative;
  z-index: 2;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-container img {
  height: 200px;
  width: auto;
}

.logo-container h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

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

nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: opacity 0.3s ease;
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: white;
  transition: width 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}

nav a:hover {
  opacity: 0.85;
}

.header-content {
  text-align: center;
  padding: 2rem 2rem 3rem;
  position: relative;
  z-index: 1;
}

header h1.main-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.tagline {
  font-size: 1.2rem;
  opacity: 0.95;
  font-weight: 300;
  letter-spacing: 0.02em;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #e9ecef;
}

#searchInput, #topicFilter {
  padding: 0.875rem 1.25rem;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  font-size: 0.95rem;
  width: 280px;
  max-width: 90%;
  transition: all 0.3s ease;
  background: #f8f9fa;
  font-family: inherit;
}

#searchInput:focus, #topicFilter:focus {
  outline: none;
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

#topicFilter {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 3rem;
}

main {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2.5rem;
  padding: 3rem 2rem 4rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  flex-grow: 1;
}

.blog-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(0,0,0,0.04);
  position: relative;
}

.blog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transform: scaleX(0);
  transition: transform 0.4s ease;
  transform-origin: left;
}

.blog-card:hover::before {
  transform: scaleX(1);
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.15);
}

.blog-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.blog-card:hover img {
  transform: scale(1.05);
}

.card-content {
  padding: 2rem;
}

.card-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.875rem;
  color: #1a1a1a;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.card-content p {
  color: #6c757d;
  margin-bottom: 1.5rem;
  line-height: 1.7;
  font-size: 0.95rem;
}

.read-more {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.read-more::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.2);
  transition: left 0.5s ease;
}

.read-more:hover::before {
  left: 100%;
}

.read-more:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

footer {
  text-align: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  color: rgba(255,255,255,0.9);
  font-size: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .header-top {
    padding: 1rem;
  }

  .logo-container h1 {
    font-size: 1.2rem;
  }

  .logo-container img {
    height: 40px;
  }

  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }

  nav.active {
    display: block;
  }

  nav ul {
    flex-direction: column;
    gap: 1rem;
  }

  .mobile-menu-toggle {
    display: block;
  }

  header h1.main-title {
    font-size: 2.25rem;
  }
  
  .tagline {
    font-size: 1rem;
  }

  .header-content {
    padding: 1.5rem 1rem 2rem;
  }
  
  main {
    grid-template-columns: 1fr;
    padding: 2rem 1rem 3rem;
    gap: 2rem;
  }
  
  .controls {
    padding: 1.5rem 1rem;
  }
  
  #searchInput, #topicFilter {
    width: 100%;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Loading animation for images */
.blog-card img {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.blog-card img[src] {
  animation: none;
  background: none;
}
