/* Clean & Readable Blog Styles */

:root {
  --primary: #0f172a;
  --accent: #000000;
  --neutral-50: #ffffff;
  --neutral-100: #f5f5f5;
  --neutral-500: #666666;
  --neutral-700: #111111;
}

body {
  background: #fafafa;
  color: #111111;
}

/* Blog Hero */
.blog-hero {
  text-align: center;
  padding: 4rem 1.5rem 2.75rem;
  margin-bottom: 2rem;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.blog-hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  margin-bottom: 0.9rem;
  color: #000000;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.blog-hero p {
  font-size: 1.02rem;
  color: var(--neutral-500);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Blog Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

/* Hide the filter completely in post view */
body.post-view #blog-filter {
  display: none !important;
}

/* Polished tag chips */
#blog-filter {
  padding: 0.9rem 1rem;
  background: #ffffff;
  border: 1px solid #dedede;
  border-radius: 14px;
  align-items: center;
}

#blog-filter > span {
  color: #000000;
  letter-spacing: -0.01em;
}

#tag-chips {
  gap: 0.5rem;
}

.tag-chip {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 9999px;
  padding: 0.55rem 0.95rem;
  background: #f2f2f2;
  color: #111111;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.tag-chip:hover {
  background: #e8e8e8;
  color: #000000;
  border-color: #cccccc;
}

.tag-chip:focus-visible {
  outline: 3px solid rgba(0, 0, 0, 0.18);
  outline-offset: 2px;
}

.tag-chip-active {
  background: #111111;
  color: #fff;
  border-color: rgba(0, 0, 0, 0.35);
}

.tag-chip-active:hover {
  background: #000000;
  color: #fff;
}

/* Post Cards */
.post-card {
  background: white;
  border: 1px solid #dfdfdf;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  min-height: 480px;
}

.post-card:hover {
  border-color: #bdbdbd;
}

.post-image-wrapper {
  width: 100%;
  height: 210px;
  overflow: hidden;
  background: #f3f4f6;
  flex-shrink: 0;
}

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

.post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.post-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.7rem;
  color: #000000;
  line-height: 1.45;
  min-height: 3rem;
}

.post-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
  font-size: 0.84rem;
  color: var(--neutral-500);
}

.post-read-time {
  background: var(--neutral-100);
  padding: 0.28rem 0.7rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--neutral-700);
}

.post-description {
  color: var(--neutral-700);
  margin-bottom: 1rem;
  line-height: 1.65;
  font-size: 0.92rem;
  line-clamp: 2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3rem;
  max-height: 3rem;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.15rem;
  min-height: 1.5rem;
}

.post-tag {
  display: inline-block;
  background: var(--neutral-100);
  color: var(--neutral-700);
  padding: 0.35rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  white-space: nowrap;
  font-weight: 500;
}

.read-more-btn {
  display: inline-block;
  background: #000000;
  color: white;
  padding: 0.65rem 1.25rem;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  align-self: flex-start;
  transition: background-color 0.2s ease;
  margin-top: auto;
}

.read-more-btn:hover {
  background-color: #111111;
}

/* Post Page */
.post-wrapper {
  max-width: 720px;
  margin: 0 auto;
}

.post-hero {
  margin-bottom: 2rem;
  border-radius: 12px;
  overflow: hidden;
}

.post-hero img {
  width: 100%;
  height: auto;
  display: block;
}

.post-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  color: #000000;
  letter-spacing: -0.03em;
}

.post-header-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 1.75rem;
}

.post-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #000000;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.post-author-details {
  display: flex;
  flex-direction: column;
}

.post-author-name {
  font-weight: 600;
  color: #000000;
  font-size: 0.9rem;
}

.post-date-large {
  font-size: 0.82rem;
  color: var(--neutral-500);
}

/* Article Content - Enhanced Typography */
.post-content {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--neutral-700);
}

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

.post-content h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #000000;
  line-height: 1.35;
}

.post-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #000000;
}

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

.post-content li {
  margin-bottom: 0.7rem;
  line-height: 1.8;
}

.post-content strong {
  font-weight: 700;
  color: #000000;
}

.post-content a {
  color: #000000;
  text-decoration: underline;
  font-weight: 600;
}

.post-content a:hover {
  text-decoration-thickness: 2px;
}

/* CTA Section */
.post-cta {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  padding: 1.75rem;
  border-radius: 12px;
  margin-top: 2.5rem;
  text-align: center;
}

.post-cta h3 {
  color: #000000;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  margin-top: 0;
}

.post-cta p {
  color: var(--neutral-700);
  margin-bottom: 1rem;
}

.post-cta a {
  display: inline-block;
  background: #000000;
  color: white;
  padding: 0.65rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.post-cta a:hover {
  background-color: #111111;
}

/* Back Link */
.back-to-blog {
  display: inline-block;
  color: #000000;
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.back-to-blog:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .blog-hero h1 {
    font-size: 2.4rem;
  }

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

  .post-title {
    font-size: 1.9rem;
  }

  .post-content {
    font-size: 1rem;
    line-height: 1.75;
  }

  .post-content h2 {
    font-size: 1.25rem;
  }

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

  .post-image-wrapper {
    height: 190px;
  }
}
