/* ============================================================
   blog.css — Blog index + post detail styles
   Natural Soap Outpost
   Path: store/static/store/css/pages/blog.css
   Loaded via {% block extra_css %} in blog.html and blog_post.html
   ============================================================ */


/* ── Blog Index Grid ─────────────────────────────────────────── */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.blog-card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius, 0.5rem);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.blog-card__img-wrap {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--color-surface-alt, #f3f4f6);
}

.blog-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 0.5rem;
}

.blog-card:hover .blog-card__img {
  opacity: 0.9;
}

.blog-card__body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.blog-card__date {
  font-size: 0.8rem;
  margin: 0;
}

.blog-card__title {
  font-size: 1.1rem;
  margin: 0;
  line-height: 1.35;
}

.blog-card__title a {
  color: var(--color-text, #111);
  text-decoration: none;
}

.blog-card__title a:hover {
  text-decoration: underline;
}

.blog-card__excerpt {
  font-size: 0.92rem;
  color: var(--color-muted, #6b7280);
  margin: 0;
  flex: 1;
}

.blog-card__cta {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary, #2d6a4f);
  text-decoration: none;
  margin-top: 0.5rem;
  align-self: flex-start;
}

.blog-card__cta:hover {
  text-decoration: underline;
}


/* ── Blog Post Detail ────────────────────────────────────────── */

.blog-post__head {
  margin-bottom: 1.5rem;
}

/* Hero image */
.blog-post__hero {
  margin: 0 0 1.5rem;
  border-radius: var(--radius, 0.5rem);
  overflow: hidden;
  aspect-ratio: 21 / 9;
}

.blog-post__hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Post body typography */
.blog-post__body {
  line-height: 1.8;
  font-size: 1rem;
}

.blog-post__body h2,
.blog-post__body h3,
.blog-post__body h4 {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.blog-post__body p {
  margin-bottom: 1rem;
}

.blog-post__body ul {
  list-style-type: disc !important;
  padding-left: 2rem !important;
  margin-left: 0 !important;
  margin-bottom: 1rem;
}
 
.blog-post__body ol {
  list-style-type: decimal !important;
  padding-left: 2rem !important;
  margin-left: 0 !important;
  margin-bottom: 1rem;
}
 
.blog-post__body li {
  display: list-item !important;
  margin-bottom: 0.4rem;
}

/* Inline images — float so text wraps around them */
.blog-post__inline-img {
  max-width: 45%;
  margin: 0.25rem 1.75rem 1.25rem 0;
  float: left;
  clear: left;
}

/* Every second inline image floats right */
.blog-post__inline-img--right {
  float: right;
  margin: 0.25rem 0 1.25rem 1.75rem;
  clear: right;
}

.blog-post__inline-img img,
.blog-post__inline-img--right img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius, 0.5rem);
}

.blog-post__inline-img figcaption,
.blog-post__inline-img--right figcaption {
  font-size: 0.82rem;
  color: var(--color-muted, #6b7280);
  margin-top: 0.5rem;
  font-style: italic;
}

/* Clear floats after the post body so the CTA block sits below */
.blog-post__body::after {
  content: "";
  display: table;
  clear: both;
}

/* ── Responsive — stack images full-width on mobile ─────────── */
@media (max-width: 600px) {
  .blog-post__inline-img,
  .blog-post__inline-img--right {
    float: none;
    max-width: 100%;
    margin: 1.25rem 0;
  }
}

/* Shop CTA block */
.blog-post__cta {
  margin-top: 2rem;
  text-align: center;
}

.blog-post__cta p {
  margin-bottom: 1rem;
  color: var(--color-muted, #6b7280);
}


/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 600px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-post__hero {
    aspect-ratio: 16 / 9;
    border-radius: 0;
    margin-left: calc(-1 * var(--container-padding, 1rem));
    margin-right: calc(-1 * var(--container-padding, 1rem));
  }

  .blog-post__inline-img img {
    max-height: 260px;
  }
}

/* ── Blog Category Sections ──────────────────────────────────── */
.blog-category {
  margin-bottom: 3rem;
}

.blog-category__heading {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-border, #e5e7eb);
  color: var(--color-text, #111);
}