/*
  RFSX Hubs page
  - Center column: 2-column grid of topic hubs (collapses to 1 column on small screens)
  - Tag cloud beneath
  - Tag preview modal (stories + papers)

  Scoped to: body.rfsx-hubs-page
*/

/* Center column padding */
body.rfsx-hubs-page .hub-wrap{
  padding: 14px 16px 24px;
}

/* Make our hub sections look like the rest of the theme cards */
body.rfsx-hubs-page .hub-intro,
body.rfsx-hubs-page .hub-topics,
body.rfsx-hubs-page .hub-tags{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.02);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  margin-bottom: 14px;
}

body.rfsx-hubs-page .hub-h1{
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.25;
  font-weight: 950;
  letter-spacing: .2px;
}

body.rfsx-hubs-page .hub-h2{
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
  font-weight: 950;
}

body.rfsx-hubs-page .hub-lede{
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

body.rfsx-hubs-page .hub-muted{
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

body.rfsx-hubs-page .hub-head{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

body.rfsx-hubs-page .hub-count{
  color: var(--muted);
  font-weight: 800;
  font-size: 0.92rem;
}

body.rfsx-hubs-page .hub-empty{
  margin-top: 12px;
  border: 1px dashed rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.02);
  border-radius: 16px;
  padding: 14px;
  color: var(--muted);
}

/* Topic hubs grid (2xN) */
body.rfsx-hubs-page .hub-grid{
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 760px){
  body.rfsx-hubs-page .hub-grid{ grid-template-columns: 1fr; }
}

body.rfsx-hubs-page .hub-card{
  display:flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  text-decoration: none;
  color: var(--text);
  min-height: 148px;
}

body.rfsx-hubs-page .hub-card:hover{
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.20);
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce){
  body.rfsx-hubs-page .hub-card:hover{ transform:none; }
}

body.rfsx-hubs-page .hub-card-row{
  display:flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

body.rfsx-hubs-page .hub-card-title{
  font-weight: 950;
  font-size: 1.02rem;
  line-height: 1.25;
}

body.rfsx-hubs-page .hub-badge{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  padding: 6px 10px;
  font-weight: 850;
  color: var(--text);
  white-space: nowrap;
}

body.rfsx-hubs-page .hub-card-desc{
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

body.rfsx-hubs-page .hub-card-desc-empty{
  color: var(--link);
}

body.rfsx-hubs-page .hub-card-meta{
  margin-top: auto;
  color: var(--muted);
  font-size: 0.86rem;
}

/* Tag cloud */
body.rfsx-hubs-page .hub-tagcloud{
  margin-top: 14px;
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

body.rfsx-hubs-page .hub-tag-item{
  text-decoration:none;
  color: var(--text);
  display:inline-flex;
}

body.rfsx-hubs-page .hub-tag-chip{
  display:inline-flex;
  align-items: baseline;
  gap: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  padding: 8px 12px;
}

body.rfsx-hubs-page .hub-tag-chip:hover{
  background: rgba(255,255,255,0.07);
}

body.rfsx-hubs-page .hub-tag-count{
  color: var(--muted);
  font-weight: 900;
  font-size: 0.85rem;
}

/* Sidebar chips */
body.rfsx-hubs-page .hub-links{
  margin-top: 10px;
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
}

body.rfsx-hubs-page .hub-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  text-decoration:none;
  font-weight: 850;
}

body.rfsx-hubs-page .hub-chip:hover{ background: rgba(255,255,255,0.06); }

body.rfsx-hubs-page .hub-login,
body.rfsx-hubs-page .hub-about,
body.rfsx-hubs-page .hub-modal-info{
  color: var(--muted);
  line-height: 1.45;
}

/* Share block (same pattern used elsewhere) */
body.rfsx-hubs-page .rfsx-share{
  margin-top: 10px;
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

body.rfsx-hubs-page .rfsx-share a{
  color: var(--link);
  text-decoration: none;
  font-weight: 600;
}

body.rfsx-hubs-page .rfsx-share a:hover{ text-decoration: underline; }

body.rfsx-hubs-page .rfsx-share-copy{
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
}

body.rfsx-hubs-page .rfsx-share-copy:hover{ background: rgba(255,255,255,0.09); }
body.rfsx-hubs-page .rfsx-share-copy:disabled{ opacity: .75; cursor: default; }

/* Tag preview modal */
body.rfsx-hubs-page .hub-tag-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.70);
  z-index: 220;
  display: none;
}

body.rfsx-hubs-page .hub-tag-modal{
  position: fixed;
  inset: 0;
  z-index: 221;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

body.rfsx-hubs-page .hub-tag-modal.open,
body.rfsx-hubs-page .hub-tag-backdrop.open{
  display: flex;
}

body.rfsx-hubs-page .hub-tag-card{
  width: min(920px, 100%);
  max-height: 86vh;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(15,23,34,0.96);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
  display:flex;
  flex-direction: column;
}

body.rfsx-hubs-page .hub-tag-head{
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display:flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

body.rfsx-hubs-page .hub-tag-title{
  font-weight: 950;
  font-size: 1.15rem;
}

body.rfsx-hubs-page .hub-tag-subtitle{
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
}

body.rfsx-hubs-page .hub-tag-actions{
  display:flex;
  gap: 10px;
  align-items: center;
}

body.rfsx-hubs-page .hub-tag-open{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-weight: 850;
  text-decoration:none;
}

body.rfsx-hubs-page .hub-tag-open:hover{ background: rgba(255,255,255,0.07); }

body.rfsx-hubs-page .hub-tag-close{
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor:pointer;
  font-weight: 900;
}

body.rfsx-hubs-page .hub-tag-close:hover{ background: rgba(255,255,255,0.07); }

body.rfsx-hubs-page .hub-tag-body{
  padding: 12px 14px 14px;
  overflow: auto;
}

body.rfsx-hubs-page .hub-tag-loading{ color: var(--muted); padding: 8px 0; }

body.rfsx-hubs-page .hub-tag-section{ margin-bottom: 14px; }

body.rfsx-hubs-page .hub-tag-section-title{
  font-weight: 950;
  margin-bottom: 8px;
}

body.rfsx-hubs-page .hub-tag-items{
  display:flex;
  flex-direction: column;
  gap: 10px;
}

body.rfsx-hubs-page .hub-tag-itemcard{
  display:block;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  text-decoration:none;
  color: var(--text);
}

body.rfsx-hubs-page .hub-tag-itemcard:hover{ background: rgba(255,255,255,0.06); }

body.rfsx-hubs-page .hub-tag-itemtitle{ font-weight: 950; line-height: 1.3; }

body.rfsx-hubs-page .hub-tag-itemmeta{ margin-top: 4px; color: var(--muted); font-size: 0.92rem; }

body.rfsx-hubs-page .hub-tag-itemsnippet{ margin-top: 8px; color: var(--muted); line-height: 1.45; }

@media (max-width: 520px){
  body.rfsx-hubs-page .hub-tag-modal{ padding: 10px; }
  body.rfsx-hubs-page .hub-tag-actions{ flex-wrap: wrap; justify-content:flex-end; }
}
