/* ==========================================================================
   Homepage "Latest stories" blog section (templates/index.html)
   Same palette as the header/footer and other redesigned sections.
   ========================================================================== */

.home-blog {
  --hb-ink: #171b24;
  --hb-muted: #676459;
  --hb-line: #e9e4d8;
  --hb-tint: #f7f5f0;
  --hb-primary: #1f2a44;
  --hb-gold: #b8903f;
  --hb-shadow: 0 1px 2px rgba(23, 27, 36, 0.04), 0 22px 44px -22px rgba(23, 27, 36, 0.3);

  padding: 5rem 0 3rem !important;
  color: var(--hb-muted);
}

/* style.css removes the container's side padding site-wide; restore it here */
.home-blog .container {
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  padding-right: calc(var(--bs-gutter-x) * 0.5);
}

/* ---------- Heading ---------- */

.hb-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 2.25rem;
}

.hb-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  color: var(--hb-gold);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hb-eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: currentColor;
}

.hb-head h2 {
  margin-bottom: 0.5rem;
  color: var(--hb-ink);
  font-size: clamp(1.9rem, 1.3rem + 2vw, 2.75rem);
  letter-spacing: 0;
}

.hb-head p {
  max-width: 32rem;
  margin: 0;
  font-size: 1.05rem;
}

.hb-all {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid rgba(23, 27, 36, 0.15);
  border-radius: 999px;
  color: var(--hb-ink);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.hb-all:hover {
  border-color: var(--hb-primary);
  color: var(--hb-primary);
}

/* ---------- Shared post bits ---------- */

.hb-post {
  position: relative;
  color: var(--hb-muted);
}

.hb-post h3 a {
  color: var(--hb-ink);
  text-decoration: none;
  transition: color 0.2s ease;
}

/* whole card clickable through the title link */
.hb-post h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hb-post:hover h3 a {
  color: var(--hb-primary);
}

.hb-media {
  overflow: hidden;
  background: var(--hb-tint);
}

.hb-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hb-post:hover .hb-media img {
  transform: scale(1.05);
}

.hb-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
  margin: 0 0 0.6rem;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
}

.hb-meta li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hb-meta i {
  color: var(--hb-gold);
}

/* ---------- Featured post ---------- */

.hb-featured {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--hb-line);
  border-radius: 1.5rem;
  background: #fff;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.hb-featured:hover {
  border-color: transparent;
  box-shadow: var(--hb-shadow);
  transform: translateY(-3px);
}

.hb-featured .hb-media {
  aspect-ratio: 16 / 10;
}

.hb-featured .hb-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.5rem 1.75rem 1.75rem;
}

.hb-featured h3 {
  margin-bottom: 0.6rem;
  font-size: clamp(1.3rem, 1.1rem + 0.6vw, 1.6rem);
  line-height: 1.3;
}

.hb-featured p {
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

.hb-read {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  color: var(--hb-primary);
  font-weight: 600;
}

.hb-read i {
  transition: transform 0.2s ease;
}

.hb-post:hover .hb-read i {
  transform: translateX(3px);
}

/* ---------- Compact list ---------- */

.hb-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hb-list > li {
  flex: 1;
}

.hb-compact {
  display: flex;
  align-items: stretch;
  gap: 1.1rem;
  height: 100%;
  padding: 0.85rem;
  border: 1px solid var(--hb-line);
  border-radius: 1.25rem;
  background: #fff;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.hb-compact:hover {
  border-color: transparent;
  box-shadow: var(--hb-shadow);
  transform: translateX(3px);
}

.hb-compact .hb-media {
  flex: none;
  width: 8.5rem;
  min-height: 6.5rem; /* fills the card height next to the featured post */
  border-radius: 0.9rem;
}

.hb-compact > div:last-child {
  align-self: center;
}

.hb-compact h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.4;
}

.home-blog a:focus-visible {
  outline: 2px solid var(--hb-primary);
  outline-offset: 3px;
}

.hb-post h3 a:focus-visible {
  outline: none;
}

.hb-post:has(h3 a:focus-visible) {
  outline: 2px solid var(--hb-primary);
  outline-offset: 3px;
}

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

@media (max-width: 575.98px) {
  .home-blog {
    padding-top: 3.5rem !important;
  }

  .hb-all {
    width: 100%;
    justify-content: center;
  }

  .hb-featured .hb-body {
    padding: 1.25rem;
  }

  .hb-compact {
    gap: 0.85rem;
    padding: 0.7rem;
  }

  .hb-compact .hb-media {
    width: 6.5rem;
  }

  .hb-compact h3 {
    font-size: 0.95rem;
  }
}
