/* ─── TEAM HUB — Roadmap 3 Milestone 1 ──────────────────────────────────────
   Luxury card-based knowledge base UI.
   Uses existing CSS variable tokens (--bg, --card, --surface, --border,
   --text, --text-2, --text-3, --gold, --blue, --green, --radius).
   Isolated: all selectors are prefixed .th- or #tab-team-hub.
   ──────────────────────────────────────────────────────────────────────────── */

/* ── Container & Layout ────────────────────────────────────────────────────── */

#tab-team-hub {
  padding: 24px 28px 48px;
  max-width: 960px;
  margin: 0 auto;
  box-sizing: border-box;
}

#workspace-team-hub-article {
  padding: 0;
  overflow-y: auto;
  height: 100%;
  box-sizing: border-box;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */

.th-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.th-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
  letter-spacing: -0.3px;
}

.th-subtitle {
  font-size: 13px;
  color: var(--text-3);
  margin: 0;
}

/* ── Search ─────────────────────────────────────────────────────────────────── */

.th-search-wrapper {
  margin-bottom: 24px;
}

.th-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 10px 14px;
  transition: border-color 0.15s;
}

.th-search-bar:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(200, 160, 90, 0.12);
}

.th-search-icon {
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.6;
}

.th-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
}

.th-search-input::placeholder {
  color: var(--text-3);
}

.th-search-clear {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-3);
  padding: 0 2px;
  line-height: 1;
}

.th-search-clear:hover { color: var(--text); }

/* ── Section labels ─────────────────────────────────────────────────────────── */

.th-section {
  margin-bottom: 28px;
}

.th-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 10px;
}

/* ── Chips row (favorites & recently viewed) ────────────────────────────────── */

.th-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.th-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: inherit;
  white-space: nowrap;
}

.th-chip:hover {
  border-color: var(--gold);
  background: var(--surface);
}

.th-chip-icon { font-size: 13px; }

/* ── Category grid ──────────────────────────────────────────────────────────── */

.th-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 720px) {
  .th-category-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .th-category-grid { grid-template-columns: 1fr; }
  #tab-team-hub { padding: 16px 16px 40px; }
}

.th-cat-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

.th-cat-card:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.th-cat-card--soon {
  opacity: 0.7;
}

.th-cat-card--soon:hover {
  border-color: var(--border);
  box-shadow: none;
  transform: none;
  opacity: 0.85;
}

.th-cat-icon {
  font-size: 24px;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 1px;
}

.th-cat-body {
  flex: 1;
  min-width: 0;
}

.th-cat-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.th-cat-desc {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.4;
  margin-bottom: 8px;
}

.th-cat-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.th-cat-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--gold);
  background: rgba(200, 160, 90, 0.1);
  padding: 2px 7px;
  border-radius: 10px;
}

.th-cat-count--soon {
  color: var(--text-3);
  background: var(--surface);
}

.th-cat-updated {
  font-size: 10px;
  color: var(--text-3);
}

/* ── Category view ──────────────────────────────────────────────────────────── */

.th-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 24px 0;
  font-size: 12px;
  color: var(--text-3);
  flex-wrap: wrap;
}

.th-breadcrumb-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--gold);
  padding: 0;
  font-family: inherit;
}

.th-breadcrumb-link:hover { text-decoration: underline; }

.th-breadcrumb-sep {
  color: var(--text-3);
  font-size: 13px;
}

.th-breadcrumb-current {
  color: var(--text);
  font-weight: 500;
}

.th-cat-view-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.th-cat-view-icon { font-size: 32px; line-height: 1; }

.th-cat-view-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}

.th-cat-view-desc {
  font-size: 13px;
  color: var(--text-3);
  margin: 0;
}

/* ── Article list rows ──────────────────────────────────────────────────────── */

.th-article-list {
  padding: 8px 0;
}

.th-article-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.12s;
  font-family: inherit;
  box-sizing: border-box;
}

.th-article-row:hover { background: var(--surface); }

.th-article-row-icon { font-size: 20px; flex-shrink: 0; }

.th-article-row-body {
  flex: 1;
  min-width: 0;
}

.th-article-row-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.th-article-row-summary {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
}

.th-article-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.th-article-row-date {
  font-size: 11px;
  color: var(--text-3);
}

.th-article-row-arrow {
  font-size: 18px;
  color: var(--text-3);
  flex-shrink: 0;
}

/* ── Article type badge ─────────────────────────────────────────────────────── */

.th-article-type-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-3);
}

/* Type-specific badge colors */
.th-type-sop       { background: rgba(59, 130, 246, 0.1); color: var(--blue); }
.th-type-policy    { background: rgba(239, 68, 68, 0.1);  color: var(--red, #ef4444); }
.th-type-training  { background: rgba(16, 185, 129, 0.1); color: var(--green); }
.th-type-checklist { background: rgba(200, 160, 90, 0.1); color: var(--gold); }
.th-type-template  { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.th-type-script    { background: rgba(245, 158, 11, 0.1); color: #d97706; }

/* ── Coming soon banner ─────────────────────────────────────────────────────── */

.th-coming-soon-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px;
}

.th-coming-soon-icon { font-size: 28px; flex-shrink: 0; }

.th-coming-soon-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.th-coming-soon-text {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
}

/* ── Sprint C-C6: Win Wall ──────────────────────────────────────────────────── */

.th-win-wall {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 8px;
}

.th-btn {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: opacity .15s;
}
.th-btn:hover { opacity: .85; }
.th-btn-gold {
  background: linear-gradient(135deg, var(--gold, #c8a96e), var(--gold-dark, #a07840));
  color: #fff;
}

.th-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.th-badge-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2, rgba(255,255,255,.04));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--text-2);
  cursor: default;
}
.th-badge-icon { font-size: 15px; }
.th-badge-label { font-weight: 500; }

.th-win-empty {
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  padding: 24px 0;
}
.th-win-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.th-win-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2, rgba(255,255,255,.03));
  border: 1px solid var(--border);
  border-radius: 8px;
}
.th-win-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}
.th-win-body { flex: 1; min-width: 0; }
.th-win-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 4px;
}
.th-win-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
}

/* ── Article viewer chrome ──────────────────────────────────────────────────── */

.th-viewer-chrome {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  background: var(--card);
}

.th-article-header {
  padding: 16px 28px 16px;
}

.th-article-header-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}

.th-article-icon-lg {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 3px;
}

.th-article-meta-block { flex: 1; min-width: 0; }

.th-article-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.th-article-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-3);
}

.th-article-meta-sep { color: var(--border); }

.th-article-meta-cat { color: var(--text-2); }

.th-article-summary {
  font-size: 14px;
  color: var(--text-3);
  margin: 0;
  line-height: 1.5;
}

/* Favorite button */
.th-fav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 20px;
  padding: 6px 10px;
  line-height: 1;
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.th-fav-btn:hover { border-color: var(--gold); background: var(--surface); }

.th-fav-btn--active { border-color: var(--gold); }

/* Tags */
.th-article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 4px;
}

.th-tag {
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 8px;
}

/* ── Article content body ───────────────────────────────────────────────────── */

.th-article-content {
  padding: 28px 28px 0;
  max-width: 760px;
}

.th-article-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
}

.th-article-body h2, .th-article-body h3, .th-article-body h4 {
  color: var(--text);
  margin: 24px 0 10px;
  font-weight: 600;
}

.th-article-body h2 { font-size: 17px; }
.th-article-body h3 { font-size: 15px; }
.th-article-body h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }

.th-article-body p { margin: 0 0 12px; }

.th-article-body ul, .th-article-body ol {
  margin: 0 0 14px;
  padding-left: 20px;
}

.th-article-body li { margin-bottom: 6px; }

.th-article-body strong { font-weight: 600; color: var(--text); }

.th-article-body a {
  color: var(--gold);
  text-decoration: none;
}
.th-article-body a:hover { text-decoration: underline; }

/* ── Related articles ───────────────────────────────────────────────────────── */

.th-related {
  padding: 28px 28px 48px;
  max-width: 760px;
  margin-top: 28px;
  border-top: 1px solid var(--border);
}

.th-related-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.th-related-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  width: 100%;
  transition: padding-left 0.15s;
}

.th-related-item:last-child { border-bottom: none; }

.th-related-item:hover { padding-left: 4px; }

.th-related-icon { font-size: 18px; flex-shrink: 0; }

.th-related-body { flex: 1; min-width: 0; }

.th-related-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.th-related-summary {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.th-related-arrow {
  font-size: 16px;
  color: var(--text-3);
  flex-shrink: 0;
}

/* ── Search results ─────────────────────────────────────────────────────────── */

.th-search-results { margin-bottom: 16px; }

.th-search-empty {
  font-size: 13px;
  color: var(--text-3);
  padding: 16px 0;
  text-align: center;
}

/* ── Error / not-found states ───────────────────────────────────────────────── */

.th-error {
  padding: 40px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}

.th-article-not-found {
  padding: 60px 24px;
  text-align: center;
}

.th-nf-icon { font-size: 40px; margin-bottom: 12px; }

.th-nf-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.th-nf-text {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 20px;
}

.th-btn-back {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
}

.th-btn-back:hover { border-color: var(--gold); }

/* ── Sprint C-C8: Black Diamond Academy ─────────────────────────────────────
   Custom structured landing for the Training category.
   ──────────────────────────────────────────────────────────────────────────── */

.th-academy-hero {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.th-academy-hero-icon {
  font-size: 40px;
  line-height: 1;
  flex-shrink: 0;
}

.th-academy-hero-body { flex: 1; }

.th-academy-paths {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.th-academy-path-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.th-academy-path-card:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.th-academy-path-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.th-academy-path-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.th-academy-path-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.th-academy-path-desc {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.4;
}

.th-academy-steps {
  margin: 0;
  padding-left: 20px;
}

.th-academy-step {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 4px;
}

.th-academy-step:last-child { margin-bottom: 0; }
