/* blog.css — shared styles for blog pages */
:root {
  --primary-color: #5cb85c;
  --secondary-color: #2c3e50;
  --muted: #6b7373;
  --bg: #fff;
  --max-width: 1100px;
  --gap: 2rem;
}

/* Page container */
.blog-container {
  margin: 0 auto;
  padding: 2.2rem 6%;
}
.blog-container h1 {
  text-align: center;
  margin-bottom: 20px;
}

/* Article header (title + meta) */
.article-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1.25rem;
}
.article-header h1 {
  font-size: clamp(1.6rem, 2.6vw, 2.25rem);
  color: var(--secondary-color);
  margin-bottom: 0;
}
.article-meta {
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}
.blog-meta-row {
  align-items: center;
  display: flex;
  justify-content: center;
}

/* Two-column hero layout: image + content */
.blog-hero {
  display: grid;
  grid-template-columns: 48% 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 1.6rem;
}
.blog-hero.alt {
  grid-template-columns: 1fr 48%;
} /* alternate layout */

/* hero image card */
.blog-hero .hero-media {
  background: linear-gradient(180deg, #f7fbf7, #fff);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}
.hero-media {
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-media img {
  width: 400px;
  height: 300px;
  object-fit: cover;
  display: block;
}

/* hero content (excerpt / read time / CTA) */
.hero-content {
  background: rgba(255, 255, 255, 0.98);
  padding: 1.1rem 1.25rem;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.04);
}
.hero-content h2 a {
  color: #5cb85c;
  text-decoration: none;
}
.hero-excerpt {
  color: #444;
  line-height: 1.7;
  margin-bottom: 0.9rem;
}
.read-time {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

/* article body */
.article-body {
  margin-top: 2rem;
  display: grid;
  gap: 1.1rem;
  color: #333;
  line-height: 1.8;
}
.article-body h2 {
  color: var(--secondary-color);
  margin-top: 0.6rem;
}
.article-body h3 {
  color: var(--primary-color);
  margin-top: 0.4rem;
}

/* recipe / tip boxes */
.callout {
  background: linear-gradient(
    180deg,
    rgba(92, 184, 92, 0.04),
    rgba(255, 255, 255, 0.98)
  );
  padding: 0.9rem;
  border-left: 4px solid var(--primary-color);
  border-radius: 8px;
  margin: 0.6rem 0;
}

/* image inside article */
.article-img {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
}

/* CTA block at end */
.blog-cta {
  margin-top: 2rem;
  text-align: center;
  padding: 1.1rem;
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    rgba(245, 250, 245, 0.9),
    rgba(255, 255, 255, 0.95)
  );
  box-shadow: 0 10px 30px rgba(92, 184, 92, 0.06);
}
.blog-cta .btn-primary {
  padding: 10px 16px;
  border-radius: 10px;
}
.blog-cta button{
  margin-top: 10px;
  color: #fff;
  background-color: #5cb85c;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.blog-cta button:hover{
  transform: scale(1.2);
}

/* Tags / share row */
/* .blog-meta-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.8rem;
} */
.tag {
  background: #f3f7f3;
  color: var(--primary-color);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Responsive: stack on smaller screens */
@media (max-width: 920px) {
  .blog-hero,
  .blog-hero.alt {
    grid-template-columns: 1fr;
  }
  .blog-container {
    padding: 1.6rem 5%;
  }
  .hero-content {
    order: 2;
  }
  .hero-media {
    order: 1;
    height: 260px;
  }
}

/* Mobile tweaks */
@media (max-width: 520px) {
  .hero-media {
    height: 200px;
  }
  .article-header h1 {
    font-size: 1.5rem;
  }
  .blog-hero {
    gap: 1rem;
  }
}

/* subtle reveal helper — uses .reveal/.visible pattern from global stylesheet */
.blog-hero .hero-media.reveal,
.blog-hero .hero-content.reveal,
.article-body .callout.reveal {
  transition: opacity 560ms cubic-bezier(0.2, 0.9, 0.2, 1),
    transform 560ms cubic-bezier(0.2, 0.9, 0.2, 1);
}



/* ---------- Simultaneous opposite-direction slide+fade (image + content) ---------- */

/* Base: hero children initial hidden state */
.blog-list-item .hero-media,
.blog-list-item .hero-content {
  opacity: 0;
  transform: translateX(0);
  transition: transform 560ms cubic-bezier(.2,.9,.2,1), opacity 560ms cubic-bezier(.2,.9,.2,1);
  will-change: transform, opacity;
}

/* IMAGE Sliding: from left or right */
.blog-list-item.img-from-left .hero-media {
  transform: translateX(-40px);
  opacity: 0;
}
.blog-list-item.img-from-right .hero-media {
  transform: translateX(40px);
  opacity: 0;
}

/* CONTENT Sliding: from left or right */
.blog-list-item.content-from-left .hero-content {
  transform: translateX(-40px);
  opacity: 0;
}
.blog-list-item.content-from-right .hero-content {
  transform: translateX(40px);
  opacity: 0;
}

/* Visible state: both image & content land and fade in simultaneously */
.blog-list-item.visible .hero-media,
.blog-list-item.visible .hero-content {
  transform: translateX(0);
  opacity: 1;
}

/* Micro-stagger for nicer polish (still effectively simultaneous) */
.blog-list-item.visible .hero-media { transition-delay: 0s; }
.blog-list-item.visible .hero-content { transition-delay: 0s; }

/* Slightly larger offset for wide screens */
@media (min-width: 900px) {
  .blog-list-item.img-from-left .hero-media,
  .blog-list-item.content-from-left .hero-content { transform: translateX(-48px); }
  .blog-list-item.img-from-right .hero-media,
  .blog-list-item.content-from-right .hero-content { transform: translateX(48px); }
}

/* On narrow screens switch to vertical slide (stacked layout): use translateY */
@media (max-width: 920px) {
  .blog-list-item.img-from-left .hero-media,
  .blog-list-item.img-from-right .hero-media,
  .blog-list-item.content-from-left .hero-content,
  .blog-list-item.content-from-right .hero-content {
    transform: translateY(12px);
  }
  .blog-list-item.visible .hero-media,
  .blog-list-item.visible .hero-content {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .blog-list-item .hero-media,
  .blog-list-item .hero-content {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
