/* ═══════════════════════════════════════════════════════════════
   Luubu Help Center — "Studio" design system skin
   Page chrome (reset, nav, footer, buttons, tokens) comes from
   /css/site.css — this file only styles the .lhc-* knowledge-base
   components rendered by luubu-help.js.
   Fonts: Fraunces (display) + Inter (body), self-hosted via site.css.
═══════════════════════════════════════════════════════════════ */

:root {
  /* Legacy alias — luubu-help.js injects an inline "Loading article..."
     state that reads var(--text-muted). Keep it mapped to the new inks. */
  --text-muted: var(--ink-3);
  --lhc-max-w: 1200px;
}

:focus-visible { outline: 3px solid var(--accent-blue); outline-offset: 2px; }

/* ── Layout ─────────────────────────────────────────────────── */
.lhc-main {
  max-width: var(--lhc-max-w);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 64px) 24px clamp(72px, 9vw, 112px);
}

/* ── Views ──────────────────────────────────────────────────── */
.lhc-view { display: none; }
.lhc-view--active { display: block; }

/* ── Hero (brand-green band, persistent search) ─────────────── */
.lhc-hero {
  background: var(--brand);
  color: var(--brand-ink);
  border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
  padding: calc(var(--nav-h) + clamp(48px, 7vw, 88px)) 24px clamp(56px, 8vw, 96px);
  text-align: center;
  overflow: visible; /* search dropdown must escape the band */
}
.lhc-hero-inner { max-width: 720px; margin: 0 auto; }
.lhc-hero h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-variation-settings: "SOFT" 0, "WONK" 1;
  font-size: clamp(2.4rem, 5.6vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  text-wrap: balance;
}
.lhc-hero p {
  font-size: clamp(1rem, 1.7vw, 1.1875rem);
  font-weight: 600;
  opacity: .85;
  max-width: 560px;
  margin: 0 auto 32px;
}

/* ── Search ─────────────────────────────────────────────────── */
.lhc-search-wrap {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}
.lhc-search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--ink-4);
  pointer-events: none;
}
.lhc-search-input {
  width: 100%;
  padding: 17px 26px 17px 54px;
  border: 0;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  outline: none;
  transition: box-shadow .2s ease;
}
.lhc-search-input::placeholder { color: var(--ink-4); }
.lhc-search-input:focus {
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(6, 20, 10, .22);
}

.lhc-search-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 200;
  text-align: left;
  color: var(--ink);
}
.lhc-search-item {
  padding: 14px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.lhc-search-item:last-child { border-bottom: none; }
.lhc-search-item:hover, .lhc-search-item:focus-visible { background: var(--bg); }
.lhc-search-item-title { font-weight: 700; font-size: .9375rem; color: var(--ink); }
.lhc-search-item-meta { font-size: .78rem; color: var(--ink-4); margin-top: 2px; }
.lhc-search-item-excerpt { font-size: .8438rem; color: var(--ink-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lhc-search-no-results { padding: 20px; text-align: center; color: var(--ink-3); font-size: .9375rem; }

/* ── Category accordion (cream tiles) ───────────────────────── */
.lhc-category-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lhc-category-section {
  background: var(--cream);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.lhc-category-section:hover {
  box-shadow: var(--shadow-md);
}
.lhc-category-section.lhc-category-open {
  box-shadow: var(--shadow-md);
}

/* Category button */
.lhc-category-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  text-align: left;
  transition: background 0.15s;
}
.lhc-category-btn:hover {
  background: var(--cream-deep);
}
.lhc-category-btn-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lhc-category-btn-name {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
}
.lhc-category-btn-count {
  font-size: .8438rem;
  font-weight: 500;
  color: var(--ink-3);
}

/* Chevron icon */
.lhc-category-chevron {
  width: 22px;
  height: 22px;
  color: var(--ink-3);
  flex-shrink: 0;
  transition: transform 0.25s ease, color 0.25s ease;
}
.lhc-category-open .lhc-category-chevron {
  transform: rotate(180deg);
  color: var(--brand-deep);
}

/* Expanded content area */
.lhc-category-content {
  padding: 0 12px 12px;
}

/* Folder group inside expanded category — white inner cards */
.lhc-folder-group {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 10px;
}
.lhc-folder-group:last-child {
  margin-bottom: 0;
}
.lhc-folder-heading {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-4);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Article items inside folder */
.lhc-folder-articles {
  list-style: none;
  padding: 0;
  margin: 0;
}
.lhc-article-item {
  border-bottom: 1px solid var(--border);
}
.lhc-article-item:last-child {
  border-bottom: none;
}
.lhc-article-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--ink-2);
  border-radius: var(--radius-md);
  transition: background 0.15s, color 0.15s;
}
.lhc-article-item a:hover {
  background: var(--bg);
  color: var(--brand-deep);
}
.lhc-article-item .lhc-article-title {
  font-size: .9375rem;
  font-weight: 500;
}
.lhc-article-item .lhc-article-badge {
  font-size: .7rem;
  background: var(--brand);
  color: var(--brand-ink);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  margin-left: 12px;
  font-weight: 700;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.lhc-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: .875rem;
  color: var(--ink-4);
  margin-bottom: 20px;
}
.lhc-breadcrumb a {
  color: var(--ink-3);
  text-decoration: none;
  font-weight: 600;
}
.lhc-breadcrumb a:hover { color: var(--brand-deep); text-decoration: underline; }
.lhc-breadcrumb span { color: var(--ink-4); }

/* ── Folder view title ──────────────────────────────────────── */
#lhc-folder-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-variation-settings: "SOFT" 0, "WONK" 1;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -.01em;
  color: var(--ink);
}

/* ── Article list (folder view) ─────────────────────────────── */
.lhc-article-list {
  list-style: none;
  padding: 0;
  margin-top: 20px;
}
.lhc-article-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin-bottom: 10px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.lhc-article-list li:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
}
.lhc-article-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  text-decoration: none;
  color: var(--ink);
  border-radius: var(--radius-xl);
}
.lhc-article-list li a .lhc-article-title { font-weight: 600; font-size: .9843rem; }
.lhc-article-list li a .lhc-article-badge {
  font-size: .72rem;
  background: var(--brand);
  color: var(--brand-ink);
  padding: 3px 12px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  margin-left: 12px;
  font-weight: 700;
}

/* ── Article body (white card) ──────────────────────────────── */
.lhc-article-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: clamp(28px, 5vw, 48px);
  max-width: 860px;
  box-shadow: var(--shadow-xs);
  color: var(--ink-2);
}
.lhc-article-body h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-variation-settings: "SOFT" 0, "WONK" 1;
  font-size: clamp(1.75rem, 3vw, 2.375rem);
  line-height: 1.08;
  letter-spacing: -.01em;
  color: var(--ink);
  margin-bottom: 10px;
  text-wrap: balance;
}
.lhc-article-body .lhc-article-meta {
  font-size: .8438rem;
  color: var(--ink-4);
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.lhc-article-body h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-variation-settings: "SOFT" 0, "WONK" 1;
  font-size: 1.5rem;
  line-height: 1.15;
  color: var(--ink);
  margin: 32px 0 12px;
}
.lhc-article-body h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
  margin: 24px 0 8px;
}
.lhc-article-body h4 { font-size: 1rem; font-weight: 700; color: var(--ink); margin: 18px 0 6px; }
.lhc-article-body p { margin-bottom: 14px; }
.lhc-article-body ul,
.lhc-article-body ol { margin: 0 0 14px 22px; }
.lhc-article-body li { margin-bottom: 4px; }
.lhc-article-body a { color: var(--brand-deep); font-weight: 600; }
.lhc-article-body a:hover { text-decoration: underline; }
.lhc-article-body img { max-width: 100%; border-radius: var(--radius-lg); margin: 14px 0; }
.lhc-article-body code {
  background: var(--cream);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: .88em;
  font-family: "SFMono-Regular", Consolas, monospace;
  color: var(--ink);
}
.lhc-article-body pre {
  background: var(--dark);
  color: #f9fafb;
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin-bottom: 16px;
}
.lhc-article-body pre code { background: none; color: inherit; padding: 0; }
.lhc-article-body blockquote {
  border-left: 3px solid var(--brand);
  padding: 12px 18px;
  margin: 16px 0;
  background: var(--success-bg);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--ink-2);
}
.lhc-article-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: .9rem;
}
.lhc-article-body th,
.lhc-article-body td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
}
.lhc-article-body th { background: var(--dark); color: #fff; font-weight: 600; }
.lhc-article-body hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* Back link at bottom of article */
.lhc-article-back {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.lhc-article-back a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-deep);
  text-decoration: none;
  font-weight: 700;
  font-size: .9375rem;
  transition: color 0.2s;
}
.lhc-article-back a:hover { color: var(--ink); }

/* Video embed wrapper */
.lhc-video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-xl);
  margin: 20px 0;
  background: #000;
}
.lhc-video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .lhc-main { padding: 32px 16px 64px; }
  .lhc-hero { padding: calc(var(--nav-h) + 40px) 16px 48px; }
  .lhc-article-body { padding: 24px 20px; }
  .lhc-category-btn { padding: 16px 18px; }
  .lhc-category-content { padding: 0 8px 8px; }
  .lhc-folder-group { padding: 14px 14px; }
}
