/**
 * Professional Blog Archive Styling
 * Modern grid layout for blog posts
 *
 * @format
 */

/* Archive Wrapper */
.blog-archive-wrapper {
  background: #f8f9fa;
  min-height: 100vh;
}

/* Archive Header */
.blog-archive-header {
  background: linear-gradient(135deg, #70023d 0%, #8b0349 100%);
  color: #fff;
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}

.blog-archive-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.blog-archive-header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px;
  position: relative;
  z-index: 1;
}

.archive-type {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 25px;
}

.archive-type svg {
  width: 20px;
  height: 20px;
}

.archive-title {
  font-size: 56px;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  margin: 0 0 20px 0;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.archive-description {
  font-size: 18px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.95);
  max-width: 800px;
  margin-top: 20px;
}

.archive-description p {
  margin: 0 0 10px 0;
}

.archive-description p:last-child {
  margin-bottom: 0;
}

/* Author Archive Specific */
.archive-author-info {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-top: 20px;
}

.archive-author-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.archive-author-details {
  flex: 1;
}

/* Content Section */
.blog-archive-content {
  padding: 60px 0 80px;
}

.blog-archive-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 30px;
}

/* Posts Grid */
.blog-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 40px;
  margin-bottom: 60px;
}

/* Post Card */
.blog-post-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}

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

/* Post Image */
.post-card-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #f5f5f5 0%, #e9ecef 100%);
}

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

.post-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-post-card:hover .post-thumbnail {
  transform: scale(1.08);
}

/* Category Badge on Image */
.post-card-category {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 2;
}

.category-badge-card {
  display: inline-block;
  background: #70023d;
  color: #fff;
  padding: 8px 20px;
  border-radius: 25px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(112, 2, 61, 0.4);
  transition: all 0.3s ease;
}

.category-badge-card:hover {
  background: #8b0349;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(112, 2, 61, 0.5);
}

/* Category Badge for posts without image */
.post-card-category-top {
  margin-bottom: 15px;
}

.category-badge-inline {
  display: inline-block;
  background: #70023d;
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.category-badge-inline:hover {
  background: #8b0349;
  transform: translateY(-2px);
}

/* Post Content */
.post-card-content {
  padding: 30px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Post Meta */
.post-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 15px;
  font-size: 13px;
  color: #999;
}

.meta-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #666;
}

.author-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #f0f0f0;
}

.meta-separator {
  color: #ddd;
  font-weight: 400;
}

.meta-date,
.meta-reading-time {
  color: #999;
  font-weight: 500;
}

/* Post Title */
.post-card-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 15px 0;
  color: #1a1a1a;
}

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

.post-card-title a:hover {
  color: #70023d;
}

/* Post Excerpt */
.post-card-excerpt {
  font-size: 16px;
  line-height: 1.7;
  color: #666;
  margin-bottom: 20px;
  flex-grow: 1;
}

/* Read More Link */
.post-read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #70023d;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  margin-top: auto;
}

.post-read-more:hover {
  gap: 12px;
  color: #8b0349;
}

.post-read-more svg {
  width: 16px;
  height: 16px;
}

/* Pagination */
.blog-archive-pagination {
  margin-top: 60px;
}

.pagination-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pagination-list li {
  display: inline-block;
}

.pagination-list a,
.pagination-list .current,
.pagination-list .dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 48px;
  height: 48px;
  padding: 0 20px;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  color: #333;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.pagination-list a:hover {
  background: #70023d;
  border-color: #70023d;
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(112, 2, 61, 0.3);
}

.pagination-list .current {
  background: #70023d;
  border-color: #70023d;
  color: #fff;
  pointer-events: none;
}

.pagination-list .dots {
  border: none;
  background: transparent;
  color: #999;
  pointer-events: none;
}

.pagination-list .prev,
.pagination-list .next {
  font-weight: 700;
}

.pagination-list svg {
  width: 20px;
  height: 20px;
}

/* No Posts Found */
.blog-no-posts {
  text-align: center;
  padding: 100px 30px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.no-posts-content {
  max-width: 500px;
  margin: 0 auto;
}

.no-posts-content svg {
  color: #ccc;
  margin-bottom: 30px;
}

.no-posts-content h2 {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 15px 0;
}

.no-posts-content p {
  font-size: 18px;
  line-height: 1.6;
  color: #666;
  margin: 0 0 30px 0;
}

.btn-home {
  display: inline-block;
  padding: 15px 35px;
  background: linear-gradient(135deg, #70023d 0%, #8b0349 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 30px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(112, 2, 61, 0.3);
}

.btn-home:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(112, 2, 61, 0.4);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .blog-posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 35px;
  }

  .archive-title {
    font-size: 48px;
  }
}

@media (max-width: 992px) {
  .blog-archive-header {
    padding: 60px 0 50px;
  }

  .archive-title {
    font-size: 42px;
  }

  .blog-posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
  }

  .blog-archive-content {
    padding: 50px 0 60px;
  }

  .archive-author-info {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .blog-archive-header {
    padding: 50px 0 40px;
  }

  .blog-archive-header-container,
  .blog-archive-container {
    padding: 0 20px;
  }

  .archive-type {
    font-size: 12px;
    padding: 8px 16px;
  }

  .archive-type svg {
    width: 16px;
    height: 16px;
  }

  .archive-title {
    font-size: 36px;
  }

  .archive-description {
    font-size: 16px;
  }

  .archive-author-avatar {
    width: 100px;
    height: 100px;
  }

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

  .blog-archive-content {
    padding: 40px 0 50px;
  }

  .post-card-content {
    padding: 25px;
  }

  .post-card-title {
    font-size: 22px;
  }

  .pagination-list a,
  .pagination-list .current {
    min-width: 44px;
    height: 44px;
    padding: 0 15px;
    font-size: 15px;
  }
}

@media (max-width: 576px) {
  .blog-archive-header {
    padding: 40px 0 30px;
  }

  .archive-title {
    font-size: 30px;
  }

  .archive-description {
    font-size: 15px;
  }

  .archive-author-avatar {
    width: 80px;
    height: 80px;
  }

  .post-card-image {
    aspect-ratio: 16 / 11;
  }

  .post-card-category {
    bottom: 15px;
    left: 15px;
  }

  .category-badge-card {
    padding: 6px 16px;
    font-size: 11px;
  }

  .post-card-content {
    padding: 20px;
  }

  .post-card-meta {
    font-size: 12px;
    gap: 8px;
  }

  .author-avatar-small {
    width: 28px;
    height: 28px;
  }

  .post-card-title {
    font-size: 20px;
  }

  .post-card-excerpt {
    font-size: 15px;
  }

  .pagination-list {
    gap: 8px;
  }

  .pagination-list a,
  .pagination-list .current {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
  }

  .pagination-list .prev span,
  .pagination-list .next span {
    display: none;
  }

  .pagination-list svg {
    width: 18px;
    height: 18px;
  }

  .no-posts-content {
    padding: 0 20px;
  }

  .no-posts-content h2 {
    font-size: 26px;
  }

  .no-posts-content p {
    font-size: 16px;
  }
}

/* Loading Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.blog-post-card {
  animation: fadeInUp 0.6s ease-out;
  animation-fill-mode: both;
}

/* Stagger animation for cards */
.blog-post-card:nth-child(1) {
  animation-delay: 0.1s;
}
.blog-post-card:nth-child(2) {
  animation-delay: 0.15s;
}
.blog-post-card:nth-child(3) {
  animation-delay: 0.2s;
}
.blog-post-card:nth-child(4) {
  animation-delay: 0.25s;
}
.blog-post-card:nth-child(5) {
  animation-delay: 0.3s;
}
.blog-post-card:nth-child(6) {
  animation-delay: 0.35s;
}

/* Print Styles */
@media print {
  .blog-archive-header {
    background: #fff;
    color: #000;
    padding: 20px 0;
  }

  .blog-archive-header::before {
    display: none;
  }

  .archive-type {
    background: #f0f0f0;
    color: #000;
  }

  .archive-title {
    color: #000;
    text-shadow: none;
  }

  .blog-post-card {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
    margin-bottom: 20px;
  }

  .post-read-more,
  .blog-archive-pagination {
    display: none;
  }
}
