/* ===========================
   CSS Variables
   =========================== */
:root {
  --primary-color: #8b5cf6;
  --primary-hover: #7c3aed;
  --secondary-color: #ec4899;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --bg-color: #ffffff;
  --bg-secondary: #f9fafb;
  --border-color: #e5e7eb;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Playfair Display', Georgia, serif;
  
  --max-width: 1200px;
  --max-width-narrow: 800px;
  --spacing: 1rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

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

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

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

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

/* ===========================
   Container
   =========================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing);
}

.container-narrow {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
  padding: 0 var(--spacing);
}

/* ===========================
   Header & Navigation
   =========================== */
.site-header {
  background: var(--bg-color);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar {
  padding: 1rem 0;
}

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

.nav-brand a {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
}

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

.nav-menu a {
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.3s ease;
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text-color);
  transition: all 0.3s ease;
}

/* ===========================
   Hero Section
   =========================== */
.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 5rem 0;
  text-align: center;
}

.hero-content h1 {
  color: white;
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.hero-description {
  font-size: 1.25rem;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto;
}

/* ===========================
   Page Header
   =========================== */
.page-header {
  background: var(--bg-secondary);
  padding: 3rem 0;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.page-description {
  color: var(--text-light);
  font-size: 1.125rem;
}

/* ===========================
   Sections
   =========================== */
.featured-section,
.categories-section {
  padding: 4rem 0;
}

.featured-section h2,
.categories-section h2 {
  text-align: center;
  margin-bottom: 3rem;
  color: var(--text-color);
}

/* ===========================
   Stories Grid
   =========================== */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.story-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.story-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

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

.story-image {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  margin: -1.5rem -1.5rem 1rem;
}

.story-meta {
  margin-bottom: 0.75rem;
}

.category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--primary-color);
  color: white;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: capitalize;
}

.story-card h3 {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.story-card h3 a {
  color: var(--text-color);
}

.story-excerpt {
  color: var(--text-light);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-light);
}

/* ===========================
   Categories Grid
   =========================== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.category-item {
  display: block;
  padding: 2rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s ease;
}

.category-item:hover {
  border-color: var(--primary-color);
  transform: translateY(-3px);
}

.category-item h3 {
  color: var(--text-color);
  margin-bottom: 0.5rem;
  text-transform: capitalize;
}

.category-item .count {
  color: var(--text-light);
  font-size: 0.9375rem;
}

/* ===========================
   Terms Grid (Tags/Categories List)
   =========================== */
.terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.term-item {
  display: block;
  padding: 1.5rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-align: center;
  transition: all 0.3s ease;
}

.term-item:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
}

.term-item h3 {
  font-size: 1.125rem;
  color: var(--text-color);
  margin-bottom: 0.25rem;
  text-transform: capitalize;
}

.term-item .count {
  color: var(--text-light);
  font-size: 0.875rem;
}

/* ===========================
   Single Story Page
   =========================== */
.story-single {
  padding: 2rem 0 4rem;
}

.story-header {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
}

.story-categories {
  margin-bottom: 1rem;
}

.story-header h1 {
  font-size: 2.75rem;
  margin-bottom: 1rem;
}

.story-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-light);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}

.separator {
  color: var(--text-light);
}

.story-description {
  font-size: 1.125rem;
  color: var(--text-light);
  font-style: italic;
}

.story-content {
  padding: 3rem 0;
}

.story-content p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
  font-size: 1.0625rem;
}

.story-content h2,
.story-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.story-footer-meta {
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
}

.story-tags {
  margin-bottom: 1.5rem;
}

.tag-link {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: var(--bg-secondary);
  color: var(--text-color);
  border-radius: 20px;
  font-size: 0.875rem;
  margin: 0.25rem;
  transition: all 0.3s ease;
}

.tag-link:hover {
  background: var(--primary-color);
  color: white;
}

.share-buttons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.share-btn {
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  color: var(--text-color);
  border-radius: 6px;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.share-btn:hover {
  background: var(--primary-color);
  color: white;
}

/* ===========================
   Related Stories
   =========================== */
.related-stories {
  padding: 3rem 0;
  background: var(--bg-secondary);
  margin-top: 3rem;
}

.stories-grid-small {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.story-card-small {
  padding: 1.5rem;
  background: var(--bg-color);
  border-radius: 8px;
}

.story-card-small h4 {
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
}

.story-card-small h4 a {
  color: var(--text-color);
}

.story-excerpt-small {
  color: var(--text-light);
  font-size: 0.875rem;
}

/* ===========================
   Buttons
   =========================== */
.view-all {
  text-align: center;
  margin-top: 2rem;
}

.btn-primary {
  display: inline-block;
  padding: 0.875rem 2rem;
  background: var(--primary-color);
  color: white;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.pagination-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
}

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

/* ===========================
   Footer
   =========================== */
.site-footer {
  background: var(--text-color);
  color: white;
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

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

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

.footer-section p {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}

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

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

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

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

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.6);
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .nav-toggle {
    display: flex;
  }
  
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-color);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
  }
  
  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }
  
  .stories-grid {
    grid-template-columns: 1fr;
  }
  
  .categories-grid {
    grid-template-columns: 1fr;
  }
  
  .story-header h1 {
    font-size: 2rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  
  .hero {
    padding: 3rem 0;
  }
  
  .hero-content h1 {
    font-size: 2rem;
  }
  
  .featured-section,
  .categories-section {
    padding: 2rem 0;
  }
}

