/* ============================================================
   Blog index — page CSS (home.php)
   Scope: .hcg-home. Conditionally enqueued in hcg_assets() on
   is_home() — loaded only on the dedicated posts page.

   Token-based only — no hardcoded surface/text colours. The image
   placeholders use category-tinted gradients (one per category
   suffix) layered with a vignette that adapts to the active tone.

   Editorial layout (synthesis of mockup directions B + C):
   · Top      featured post split (image + copy) + 3 mini cards
   · Nav      print-style centred tabs with vertical rules
   · Grid     zigzag — alternating image-left / image-right rows

   Reused from theme.css: .hcg-eyebrow, .hcg-grad
   ============================================================ */

/* ---------- Layout primitives ---------- */
.hcg-home-band { padding: 80px 0; }
.hcg-home-wrap { max-width: var(--hcg-container-max, 1240px); margin: 0 auto; padding: 0 28px; }

/* Image + placeholder — both fill their parent visual slot */
.hcg-home-img,
.hcg-home-ph {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hcg-home-img { border-radius: inherit; }
.hcg-home-ph {
  position: relative;
  border-radius: inherit;
  background: var(--hcg-surface-2);
  isolation: isolate;
  overflow: hidden;
}
.hcg-home-ph::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    var(--ph-c1, var(--hcg-c1)) 0%,
    var(--ph-c2, var(--hcg-c2)) 70%,
    var(--ph-c3, var(--hcg-c3)) 100%
  );
  opacity: .85;
}
.hcg-home-ph::after {
  /* subtle vignette — different intensity per tone */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 30% 20%, transparent 30%, rgba(0, 0, 0, .35) 100%);
  mix-blend-mode: multiply;
}
body.hcgpt-theme-light .hcg-home-ph::after,
html[data-hcgpt-theme="light"] .hcg-home-ph::after {
  background: radial-gradient(120% 120% at 30% 20%, transparent 30%, rgba(0, 0, 0, .18) 100%);
}
/* Per-category tints (mapped deterministically in hcg_home_ph_class()) */
.hcg-home-ph--theory      { --ph-c1: #6e3aff; --ph-c2: #9b6eff; --ph-c3: #3b1d8f; }
.hcg-home-ph--corrections { --ph-c1: #ff8a3a; --ph-c2: #ff5a3a; --ph-c3: #b34216; }
.hcg-home-ph--business    { --ph-c1: #1f7a8c; --ph-c2: #3aaecc; --ph-c3: #0e3d49; }
.hcg-home-ph--ai          { --ph-c1: #ff3a8c; --ph-c2: #c41e75; --ph-c3: #7a1247; }
.hcg-home-ph--education   { --ph-c1: #cf9a3a; --ph-c2: #e0b870; --ph-c3: #7a5a14; }

/* ---------- Editorial typographic helpers ---------- */
.hcg-home-kicker {
  font-family: var(--hcg-font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--hcg-c1);
  display: inline-block;
}
a.hcg-home-kicker { text-decoration: none; }
a.hcg-home-kicker:hover { color: var(--hcg-c2); }

.hcg-home-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: .86rem;
  color: var(--hcg-muted);
  margin: 0;
}
.hcg-home-meta b { color: var(--hcg-text); font-weight: 600; }
.hcg-home-meta__dot {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: var(--hcg-muted);
  display: inline-block;
}

/* ---------- 1 · Hero (featured + secondary) ---------- */
.hcg-home-hero { padding: 64px 0 48px; }
.hcg-home-feat {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
}
.hcg-home-feat__visual {
  aspect-ratio: 5 / 4;
  width: 100%;
  border-radius: var(--hcg-r-xl);
  overflow: hidden;
  background: var(--hcg-surface-2);
}
.hcg-home-feat__copy .hcg-home-kicker { margin-bottom: 18px; }
.hcg-home-feat__title {
  font-family: var(--hcg-font-heading);
  font-weight: 800;
  font-size: clamp(2.1rem, 3.6vw, 3.6rem);
  line-height: 1.06;
  letter-spacing: -.02em;
  margin: 0;
}
.hcg-home-feat__title a { background-image: var(--hcg-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; text-decoration: none; }
.hcg-home-feat__title a:hover { background-image: none; -webkit-text-fill-color: currentColor; color: var(--hcg-text); }
.hcg-home-feat__excerpt {
  color: var(--hcg-text-2);
  font-size: 1.08rem;
  line-height: 1.62;
  margin: 22px 0 0;
  max-width: 46ch;
}
.hcg-home-feat__meta { margin-top: 24px; }
.hcg-home-feat__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  font-family: var(--hcg-font-body);
  font-weight: 700;
  font-size: 1rem;
  color: var(--hcg-text);
  border-bottom: 1px solid currentColor;
  padding-bottom: 4px;
  text-decoration: none;
}
.hcg-home-feat__cta:hover { background-image: var(--hcg-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; border-bottom-color: var(--hcg-c2); }

/* Three secondary mini-cards in a horizontal row, after the featured */
.hcg-home-side {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 64px;
  padding-top: 36px;
  border-top: 1px solid var(--hcg-border);
}
.hcg-home-side__lbl {
  grid-column: 1 / -1;
  font-family: var(--hcg-font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--hcg-muted);
  margin: 0 0 8px;
}
.hcg-home-mini { display: flex; flex-direction: column; }
.hcg-home-mini__visual {
  aspect-ratio: 16 / 10;
  width: 100%;
  border-radius: var(--hcg-r-lg);
  overflow: hidden;
  background: var(--hcg-surface-2);
  display: block;
}
.hcg-home-mini .hcg-home-kicker { margin: 14px 0 6px; }
.hcg-home-mini__title {
  font-family: var(--hcg-font-heading);
  font-weight: 700;
  font-size: 1.18rem;
  line-height: 1.18;
  margin: 0 0 8px;
}
.hcg-home-mini__title a { background-image: var(--hcg-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; text-decoration: none; }
.hcg-home-mini__title a:hover { background-image: none; -webkit-text-fill-color: currentColor; color: var(--hcg-text); }
.hcg-home-mini__meta {
  font-family: var(--hcg-font-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--hcg-muted);
  margin: 0;
}

/* ---------- 2 · Category nav (print masthead) ---------- */
.hcg-home-nav {
  padding: 30px 0;
  border-top: 1px solid var(--hcg-border-strong);
  border-bottom: 1px solid var(--hcg-border-strong);
}
.hcg-home-nav__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  justify-content: center;
  align-items: center;
  row-gap: 16px;
}
.hcg-home-nav__row a {
  font-family: var(--hcg-font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--hcg-text-2);
  padding: 4px 22px;
  border-right: 1px solid var(--hcg-border-strong);
  text-decoration: none;
  position: relative;
}
.hcg-home-nav__row a:last-child { border-right: 0; }
.hcg-home-nav__row a:hover { color: var(--hcg-text); }
.hcg-home-nav__row a.is-active { color: var(--hcg-text); }
.hcg-home-nav__row a.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -32px;
  width: 36px;
  height: 2px;
  background: var(--hcg-gradient);
}

/* ---------- 3 · Zigzag posts grid ---------- */
.hcg-home-grid { padding: 88px 0 110px; }
.hcg-home-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
  margin-bottom: 80px;
}
.hcg-home-row:last-of-type { margin-bottom: 0; }
.hcg-home-row--rev .hcg-home-row__visual { order: 2; }
.hcg-home-row__visual {
  aspect-ratio: 5 / 4;
  width: 100%;
  border-radius: var(--hcg-r-xl);
  overflow: hidden;
  background: var(--hcg-surface-2);
  display: block;
}
.hcg-home-row__copy .hcg-home-kicker { margin-bottom: 14px; }
.hcg-home-row__title {
  font-family: var(--hcg-font-heading);
  font-weight: 700;
  font-size: clamp(1.8rem, 2.6vw, 2.4rem);
  line-height: 1.08;
  margin: 0 0 14px;
}
.hcg-home-row__title a { background-image: var(--hcg-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; text-decoration: none; }
.hcg-home-row__title a:hover { background-image: none; -webkit-text-fill-color: currentColor; color: var(--hcg-text); }
.hcg-home-row__excerpt {
  color: var(--hcg-text-2);
  font-size: 1rem;
  line-height: 1.65;
  margin: 0;
  max-width: 48ch;
}
.hcg-home-row__meta { margin-top: 18px; }

/* ---------- Editorial archive masthead (archive.php) ---------- */
.hcg-home-archhead {
  text-align: center;
  padding: 80px 0 24px;
}
.hcg-home-archhead__kicker {
  font-family: var(--hcg-font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--hcg-muted);
  margin: 0 0 16px;
}
.hcg-home-archhead__title {
  font-family: var(--hcg-font-heading);
  font-weight: 800;
  font-size: clamp(2.4rem, 4.6vw, 3.8rem);
  line-height: 1.04;
  letter-spacing: -.02em;
  margin: 0 auto;
  max-width: 22ch;
  background: var(--hcg-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hcg-home-archhead__count {
  font-family: var(--hcg-font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--hcg-muted);
  margin: 18px 0 0;
}

/* ---------- Pagination ----------
   Markup is the same in home.php (custom paginate_links() wrapped in
   .nav-links) and in archive.php (the_posts_pagination's native output,
   which produces .nav-links). All inner links carry the WP-standard
   .page-numbers / .prev / .next / .current / .dots classes. */
.hcg-home-pag {
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--hcg-border);
}
.hcg-home-pag .nav-links {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}
.hcg-home-pag .nav-links a,
.hcg-home-pag .nav-links .page-numbers,
.hcg-home-pag .nav-links .current,
.hcg-home-pag .nav-links .dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 10px 16px;
  font-family: var(--hcg-font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--hcg-muted);
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
}
.hcg-home-pag .nav-links a:hover,
.hcg-home-pag .nav-links a.page-numbers:hover {
  color: var(--hcg-text);
  border-color: var(--hcg-border-strong);
  background: var(--hcg-surface);
}
.hcg-home-pag .nav-links .current {
  color: #fff;
  background: var(--hcg-gradient);
  font-weight: 700;
}
/* Hide the screen-reader heading that the_posts_pagination injects. */
.hcg-home-pag .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Empty state ---------- */
.hcg-home-empty {
  text-align: center;
  padding: 64px 0 48px;
}
.hcg-home-empty .hcg-eyebrow {
  display: block;
  margin-bottom: 14px;
}
.hcg-home-empty__t {
  font-family: var(--hcg-font-heading);
  font-weight: 800;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.1;
  margin: 0 auto;
  max-width: 28ch;
}
.hcg-home-empty__b {
  color: var(--hcg-muted);
  margin: 16px auto 0;
  max-width: 46ch;
  font-size: 1rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hcg-home-feat { grid-template-columns: 1fr; }
  .hcg-home-side { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .hcg-home-band { padding: 56px 0; }
  .hcg-home-hero { padding: 48px 0 32px; }
  .hcg-home-grid { padding: 56px 0 72px; }
  .hcg-home-side { grid-template-columns: 1fr; }
  .hcg-home-row { grid-template-columns: 1fr; gap: 32px; margin-bottom: 56px; }
  /* On mobile, always image-on-top regardless of zigzag order */
  .hcg-home-row--rev .hcg-home-row__visual { order: 0; }
}
