/**
 * Blog Archive Styles for Dev Marketing Flow Theme
 */

/* ==========================================================================
   Archive Header
   ========================================================================== */

.blog-archive {
  background: var(--bg-light);
  min-height: 100vh;
  padding: 3rem 0;
}

.archive-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.archive-title {
  font-size: 3rem;
  color: var(--text-color);
  margin-bottom: 1rem;
  font-weight: 700;
}

.archive-description {
  font-size: 1.125rem;
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ==========================================================================
   Blog Posts Grid
   ========================================================================== */

.blog-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

.blog-post-card {
  background: var(--bg-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-post-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(67, 24, 255, 0.15);
}

/* ==========================================================================
   Post Card Image
   ========================================================================== */

.post-card-image {
  width: 100%;
  height: 240px;
  overflow: hidden;
  position: relative;
}

.post-card-image a {
  display: block;
  width: 100%;
  height: 100%;
}

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

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

.post-card-image.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
}

.post-card-image.placeholder span {
  font-size: 4rem;
}

/* ==========================================================================
   Post Card Content
   ========================================================================== */

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

.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.post-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-date {
  font-size: 0.875rem;
  color: var(--text-light);
}

.post-card-title {
  font-size: 1.25rem;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.post-card-title a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.post-card-excerpt {
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* ==========================================================================
   Post Card Footer
   ========================================================================== */

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
}

.author-avatar-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-name {
  font-size: 0.875rem;
  color: var(--text-light);
  font-weight: 500;
}

.read-more-link {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: gap 0.3s ease;
}

.read-more-link:hover {
  gap: 0.5rem;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.blog-pagination {
  margin-top: 4rem;
}

.navigation.pagination {
  text-align: center;
}

.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 45px;
  height: 45px;
  padding: 0.5rem 1rem;
  background: var(--bg-color);
  color: var(--text-color);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.page-numbers:hover,
.page-numbers.current {
  background: var(--primary-color);
  color: var(--text-white);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.page-numbers.dots {
  border: none;
  background: transparent;
}

.page-numbers.dots:hover {
  transform: none;
  background: transparent;
  color: var(--text-color);
}

/* ==========================================================================
   Sidebar Layout (Optional)
   ========================================================================== */

.blog-archive.has-sidebar {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 3rem;
}

.blog-archive.has-sidebar .blog-posts-grid {
  grid-template-columns: repeat(2, 1fr);
}

/* ==========================================================================
   Featured Post
   ========================================================================== */

.featured-post {
  grid-column: 1 / -1;
}

.featured-post .post-card-image {
  height: 400px;
}

.featured-post .post-card-content {
  padding: 2rem;
}

.featured-post .post-card-title {
  font-size: 2rem;
}

.featured-post.blog-post-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.featured-post .post-card-image {
  height: 100%;
  min-height: 400px;
}

/* ==========================================================================
   Blog Categories/Tags
   ========================================================================== */

.blog-categories {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  justify-content: center;
}

.blog-category-link {
  padding: 0.5rem 1.25rem;
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  border-radius: 25px;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.blog-category-link:hover,
.blog-category-link.active {
  background: var(--primary-color);
  color: var(--text-white);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.no-posts-found {
  text-align: center;
  padding: 4rem 2rem;
}

.no-posts-found h2 {
  font-size: 2rem;
  color: var(--text-color);
  margin-bottom: 1rem;
}

.no-posts-found p {
  color: var(--text-light);
  font-size: 1.125rem;
  margin-bottom: 2rem;
}

/* ==========================================================================
   Search Results
   ========================================================================== */

.search-results .archive-header {
  background: var(--gradient-primary);
  color: var(--text-white);
  padding: 3rem 2rem;
  border-radius: 16px;
  margin-bottom: 3rem;
}

.search-results .archive-title {
  color: var(--text-white);
}

.search-results .archive-description {
  color: var(--text-white);
  opacity: 0.9;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.blog-posts-grid.loading {
  opacity: 0.6;
  pointer-events: none;
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.post-card-skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-light) 0%,
    var(--border-color) 50%,
    var(--bg-light) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1200px) {
  .blog-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 768px) {
  .blog-archive {
    padding: 2rem 0;
  }

  .archive-header {
    margin-bottom: 2rem;
    padding: 1rem 0;
  }

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

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

  .blog-posts-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .post-card-image {
    height: 200px;
  }

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

  .featured-post .post-card-image {
    height: 250px;
    min-height: auto;
  }

  .featured-post .post-card-title {
    font-size: 1.5rem;
  }

  .post-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

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

  .nav-links {
    gap: 0.25rem;
  }

  .page-numbers {
    min-width: 40px;
    height: 40px;
    padding: 0.5rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .archive-title {
    font-size: 1.75rem;
  }

  .post-card-content {
    padding: 1rem;
  }

  .post-card-title {
    font-size: 1.125rem;
  }

  .blog-categories {
    gap: 0.5rem;
  }

  .blog-category-link {
    font-size: 0.75rem;
    padding: 0.375rem 1rem;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  .blog-pagination,
  .post-card-footer,
  .archive-header {
    display: none;
  }

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

  .blog-post-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
