/* Combined b.css */
:root {
  /* Color variables */
  --primary-color: #2563eb;
  --secondary-color: #1f2937;
  --background-color: #f9fafb;
  --border-color: #e5e7eb;
  --color-primary: #ffffff;
  --color-shadow: rgba(0, 0, 0, 0.2);

  /* Size variables */
  --grid-gap: 1.5rem;
  --sidebar-width: 3fr;
  --main-content-span: 10;
  --sidebar-span: 2;
  --icon-size: 24px;
  --spacing-sm: 0.75rem;

  /* Transitions */
  --transition-speed: 0.3s;
  --transition-easing: ease;
}

/* Post Card Styles */
.post-card {
  transition: transform var(--transition-speed) var(--transition-easing), 
              box-shadow var(--transition-speed) var(--transition-easing);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-5px);
}

.post-image-container {
  height: 200px;
  overflow: hidden;
}

.post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--transition-easing);
}

.post-card:hover .post-image {
  transform: scale(1.05);
}

.post-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.post-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--secondary-color);
}

.dark .post-title {
  color: #9ca3af;
}

.post-excerpt {
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.dark .post-excerpt {
  color: #9ca3af;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.post-meta .post-date {
  margin-left: auto;
}

.category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background-color: #e0f2fe;
  color: #0369a1;
}

.dark .category-badge {
  background-color: #1e3a8a;
  color: #bfdbfe;
}

.post-date {
  font-size: 0.75rem;
  color: #9ca3af;
}

.read-more-btn {
  align-self: flex-start;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  transition: background-color 0.2s var(--transition-easing);
}

.read-more-btn:hover {
  background-color: #1d4ed8;
}

/* Sidebar Styles */
@media (min-width: 1024px) {
  .lg\:grid-cols-12 {
      grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .main-content {
      grid-column: 1 / var(--main-content-span);
  }

  .sidebar-container {
      grid-column: var(--main-content-span) / 13;
      display: flex;
      flex-direction: column;
      gap: var(--grid-gap);
  }
}

/* Promo Card Styles */
.promo-card {
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-speed) var(--transition-easing), 
              box-shadow var(--transition-speed) var(--transition-easing);
}

.promo-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.promo-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  object-fit: contain;
}

/* Category Grid Styles */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.category-card {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 20px;
  transition: transform 0.3s ease;
  border: 1px solid #e0e0e0;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.category-card h3 {
  margin-top: 0;
  color: #2c3e50;
}

.post-count {
  background: #3498db;
  color: white;
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.8em;
  float: right;
}

/* Error Page Styles */
.error-container {
  min-height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

.error-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
}

.error-title {
  font-size: 2.5rem;
  font-weight: bold;
  color: #1f2937;
  margin-bottom: 1rem;
}

.error-message {
  font-size: 1.25rem;
  color: #4b5563;
  margin-bottom: 2rem;
  max-width: 600px;
}

.error-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.error-details {
  margin-top: 2rem;
  padding: 1rem;
  background-color: #f3f4f6;
  border-radius: 0.5rem;
  max-width: 600px;
  text-align: left;
}

/* Post Content Styles */
.featured-image {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  margin: 2rem 0;
}

.additional-image-container {
  margin: 3rem 0;
  padding: 1.5rem;
}

.additional-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
}

.image-caption-f {
  margin-bottom: 1vh;
  margin-top: -3.5vh;
}

.active-toc {
  color: #3b82f6;
  font-weight: 600;
}

.view-count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: #6b7280;
}

/* Search Styles */
.search-container {
  position: relative;
  width: 100%;
}

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  z-index: 100;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}

.search-suggestion-item {
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.search-suggestion-item:hover {
  background-color: #f5f5f5;
}

.search-highlight {
  background-color: #0438A2;
  color: #fff;
}

/* Common Components */
.breadcrumb {
  font-size: 0.9em;
  margin-bottom: 20px;
}

.breadcrumb a {
  color: #3b82f6;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  color: #6b7280;
}

.category-badge {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-right: 4px;
  margin-bottom: 4px;
}

.category-badge:hover {
  background: #bae6fd;
  text-decoration: none;
}

.active-category {
  background: #0369a1;
  color: white;
}

.no-results {
  text-align: center;
  padding: 40px;
  font-size: 1.2em;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.post-date {
  color: #6b7280;
  font-size: 0.75rem;
}

/* Dark Mode Styles */
.dark .error-title {
  color: #f3f4f6;
}

.dark .error-message {
  color: #d1d5db;
}

.dark .error-details {
  background-color: #374151;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .featured-image {
      max-height: 300px;
  }

  .additional-image {
      max-height: 250px;
  }
}