/* Blog Index Styles - Forest Green Theme */
:root {
  --primary: #1b4332; /* Dark forest green */
  --primary-light: #2d6a4f; /* Medium forest green */
  --primary-dark: #1b4332; /* Dark forest green for headings */
  --accent: #52b788; /* Light green */
  --accent-light: #74c69d; /* Lighter green */
  --text-light: #d8f3dc; /* Very light green */
  --text-dark: #333333; /* Dark gray for body text */
  --background: #f8f9fa; /* Light background */
  --background-dark: #081c15; /* Dark background */
  --card: #ffffff; /* Card background */
  --card-dark: #1b2d2a; /* Dark card background */
  --border: #e9ecef; /* Light border */
  --border-dark: #2d6a4f; /* Dark border */
  --shadow: rgba(0, 0, 0, 0.1); /* Shadow color */
  --radius: 0.5rem; /* Border radius */
  --transition: all 0.3s ease; /* Default transition */
}

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

body {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  color: var(--text-dark);
  background-color: var(--background);
  line-height: 1.6;
}

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

/* Hero Section */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 3rem;
  box-shadow: 0 10px 30px var(--shadow);
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("/images/forest-pattern.svg");
  background-size: 200px;
  opacity: 0.05;
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 2rem;
  text-align: center;
}

.hero-title {
  font-family: "Merriweather", serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-description {
  font-size: 1.25rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Search Form */
.search-form {
  max-width: 500px;
  margin: 0 auto;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  border: none;
  border-radius: 50px;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  backdrop-filter: blur(5px);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.search-input:focus {
  outline: none;
  background-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.search-button {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--accent);
  color: var(--primary-dark);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.search-button:hover {
  background-color: var(--accent-light);
  transform: translateY(-50%) scale(1.05);
}

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

/* Blog Card */
.blog-card {
  display: flex;
  flex-direction: column;
  background-color: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 20px var(--shadow);
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px var(--shadow);
}

.blog-card-image {
  height: 200px;
  overflow: hidden;
}

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

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

.blog-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: var(--text-light);
  font-weight: 600;
  font-size: 1.5rem;
}

.blog-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--primary-dark);
  transition: color 0.2s ease;
  line-height: 1.4;
}

.blog-card:hover .blog-card-title {
  color: var(--primary);
}

.blog-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: #6c757d;
  margin-bottom: 1.5rem;
}

.blog-card-author,
.blog-card-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-card-action {
  margin-top: auto;
}

.read-more {
  display: inline-block;
  background-color: var(--primary-light);
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  transition: var(--transition);
}

.blog-card:hover .read-more {
  background-color: var(--primary);
}

/* No Blogs Found */
.no-blogs {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
}

.no-blogs i {
  font-size: 3rem;
  color: #adb5bd;
  margin-bottom: 1rem;
}

.no-blogs h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--primary-dark);
}

.no-blogs p {
  color: #6c757d;
  margin-bottom: 1.5rem;
}

.clear-search {
  display: inline-block;
  background-color: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.clear-search:hover {
  background-color: var(--primary-dark);
}

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

.pagination nav {
  display: inline-flex;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 10px var(--shadow);
}

.pagination-prev,
.pagination-next,
.pagination-number {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  background-color: var(--card);
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  border-right: 1px solid var(--border);
}

.pagination-prev:hover,
.pagination-next:hover,
.pagination-number:hover {
  background-color: var(--accent-light);
  color: var(--primary-dark);
}

.pagination-number.active {
  background-color: var(--primary);
  color: white;
}

.pagination-prev {
  border-radius: var(--radius) 0 0 var(--radius);
}

.pagination-next {
  border-radius: 0 var(--radius) var(--radius) 0;
  border-right: none;
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  animation: fadeIn 0.8s ease-out;
}

.blog-card {
  opacity: 0;
  animation: fadeIn 0.6s ease-out forwards;
}

/* Staggered animation for blog cards */
.blog-card:nth-child(1) {
  animation-delay: 0.1s;
}
.blog-card:nth-child(2) {
  animation-delay: 0.2s;
}
.blog-card:nth-child(3) {
  animation-delay: 0.3s;
}
.blog-card:nth-child(4) {
  animation-delay: 0.4s;
}
.blog-card:nth-child(5) {
  animation-delay: 0.5s;
}
.blog-card:nth-child(6) {
  animation-delay: 0.6s;
}
.blog-card:nth-child(7) {
  animation-delay: 0.7s;
}
.blog-card:nth-child(8) {
  animation-delay: 0.8s;
}
.blog-card:nth-child(9) {
  animation-delay: 0.9s;
}

/* Dark Mode Styles */
@media (prefers-color-scheme: dark) {
  body {
    background-color: var(--background-dark);
    color: var(--text-light);
  }

  .blog-card {
    background-color: var(--card-dark);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }

  .blog-card-title {
    color: var(--text-light);
  }

  .blog-card:hover .blog-card-title {
    color: var(--accent-light);
  }

  .blog-card-meta {
    color: #adb5bd;
  }

  .no-blogs h3 {
    color: var(--text-light);
  }

  .no-blogs p {
    color: #adb5bd;
  }

  .pagination-prev,
  .pagination-next,
  .pagination-number {
    background-color: var(--card-dark);
    color: var(--text-light);
    border-right: 1px solid var(--border-dark);
  }

  .pagination-prev:hover,
  .pagination-next:hover,
  .pagination-number:hover {
    background-color: var(--primary-light);
    color: white;
  }
}

/* Responsive Styles */
@media (max-width: 768px) {
  .hero-content {
    padding: 3rem 1.5rem;
  }

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

  .hero-description {
    font-size: 1.1rem;
  }

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

@media (max-width: 576px) {
  .hero-content {
    padding: 2.5rem 1rem;
  }

  .hero-title {
    font-size: 2rem;
  }

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

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

  .pagination nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .pagination-prev,
  .pagination-next,
  .pagination-number {
    margin: 0.25rem;
    border-radius: var(--radius);
    border: none;
    box-shadow: 0 2px 5px var(--shadow);
  }
}

/* Print Styles */
/* Print Styles (continued) */
@media print {
  .blog-card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
    margin-bottom: 1rem;
  }

  .blog-card-image {
    height: 150px;
  }

  .blog-card-title {
    color: black;
  }

  .blog-card-meta {
    color: #333;
  }
}

/* Accessibility Focus Styles */
a:focus,
button:focus,
input:focus {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .blog-card:hover {
    transform: none;
  }

  .blog-card:hover .blog-card-image img {
    transform: none;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}
