/*
 * Help Center — WagePress
 *
 * Built entirely on the tokens styles.css already defines (--green, --navy,
 * --radius, --shadow-card, the three font families). Nothing here introduces a
 * new colour or a new radius: the help centre has to read as the same product
 * as the marketing pages, not as a docs tool bolted on beside them.
 */

/* ---------------------------------------------------------------- *
 * Hero
 * ---------------------------------------------------------------- */

.kb-hero {
  background:
    radial-gradient(1100px 420px at 50% -160px, rgba(22, 217, 152, .16), transparent 70%),
    var(--bg-hero);
  border-bottom: 1px solid var(--line);
  padding: clamp(56px, 8vw, 104px) 20px clamp(44px, 6vw, 76px);
}

.kb-hero__inner {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.kb-hero__eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--green-ink);
  background: rgba(22, 217, 152, .12);
  border: 1px solid rgba(22, 217, 152, .28);
  border-radius: 999px;
  padding: 7px 16px;
  margin-bottom: 20px;
}

.kb-hero__title {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink);
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.1;
  margin: 0 0 14px;
}

.kb-hero__title .grad {
  background: var(--grad-green);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.kb-hero__sub {
  font-family: var(--font-para);
  color: var(--muted);
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.65;
  margin: 0 auto 30px;
  max-width: 560px;
}

/* ---------------------------------------------------------------- *
 * Search
 * ---------------------------------------------------------------- */

.kb-search {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 620px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.kb-search:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(22, 217, 152, .16), var(--shadow-soft);
}

.kb-search__icon {
  width: 20px;
  height: 20px;
  flex: none;
  margin-left: 20px;
  fill: none;
  stroke: var(--muted-2);
  stroke-width: 2;
  stroke-linecap: round;
}

.kb-search__input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  padding: 17px 14px;
  min-width: 0;
}

.kb-search__input::placeholder { color: var(--muted-2); }

.kb-search__clear {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 20px 0 6px;
}

.kb-search__clear:hover { color: var(--ink); }

.kb-search__meta {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--muted);
  margin: 14px 0 0;
  min-height: 20px;
}

/* ---------------------------------------------------------------- *
 * Layout
 * ---------------------------------------------------------------- */

.kb {
  background: var(--white);
  padding: clamp(32px, 5vw, 64px) 20px clamp(56px, 8vw, 96px);
}

.kb__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

/* Sidebar sticks so a reader deep in Payroll can still jump elsewhere. */
.kb__sidebar {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 128px);
  overflow-y: auto;
  padding-right: 6px;
}

.kb__sidebar::-webkit-scrollbar { width: 6px; }
.kb__sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }

.kb__navtoggle { display: none; }

.kb__nav { display: block; }

.kb__nav-group + .kb__nav-group { margin-top: 2px; }

.kb__nav-link {
  display: block;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 10px;
  border-left: 2px solid transparent;
  line-height: 1.35;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.kb__nav-link:hover {
  background: rgba(22, 217, 152, .08);
  color: var(--ink);
}

.kb__nav-link.is-current {
  background: rgba(22, 217, 152, .12);
  border-left-color: var(--green);
  color: var(--green-ink);
}

.kb__nav-sub {
  list-style: none;
  margin: 2px 0 6px;
  padding: 0 0 0 14px;
}

.kb__nav-sub .kb__nav-link {
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 12px;
}

.kb__nav-link[hidden] { display: none; }

/* ---------------------------------------------------------------- *
 * Content
 * ---------------------------------------------------------------- */

.kb__content { min-width: 0; }

.kb__loading {
  font-family: var(--font-body);
  color: var(--muted);
  padding: 40px 0;
}

.kb-section {
  scroll-margin-top: 92px;
  padding-bottom: 46px;
  margin-bottom: 46px;
  border-bottom: 1px solid var(--line);
}

.kb-section:last-child { border-bottom: 0; margin-bottom: 0; }

.kb-section__title {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
  margin: 0 0 20px;
}

.kb-sub {
  scroll-margin-top: 92px;
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px dashed var(--line);
}

.kb-sub__title {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--navy);
  font-size: clamp(18px, 2.2vw, 22px);
  margin: 0 0 14px;
}

.kb-section p {
  font-family: var(--font-para);
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.75;
  margin: 0 0 12px;
}

/*
 * "Description", "Happy Flow Steps", "Scenarios" are the guide's own recurring
 * labels. They are plain paragraphs in the .docx, so the renderer tags them and
 * they get promoted here — otherwise every section reads as one flat wall.
 */
.kb-section p.kb-label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--green-ink);
  margin: 26px 0 10px;
}

.kb-steps {
  counter-reset: kbstep;
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.kb-steps li {
  counter-increment: kbstep;
  position: relative;
  font-family: var(--font-para);
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.7;
  padding: 0 0 0 40px;
  margin-bottom: 11px;
}

.kb-steps li::before {
  content: counter(kbstep);
  position: absolute;
  left: 0;
  top: 1px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(22, 217, 152, .14);
  color: var(--green-ink);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12.5px;
  display: grid;
  place-items: center;
}

.kb-figure {
  margin: 22px 0 26px;
}

.kb-figure__frame {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-hero);
  box-shadow: var(--shadow-card);
  cursor: zoom-in;
  transition: transform .2s ease, box-shadow .2s ease;
}

.kb-figure__frame:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 68px rgba(18, 40, 35, .13);
}

.kb-figure__frame img {
  display: block;
  width: 100%;
  height: auto;
}

/* No-results state for search. */
.kb-empty {
  font-family: var(--font-body);
  color: var(--muted);
  background: var(--bg-hero);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 44px 24px;
  text-align: center;
}

.kb-empty strong { color: var(--ink); }

.kb-section[hidden], .kb-sub[hidden] { display: none; }

/* Search hit highlight. */
.kb-hit {
  background: rgba(22, 217, 152, .22);
  border-radius: 3px;
  padding: 0 2px;
}

/* ---------------------------------------------------------------- *
 * Lightbox
 * ---------------------------------------------------------------- */

.kb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(4, 20, 29, .92);
  display: grid;
  place-items: center;
  padding: 32px;
}

.kb-lightbox[hidden] { display: none; }

.kb-lightbox__img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, .5);
}

.kb-lightbox__close {
  position: absolute;
  top: 18px;
  right: 24px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.kb-lightbox__close:hover { background: rgba(255, 255, 255, .22); }

/* ---------------------------------------------------------------- *
 * Responsive
 * ---------------------------------------------------------------- */

@media (max-width: 980px) {
  .kb__inner { grid-template-columns: 1fr; }

  .kb__sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    margin-bottom: 22px;
  }

  /* Collapsed by default on small screens: 18 sections above the content is a
     page of navigation before a reader reaches a single answer. */
  .kb__navtoggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
    background: var(--bg-hero);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 18px;
    cursor: pointer;
  }

  .kb__navtoggle-caret { transition: transform .18s ease; }
  .kb__navtoggle[aria-expanded="true"] .kb__navtoggle-caret { transform: rotate(180deg); }

  .kb__nav { display: none; padding-top: 10px; }
  .kb__nav.is-open { display: block; }
}
