/**
 * Blog & Archive Pages Styles
 * 
 * @package NerdyByte
 */

/* ── POSTS GRID LAYOUT ────────────────────────– */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ── POST CARD COMPONENT ──────────────────────– */
.post-card {
  background: var(--light-card);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.post-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(123, 47, 255, 0.1);
  border-color: rgba(123, 47, 255, 0.2);
}

/* ── POST IMAGE WRAPPER ───────────────────────– */
.post-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #e2e8f0;
}

.post-image a {
  display: block;
  width: 100%;
  height: 100%;
}

.post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-card:hover .post-image img {
  transform: scale(1.08);
}

/* ── CATEGORY BADGE IN POST IMAGE ────────────– */
.post-category-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  z-index: 2;
}

.badge-link {
  background: rgba(123, 47, 255, 0.9);
  color: #fff;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.badge-link:hover {
  background: var(--primary);
  transform: translateY(-2px);
}

/* ── POST CONTENT SECTION ─────────────────────– */
.post-content {
  padding: 25px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ── POST TITLE ───────────────────────────────– */
.post-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 12px 0;
  line-height: 1.4;
}

.post-title a {
  color: var(--dark);
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-title a:hover {
  color: var(--primary);
}

/* ── POST METADATA ────────────────────────────– */
.post-meta {
  display: flex;
  gap: 15px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.post-meta a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-meta a:hover {
  color: var(--secondary);
}

.post-date,
.post-author,
.reading-time {
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-date i,
.post-author i,
.reading-time i {
  color: var(--primary);
  font-size: 12px;
}

/* ── POST EXCERPT ─────────────────────────────– */
.post-excerpt {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 15px 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── READ MORE LINK ───────────────────────────– */
.read-more-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  align-self: flex-start;
}

.read-more-link:hover {
  color: var(--secondary);
  gap: 12px;
}

.read-more-link i {
  font-size: 11px;
  transition: transform 0.3s ease;
}

.read-more-link:hover i {
  transform: translateX(4px);
}

/* ── BADGES & FILTERS ─────────────────────────– */
.badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--light-bg);
  color: var(--dark);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.filter-btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* ── NO POSTS MESSAGE ─────────────────────────– */
.no-posts-message {
  text-align: center;
  padding: 80px 20px;
}

.no-posts-message h2 {
  font-size: 36px;
  color: var(--dark);
  margin-bottom: 15px;
}

.no-posts-message p {
  color: var(--text-dim);
  font-size: 16px;
  margin-bottom: 30px;
}

/* ── FEATURED POST SECTION ────────────────────– */
.featured-post {
  background: linear-gradient(135deg, rgba(112, 52, 221, 0.1) 0%, rgba(14, 131, 242, 0.1) 100%);
  border: 1px solid rgba(123, 47, 255, 0.2);
  border-radius: 12px;
  padding: 40px;
  margin-bottom: 50px;
}

/* ── PAGE HEADER STYLING ──────────────────────– */
.page-header {
  text-align: left;
}

.page-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  color: #fff;
  margin-bottom: 15px;
  line-height: 1.2;
}

.section-tag {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 15px;
}

.section-sub {
  font-size: 16px;
  color: var(--text-dim);
  line-height: 1.8;
}

/* ── CATEGORY DESCRIPTION ─────────────────────– */
.category-description,
.tag-description {
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  line-height: 1.8;
  max-width: 700px;
  margin-top: 15px;
}

/* ── TAG CHIP STYLING ─────────────────────────– */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.tag-chip:hover {
  background: var(--secondary);
  border-color: var(--secondary);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(14, 131, 242, 0.2);
}

.tag-chip i {
  font-size: 11px;
}

/* ── PAGINATION STYLING ───────────────────────– */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 50px 0 0 0;
  flex-wrap: wrap;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.3s ease;
  color: var(--dark);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.page-numbers:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.page-numbers.current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.prev.page-numbers::before {
  content: "←";
  margin-right: 8px;
}

.next.page-numbers::after {
  content: "→";
  margin-left: 8px;
}

/* ── RESPONSIVE TABLET (1024px) ──────────────– */
@media (max-width: 1024px) {
  .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
  }

  .post-card {
    flex-direction: column;
  }

  .post-image {
    height: 180px;
  }

  .post-content {
    padding: 20px;
  }

  .page-title {
    font-size: clamp(28px, 4vw, 40px);
  }

  .section-title {
    font-size: clamp(24px, 3vw, 36px);
  }
}

/* ── RESPONSIVE MOBILE (768px) ───────────────– */
@media (max-width: 768px) {
  .posts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .post-image {
    height: 200px;
  }

  .post-content {
    padding: 18px;
  }

  .post-title {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .post-meta {
    font-size: 12px;
    gap: 12px;
  }

  .post-excerpt {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }

  .page-title {
    font-size: clamp(24px, 5vw, 32px);
    margin-bottom: 12px;
  }

  .section-title {
    font-size: clamp(20px, 4vw, 28px);
  }

  .section-sub {
    font-size: 15px;
  }

  .page-header {
    padding: 40px 0 30px !important;
  }

  /* Featured post grid stacking */
  .featured-post {
    padding: 25px;
  }

  .featured-post > div {
    grid-template-columns: 1fr !important;
  }
}

/* ── EXTRA SMALL DEVICES (480px) ─────────────– */
@media (max-width: 480px) {
  .post-card {
    margin-bottom: 0;
  }

  .post-image {
    height: 180px;
  }

  .post-content {
    padding: 16px;
  }

  .post-title {
    font-size: 15px;
  }

  .post-excerpt {
    font-size: 12px;
    margin-bottom: 12px;
  }

  .post-meta {
    font-size: 11px;
    gap: 10px;
  }

  .badge {
    padding: 6px 12px;
    font-size: 11px;
  }

  .filter-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .page-title {
    font-size: clamp(20px, 5vw, 24px);
  }

  .section-title {
    font-size: clamp(18px, 4vw, 24px);
  }

  .section-sub {
    font-size: 14px;
  }

  .pagination {
    gap: 8px;
    margin: 40px 0 0 0;
  }

  .page-numbers {
    min-width: 36px;
    height: 36px;
    font-size: 12px;
    padding: 0 8px;
  }
}
