/* ============================================================
   Klerio Research Hub - shared visual design system
   Used by hand-authored "-visual.html" content pages (Home,
   Survey Synthesis, Market Research, etc). Brand accent (brown/
   olive) stays primary per Brand Guidelines; green/orange/blue
   are semantic accents for data states only - never used as the
   dominant UI color.
   ============================================================ */

:root {
  --primary:     #8B7355;
  --primary-lt:  #C4B49A;
  --primary-bg:  #EDE9E0;
  --secondary:   #898045;

  --ink:    #1C1917;
  --ink-2:  #57534E;
  --ink-3:  #79716B;

  --bg:        #FFFFFF;
  --surface:   #FAFAF9;
  --surface-2: #F5F5F4;
  --border:    #E7E5E4;

  --sb-bg:    #1C1917;
  --sb-border:#292524;
  --sb-text:  #A8A29E;

  /* semantic accents - data states only, not chrome/nav */
  --success:    #16A34A;
  --success-bg: #DCFCE7;
  --warning:    #D97706;
  --warning-bg: #FEF3C7;
  --danger:     #DC2626;
  --danger-bg:  #FEE2E2;
  --info:       #2563EB;
  --info-bg:    #DBEAFE;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--surface);
  color: var(--ink);
  line-height: 1.6;
}

html { scroll-behavior: smooth; }

/* ---- Tab nav (sticky, anchor-based) ---- */
nav.hub-nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--sb-bg);
  padding: 0 40px;
  display: flex; align-items: center; gap: 32px;
  height: 50px; border-bottom: 1px solid var(--sb-border);
  overflow-x: auto;
}
.hub-nav-brand {
  color: #FAFAF9; font-family: 'Source Serif 4', serif;
  font-weight: 600; font-size: 20px; letter-spacing: -0.2px;
  margin-right: 8px; white-space: nowrap;
}
.hub-nav a {
  color: var(--sb-text); text-decoration: none; font-size: 13px; font-weight: 500;
  padding: 4px 0; border-bottom: 2px solid transparent; transition: all .15s;
  white-space: nowrap;
}
.hub-nav a:hover { color: #FAFAF9; border-bottom-color: var(--primary); }

/* ---- Layout ---- */
.hub-page { max-width: 1200px; margin: 0 auto; padding: 0 40px 80px; }
.hub-section { padding: 52px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 62px; }
.hub-section:last-child { border-bottom: none; }

.hub-section h2 {
  font-family: 'Source Serif 4', serif;
  font-size: 26px; font-weight: 600; color: var(--ink);
  margin-bottom: 6px; letter-spacing: -0.3px;
}
.hub-section-desc { font-size: 14px; color: var(--ink-3); margin-bottom: 32px; }

/* ---- Sub-section ---- */
.sub-section { margin-bottom: 48px; }
.sub-section:last-child { margin-bottom: 0; }
.sub-heading {
  font-family: 'Source Serif 4', serif;
  font-size: 19px; font-weight: 600; color: var(--ink);
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.sub-heading-secondary { color: var(--secondary); }

/* ---- Hero ---- */
.hub-hero {
  background: var(--sb-bg);
  padding: 52px 40px 40px;
  border-bottom: 1px solid var(--sb-border);
}
.hub-hero-inner { max-width: 1200px; margin: 0 auto; }
.hub-hero h1 {
  font-family: 'Source Serif 4', serif;
  font-size: 36px; font-weight: 600; color: #FAFAF9;
  letter-spacing: -0.5px; line-height: 1.2;
}
.hub-hero p { color: #A8A29E; font-size: 15px; margin-top: 10px; max-width: 680px; line-height: 1.6; }
.hub-hero-meta { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; align-items: center; }
.hub-badge {
  display: inline-flex; align-items: center;
  background: transparent; border: 1px solid #44403C;
  color: #A8A29E; padding: 4px 12px; border-radius: 4px;
  font-size: 12px; font-weight: 500;
}
.hub-badge-primary { background: var(--primary); border-color: var(--primary); color: #FAFAF9; }
.hub-hero-byline { font-size: 12.5px; color: #78716C; margin-top: 16px; }
.hub-hero-byline b { color: #D6D3D1; font-weight: 500; }
.hub-hero-byline .sep { margin: 0 8px; color: #44403C; }

/* ---- Insight list (headline + detail, 2-tier) ---- */
.insight-list { list-style: none; display: flex; flex-direction: column; gap: 0; }
.insight-item {
  display: flex; gap: 20px; align-items: flex-start;
  padding: 18px 0; border-bottom: 1px solid var(--surface-2);
}
.insight-item:last-child { border-bottom: none; }
.insight-num {
  font-family: 'Source Serif 4', serif;
  font-size: 15px; font-weight: 600; color: var(--primary-lt);
  min-width: 24px; text-align: right; padding-top: 1px;
  flex-shrink: 0;
}
.insight-num.secondary { color: #B8B480; }
.insight-body { flex: 1; min-width: 0; }
.insight-headline { font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.55; }
.insight-detail { font-size: 13.5px; color: var(--ink-2); line-height: 1.7; margin-top: 6px; }

/* ---- Cross-reference chip (jumps to another hub tab) ---- */
.xref-chip {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11.5px; font-weight: 600; color: var(--primary);
  background: var(--primary-bg); border-radius: 4px;
  padding: 1px 7px; text-decoration: none;
  cursor: pointer; white-space: nowrap;
}
.xref-chip:hover { background: var(--primary-lt); color: #FFFFFF; }

/* ---- What-for / strategy cards ---- */
.so-what-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.so-what-card {
  background: var(--bg); border: 1px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 8px; padding: 22px 24px;
}
.so-what-card.card-success { border-top-color: var(--success); }
.so-what-card.card-warning { border-top-color: var(--warning); }
.so-what-card.card-info    { border-top-color: var(--info); }
.so-what-card h4 {
  font-family: 'Source Serif 4', serif;
  font-size: 16px; font-weight: 600; color: var(--ink);
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.so-what-card.card-success h4 { color: var(--success); }
.so-what-card.card-warning h4 { color: var(--warning); }
.so-what-card.card-info h4    { color: var(--info); }
.so-what-card ul { list-style: none; }
.so-what-card li {
  font-size: 13.5px; color: var(--ink); padding: 8px 0 8px 16px;
  position: relative; line-height: 1.6;
  border-bottom: 1px solid var(--surface-2);
}
.so-what-card li:last-child { border-bottom: none; }
.so-what-card li::before { content: ''; position: absolute; left: 0; top: 15px; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }
.so-what-card.card-success li::before { background: var(--success); }
.so-what-card.card-warning li::before { background: var(--warning); }
.so-what-card.card-info li::before    { background: var(--info); }

/* ---- Details label ---- */
.details-label {
  display: inline-block;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--ink-3); background: var(--surface-2); border-radius: 3px;
  padding: 3px 8px; margin-bottom: 6px;
}

/* ---- Stat cards ---- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 22px 24px; }
.stat-num { font-family: 'Source Serif 4', serif; font-size: 38px; font-weight: 700; color: var(--primary); line-height: 1.1; }
.stat-label { font-size: 13px; font-weight: 600; color: var(--ink); margin-top: 6px; }
.stat-note { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* ---- Generic data table ---- */
.hub-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hub-table th {
  background: var(--sb-bg); color: var(--sb-text);
  padding: 10px 14px; text-align: left;
  font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
}
.hub-table td { padding: 12px 14px; border-bottom: 1px solid var(--surface-2); vertical-align: top; }
.hub-table tr:last-child td { border-bottom: none; }
.hub-table tr:nth-child(even) td { background: var(--surface); }

.hub-tag { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.tag-success { background: var(--success-bg); color: #166534; }
.tag-warning { background: var(--warning-bg); color: #92400E; }
.tag-danger  { background: var(--danger-bg);  color: #991B1B; }
.tag-info    { background: var(--info-bg);    color: #1E40AF; }
.tag-neutral { background: var(--surface-2);  color: var(--ink-3); }
.tag-brand   { background: var(--primary-bg); color: var(--primary); }

/* ---- Open questions list ---- */
.q-list { list-style: none; }
.q-list li {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--surface-2); font-size: 14px; color: var(--ink-2);
}
.q-list li:last-child { border-bottom: none; }
.q-num {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary-bg); color: var(--primary);
  font-size: 11px; font-weight: 700; flex-shrink: 0; margin-top: 1px;
  font-family: 'Source Serif 4', serif;
}

/* ---- Detail sub-heading ---- */
.detail-sub {
  font-family: 'Source Serif 4', serif;
  font-size: 18px; font-weight: 600; color: var(--ink);
  margin-bottom: 16px; margin-top: 44px; padding-top: 44px;
  border-top: 1px solid var(--border);
}
.detail-sub:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
.detail-sub-desc { font-size: 13px; color: var(--ink-3); margin-bottom: 20px; }

/* ---- Note list ---- */
.note-list { list-style: none; display: flex; flex-direction: column; gap: 0; margin-top: 14px; }
.note-list li { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--surface-2); font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.note-list li:last-child { border-bottom: none; }
.note-bullet { color: var(--primary-lt); font-weight: 700; flex-shrink: 0; padding-top: 1px; }

/* ---- Card grid (Home module cards, generic nav-style cards) ---- */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px; margin-top: 4px;
}
.hub-card {
  display: block; text-align: left; text-decoration: none;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 18px 20px; cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
}
.hub-card:hover { border-color: var(--primary); background: var(--surface); transform: translateY(-1px); }
.hub-card-title { font-size: 14.5px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.hub-card-desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.hub-card-group {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--primary); margin-bottom: 8px; margin-top: 28px;
}
.hub-card-group:first-of-type { margin-top: 0; }

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .so-what-grid { grid-template-columns: 1fr; }
}
