/* ════════════════════════════════════════════════════════════════════
 * HUB PAGES - index/landing pages. Light, card-grid heavy.
 * Reuses tokens.css + homepage.css + guide.css (cards, byline, ftc).
 * ════════════════════════════════════════════════════════════════════ */

/* ── Hub hero (light) ── */
.hub-hero{ background:var(--bg); padding-block:var(--space-16) var(--space-10); text-align:center; border-bottom:1px solid var(--border-subtle); }
.hub-hero-inner{ max-width:720px; margin-inline:auto; }
.hub-hero .eyebrow{ color:var(--brand-purple); }
.hub-hero h1{ font-size:clamp(36px,5.5vw,56px); letter-spacing:var(--tracking-tight); line-height:1.06; margin-bottom:var(--space-4); text-wrap:balance; }
.hub-hero p{ font-size:var(--text-body-lg); color:var(--text-secondary); line-height:var(--leading-relaxed); max-width:600px; margin-inline:auto; }
.hub-clusters{ display:flex; gap:var(--space-3); flex-wrap:wrap; justify-content:center; margin-top:var(--space-8); }

/* ── Filter chips (visual; CSS-only highlight via radio) ── */
.chips{ display:flex; flex-wrap:wrap; gap:var(--space-2); justify-content:center; margin-bottom:var(--space-10); }
.chip-radio{ position:absolute; opacity:0; width:1px; height:1px; }
.chip{ display:inline-flex; align-items:center; min-height:40px; padding:var(--space-2) var(--space-4); border:1px solid var(--border-default); border-radius:var(--radius-full); background:var(--bg); font-size:var(--text-body-sm); font-weight:var(--weight-medium); color:var(--text-secondary); cursor:pointer; white-space:nowrap; }
.chip:hover{ border-color:var(--brand-purple); color:var(--brand-purple-hover); }
/* Radios precede .chips + #toolGrid as siblings, so a checked radio can both
 * highlight its label and filter the cards below, with no JavaScript. */
#cat-0:checked ~ .chips label[for="cat-0"],
#cat-1:checked ~ .chips label[for="cat-1"],
#cat-2:checked ~ .chips label[for="cat-2"],
#cat-3:checked ~ .chips label[for="cat-3"],
#cat-4:checked ~ .chips label[for="cat-4"],
#cat-5:checked ~ .chips label[for="cat-5"]{ background:var(--brand-purple-light); border-color:var(--brand-purple); color:var(--brand-purple-hover); }

#cat-1:checked ~ #toolGrid .hcard:not(.cat-pricing),
#cat-2:checked ~ #toolGrid .hcard:not(.cat-content),
#cat-3:checked ~ #toolGrid .hcard:not(.cat-promo),
#cat-4:checked ~ #toolGrid .hcard:not(.cat-tax),
#cat-5:checked ~ #toolGrid .hcard:not(.cat-analytics){ display:none; }

/* ── Search ── */
.hub-search{ max-width:520px; margin:0 auto var(--space-10); position:relative; }
.hub-search input{ width:100%; font-family:var(--font-body); font-size:var(--text-body); color:var(--text-primary); background:var(--bg); border:1px solid var(--border-default); border-radius:var(--radius-full); padding:var(--space-3) var(--space-5) var(--space-3) var(--space-10); min-height:50px; }
.hub-search input:focus{ outline:none; border-color:var(--brand-blue); box-shadow:var(--shadow-focus-ring); }
.hub-search svg{ position:absolute; left:var(--space-4); top:50%; transform:translateY(-50%); width:20px; height:20px; color:var(--text-tertiary); }

/* ── Card grids ── */
.hub-grid{ display:grid; grid-template-columns:1fr; gap:var(--space-6); }
@media (min-width:560px){ .hub-grid.c2{ grid-template-columns:1fr 1fr; } }
@media (min-width:680px){ .hub-grid.c3{ grid-template-columns:repeat(3,1fr); } }
@media (min-width:920px){ .hub-grid.c3{ grid-template-columns:repeat(3,1fr); } }

/* generic hub card (whole card is a link) */
.hcard{ display:flex; flex-direction:column; background:var(--bg-card); border:1px solid var(--border-subtle); border-radius:var(--radius-lg); padding:var(--space-6); text-decoration:none; color:inherit; transition:box-shadow var(--duration-base) var(--ease-out), border-color var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out); }
.hcard:hover{ box-shadow:var(--shadow-lg); border-color:var(--brand-blue); transform:translateY(-2px); text-decoration:none; }
.hcard-icon{ width:44px; height:44px; border-radius:var(--radius-md); background:var(--brand-blue-light); color:var(--brand-blue); display:inline-flex; align-items:center; justify-content:center; margin-bottom:var(--space-4); }
.hcard-icon svg{ width:22px; height:22px; }
.hcard-cat{ font-size:11px; font-weight:var(--weight-bold); letter-spacing:var(--tracking-wide); text-transform:uppercase; color:var(--brand-purple); margin-bottom:var(--space-3); }
.hcard h3{ font-size:var(--text-h4); line-height:var(--leading-snug); margin-bottom:var(--space-2); }
.hcard p{ font-size:var(--text-body-sm); color:var(--text-secondary); line-height:var(--leading-relaxed); margin-bottom:var(--space-4); flex:1; }
.hcard-cta{ font-size:var(--text-body-sm); font-weight:var(--weight-semibold); color:var(--brand-blue); margin-top:auto; }
.hcard-meta{ display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-2); margin-top:auto; font-size:var(--text-caption); color:var(--text-tertiary); }
.hcard-meta .sep{ color:var(--border-default); }

/* cluster card (large, for guides hub) */
.cluster{ padding:var(--space-8); }
.cluster .hcard-icon{ width:48px; height:48px; }
.cluster h3{ font-size:var(--text-h3); letter-spacing:var(--tracking-snug); }
.cluster .count{ font-family:var(--font-mono); font-size:var(--text-caption); color:var(--text-tertiary); margin-bottom:var(--space-3); }

/* cover thumbnail (listicles/blog) */
.hcard-cover{ aspect-ratio:16/9; border-radius:var(--radius-md); margin-bottom:var(--space-4); display:flex; align-items:center; justify-content:center; background:repeating-linear-gradient(135deg,var(--bg-subtle),var(--bg-subtle) 12px,#eef2f7 12px,#eef2f7 24px); border:1px solid var(--border-subtle); }
.hcard-cover .ph{ font-family:var(--font-mono); font-size:11px; color:var(--text-tertiary); text-transform:uppercase; letter-spacing:var(--tracking-wide); }
.hcard-cover.grad{ background:linear-gradient(135deg,var(--brand-blue),var(--brand-purple)); border:0; }
.hcard-cover.grad .ph{ color:rgba(255,255,255,.85); }

/* featured card (research/case/blog) */
.featured-card{ position:relative; background:linear-gradient(180deg,var(--bg) 0%, var(--bg-subtle) 100%); border:1px solid var(--border-subtle); border-radius:var(--radius-2xl); padding:var(--space-10); margin-bottom:var(--space-10); overflow:hidden; display:block; text-decoration:none; color:inherit; }
.featured-card::before{ content:''; position:absolute; top:0; left:0; right:0; height:3px; background:var(--brand-gradient); }
.featured-card:hover{ box-shadow:var(--shadow-lg); text-decoration:none; }
@media (min-width:760px){ .featured-card.split{ display:grid; grid-template-columns:1fr auto; gap:var(--space-10); align-items:center; } }
.featured-tag{ font-size:11px; font-weight:var(--weight-bold); letter-spacing:var(--tracking-wide); text-transform:uppercase; color:var(--brand-purple); margin-bottom:var(--space-3); }
.featured-card h2{ font-size:var(--text-h3); letter-spacing:var(--tracking-tight); margin-bottom:var(--space-3); }
.featured-card p{ font-size:var(--text-body); color:var(--text-secondary); line-height:var(--leading-relaxed); margin-bottom:var(--space-5); max-width:560px; }
.featured-stat{ text-align:center; flex:none; }
.featured-stat .v{ font-family:var(--font-mono); font-size:64px; font-weight:var(--weight-black); line-height:1; letter-spacing:var(--tracking-tighter); background:var(--brand-gradient); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; color:transparent; }
.featured-stat .k{ font-size:var(--text-caption); color:var(--text-tertiary); margin-top:var(--space-2); }

/* before/after (case studies) */
.ba{ font-family:var(--font-display); font-size:var(--text-h4); font-weight:var(--weight-bold); letter-spacing:var(--tracking-tight); }
.ba .from{ color:var(--text-tertiary); } .ba .to{ color:var(--color-success-text); }

/* stats strip (case/transparency) */
.hub-stats{ display:grid; grid-template-columns:1fr; gap:var(--space-8); max-width:880px; margin:0 auto; text-align:center; }
@media (min-width:600px){ .hub-stats.c3{ grid-template-columns:repeat(3,1fr); } .hub-stats.c4{ grid-template-columns:repeat(4,1fr); } }
.hub-stat .v{ font-family:var(--font-mono); font-size:var(--text-stat); font-weight:var(--weight-black); line-height:1; letter-spacing:var(--tracking-tighter); background:var(--brand-gradient); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; color:transparent; display:block; margin-bottom:var(--space-3); }
.hub-stat .k{ font-size:var(--text-body-sm); color:var(--text-secondary); font-weight:var(--weight-medium); }

/* archive list (transparency) */
.archive{ max-width:820px; margin-inline:auto; }
.archive-year{ background:var(--bg-card); border:1px solid var(--border-subtle); border-radius:var(--radius-lg); overflow:hidden; margin-bottom:var(--space-4); }
.archive-year summary{ list-style:none; cursor:pointer; display:flex; align-items:center; justify-content:space-between; padding:var(--space-5) var(--space-6); font-family:var(--font-display); font-size:var(--text-h4); font-weight:var(--weight-bold); }
.archive-year summary::-webkit-details-marker{ display:none; }
.archive-year summary::after{ content:'+'; color:var(--text-tertiary); font-size:22px; }
.archive-year[open] summary::after{ content:'–'; }
.archive-row{ display:flex; align-items:center; justify-content:space-between; gap:var(--space-4); padding:var(--space-4) var(--space-6); border-top:1px solid var(--border-subtle); text-decoration:none; color:inherit; flex-wrap:wrap; }
.archive-row:hover{ background:var(--bg-subtle); text-decoration:none; }
.archive-row .am{ display:flex; flex-direction:column; gap:2px; }
.archive-row .am .m{ font-weight:var(--weight-semibold); color:var(--text-primary); font-size:var(--text-body); }
.archive-row .am .s{ font-size:var(--text-body-sm); color:var(--text-secondary); }
.archive-row .ak{ font-family:var(--font-mono); font-weight:var(--weight-bold); color:var(--brand-purple); font-size:var(--text-body); white-space:nowrap; }

/* CTA block */
.hub-cta{ background:var(--bg-subtle); }
.hub-cta-card{ max-width:720px; margin-inline:auto; text-align:center; }
.hub-cta-card h2{ font-size:var(--text-h2); letter-spacing:var(--tracking-tight); margin-bottom:var(--space-3); }
.hub-cta-card p{ font-size:var(--text-body-lg); color:var(--text-secondary); line-height:var(--leading-relaxed); margin-bottom:var(--space-6); max-width:520px; margin-inline:auto; }

/* manifesto (transparency) */
.hub-manifesto{ max-width:720px; margin-inline:auto; text-align:center; }
.hub-manifesto p{ font-size:18px; line-height:1.7; color:var(--text-secondary); margin-bottom:var(--space-5); text-align:left; }
.hub-manifesto p.hub-quote{ font-family:var(--font-display); font-size:clamp(26px,3.6vw,38px); font-weight:var(--weight-bold); line-height:1.18; letter-spacing:var(--tracking-tight); margin:var(--space-8) 0; text-wrap:balance; color:var(--text-primary); }
.hub-quote .accent{ background:var(--brand-gradient); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; color:transparent; }

/* newsletter (reuse guide.css .newsletter; provide hub variant spacing) */
.hub-news{ background:var(--bg-subtle); }

/* ── Live search filter helpers (JS-driven) ── */
#guidesList .hcard[hidden]{ display:none !important; }
#guidesList section[hidden]{ display:none !important; }
.guides-empty{ text-align:center; color:var(--text-secondary); font-size:var(--text-body-lg); padding:var(--space-16) var(--space-4); }

/* ── Back to top (JS toggles .is-visible after scroll) ── */
.to-top{ position:fixed; right:var(--space-6); bottom:var(--space-6); z-index:60; width:46px; height:46px; display:flex; align-items:center; justify-content:center; border-radius:var(--radius-full); background:var(--brand-gradient); color:#fff; border:0; box-shadow:var(--shadow-lg); text-decoration:none; font-size:20px; line-height:1; opacity:0; visibility:hidden; transform:translateY(10px); transition:opacity var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out), visibility var(--duration-base); }
.to-top.is-visible{ opacity:1; visibility:visible; transform:none; }
.to-top:hover{ filter:brightness(1.06); color:#fff; }
.to-top:focus-visible{ outline:none; box-shadow:var(--shadow-focus-ring); }
@media (max-width:560px){ .to-top{ right:var(--space-4); bottom:var(--space-4); } }
