/* ==========================================================================
   Blog listing page (templates/blog.html)
   Same palette as the header/footer and other redesigned pages.
   ========================================================================== */

.blog-page {
  --bl-ink: #171b24;
  --bl-muted: #676459;
  --bl-line: #e9e4d8;
  --bl-tint: #f7f5f0;
  --bl-primary: #1f2a44;
  --bl-primary-hover: #151d31;
  --bl-primary-soft: rgba(31, 42, 68, 0.08);
  --bl-gold: #b8903f;
  --bl-shadow: 0 1px 2px rgba(23, 27, 36, 0.04), 0 22px 44px -22px rgba(23, 27, 36, 0.3);

  color: var(--bl-muted);
}

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

/* ---------- Intro ---------- */

.blog-page .bl-intro {
  padding: 3.5rem 0 2.5rem;
  background: radial-gradient(40rem 18rem at 0% -20%, rgba(31, 42, 68, 0.1), transparent 70%);
}

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

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

.bl-intro h1 {
  max-width: 42rem;
  margin-bottom: 0.9rem;
  color: var(--bl-ink);
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.bl-intro .lead {
  max-width: 36rem;
  margin: 0;
  color: var(--bl-muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

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

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

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

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

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

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

.bl-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.35rem 1.5rem 1.5rem;
}

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

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

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

.bl-post h2,
.bl-post h3 {
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

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

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

.bl-post:hover h2 a,
.bl-post:hover h3 a {
  color: var(--bl-primary);
}

.bl-excerpt {
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

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

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

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

/* ---------- Featured (newest) post ---------- */

.bl-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  margin-bottom: 2.5rem;
}

.bl-featured .bl-media {
  min-height: 22rem;
}

.bl-featured .bl-body {
  justify-content: center;
  padding: clamp(1.5rem, 3.5vw, 3rem);
}

.bl-tag {
  align-self: flex-start;
  margin-bottom: 1rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--bl-primary-soft);
  color: var(--bl-primary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bl-featured h2 {
  font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.1rem);
  letter-spacing: 0;
}

.bl-featured .bl-excerpt {
  font-size: 1.05rem;
}

/* ---------- Grid cards ---------- */

.bl-card .bl-media {
  aspect-ratio: 16 / 10;
}

.bl-card h3 {
  font-size: 1.15rem;
}

.bl-card .bl-excerpt {
  font-size: 0.95rem;
}

.bl-empty {
  padding: 3rem 1rem;
  border: 1px dashed var(--bl-line);
  border-radius: 1.25rem;
  text-align: center;
}

/* ---------- Pagination ---------- */

.bl-pages {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 3rem 0 0;
  padding: 0;
  list-style: none;
}

.bl-pages a,
.bl-pages span {
  display: grid;
  place-items: center;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.9rem;
  border: 1px solid var(--bl-line);
  border-radius: 999px;
  background: #fff;
  color: var(--bl-ink);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.bl-pages a:hover {
  border-color: var(--bl-primary);
  color: var(--bl-primary);
}

.bl-pages [aria-current="page"] {
  border-color: var(--bl-primary);
  background: var(--bl-primary);
  color: #fff;
}

/* ---------- CTA ---------- */

.blog-page .bl-cta {
  padding: 4rem 0 5rem;
}

.bl-cta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: 1.5rem;
  background:
    radial-gradient(40rem 18rem at 100% 0%, rgba(31, 42, 68, 0.12), transparent 60%),
    var(--bl-tint);
}

.bl-cta h2 {
  margin-bottom: 0.4rem;
  color: var(--bl-ink);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
}

.bl-cta p {
  max-width: 34rem;
  margin: 0;
}

.blog-page .bl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  background: var(--bl-primary);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 12px 28px -12px rgba(31, 42, 68, 0.8);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.blog-page .bl-btn:hover {
  background: var(--bl-primary-hover);
  color: #fff;
  transform: translateY(-1px);
}

/* ---------- Focus, motion, responsive ---------- */

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

.bl-post h2 a:focus-visible,
.bl-post h3 a:focus-visible {
  outline: none;
}

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

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

@media (max-width: 991.98px) {
  .bl-featured {
    grid-template-columns: 1fr;
  }

  .bl-featured .bl-media {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 575.98px) {
  .blog-page .bl-intro {
    padding: 2.25rem 0 1.75rem;
  }

  .bl-featured {
    margin-bottom: 1.5rem;
  }

  .bl-cta .bl-btn {
    width: 100%;
    justify-content: center;
  }
}
