/* ============================================================================
   HCM Blog Index  (hcm-blog.php)
   ----------------------------------------------------------------------------
   Loaded on /blog-posts/ and on category archives.

   Same Astra-bleed rules as the rest of this site: every selector is scoped, and
   anything the theme paints uninvited is zeroed explicitly.
   ========================================================================== */

.hcm-blogx{
  --bx-cyan:      var(--hcm-cyan-primary, #14ffec);
  --bx-ink:       var(--hcm-deep-space, #020810);
  --bx-surface:   rgba(255,255,255,.04);
  --bx-surface-2: rgba(255,255,255,.07);
  --bx-line:      rgba(255,255,255,.11);
  --bx-line-hi:   rgba(20,255,236,.34);
  --bx-text:      rgba(255,255,255,.82);
  --bx-dim:       rgba(255,255,255,.56);
  --bx-body:      var(--hcm-font-body, 'Barlow'), system-ui, sans-serif;
  --bx-display:   var(--hcm-font-display, 'Bebas Neue'), sans-serif;

  font-family:var(--bx-body); color:var(--bx-text); line-height:1.65;
  max-width:1140px; margin:0 auto; padding:0 clamp(1rem,4vw,2rem) 4rem;
}
.hcm-blogx *{ box-sizing:border-box; }
.hcm-blogx [hidden]{ display:none !important; }

/* ---- header ---- */
/* Padding-top replaces the removed eyebrow, so the title does not sit tight under the
   fixed header now that nothing precedes it. */
.hcm-blogx__head{ text-align:center; margin-bottom:1.75rem; padding-top:.75rem; }
.hcm-blogx .hcm-blogx__title{
  font-family:var(--bx-display); font-weight:400; text-transform:none;
  font-size:clamp(2.2rem,5.4vw,3.6rem); line-height:1.03; letter-spacing:.015em;
  color:#fff !important; margin:0 0 .8rem;
}
.hcm-blogx .hcm-blogx__lede{
  max-width:660px; margin:0 auto; color:var(--bx-dim);
  font-size:clamp(.98rem,1.5vw,1.08rem);
}

/* ---- category navigation ---- */
.hcm-blogx__cats{
  display:flex; flex-wrap:wrap; justify-content:center; gap:.5rem;
  margin:0 0 2.25rem;
}
.hcm-blogx .hcm-blogx__cat{
  display:inline-flex; align-items:center; gap:.45rem;
  padding:.45rem 1rem; border-radius:100px;
  border:1px solid var(--bx-line); background:var(--bx-surface);
  color:var(--bx-text) !important; text-decoration:none !important;
  font-size:.88rem; font-weight:600; line-height:1.3;
  transition:all .18s ease;
}
.hcm-blogx .hcm-blogx__cat span{
  font-size:.76rem; font-weight:700; color:var(--bx-dim);
  background:rgba(255,255,255,.07); border-radius:100px; padding:.05rem .45rem;
}
.hcm-blogx .hcm-blogx__cat:hover,
.hcm-blogx .hcm-blogx__cat:focus-visible{
  border-color:var(--bx-line-hi); background:rgba(20,255,236,.08);
  color:var(--bx-cyan) !important;
}
.hcm-blogx .hcm-blogx__cat.is-current{
  background:var(--bx-cyan); border-color:var(--bx-cyan); color:var(--bx-ink) !important;
}
.hcm-blogx .hcm-blogx__cat.is-current span{ background:rgba(2,8,16,.16); color:var(--bx-ink); }

/* ---- cards ---- */
.hcm-blogx__grid{
  display:grid;
  /* minmax(0,1fr), not 1fr. A bare 1fr resolves to minmax(auto,1fr), so a card whose
     content has a wide minimum steals width from its neighbours: measured on a post,
     three equal columns rendered 222px / 278px / 278px. */
  grid-template-columns:repeat(3,minmax(0,1fr)); gap:1.15rem;
  align-items:stretch;      /* equal-height cards, which the old widget did not do */
}
.hcm-blogx-card{
  display:flex; flex-direction:column;
  background:var(--bx-surface); border:1px solid var(--bx-line);
  border-radius:14px; padding:1.35rem 1.45rem;
  transition:border-color .2s ease, background .2s ease, transform .2s ease;
}
.hcm-blogx-card:hover{
  border-color:var(--bx-line-hi); background:var(--bx-surface-2); transform:translateY(-2px);
}
.hcm-blogx-card__top{ margin-bottom:.75rem; }
/* Meta lives here rather than beside the badge, so a long category name cannot wrap and
   push the title down on one card in a row while leaving its neighbours where they were. */
.hcm-blogx-card__foot{
  margin-top:auto; padding-top:1rem;
  display:flex; align-items:center; justify-content:space-between;
  gap:.75rem 1rem; flex-wrap:wrap;
  border-top:1px solid rgba(255,255,255,.07);
}
.hcm-blogx .hcm-blogx-card__cat{
  font-size:.72rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase;
  color:var(--bx-cyan) !important; text-decoration:none !important;
  border:1px solid var(--bx-line-hi); background:rgba(20,255,236,.08);
  border-radius:100px; padding:.2rem .65rem; line-height:1.4;
}
.hcm-blogx .hcm-blogx-card__cat:hover{ background:rgba(20,255,236,.16); }
.hcm-blogx-card__meta{
  font-size:.78rem; color:rgba(255,255,255,.5); letter-spacing:.02em;
}
.hcm-blogx .hcm-blogx-card__title{
  font-family:var(--bx-body); font-weight:700; text-transform:none;
  font-size:1.08rem; line-height:1.35; margin:0 0 .6rem; color:#fff !important;
}
.hcm-blogx .hcm-blogx-card__title a{
  color:#fff !important; text-decoration:none !important; border:0 !important;
}
.hcm-blogx .hcm-blogx-card__title a:hover{ color:var(--bx-cyan) !important; }
.hcm-blogx .hcm-blogx-card__excerpt{
  color:var(--bx-dim); font-size:.92rem; line-height:1.6; margin:0 0 1rem;
}
.hcm-blogx .hcm-blogx-card__link{
  color:var(--bx-cyan) !important; text-decoration:none !important;
  border:0 !important; font-weight:700; font-size:.9rem; white-space:nowrap;
}
.hcm-blogx .hcm-blogx-card__link:hover{ text-decoration:underline !important; }

/* ---- featured lead ---- */
.hcm-blogx-card--featured{
  margin-bottom:1.15rem;
  background:linear-gradient(150deg,rgba(20,255,236,.09),rgba(255,255,255,.02));
  border-color:var(--bx-line-hi);
  padding:clamp(1.5rem,3.5vw,2.4rem);
}
.hcm-blogx .hcm-blogx-card--featured .hcm-blogx-card__title{
  font-family:var(--bx-display); font-weight:400;
  font-size:clamp(1.7rem,3.6vw,2.5rem); line-height:1.08; letter-spacing:.015em;
  margin-bottom:.75rem;
}
.hcm-blogx .hcm-blogx-card--featured .hcm-blogx-card__excerpt{
  font-size:1.02rem; max-width:760px;
}

/* ---- pagination ---- */
.hcm-blogx__pager{
  display:flex; align-items:center; justify-content:center; gap:1rem;
  margin-top:2.5rem; flex-wrap:wrap;
}
.hcm-blogx .hcm-blogx__pagebtn{
  padding:.6rem 1.4rem; border-radius:100px;
  border:1px solid var(--bx-cyan); color:var(--bx-cyan) !important;
  text-decoration:none !important; font-weight:700; font-size:.9rem;
  transition:all .2s ease;
}
.hcm-blogx .hcm-blogx__pagebtn:hover{ background:var(--bx-cyan); color:var(--bx-ink) !important; }
.hcm-blogx__pagenum{ font-size:.88rem; color:rgba(255,255,255,.5); }
.hcm-blogx__empty{ text-align:center; color:var(--bx-dim); padding:3rem 0; }

@media (max-width:980px){
  .hcm-blogx__grid{ grid-template-columns:repeat(2,1fr); }
}
@media (max-width:640px){
  .hcm-blogx__grid{ grid-template-columns:1fr; }
  .hcm-blogx__cats{ justify-content:flex-start; }
}
@media (prefers-reduced-motion:reduce){
  .hcm-blogx *,.hcm-blogx *::before,.hcm-blogx *::after{ transition:none !important; }
}

/* ============================================================================
   Category archive header
   ----------------------------------------------------------------------------
   Astra renders .ast-archive-description with a WHITE background, and the theme's
   heading colour on these pages is white, so the category name rendered white on white:
   a 744x176 blank panel at the top of every category archive, which is the exact defect
   class documented in CLAUDE.md rule 8.

   Categories are now linked from the blog index, so these pages get real traffic and
   the header has to work.
   ========================================================================== */
body.category .ast-archive-description,
body.archive .ast-archive-description{
  background:transparent !important;
  padding:0 0 1.25rem !important;
  border:0 !important;
}
body.category .ast-archive-description .ast-archive-title,
body.archive .ast-archive-description .ast-archive-title{
  color:#ffffff !important;
  font-family:'Bebas Neue',sans-serif !important;
  font-size:clamp(2.2rem,5vw,3.2rem) !important;
  line-height:1.05 !important;
  letter-spacing:.02em;
  padding-top:clamp(24px,4vh,56px) !important;
  margin-bottom:.4rem !important;
}
body.category .ast-archive-description p,
body.archive .ast-archive-description p{
  color:rgba(255,255,255,.6) !important;
  max-width:680px;
}

/* ==========================================================================
   Related reading, on single posts (hcm_blog_related_html)
   --------------------------------------------------------------------------
   Reuses .hcm-blogx-card and .hcm-blogx__grid so a card looks identical here and
   on the index. The wrapper keeps the .hcm-blogx class only to inherit the --bx-*
   tokens, so the layout properties that class also sets have to be undone: on the
   index it is the page container at 1140px with its own padding, and here it sits
   inside a post's content column and must not impose either.
   ========================================================================== */
.hcm-blogx--related{
  max-width:none;
  margin:3.5rem 0 0;
  padding:2rem 0 0;
  border-top:1px solid var(--bx-line);
}
.hcm-blogx .hcm-blogx__related-title{
  font-family:var(--bx-display); font-weight:400;
  font-size:clamp(1.5rem,3vw,2rem); line-height:1.1; letter-spacing:.02em;
  margin:0 0 1.25rem; text-transform:none;
  /* No colour here deliberately. The site already paints every h2 inside a post with
     body.single-post .entry-content h2 { color:cyan !important }, at a specificity this
     selector cannot reach, and this block only ever renders on single posts. Setting a
     colour here produced a rule that silently lost, and matching the surrounding
     headings is the right result anyway. */
}
/* Card titles are h2 on the index, where they are the document structure. Inside an
   article they are subordinate to the post's own headings, so they read smaller. */
.hcm-blogx--related .hcm-blogx-card__title{ font-size:1.05rem; line-height:1.3; }
.hcm-blogx--related .hcm-blogx-card{ padding:1.15rem 1.25rem; }
@media (max-width:900px){
  .hcm-blogx--related .hcm-blogx__grid{ grid-template-columns:1fr; }
}
