/* ===== BLOG PAGE ===== */
/* Mobile-first — min-width media queries */

.blog-hero {
  padding: 110px 0 50px;
  text-align: center;
  width: 100%;
  overflow: hidden;
}

/* ===== SEARCH ===== */
.blog-search-wrap {
  width: 100%;
  max-width: 480px;
  margin: 2rem auto 2.5rem;
  position: relative;
}

.blog-search {
  width: 100%;
  padding: 0.85rem 1.2rem 0.85rem 3rem;
  background: var(--color-bg-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: border-color 0.2s ease;
}

.blog-search:focus {
  outline: none;
  border-color: var(--color-accent);
}

.blog-search::placeholder { color: var(--color-text-dim); }

.blog-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-dim);
  font-size: 1rem;
  pointer-events: none;
}

/* ===== BLOG GRID ===== */
/* 1 column mobile */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.blog-card {
  background: var(--color-bg-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  min-width: 0;
}

.blog-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-4px);
}

.blog-card[data-hidden="true"] { display: none; }

.blog-card-cover {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--color-bg-3);
  display: block;
}

.blog-card-cover-placeholder {
  height: 180px;
  background: var(--color-bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.blog-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.blog-card-date {
  font-size: 0.8rem;
  color: var(--color-text-dim);
  white-space: nowrap;
}

.blog-card-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.blog-tag {
  padding: 0.15rem 0.55rem;
  background: var(--color-accent-light);
  color: var(--color-accent);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 500;
}

.blog-card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.6rem;
  transition: color 0.2s;
  word-break: break-word;
}

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

.blog-card-excerpt {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1.25rem;
}

.blog-read-btn {
  align-self: flex-start;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: gap 0.2s;
}

.blog-card:hover .blog-read-btn { gap: 0.6rem; }

/* ===== NO RESULTS ===== */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--color-text-muted);
  display: none;
}

.no-results.visible { display: block; }

/* ===== BLOG POST PAGE ===== */
.post-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 100px 1.25rem 60px;
}

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  transition: color 0.2s;
}

.post-back:hover { color: var(--color-text); }

.post-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.post-date {
  font-size: 0.85rem;
  color: var(--color-text-dim);
  margin-bottom: 1rem;
}

.post-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.25;
  margin-bottom: 2rem;
  word-break: break-word;
}

.post-cover {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 2.5rem;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

/* ===== POST CONTENT (Markdown) ===== */
.post-content {
  color: var(--color-text-muted);
  line-height: 1.8;
  font-size: 1rem;
}

.post-content h2 {
  font-size: 1.4rem;
  color: var(--color-text);
  margin: 2rem 0 0.875rem;
}

.post-content h3 {
  font-size: 1.15rem;
  color: var(--color-text);
  margin: 1.75rem 0 0.75rem;
}

.post-content p { margin-bottom: 1.25rem; }

.post-content ul, .post-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.post-content li { margin-bottom: 0.5rem; }

.post-content code {
  background: var(--color-bg-3);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--color-accent);
}

.post-content pre {
  background: var(--color-bg-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: var(--color-text);
}

.post-content blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: 1.25rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: 1.5rem;
}

.post-content strong { color: var(--color-text); }
.post-content a { color: var(--color-accent); text-decoration: underline; }

.post-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
}

/* ===== POST CTA ===== */
.post-cta {
  margin-top: 3.5rem;
  padding: 2rem 1.5rem;
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.12), rgba(108, 99, 255, 0.04));
  border: 1px solid rgba(108, 99, 255, 0.3);
  border-radius: var(--radius);
  text-align: center;
}

.post-cta h3 { margin-bottom: 0.75rem; }

.post-cta p {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* hidden helper */
.hidden { display: none !important; }

/* ===== TABLET (min-width: 600px) ===== */
@media (min-width: 600px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== DESKTOP (min-width: 768px) ===== */
@media (min-width: 768px) {
  .blog-hero {
    padding: 140px 0 60px;
  }

  .blog-search-wrap {
    margin: 2rem auto 3rem;
  }

  .post-wrap {
    padding: 140px 2rem 80px;
  }

  .post-content {
    font-size: 1.05rem;
  }

  .post-content h2 {
    font-size: 1.6rem;
    margin: 2.5rem 0 1rem;
  }

  .post-content h3 {
    font-size: 1.25rem;
    margin: 2rem 0 0.75rem;
  }

  .post-cta {
    padding: 2.5rem;
  }
}

/* ===== LARGE DESKTOP (min-width: 1024px) ===== */
@media (min-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }

  .blog-card-cover {
    height: 200px;
  }

  .blog-card-cover-placeholder {
    height: 200px;
  }
}
