/* ==========================================================================
   HeartandHome — Blog / Latest Articles Section
   Injected via PHP hook (et_theme_builder_template_before_footer).
   Renders after Divi body content, before Theme Builder footer.

   Enqueued by: wp-content/themes/heartandhome-child/functions.php
   Handle: hh-blog (depends on hh-tokens)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Section container — cream background, section padding
   -------------------------------------------------------------------------- */

.hh-blog-section {
  background-color: var(--hh-bg-cream);
  padding: var(--hh-padding-section-y) var(--hh-padding-section-x);
}

/* --------------------------------------------------------------------------
   Inner wrapper — max-width to match Divi content width
   -------------------------------------------------------------------------- */

.hh-blog-inner {
  max-width: 1200px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Header row — heading left, "View All" right
   -------------------------------------------------------------------------- */

.hh-blog-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--hh-gap-section);
}

.hh-blog-header-row > div {
  flex: 1;
}

.hh-blog-header-row .hh-blog-heading {
  margin-bottom: 0;
}

.hh-blog-view-all {
  font-family: var(--hh-font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--hh-accent-sage);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
  flex-shrink: 0;
  padding-bottom: 6px;
}

.hh-blog-view-all:hover,
.hh-blog-view-all:focus-visible {
  color: var(--hh-btn-sage-hover-bg);
}

/* --------------------------------------------------------------------------
   Eyebrow label — sage green, uppercase, tracked
   -------------------------------------------------------------------------- */

.hh-blog-eyebrow {
  display: block;
  font-family: var(--hh-font-body);
  font-size: var(--hh-font-label);
  font-weight: 600;
  letter-spacing: var(--hh-ls-label);
  color: var(--hh-accent-sage);
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   Section heading — Fraunces, left-aligned, large
   -------------------------------------------------------------------------- */

.hh-blog-heading {
  font-family: var(--hh-font-heading);
  font-size: var(--hh-font-heading-section);
  font-weight: 400;
  letter-spacing: var(--hh-ls-heading);
  line-height: 1.15;
  color: var(--hh-text-primary);
  margin: 0 0 var(--hh-gap-section) 0;
}

/* --------------------------------------------------------------------------
   4-column card grid
   -------------------------------------------------------------------------- */

.hh-blog-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

/* --------------------------------------------------------------------------
   Blog card — full clickable link, no text decoration
   -------------------------------------------------------------------------- */

.hh-blog-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease;
}

.hh-blog-card:hover,
.hh-blog-card:focus-visible {
  transform: translateY(-4px);
}

/* --------------------------------------------------------------------------
   Card image — 16:10 aspect ratio, rounded corners
   -------------------------------------------------------------------------- */

.hh-blog-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--hh-radius-card-sm);
  overflow: hidden;
  margin-bottom: 16px;
}

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

/* Subtle dark gradient overlay — matches services card style */
.hh-blog-card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 40%, rgba(0, 0, 0, 0.35));
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
}

/* --------------------------------------------------------------------------
   Card body — text content below image
   -------------------------------------------------------------------------- */

.hh-blog-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Category pill — outlined, small text
   -------------------------------------------------------------------------- */

.hh-blog-card-category {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--hh-font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--hh-text-primary);
  background: transparent;
  border: 1px solid var(--hh-border-light);
  padding: 4px 10px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Card title — body font, medium weight
   -------------------------------------------------------------------------- */

.hh-blog-card-title {
  font-family: var(--hh-font-body);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--hh-text-primary);
  margin: 4px 0 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Meta line — date + read time with separator, top border
   -------------------------------------------------------------------------- */

.hh-blog-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--hh-font-body);
  font-size: var(--hh-font-body-small);
  color: var(--hh-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-top: 14px;
  margin-top: 4px;
  border-top: 1px solid var(--hh-border-light);
}

.hh-blog-card-meta span:last-child {
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Responsive — Tablet (max-width: 980px)
   -------------------------------------------------------------------------- */

@media (max-width: 980px) {
  .hh-blog-section {
    padding: 60px 40px;
  }

  .hh-blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .hh-blog-heading {
    font-size: 32px;
  }

  .hh-blog-view-all {
    font-size: 13px;
  }
}

/* --------------------------------------------------------------------------
   Remove white strip between blog section and footer
   -------------------------------------------------------------------------- */

.et-l--footer .et_pb_section_0_tb_footer {
  padding-top: 0 !important;
  background-color: var(--hh-bg-cream) !important;
}

/* --------------------------------------------------------------------------
   Responsive — Phone (max-width: 767px)
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  .hh-blog-section {
    padding: 48px 20px;
  }

  .hh-blog-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hh-blog-heading {
    font-size: 26px;
  }

  .hh-blog-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .hh-blog-card-title {
    font-size: 16px;
  }
}

/* --------------------------------------------------------------------------
   SW-6 — prefers-reduced-motion: disable transitions & animations
   -------------------------------------------------------------------------- */

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