/* ─── BLOG ENTRANCE ANIMATIONS ─────────────────────────── */

.blog-fade {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.blog-fade.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .blog-fade {
    opacity: 1;
    transform: none;
    transition: none;
  }
}


/* ─── BLOG LISTING PAGE ────────────────────────────────── */

.blog-listing {
  padding: var(--space-24) 0 var(--space-24);
  min-height: calc(100vh - 48px - 60px);
}

.blog-header {
  text-align: left;
  max-width: 680px;
  margin: 0 auto var(--space-12);
}

.blog-header h1 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
}

.blog-intro {
  color: var(--slate-600);
  font-size: 1.0625rem;
  line-height: 1.6;
  letter-spacing: 0.005em;
}

.blog-grid {
  display: grid;
  gap: 0;
  max-width: 680px;
  margin: 0 auto;
}

.blog-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: var(--space-8) 0;
  border-bottom: 1px solid rgba(101, 163, 13, 0.18);
  transition: opacity 300ms ease;
}

.blog-card:first-child {
  border-top: 1px solid rgba(101, 163, 13, 0.18);
}

.blog-grid:hover .blog-card {
  opacity: 0.45;
}

.blog-grid:hover .blog-card:hover {
  opacity: 1;
}

.blog-card-image {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  display: block;
  border-radius: 10px;
  margin-bottom: var(--space-4);
}

.blog-card-body {
  padding: 0;
}

.blog-card-body time {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.blog-card-body h2 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: var(--space-1) 0 var(--space-2);
  color: var(--slate-900);
  transition: color 250ms ease;
}

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

.blog-card-body p {
  font-size: 0.9375rem;
  color: var(--slate-500);
  line-height: 1.6;
  margin: 0;
}

.blog-card-meta {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--slate-400);
  margin-top: var(--space-3);
  display: inline-block;
}


/* ─── BLOG POST PAGE ──────────────────────────────────── */

.blog-post {
  padding: var(--space-24) 0 var(--space-24);
}

/* Post header — same column width as .post-content */
.post-header {
  max-width: 720px;
  margin: 0 auto var(--space-8);
  padding: 0 var(--space-6);
  text-align: left;
}

.back-to-blog {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: var(--space-6);
  text-decoration: none;
  transition: color 200ms ease, gap 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.back-to-blog:hover {
  color: var(--accent-hover);
  gap: 6px;
}

.post-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-4);
  color: var(--slate-900);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: var(--space-4);
  font-size: 0.875rem;
  color: var(--slate-500);
}

.post-tags {
  display: flex;
  gap: var(--space-2);
}

.tag {
  background: var(--accent-light, rgba(101, 163, 13, 0.1));
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 200ms ease;
}

.post-featured-image {
  width: 100%;
  max-width: 960px;
  margin: var(--space-8) auto 0;
  display: block;
  border-radius: 12px;
  box-shadow: 0 8px 30px -8px rgba(0, 0, 0, 0.1);
}


/* ─── POST CONTENT — READING EXPERIENCE ───────────────── */

.post-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--slate-800);
}

/* Headings */
.post-content h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: var(--space-12) 0 var(--space-4);
  color: var(--slate-900);
}

.post-content h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: var(--space-8) 0 var(--space-4);
  color: var(--slate-900);
}

/* Paragraphs */
.post-content p {
  margin-bottom: var(--space-6);
  max-width: none;
}

.post-content p + p {
  margin-top: 0;
}

/* Inline elements */
.post-content strong {
  color: var(--slate-900);
  font-weight: 600;
}

.post-content em {
  font-style: italic;
}

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 200ms ease, text-decoration-color 200ms ease;
}

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

/* Blockquotes */
.post-content blockquote {
  margin: var(--space-8) 0;
  padding: var(--space-4) var(--space-6);
  border-left: 3px solid var(--accent);
  background: var(--slate-50);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--slate-700);
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

/* Images */
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: var(--space-8) 0;
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.08);
}

/* Inline code */
.post-content code {
  font-size: 0.9em;
  background: var(--slate-100);
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 500;
  color: var(--slate-800);
}

/* Code blocks */
.post-content pre {
  margin: var(--space-8) 0;
  padding: var(--space-6);
  background: var(--slate-100);
  border-radius: 12px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.7;
  -webkit-overflow-scrolling: touch;
}

.post-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
}

/* Lists */
.post-content ul,
.post-content ol {
  margin: var(--space-4) 0 var(--space-6);
  padding-left: 1.5em;
}

.post-content li {
  margin-bottom: var(--space-2);
  line-height: 1.7;
}

.post-content li::marker {
  color: var(--accent);
}

/* Horizontal rules */
.post-content hr {
  border: none;
  height: 1px;
  background: var(--slate-200);
  margin: var(--space-12) auto;
  max-width: 80px;
}


/* ─── FULL-BLEED BREAKOUT ─────────────────────────────── */

.post-content .full-bleed {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  border-radius: 0;
  box-shadow: none;
}


/* ─── INTERACTIVE BLOCK CONTAINER ─────────────────────── */

.post-content .interactive-block {
  max-width: 900px;
  margin: var(--space-12) auto;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  overflow: hidden;
}

.interactive-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
}

.interactive-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.interactive-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-900);
}

.interactive-body {
  padding: var(--space-6);
}


/* ─── FIGURES & CAPTIONS ──────────────────────────────── */

.post-content figure {
  margin: var(--space-8) 0;
}

.post-content figure img {
  margin: 0;
  width: 100%;
}

.post-content figcaption {
  text-align: center;
  font-size: 0.875rem;
  color: var(--slate-500);
  margin-top: var(--space-2);
  line-height: 1.5;
}


/* ─── POST SIGN-OFF ───────────────────────────────────── */

.post-signoff {
  margin-top: var(--space-8);
  font-style: italic;
  color: var(--slate-600);
  line-height: 1.6;
}


/* ─── POST NAVIGATION ─────────────────────────────────── */

.post-nav {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  max-width: 720px;
  margin: var(--space-12) auto 0;
  padding: var(--space-6);
  border-top: 1px solid var(--slate-200);
  gap: var(--space-4);
}

.post-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: color 200ms ease;
  max-width: 45%;
}

.post-nav a:hover {
  color: var(--accent-hover);
}

.post-nav-prev {
  text-align: left;
}

.post-nav-next {
  text-align: right;
  margin-left: auto;
}


/* ─── RESPONSIVE ──────────────────────────────────────── */

@media (max-width: 768px) {
  .blog-listing {
    padding: var(--space-16) 0 var(--space-16);
  }

  .blog-header {
    margin-bottom: var(--space-8);
  }

  .blog-post {
    padding: var(--space-16) 0 var(--space-16);
  }

  .post-header h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
  }

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

  .post-content h2 {
    font-size: 1.35rem;
    margin-top: var(--space-8);
  }

  .post-content h3 {
    font-size: 1.15rem;
    margin-top: var(--space-6);
  }

  .post-nav {
    flex-direction: column;
    gap: var(--space-4);
  }

  .post-nav a {
    max-width: 100%;
  }

  .post-nav-next {
    margin-left: 0;
    text-align: left;
  }
}


/* ─── SMOOTH THEME TRANSITIONS ────────────────────────── */

.blog-card,
.post-content,
.post-header,
.tag,
.post-nav {
  transition: background-color 350ms ease, color 350ms ease, border-color 350ms ease;
}


/* ─── REDUCED MOTION ──────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .blog-card {
    transition: none !important;
  }

  .blog-grid:hover .blog-card {
    opacity: 1;
  }
}
