/* shadcn/ui inspired design system */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Colors - shadcn/ui inspired palette */
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;
  --primary: 221.2 83.2% 53.3%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96.1%;
  --secondary-foreground: 222.2 47.4% 11.2%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96.1%;
  --accent-foreground: 222.2 47.4% 11.2%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 221.2 83.2% 53.3%;
  --radius: 0.5rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.dark {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --card: 222.2 84% 4.9%;
  --card-foreground: 210 40% 98%;
  --primary: 217.2 91.2% 59.8%;
  --primary-foreground: 222.2 47.4% 11.2%;
  --secondary: 217.2 32.6% 17.5%;
  --secondary-foreground: 210 40% 98%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --accent: 217.2 32.6% 17.5%;
  --accent-foreground: 210 40% 98%;
  --border: 217.2 32.6% 17.5%;
  --input: 217.2 32.6% 17.5%;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

a {
  color: hsl(var(--primary));
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: hsl(var(--primary) / 0.8);
}

/* Header */
header {
  border-bottom: 1px solid hsl(var(--border));
  background-color: hsl(var(--background) / 0.95);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.site-branding {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  letter-spacing: -0.05em;
}

.site-description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

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

.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: color 0.2s ease;
  position: relative;
}

.nav-link:hover {
  color: hsl(var(--foreground));
}

/* Main Layout */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

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

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 0;
  margin-bottom: 3rem;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  margin-bottom: 1rem;
  background: linear-gradient(to right, hsl(var(--primary)), hsl(var(--primary) / 0.6));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.25rem;
  color: hsl(var(--muted-foreground));
  max-width: 600px;
  margin: 0 auto;
}

/* Card Component */
.card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: hsl(var(--primary) / 0.3);
}

/* Posts List */
.posts-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: hsl(var(--primary) / 0.5);
}

.post-thumbnail {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: linear-gradient(135deg, hsl(var(--primary) / 0.1), hsl(var(--secondary)));
  overflow: hidden;
}

.post-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.post-content-wrapper {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

.post-title a {
  color: hsl(var(--foreground));
  transition: color 0.2s ease;
}

.post-title a:hover {
  color: hsl(var(--primary));
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  flex-wrap: wrap;
}

.category {
  display: inline-flex;
  align-items: center;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.025em;
}

.description {
  font-size: 0.9375rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
  background-color: hsl(var(--muted));
  padding: 1rem;
  border-radius: calc(var(--radius) - 2px);
  border-left: 3px solid hsl(var(--primary));
}

.post-excerpt {
  font-size: 0.9375rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
  flex: 1;
}

.post-footer {
  padding-top: 1rem;
  border-top: 1px solid hsl(var(--border));
  margin-top: auto;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: hsl(var(--primary));
  transition: gap 0.2s ease;
}

.read-more:hover {
  gap: 0.75rem;
}

.read-more::after {
  content: '→';
  font-size: 1.125rem;
}

/* Article Content */
.post-content {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px);
  padding: 3rem;
  box-shadow: var(--shadow-sm);
}

.post-content h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.post-content h2 {
  font-size: 2rem;
  margin: 2.5rem 0 1rem;
  padding-top: 2rem;
  border-top: 1px solid hsl(var(--border));
}

.post-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.post-content h3 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
}

.post-content p {
  margin: 1.5rem 0;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: hsl(var(--foreground) / 0.9);
}

.post-content ul, .post-content ol {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

.post-content li {
  margin: 0.5rem 0;
  line-height: 1.7;
}

.post-content code {
  background-color: hsl(var(--muted));
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: 'Monaco', 'Courier New', monospace;
}

.post-content pre {
  background-color: hsl(var(--muted));
  padding: 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
}

.post-content pre code {
  background: none;
  padding: 0;
}

.post-content blockquote {
  border-left: 4px solid hsl(var(--primary));
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: hsl(var(--muted-foreground));
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 6rem;
  height: fit-content;
}

.widget {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.widget h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid hsl(var(--border));
}

.widget ul {
  list-style: none;
}

.widget li {
  padding: 0.625rem 0;
  border-bottom: 1px solid hsl(var(--border) / 0.5);
}

.widget li:last-child {
  border-bottom: none;
}

.widget li a {
  color: hsl(var(--foreground));
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.widget li a:hover {
  color: hsl(var(--primary));
  padding-left: 0.5rem;
}

/* Ad Widget */
.ad-widget {
  background-color: hsl(var(--muted));
  border: 1px dashed hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.ad-placeholder {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

/* Footer */
footer {
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted) / 0.3);
  margin-top: 4rem;
  padding: 3rem 0 1.5rem;
}

footer .container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: block;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: hsl(var(--foreground));
}

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

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

.footer-section a {
  color: hsl(var(--muted-foreground));
  font-size: 0.9375rem;
  transition: color 0.2s ease;
}

.footer-section a:hover {
  color: hsl(var(--primary));
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid hsl(var(--border));
  text-align: center;
}

.footer-bottom p {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* Social Links */
.social-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background-color: hsl(var(--secondary));
  color: hsl(var(--foreground));
  transition: all 0.2s ease;
}

.social-link:hover {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  transform: translateY(-2px);
}

/* Related Books */
.related-books {
  margin-top: 3rem;
  padding: 2rem;
  background-color: hsl(var(--muted) / 0.5);
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
}

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

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

.book-card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.book-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.book-title {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.book-title a {
  color: hsl(var(--foreground));
}

.book-title a:hover {
  color: hsl(var(--primary));
}

.book-author {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.75rem;
}

.book-reason {
  font-size: 0.9375rem;
  color: hsl(var(--foreground) / 0.8);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.book-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--primary));
  transition: gap 0.2s ease;
}

.book-link:hover {
  gap: 0.75rem;
}

.book-link::after {
  content: '→';
}

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

  .sidebar {
    position: static;
  }

  .posts-list {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  main {
    padding: 2rem 1rem;
  }

  header .container {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .site-navigation nav ul {
    gap: 1rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

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

  .posts-list {
    grid-template-columns: 1fr;
  }

  .post-content {
    padding: 1.5rem;
  }

  .post-content h1 {
    font-size: 2rem;
  }

  .post-content h2 {
    font-size: 1.5rem;
  }

  .post-content h3 {
    font-size: 1.25rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  footer .container {
    padding: 0 1rem;
  }
}

/* Smooth Transitions */
* {
  transition-property: background-color, border-color, color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

button, a, .post-card, .card {
  transition-property: all;
  transition-duration: 200ms;
}