/* ============================================
   Water LLM — Help Article Styles
   Paste into: Design > Custom CSS (after global.css)
   Required by: every page under pages/help/
   ============================================ */

/* --- Article Hero --- */
.wl-help-hero {
  padding: 72px 24px 32px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
}

.wl-help-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-500);
  margin-bottom: 16px;
  transition: color var(--transition);
}

.wl-help-breadcrumb:hover { color: var(--purple); }

.wl-help-title {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--gray-900);
}

.wl-help-title__icon {
  flex-shrink: 0;
  width: 1.4em;
  height: 1.4em;
  font-size: 0.7em;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(124,92,252,0.12), rgba(0,212,255,0.12));
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wl-help-desc {
  margin-top: 18px;
  font-size: 1.05rem;
  color: var(--gray-500);
  line-height: 1.7;
  max-width: 680px;
}

/* --- Section nav ---
   Mobile/tablet: a horizontal chip rail under the hero.
   Desktop (>=1000px): a sticky sidebar beside the article, because the
   help section has 11 articles and a scrolling rail hides most of them. */
.wl-help-nav {
  position: relative;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  padding: 14px 0;
}

/* The rail scrolls horizontally with its scrollbar hidden, so without this
   fade there is no cue that more articles exist off the right edge. */
.wl-help-nav::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 56px;
  background: linear-gradient(to right, rgba(243, 244, 246, 0), var(--gray-100));
  pointer-events: none;
}

.wl-help-nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 24px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.wl-help-nav__inner::-webkit-scrollbar { display: none; }

.wl-help-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-700);
  background: var(--white);
  border: 1px solid var(--gray-300);
  white-space: nowrap;
  transition: all var(--transition);
}

.wl-help-nav-link:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.wl-help-nav-link.is-active {
  background: var(--gradient);
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(124,92,252,0.25);
}

.wl-help-nav-link__icon { font-size: 1rem; line-height: 1; }

/* --- Article body --- */
.wl-help-body {
  padding: 48px 24px 64px;
}

.wl-help-article {
  max-width: 820px;
  margin: 0 auto;
}

/* --- Collapsible help sections --- */
.wl-help-section {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.wl-help-section:hover { border-color: var(--gray-300); }
.wl-help-section[open] {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-md);
}

.wl-help-section > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--gray-900);
  transition: background var(--transition);
}

.wl-help-section > summary::-webkit-details-marker { display: none; }
.wl-help-section > summary::marker { content: ''; }
.wl-help-section > summary:hover { background: var(--gray-100); }

.wl-help-section[open] > summary {
  border-bottom: 1px solid var(--gray-100);
}

.wl-help-section__icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(124,92,252,0.1), rgba(0,212,255,0.1));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.wl-help-section__title { flex: 1; }

.wl-help-section__arrow {
  color: var(--gray-500);
  font-size: 1rem;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.wl-help-section[open] > summary .wl-help-section__arrow {
  transform: rotate(180deg);
}

.wl-help-section__body {
  padding: 24px 22px 28px;
  font-size: 0.96rem;
  color: var(--gray-700);
  line-height: 1.7;
}

.wl-help-section__body > *:last-child { margin-bottom: 0; }
.wl-help-section__body p { margin-bottom: 12px; line-height: 1.7; }
.wl-help-section__body ul,
.wl-help-section__body ol { margin: 8px 0 14px 22px; }
.wl-help-section__body li { margin-bottom: 6px; line-height: 1.65; }
.wl-help-section__body strong { font-weight: 600; color: var(--gray-900); }
.wl-help-section__body a {
  color: var(--purple);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.wl-help-section__body a:hover { color: var(--purple-dark); }

/* --- Sub-sections inside a section body --- */
.wl-help-subsection { margin: 24px 0; }
.wl-help-subsection:first-child { margin-top: 0; }
.wl-help-subsection:last-child { margin-bottom: 0; }

.wl-help-subheading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-100);
}

.wl-help-subheading__icon { font-size: 1.05rem; color: var(--gray-500); }

/* --- Inline code, blocks, kbd --- */
.wl-help-section__body code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--gray-100);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  color: var(--purple-dark);
}

.wl-help-section__body pre {
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 14px 0;
}

.wl-help-section__body pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--gray-900);
}

.wl-help-section__body kbd {
  display: inline-block;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  padding: 1px 7px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--gray-900);
  white-space: nowrap;
}

/* --- Data tables ---
   .wl-help-section clips its overflow, so a table wider than the card was
   being truncated with no way to reach the hidden columns. The scroll
   wrapper gives narrow screens a scrollable table instead. */
.wl-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0;
}

.wl-data-table {
  width: 100%;
  min-width: 440px;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

.wl-data-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  background: var(--gray-100);
  border-bottom: 2px solid var(--gray-300);
  padding: 10px 14px;
  white-space: nowrap;
}

.wl-data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: top;
  color: var(--gray-700);
}

.wl-data-table tr:last-child td { border-bottom: none; }

/* --- Callouts --- */
.wl-callout {
  display: flex;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin: 18px 0;
  font-size: 0.94rem;
  line-height: 1.6;
}

.wl-callout__icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1.2;
}

.wl-callout__body { flex: 1; min-width: 0; }
.wl-callout__title { font-weight: 600; margin-bottom: 4px; }

.wl-callout p { margin-bottom: 6px; font-size: 0.94rem; }
.wl-callout p:last-child { margin-bottom: 0; }
.wl-callout ul { margin: 4px 0 4px 20px; }
.wl-callout li { margin-bottom: 4px; }

.wl-callout--tip {
  background: linear-gradient(135deg, rgba(0,212,255,0.06), rgba(124,92,252,0.06));
  border: 1px solid rgba(124,92,252,0.18);
}
.wl-callout--tip .wl-callout__icon { color: var(--purple); }
.wl-callout--tip .wl-callout__title { color: var(--purple-dark); }

.wl-callout--note {
  background: rgba(0,212,255,0.06);
  border: 1px solid rgba(0,184,219,0.25);
}
.wl-callout--note .wl-callout__icon { color: var(--cyan-dark); }
.wl-callout--note .wl-callout__title { color: var(--cyan-dark); }

.wl-callout--warning {
  background: #FEF7E0;
  border: 1px solid #F5C842;
}
.wl-callout--warning .wl-callout__icon { color: #B06000; }
.wl-callout--warning .wl-callout__title { color: #B06000; }

.wl-callout--watchout {
  background: #FFF3E0;
  border: 1px solid #FFB74D;
  border-left: 4px solid #F57C00;
}
.wl-callout--watchout .wl-callout__icon { color: #F57C00; }
.wl-callout--watchout .wl-callout__title { color: #E65100; }

.wl-callout--danger {
  background: #FEE2E2;
  border: 1px solid #F5A8A3;
}
.wl-callout--danger .wl-callout__icon { color: #DC2626; }
.wl-callout--danger .wl-callout__title { color: #991B1B; }

/* --- Step list --- */
.wl-steps {
  list-style: none;
  margin: 16px 0;
  padding: 0;
}

.wl-steps li {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.wl-steps li:last-child { margin-bottom: 0; }

.wl-step__num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient);
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  box-shadow: 0 2px 8px rgba(124,92,252,0.25);
}

.wl-step__body { flex: 1; padding-top: 3px; }

.wl-step__label {
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
}

/* --- Loom video embed (real or stub) --- */
.wl-loom-stub {
  background: linear-gradient(135deg, rgba(124,92,252,0.04), rgba(0,212,255,0.04));
  border: 2px dashed rgba(124,92,252,0.25);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  margin: 18px 0;
}

.wl-loom-stub__icon {
  font-size: 2.2rem;
  color: var(--purple);
  margin-bottom: 8px;
}

.wl-loom-stub__label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 4px;
}

/* The build token for the Loom that replaces this stub. Kept in the markup so
   whoever swaps the embed in can find the right slot with a text search, but
   hidden from readers — "LOOM_CRM_OVERVIEW" on a help page reads as a page
   that was shipped half-finished. Screen readers skip it too: it is a note to
   us, not content. Delete the whole .wl-loom-stub block when the real embed
   lands; do not just unhide this. */
.wl-loom-stub__key {
  display: none;
}

/* What the reader sees instead, once every stub has one. */
.wl-loom-stub__soon {
  font-size: 0.78rem;
  color: var(--gray-500);
  letter-spacing: 0.02em;
}

.wl-loom-embed {
  border-radius: var(--radius);
  overflow: hidden;
  margin: 18px 0;
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  box-shadow: var(--shadow-md);
}

.wl-loom-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* --- Menu path chip --- */
.wl-menu-path {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 2px 9px;
  font-size: 0.85em;
  font-family: var(--font-mono);
  color: var(--gray-900);
  white-space: nowrap;
}

.wl-menu-path__arrow { color: var(--gray-500); font-size: 1em; }

/* --- Tags / badges --- */
.wl-tag {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}

.wl-tag--new      { background: rgba(16,185,129,0.12);  color: #047857; border: 1px solid rgba(16,185,129,0.3); }
.wl-tag--beta     { background: rgba(245,158,11,0.14);  color: #B45309; border: 1px solid rgba(245,158,11,0.3); }
.wl-tag--auto     { background: rgba(124,92,252,0.12);  color: var(--purple-dark); border: 1px solid rgba(124,92,252,0.3); }
.wl-tag--manual   { background: var(--gray-100);        color: var(--gray-700); border: 1px solid var(--gray-300); }
.wl-tag--danger   { background: rgba(220,38,38,0.1);    color: #991B1B; border: 1px solid rgba(220,38,38,0.3); }

/* --- Feature card grid (auto-fit, in-article) --- */
.wl-help-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.wl-help-feature-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: var(--gray-900);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wl-help-feature-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--purple);
  transform: translateY(-2px);
}

.wl-help-feature-card__icon {
  font-size: 1.35rem;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(124,92,252,0.1), rgba(0,212,255,0.1));
}

.wl-help-feature-card__title {
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wl-help-feature-card__desc {
  font-size: 0.85rem;
  color: var(--gray-500);
  line-height: 1.55;
}

/* --- Article footer (last updated / prev-next nav) --- */
.wl-help-article-footer {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-300);
  font-size: 0.9rem;
  color: var(--gray-500);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.wl-help-article-footer a {
  color: var(--purple);
  font-weight: 500;
  transition: color var(--transition);
}

.wl-help-article-footer a:hover { color: var(--purple-dark); }

.wl-help-article-footer__nav {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

/* --- Section divider inside article body --- */
.wl-help-divider {
  height: 1px;
  background: var(--gray-100);
  margin: 24px 0;
  border: none;
}

/* --- Column color swatch (used in sheet legend tables) --- */
.wl-col-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.12);
  vertical-align: middle;
  margin-right: 6px;
}
.wl-col-swatch--white { background: #ffffff; }
.wl-col-swatch--gray  { background: #d3d3d3; }
.wl-col-swatch--blue  { background: #a8c7fa; }

/* --- Inline section sub-heading (for h2 inside body) --- */
.wl-help-h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 32px 0 14px;
  letter-spacing: -0.01em;
}
.wl-help-h2__icon { color: #F57C00; font-size: 1.3rem; }

/* --- Release-note specific blocks (used on release-notes page) --- */
.wl-release-block {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.wl-release-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-100);
  flex-wrap: wrap;
}

.wl-release-version {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-900);
  font-family: var(--font-mono);
}

.wl-release-date {
  font-size: 0.78rem;
  color: var(--gray-500);
  margin-left: auto;
}

.wl-release-body { padding: 18px 20px; }

.wl-release-body h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  margin: 16px 0 8px;
}

.wl-release-body h4:first-child { margin-top: 0; }
.wl-release-body ul { margin: 0 0 0 22px; }
.wl-release-body li { margin-bottom: 6px; line-height: 1.55; font-size: 0.92rem; }

.wl-release-placeholder {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  color: var(--gray-500);
  font-size: 0.9rem;
  background: var(--gray-100);
  margin-bottom: 16px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .wl-help-hero { padding: 48px 20px 24px; }
  .wl-help-body { padding: 32px 20px 56px; }
  .wl-help-section > summary { padding: 16px 18px; gap: 12px; }
  .wl-help-section__body { padding: 20px 18px 22px; }
  .wl-help-section__icon { width: 34px; height: 34px; font-size: 1rem; }
  .wl-help-card-grid { grid-template-columns: 1fr 1fr; }
  .wl-data-table { font-size: 0.84rem; }
  .wl-data-table th,
  .wl-data-table td { padding: 8px 10px; }
}

@media (max-width: 480px) {
  .wl-help-card-grid { grid-template-columns: 1fr; }
  .wl-help-article-footer { flex-direction: column; align-items: flex-start; }
  .wl-help-article-footer__nav { flex-direction: column; gap: 8px; }
  .wl-help-title { gap: 12px; }
}

/* ============================================
   Help layout — sidebar on desktop
   ============================================ */

.wl-help-layout {
  max-width: 1240px;
  margin: 0 auto;
}

@media (min-width: 1000px) {
  .wl-help-layout {
    display: grid;
    grid-template-columns: 244px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
    padding: 0 24px;
  }

  /* Sidebar: vertical list, sticky under the site header (68px + breathing room) */
  .wl-help-nav {
    position: sticky;
    top: 92px;
    background: none;
    border-bottom: none;
    padding: 40px 0 0;
  }

  .wl-help-nav::after { display: none; }

  .wl-help-nav__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    max-width: none;
    overflow: visible;
    padding: 0;
  }

  .wl-help-nav-link {
    justify-content: flex-start;
    width: 100%;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    border-color: transparent;
    background: transparent;
    white-space: normal;
  }

  .wl-help-nav-link:hover {
    background: var(--white);
    border-color: var(--gray-300);
  }

  .wl-help-nav-link.is-active {
    box-shadow: none;
  }

  /* The article no longer needs to centre itself — the grid column does it. */
  .wl-help-body {
    padding: 40px 0 72px;
    min-width: 0;
  }

  .wl-help-article {
    max-width: 820px;
    margin: 0;
  }
}

/* --- In-article support prompt --- */
.wl-help-support {
  margin: 40px 0 8px;
  padding: 18px 22px;
  background: var(--gray-100);
  border-radius: var(--radius);
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--gray-700);
}

.wl-help-support p { margin: 0; }

.wl-help-support a { color: var(--purple-dark); font-weight: 600; }


/* --- Sidebar group headings ---------------------------------------------
   The rail carries 13 links now, which is past the point where a flat list
   reads as a list. Headings group them on the desktop sidebar; on the
   narrow chip rail they would just be unlabelled gaps, so they are hidden
   there and the chips keep scrolling as one row. */
.wl-help-nav-group {
  display: none;
}

@media (min-width: 1000px) {
  .wl-help-nav-group {
    display: block;
    margin: 18px 0 6px;
    padding: 0 14px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gray-500);
  }

  .wl-help-nav-group:first-child {
    margin-top: 0;
  }
}
