/* ============================================================
   Canopy Blog Archive — cnp-blog.css  v1.1 (polish pass)
   Loaded only on is_home() via canopy-blog-archive.php
   All classes prefixed cnp-blog-
   Color tokens match canopy-ui.css:
     Navy  #1a365d | Orange #c4501a | Ink #0f172a | Muted #475569
     Border #e2e8f0 | Font: system-ui stack (titles: serif)
   ============================================================ */

/* ── Divi layout reset (centering fix) ──────────────────────────────────── */
/* Divi sets #left-area to float:left on blog pages — but our template has
   no sidebar, so #et-main-area must fill the viewport width. */
body.blog #et-main-area,
body.home #et-main-area {
  width: 100%;
  max-width: 100%;
  float: none;
}
.cnp-blog-archive {
  width: 100%;
}

/* ── Box-sizing scope ───────────────────────────────────────────────────── */
.cnp-blog-archive,
.cnp-blog-archive * {
  box-sizing: border-box;
}

/* ── Wrapper ────────────────────────────────────────────────────────────── */
.cnp-blog-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ── Page Header ────────────────────────────────────────────────────────── */
.cnp-blog-header {
  margin-bottom: 40px;
}
.cnp-blog-heading {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #1a365d;
  margin: 0 0 10px;
  line-height: 1.2;
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
}
.cnp-blog-subtext {
  font-size: 17px;
  color: #475569;
  margin: 0;
  line-height: 1.6;
}

/* ── Badge (category pill) ──────────────────────────────────────────────── */
.cnp-blog-badge {
  display: inline-block;
  padding: 4px 12px;
  background: #c4501a;
  color: #ffffff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  line-height: 1.6;
  white-space: nowrap;
  transition: background 0.2s;
}
.cnp-blog-badge:hover {
  background: #a8430f;
  color: #ffffff;
  text-decoration: none;
}

/* ── Hero Card ──────────────────────────────────────────────────────────── */
.cnp-blog-hero {
  display: grid;
  grid-template-columns: 55% 1fr;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  text-decoration: none;
}

/* Hero image column */
.cnp-blog-hero__img-link {
  display: flex;
  align-items: center;
  background: #1a365d;
  overflow: hidden;
}
.cnp-blog-hero__img-link img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.35s ease;
}
.cnp-blog-hero:hover .cnp-blog-hero__img-link img {
  transform: scale(1.03);
}
.cnp-blog-hero__img-placeholder {
  width: 100%;
  min-height: 360px;
  background: #e2e8f0;
}

/* Hero body column */
.cnp-blog-hero__body {
  padding: 44px 52px 44px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: center;
}
.cnp-blog-hero__title {
  font-size: clamp(19px, 2.2vw, 27px);
  font-weight: 800;
  line-height: 1.3;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.02em;
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
}
.cnp-blog-hero__title a {
  color: inherit;
  text-decoration: none;
}
.cnp-blog-hero__title a:hover {
  color: #1a365d;
}
.cnp-blog-hero__excerpt {
  font-size: 15px;
  line-height: 1.75;
  color: #475569;
  margin: 0;
}

/* Hero meta row — date + read time, no author */
.cnp-blog-hero__meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Hero read link */
.cnp-blog-hero__read {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #1a365d;
  text-decoration: none;
  width: fit-content;
  transition: gap 0.2s, color 0.2s;
}
.cnp-blog-hero__read:hover {
  gap: 10px;
  color: #c4501a;
  text-decoration: none;
}

/* ── Shared meta text styles ────────────────────────────────────────────── */
.cnp-blog-meta__date,
.cnp-blog-meta__read-time {
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
}
.cnp-blog-meta__sep {
  color: #94a3b8;
  font-size: 13px;
}

/* ── Category Filter Bar ────────────────────────────────────────────────── */
.cnp-blog-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 36px;
  overflow-x: auto;
  justify-content: center;
  /* Hide scrollbar cross-browser */
  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* IE/Edge */
}
.cnp-blog-filters::-webkit-scrollbar {
  display: none;              /* Chrome/Safari */
}
.cnp-blog-filter-pill {
  display: inline-block;
  padding: 8px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  background: #ffffff;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  line-height: 1.4;
}
.cnp-blog-filter-pill:hover {
  border-color: #1a365d;
  color: #1a365d;
  text-decoration: none;
}
.cnp-blog-filter-pill--active {
  background: #1a365d;
  border-color: #1a365d;
  color: #ffffff;
}
.cnp-blog-filter-pill--active:hover {
  background: #0f2744;
  border-color: #0f2744;
  color: #ffffff;
}

/* ── Card Grid ──────────────────────────────────────────────────────────── */
.cnp-blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 48px;
}

/* ── Individual Card ────────────────────────────────────────────────────── */
.cnp-blog-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.cnp-blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
}

/* Card image */
.cnp-blog-card__img-link {
  display: block;
}
.cnp-blog-card__img-wrap {
  position: relative;
  width: 100%;
  padding-top: 66.67%;
  overflow: hidden;
  background: #e2e8f0;
}
.cnp-blog-card__img-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.cnp-blog-card:hover .cnp-blog-card__img-wrap img {
  transform: scale(1.05);
}
.cnp-blog-card__img-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #e2e8f0;
}

/* Overlaid badge on card image */
.cnp-blog-badge--overlay {
  position: absolute;
  bottom: 10px;
  left: 12px;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Card body */
.cnp-blog-card__body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cnp-blog-card__title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
}
.cnp-blog-card__title a {
  color: inherit;
  text-decoration: none;
}
.cnp-blog-card__title a:hover {
  color: #1a365d;
}
.cnp-blog-card__excerpt {
  font-size: 13px;
  line-height: 1.65;
  color: #475569;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card meta row — date + read time, no author */
.cnp-blog-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.cnp-blog-pagination {
  display: flex;
  justify-content: center;
  padding: 8px 0 24px;
}
.cnp-blog-pagination ul.page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}
.cnp-blog-pagination ul.page-numbers li a.page-numbers,
.cnp-blog-pagination ul.page-numbers li span.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #475569;
  text-decoration: none;
  background: #ffffff;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  line-height: 1;
}
.cnp-blog-pagination ul.page-numbers li a.page-numbers:hover {
  border-color: #1a365d;
  color: #1a365d;
  text-decoration: none;
}
.cnp-blog-pagination ul.page-numbers li span.current {
  background: #1a365d;
  border-color: #1a365d;
  color: #ffffff;
}
.cnp-blog-pagination ul.page-numbers li span.dots {
  border: none;
  background: transparent;
  color: #94a3b8;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.cnp-blog-empty {
  text-align: center;
  padding: 72px 0;
  color: #475569;
  font-size: 16px;
  line-height: 1.6;
}
.cnp-blog-empty a {
  color: #1a365d;
  font-weight: 700;
  text-decoration: underline;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

/* Tablet: 601–980px — 2-col grid, hero stacks */
@media (max-width: 980px) {
  .cnp-blog-wrap {
    padding: 36px 20px 56px;
  }
  .cnp-blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .cnp-blog-filters {
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  /* Hero stacks: image on top, text below */
  .cnp-blog-hero {
    grid-template-columns: 1fr;
    border-radius: 16px;
  }
  .cnp-blog-hero__img-link img {
    min-height: auto;
  }
  .cnp-blog-hero__body {
    padding: 28px 28px 32px;
    gap: 14px;
  }
}

/* Mobile: ≤600px — 1-col everything */
@media (max-width: 600px) {
  .cnp-blog-wrap {
    padding: 24px 16px 48px;
  }
  .cnp-blog-header {
    margin-bottom: 28px;
  }
  .cnp-blog-heading {
    font-size: 26px;
  }
  .cnp-blog-hero {
    margin-bottom: 28px;
    border-radius: 14px;
  }
  .cnp-blog-hero__img-link img {
    min-height: auto;
  }
  .cnp-blog-hero__body {
    padding: 20px 20px 24px;
    gap: 12px;
  }
  .cnp-blog-hero__title {
    font-size: 19px;
  }
  .cnp-blog-filters {
    gap: 6px;
    margin-bottom: 28px;
    justify-content: flex-start;
  }
  .cnp-blog-filter-pill {
    font-size: 12px;
    padding: 7px 14px;
  }
  .cnp-blog-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 36px;
  }
  .cnp-blog-pagination ul.page-numbers {
    gap: 4px;
  }
  .cnp-blog-pagination ul.page-numbers li a.page-numbers,
  .cnp-blog-pagination ul.page-numbers li span.page-numbers {
    min-width: 36px;
    height: 36px;
    font-size: 13px;
  }
}
