/*
  NameHippo — SEO Hubs  v8
  ─────────────────────────────────────────────────────────────────────
  RULES:
    1. Never override .nh-collections-hero, .nh-collections-domains,
       .nh-collections-pill, .nh-collections-chip, .nh-sim-card.
       Those live in nh-collections-premium.css. We extend, never fight.
    2. Brand colors: #4776e6 (primary) #8e54e9 (secondary) — not Tailwind indigo.
    3. .nh-collections-domains is repeat(12,1fr). Don't touch it.
    4. All new classes are .nh-hub-* to avoid any collision.
  ─────────────────────────────────────────────────────────────────────
*/

/* ── Design tokens (hub-scoped, won't pollute root) ─────────────── */
.nh-hub-page {
  --hub-blue:        #4776e6;
  --hub-purple:      #8e54e9;
  --hub-blue-soft:   rgba(71,118,230,.10);
  --hub-blue-border: rgba(71,118,230,.22);
  --hub-blue-glow:   rgba(71,118,230,.16);
  --hub-text-hi:     #0b1220;
  --hub-text-mid:    #475569;
  --hub-text-lo:     #7c8ca0;
  --hub-surface:     #ffffff;
  --hub-border:      rgba(15,23,42,.08);
  --hub-border-md:   rgba(15,23,42,.13);
  --hub-shadow-sm:   0 2px 8px rgba(2,6,23,.05);
  --hub-shadow-md:   0 6px 22px rgba(2,6,23,.08);
  --hub-shadow-lg:   0 14px 44px rgba(2,6,23,.11);
  --hub-r-sm:        10px;
  --hub-r-md:        16px;
  --hub-r-lg:        22px;
  --hub-ease:        cubic-bezier(.22,.68,0,1.05);
  --hub-dur:         .18s;
}

/* ── Page atmosphere ─────────────────────────────────────────────── */
/* Scoped to .nh-hub-page so it only affects hub pages, not others   */
.nh-hub-page {
  min-height: 100vh;
}
/* Apply atmosphere on the page wrapper set by template */
.nh-home-wrap:has(.nh-hub-page) {
  background:
    radial-gradient(900px 420px at 10% 0%,   rgba(71,118,230,.08), transparent 60%),
    radial-gradient(700px 380px at 88% 12%,  rgba(142,84,233,.06), transparent 58%),
    radial-gradient(500px 280px at 50% 100%, rgba(71,118,230,.05), transparent 55%),
    #f8fafc !important;
}

/* ── Breadcrumb ──────────────────────────────────────────────────── */
.nh-hub-breadcrumb {
  font-size: 12.5px;
  font-weight: 500;
  color: #94a3b8;
}
.nh-hub-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  content: "›";
  font-weight: 700;
  color: #cbd5e1;
}
.nh-hub-breadcrumb a {
  color: #64748b;
  text-decoration: none;
  transition: color var(--hub-dur);
}
.nh-hub-breadcrumb a:hover { color: var(--hub-blue); }
.nh-hub-breadcrumb .active { color: var(--hub-text-hi); font-weight: 700; }

/* ── Eyebrow pill above H1 ───────────────────────────────────────── */
.nh-hub-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--hub-blue);
  padding: 4px 11px;
  background: var(--hub-blue-soft);
  border: 1px solid var(--hub-blue-border);
  border-radius: 999px;
}

/* ── Hero content typography upgrades ───────────────────────────── */
/* We only set font-size / letter-spacing — layout stays with theme  */
.nh-hub-page .nh-collections-title {
  font-size: clamp(26px, 3.4vw, 40px);
  letter-spacing: -.028em;
  line-height: 1.1;
}
.nh-hub-page .nh-collections-sub {
  font-size: 15.5px;
  line-height: 1.65;
}

/* Trust chips: stack vertically on hero right side */
.nh-hub-trust-col {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.nh-hub-trust-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: rgba(255,255,255,.88);
  border: 1px solid var(--hub-border-md);
  border-radius: var(--hub-r-md);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--hub-text-hi);
  box-shadow: var(--hub-shadow-sm);
}
.nh-hub-trust-chip i {
  color: #22c55e;
  font-size: 13px;
  flex-shrink: 0;
}

@media (max-width: 991.98px) {
  .nh-hub-trust-col {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .nh-hub-trust-chip { padding: 8px 12px; font-size: 12.5px; }
}

/* ── Two-column layout ───────────────────────────────────────────── */
.nh-hub-layout { align-items: flex-start; }

.nh-hub-sticky-aside {
  position: sticky;
  top: 130px; /* real 2-row header: ~60px social bar + ~70px nav */
}
@media (max-width: 991.98px) {
  .nh-hub-sticky-aside { position: static; }
}

/* ── Section header — strong enough to anchor the page ──────────── */
.nh-hub-sec {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
/* Gradient left bar — thicker than before, uses real brand gradient */
.nh-hub-sec::before {
  content: "";
  display: block;
  width: 4px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--hub-blue), var(--hub-purple));
  flex-shrink: 0;
}
/* h2 elements inside .nh-hub-sec need Bootstrap reset */
.nh-hub-sec h2.nh-hub-sec-title,
.nh-hub-sec-title {
  font-size: 16px !important;
  font-weight: 800 !important;
  color: var(--hub-text-hi) !important;
  letter-spacing: -.01em;
  line-height: 1.3;
  margin: 0 !important;
}
.nh-hub-sec-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--hub-text-lo);
}

/* Smart-picks label */
.nh-hub-picks-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.nh-hub-picks-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--hub-text-hi);
}
.nh-hub-picks-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(120deg, var(--hub-blue), var(--hub-purple));
  padding: 3px 9px;
  border-radius: 999px;
}

/* ── Load more count indicator ───────────────────────────────────── */
.nh-hub-load-hint {
  text-align: center;
  font-size: 12.5px;
  color: var(--hub-text-lo);
  margin-top: 6px;
}

/* ── Content cards (about, guide wrapper) ────────────────────────── */
.nh-hub-card {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-r-lg);
  box-shadow: var(--hub-shadow-md);
}

/* ── Prose ───────────────────────────────────────────────────────── */
.nh-hub-prose {
  font-size: 15.5px;
  color: #1e293b;
  line-height: 1.78;
}
.nh-hub-prose p            { margin: 0 0 14px; }
.nh-hub-prose p:last-child { margin-bottom: 0; }
.nh-hub-prose ul           { margin: 8px 0 14px 22px; padding: 0; }
.nh-hub-prose li           { margin: 6px 0; color: var(--hub-text-mid); }
.nh-hub-prose strong       { color: var(--hub-text-hi); }

/* ── Numbered guide cards ────────────────────────────────────────── */
.nh-hub-guides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 575.98px) { .nh-hub-guides { grid-template-columns: 1fr; } }

.nh-hub-guide {
  display: flex;
  gap: 16px;
  padding: 20px 22px;
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-r-lg);
  box-shadow: var(--hub-shadow-sm);
  transition:
    box-shadow var(--hub-dur) var(--hub-ease),
    border-color var(--hub-dur) var(--hub-ease),
    transform var(--hub-dur) var(--hub-ease);
  position: relative;
  overflow: hidden;
}
/* top accent bar on hover */
.nh-hub-guide::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--hub-blue), var(--hub-purple));
  opacity: 0;
  transition: opacity var(--hub-dur);
}
.nh-hub-guide:hover {
  box-shadow: var(--hub-shadow-lg);
  border-color: var(--hub-blue-border);
  transform: translateY(-2px);
}
.nh-hub-guide:hover::before { opacity: 1; }

.nh-hub-guide-num {
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  color: var(--hub-blue-soft);
  /* color trick: faint but legible large numeral */
  background: linear-gradient(135deg, var(--hub-blue), var(--hub-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: .22;
  min-width: 38px;
  flex-shrink: 0;
  user-select: none;
  margin-top: -2px;
}

.nh-hub-guide-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--hub-text-hi);
  line-height: 1.35;
  margin-bottom: 4px;
}
.nh-hub-guide-sub {
  font-size: 13px;
  color: var(--hub-text-lo);
  line-height: 1.5;
}

/* ── Tag / chip clouds ───────────────────────────────────────────── */
.nh-hub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.nh-hub-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  min-height: 38px; /* touch target */
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  background: var(--hub-surface);
  border: 1px solid var(--hub-border-md);
  border-radius: 999px;
  text-decoration: none;
  transition:
    background var(--hub-dur) var(--hub-ease),
    border-color var(--hub-dur) var(--hub-ease),
    color var(--hub-dur) var(--hub-ease),
    transform var(--hub-dur) var(--hub-ease);
}
.nh-hub-chip:hover {
  background: var(--hub-blue-soft);
  border-color: var(--hub-blue-border);
  color: var(--hub-blue);
  transform: translateY(-1px);
}
.nh-hub-chip-count {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--hub-blue);
  background: var(--hub-blue-soft);
  padding: 1px 6px;
  border-radius: 999px;
}

/* ── FAQ ─────────────────────────────────────────────────────────── */
.nh-hub-faqs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nh-hub-faq-item {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-r-md);
  overflow: hidden;
  box-shadow: var(--hub-shadow-sm);
  transition: border-color var(--hub-dur), box-shadow var(--hub-dur);
}
/* Open state — CSS :has() where supported, fallback via accordion-button state */
.nh-hub-faq-item:has(.accordion-button:not(.collapsed)) {
  border-color: var(--hub-blue-border);
  box-shadow: 0 4px 18px var(--hub-blue-glow);
}
.nh-hub-faq-btn {
  font-size: 15px;
  font-weight: 700;
  color: var(--hub-text-hi) !important; /* override Bootstrap accordion */
  background: var(--hub-surface) !important;
  padding: 17px 20px;
  border: none !important;
  box-shadow: none !important;
  min-height: 54px;
  line-height: 1.4;
  transition: color var(--hub-dur), background var(--hub-dur);
}
.nh-hub-faq-btn:not(.collapsed) {
  color: var(--hub-blue) !important;
  background: var(--hub-blue-soft) !important;
}
.nh-hub-faq-btn:not(.collapsed)::after {
  /* tint the Bootstrap chevron with brand color */
  filter: hue-rotate(195deg) saturate(2.2) brightness(.9);
}
.nh-hub-faq-btn:focus-visible {
  box-shadow: 0 0 0 3px var(--hub-blue-glow) !important;
  outline: none;
}
.nh-hub-faq-body {
  font-size: 14.5px;
  color: var(--hub-text-mid);
  line-height: 1.72;
  padding: 0 20px 18px;
  border-top: 1px solid var(--hub-border);
}

/* ── Aside panels ────────────────────────────────────────────────── */
.nh-hub-aside-panel {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-r-lg);
  box-shadow: var(--hub-shadow-md);
  overflow: hidden;
}
.nh-hub-aside-panel + .nh-hub-aside-panel { margin-top: 12px; }

.nh-hub-aside-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--hub-border);
  background: rgba(71,118,230,.03);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--hub-text-lo);
}
.nh-hub-aside-hd i { color: var(--hub-blue); font-size: 11px; }

.nh-hub-aside-bd { padding: 12px 14px; }

/* TOC links */
.nh-hub-toc-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: var(--hub-r-sm);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--hub-text-mid);
  text-decoration: none;
  transition: background var(--hub-dur), color var(--hub-dur);
}
.nh-hub-toc-link:hover {
  background: var(--hub-blue-soft);
  color: var(--hub-blue);
}
.nh-hub-toc-link.is-active {
  background: var(--hub-blue-soft);
  color: var(--hub-blue);
}
.nh-hub-toc-link i {
  font-size: 9px;
  opacity: .35;
  transition: opacity var(--hub-dur), transform var(--hub-dur);
}
.nh-hub-toc-link.is-active i,
.nh-hub-toc-link:hover i {
  opacity: 1;
  transform: translateX(2px);
}

/* Aside kicker */
.nh-hub-aside-kicker {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 10px 0 7px;
}
.nh-hub-aside-kicker:first-child { margin-top: 0; }

/* Trust list */
.nh-hub-trust-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.nh-hub-trust-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: #334155;
  line-height: 1.5;
}
.nh-hub-trust-list i {
  color: #22c55e;
  margin-top: 2px;
  font-size: 13px;
  flex-shrink: 0;
}

/* Aside CTA */
.nh-hub-aside-cta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--hub-border);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--hub-blue);
  text-decoration: none;
  transition: color var(--hub-dur);
}
.nh-hub-aside-cta:hover { color: #3458c4; }

/* ── Bottom nav ──────────────────────────────────────────────────── */
.nh-hub-footnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 52px;
  padding-top: 22px;
  border-top: 1px solid var(--hub-border);
}
.nh-hub-footnav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 800;
  color: #334155;
  text-decoration: none;
  transition: color var(--hub-dur);
}
.nh-hub-footnav-link:hover { color: var(--hub-blue); }

/* ── Fade-up stagger on page entry ──────────────────────────────── */
@keyframes nhFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nh-hub-anim { animation: nhFadeUp .45s cubic-bezier(.22,.68,0,1) both; }
.nh-hub-anim-1 { animation-delay: .05s; }
.nh-hub-anim-2 { animation-delay: .10s; }
.nh-hub-anim-3 { animation-delay: .15s; }
.nh-hub-anim-4 { animation-delay: .20s; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .nh-hub-prose       { font-size: 15px; }
  .nh-hub-guide       { padding: 16px 18px; }
  .nh-hub-guide-num   { font-size: 24px; min-width: 30px; }
  .nh-hub-guide-title { font-size: 13.5px; }
  .nh-hub-faq-btn     { font-size: 14px; padding: 15px 16px; }
  .nh-hub-faq-body    { font-size: 14px; padding: 0 16px 15px; }
  .nh-hub-footnav     { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 575.98px) {
  .nh-hub-page .nh-collections-title { font-size: 24px; }
  .nh-hub-chip        { padding: 7px 12px; font-size: 12.5px; }
}


/* ── Section separation — subtle tinted backgrounds ─────────────── */
/* About card: warm left border to signal "editorial" content */
.nh-hub-section-about .nh-hub-card {
  border-left: 4px solid var(--hub-blue);
  padding-left: calc(1.5rem - 4px);
}

/* Guide section gets a subtle inset fill */
.nh-hub-section-guide {
  background: rgba(71,118,230,.025);
  border: 1px solid rgba(71,118,230,.08);
  border-radius: var(--hub-r-lg);
  padding: 24px;
}

/* Picks heading gets stronger weight */
.nh-hub-picks-hd {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hub-border);
  margin-bottom: 16px;
}

/* Related section — pill cloud on a tinted bg */
.nh-hub-section-related {
  background: rgba(255,255,255,.70);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-r-lg);
  padding: 22px;
}

/* FAQ items: open state highlight via JS class since :has() may be limited */
.nh-hub-faq-item.is-open {
  border-color: var(--hub-blue-border);
  box-shadow: 0 4px 18px var(--hub-blue-glow);
}


/* =========================================================
   Fallbacks (low specificity) — if nh-collections-premium.css
   is missing/not loaded, hubs still look formatted.
   Uses :where() to stay low-specificity and avoid conflicts.
   ========================================================= */
.nh-hub-page :where(.nh-collections-hero){
  border-radius: 22px;
  border: 1px solid rgba(16,24,40,.10);
  background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.74));
  box-shadow: 0 18px 50px rgba(16,24,40,.10);
  overflow: hidden;
}
.nh-hub-page :where(.nh-collections-hero-inner){
  padding: 22px 18px;
}
.nh-hub-page :where(.nh-collections-h1){
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-size: clamp(26px, 3vw, 42px);
  margin: 0 0 8px;
}
.nh-hub-page :where(.nh-collections-sub){
  color: rgba(16,24,40,.70);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 14px;
  max-width: 74ch;
}
.nh-hub-page :where(.nh-collections-domains){
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1200px){
  .nh-hub-page :where(.nh-collections-domains){ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px){
  .nh-hub-page :where(.nh-collections-domains){ grid-template-columns: 1fr; }
}
.nh-hub-page :where(.nh-collections-pill){
  display:inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.90);
  border: 1px solid rgba(16,24,40,.10);
  text-decoration:none;
  color: rgba(16,24,40,.82);
  font-size: 13px;
}

/* =========================================================
   Hub Grid + Spacing Fix (v9 integrated)
   Uses existing domain_card partials; no markup changes needed.
   ========================================================= */
.nh-hub-page .nh-hub-container{
  margin-top: 14px;   /* reduce header-to-hero gap */
  margin-bottom: 28px;
}

.nh-hub-page .nh-hub-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

/* If any hub grid accidentally carries Bootstrap row gutters, neutralize */
.nh-hub-page .nh-hub-grid.row{
  --bs-gutter-x: 0;
  --bs-gutter-y: 0;
}

/* Prevent child wrappers (col-*) from forcing full width */
.nh-hub-page .nh-hub-grid > *{
  min-width: 0;
  margin: 0;
  padding: 0;
  width: auto;
  max-width: none;
  flex: initial;
}

@media (max-width: 767.98px){
  .nh-hub-page .nh-hub-grid{
    grid-template-columns: 1fr;
    gap: 14px;
  }
}


/* =========================================================
   HUB GRID FIX v10
   Problem: cards span full width (grid overridden or items spanning columns)
   Fix: force grid with !important and reset grid-column on items/cards
   ========================================================= */
.nh-hub-page .nh-hub-grid{
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px !important;
  align-items: stretch !important;
}

/* If upstream CSS forces flex/block, this wins */
.nh-hub-page .nh-hub-grid,
.nh-hub-page .nh-hub-grid.nh-collections-domains{
  width: 100% !important;
}

/* Prevent any "featured/wide" rules from spanning all columns */
.nh-hub-page .nh-hub-grid > *{
  grid-column: auto !important;
  grid-row: auto !important;
  min-width: 0 !important;
}

/* Also reset on common card roots inside the item */
.nh-hub-page .nh-hub-grid .nh-domain-card,
.nh-hub-page .nh-hub-grid .domain-card,
.nh-hub-page .nh-hub-grid a,
.nh-hub-page .nh-hub-grid .nh-domain-card-wrap{
  grid-column: auto !important;
  max-width: 100% !important;
}

@media (max-width: 767.98px){
  .nh-hub-page .nh-hub-grid{
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
}
