/* Help articles. Uses the variables and components of portal.css.
   .kb-doc and everything inside it is also what the console's preview shows (helpdesk-articles.js loads this
   file and portal.css into the preview's frame), so an article looks the same there as it does here. */

/* ------------------------------------------------------------------ the help page */

.kb-search { flex: none; max-width: none; margin: 0 0 24px; }
.kb-search .search-input { min-height: 54px; font-size: 1.05rem; border-radius: 14px; box-shadow: var(--shadow-1); }
.kb-search > .icon { left: 16px; }
.kb-search .search-input { padding-left: 48px; }

.kb-results-title { margin-bottom: 12px; font: 650 1.02rem/1.3 var(--font); color: var(--ink-2); }
.kb-q { color: var(--ink); }
.kb-results, .kb-browse { min-height: 120px; }

.kb-list-rows > li + li { border-top: 1px solid var(--line); }
.kb-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 18px; gap: 14px; align-items: center; padding: 14px 18px; color: inherit; }
.kb-row:hover { background: var(--surface-2); text-decoration: none; }
.kb-row:focus-visible { outline-offset: -3px; border-radius: 12px; }
.kb-row-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--blue-bg); color: var(--blue-ink); }
.kb-row-icon .icon { width: 20px; height: 20px; }
.kb-row-main { display: grid; gap: 2px; min-width: 0; }
.kb-row-title { font-weight: 600; }
.kb-row-text { color: var(--ink-2); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kb-row-meta { color: var(--muted); font-size: .82rem; }
.kb-row-go { width: 18px; height: 18px; color: var(--muted); }
.kb-row mark { background: color-mix(in srgb, var(--amber) 34%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

.kb-stuck { display: flex; align-items: center; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; margin-top: 28px; padding: 18px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.kb-stuck .muted { font-size: .93rem; }

/* ------------------------------------------------------------------ one article */

.kb-read-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.kb-print { margin-top: -6px; }
.kb-page { padding: 34px 40px 28px; }
.kb-doc { max-width: 68ch; }
.kb-head { margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.kb-head h1 { font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2rem); line-height: 1.18; }
.kb-head .lead { margin-top: 10px; font-size: 1.08rem; }
.kb-updated { margin-top: 26px; }

/* The text itself: a comfortable measure, room between blocks, and steps that read as steps. */
.kb-article { font-size: 1.04rem; line-height: 1.68; color: var(--ink); overflow-wrap: anywhere; }
.kb-article > * + * { margin-top: 1.05em; }
.kb-article h2 { margin-top: 1.9em; font: 700 1.3rem/1.25 var(--font-display); letter-spacing: -.015em; }
.kb-article h3 { margin-top: 1.6em; font: 650 1.08rem/1.3 var(--font); }
.kb-article > :first-child { margin-top: 0; }
.kb-article h2 + *, .kb-article h3 + * { margin-top: .6em; }
.kb-article strong { font-weight: 680; }
.kb-article a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.kb-article a::after { content: "\2197"; display: inline-block; margin-left: 2px; font-size: .82em; text-decoration: none; }
.kb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.kb-list { list-style: disc; padding-left: 1.35em; }
.kb-list > li + li { margin-top: .4em; }
.kb-list > li::marker { color: var(--muted); }

/* Numbered steps: the number sits in a blue disc, taken from the list itself so "4." after a note stays 4. */
.kb-steps { list-style: none; padding: 0; counter-reset: none; }
.kb-steps > li { position: relative; padding-left: 2.9em; min-height: 2em; }
.kb-steps > li + li { margin-top: .8em; }
.kb-steps > li::before {
  content: counter(list-item); position: absolute; left: 0; top: .08em; display: inline-flex; align-items: center; justify-content: center;
  width: 1.9em; height: 1.9em; border-radius: 50%; background: var(--blue-bg); color: var(--blue-ink); font: 700 .88em/1 var(--font); font-variant-numeric: tabular-nums;
}
.kb-steps .kb-list { margin-top: .5em; }
.kb-item { display: block; }

/* Where to click: the name of a button, a menu or a setting. */
.kb-ui { padding: .08em .42em; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface-2); font-weight: 600; font-size: .95em; white-space: nowrap; }
/* A key on the keyboard. */
.kb-key {
  display: inline-block; min-width: 1.7em; padding: .1em .45em; border: 1px solid var(--line-strong); border-bottom-width: 2.5px; border-radius: 6px;
  background: var(--surface); font: 600 .84em/1.4 var(--font); text-align: center; white-space: nowrap; vertical-align: .06em;
}

.kb-note { padding: 14px 18px 15px; border-left: 4px solid var(--tone); border-radius: 4px var(--radius-s) var(--radius-s) 4px; background: var(--tone-bg); color: var(--tone-ink); --tone-bg: var(--blue-bg); --tone-ink: var(--blue-ink); --tone: var(--blue); }
.kb-note.kb-tip { --tone-bg: var(--green-bg); --tone-ink: var(--green-ink); --tone: var(--green); }
.kb-note.kb-warning { --tone-bg: var(--amber-bg); --tone-ink: var(--amber-ink); --tone: var(--amber); }
.kb-note-label { margin-bottom: 2px; font: 750 .78rem/1.4 var(--font); letter-spacing: .07em; text-transform: uppercase; }
.kb-note-body { font-size: .98em; line-height: 1.6; }
.kb-note-body > p + p { margin-top: .6em; }
.kb-note .kb-ui, .kb-note .kb-key { color: var(--ink); }
.kb-note a { color: inherit; }

/* The quick fix an article offers: the same card as on a device's page, at the end of the text. */
.kb-fix { margin-top: 30px; max-width: 68ch; }
.kb-fix-card { gap: 12px; padding: 20px; }
.kb-fix-card h2 { font: 650 1.1rem/1.3 var(--font); }
.kb-fix-eyebrow { color: var(--muted); font-size: .78rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.kb-fix-foot { display: grid; gap: 10px; }
.kb-fix-where { display: flex; gap: 10px; color: var(--ink-2); font-size: .94rem; }
.kb-fix-where .icon { flex: none; width: 18px; height: 18px; margin-top: 3px; color: var(--muted); }
.kb-fix [tabindex="-1"]:focus { outline: none; }

/* Did this help? */
.kb-vote { margin-top: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.kb-vote-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.kb-vote-q { font: 650 1.02rem/1.3 var(--font); }
.kb-vote-buttons { display: flex; gap: 8px; }
.kb-vote-buttons .btn { min-width: 84px; }
.kb-vote-buttons .btn[aria-pressed="true"] { background: var(--blue-bg); border-color: var(--blue); color: var(--blue-ink); }
.kb-vote-after { display: grid; gap: 12px; justify-items: start; color: var(--ink-2); }
.kb-vote-after:not(:empty) { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.kb-read .kb-stuck { margin-top: 16px; }
.kb-related { margin-top: 32px; }

/* ------------------------------------------------------------------ on the new-ticket page and the home page */

.kb-suggest { padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.kb-suggest-title { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 650; font-size: .95rem; }
.kb-suggest-title .icon { width: 18px; height: 18px; color: var(--brand-ink); }
.kb-suggest .kb-row { padding: 10px 4px; grid-template-columns: 34px minmax(0, 1fr) 16px; gap: 12px; border-radius: 10px; }
.kb-suggest .kb-row-icon { width: 34px; height: 34px; border-radius: 10px; }
.kb-suggest .kb-row-text { -webkit-line-clamp: 1; line-clamp: 1; }
.kb-suggest-note { margin-top: 6px; }

.kb-home-search { flex: none; max-width: none; margin: 14px 14px 6px; }
.kb-home-search .search-input { min-height: 44px; }
.kb-home-list .kb-row { padding: 11px 16px; grid-template-columns: 34px minmax(0, 1fr) 16px; gap: 12px; }
.kb-home-list .kb-row-icon { width: 34px; height: 34px; border-radius: 10px; }
.kb-home-list .kb-row-title { font-size: .95rem; }
.kb-home-list > li:first-child { border-top: 1px solid var(--line); margin-top: 8px; }

/* ------------------------------------------------------------------ narrow windows (a phone, the Support window) */

@media (max-width: 720px) {
  .kb-page { padding: 22px 18px 20px; }
  .kb-article { font-size: 1rem; line-height: 1.62; }
  .kb-steps > li { padding-left: 2.6em; }
  .kb-row { padding: 13px 14px; gap: 12px; }
  .kb-stuck .btn, .kb-vote-buttons { flex: 1 1 auto; }
  .kb-vote-buttons .btn { flex: 1; }
  .kb-print { display: none; }
}

/* ------------------------------------------------------------------ the console's preview frame */

.kb-preview { margin: 0; min-height: 0; padding: 18px; background: var(--bg); }
.kb-preview .kb-page { max-width: 800px; margin: 0 auto; }
.kb-preview.narrow { padding: 12px; }
.kb-preview-fix { margin-top: 30px; max-width: 68ch; }
.kb-preview-empty { color: var(--muted); font-style: italic; }

/* ------------------------------------------------------------------ on paper */

@media print {
  .kb-read-top, .kb-vote, .kb-stuck, .kb-related, .kb-fix, .kb-search, .skip { display: none !important; }
  .kb-read { max-width: none; padding: 0; }
  .kb-page { padding: 0; border: 0; border-radius: 0; background: #fff; }
  .kb-doc { max-width: none; }
  .kb-article { font-size: 11.5pt; line-height: 1.5; color: #000; }
  .kb-head h1 { font-size: 20pt; }
  .kb-article h2, .kb-article h3 { break-after: avoid; }
  .kb-steps > li, .kb-note, .kb-list > li { break-inside: avoid; }
  .kb-steps > li::before { background: none; border: 1px solid #555; color: #000; }
  .kb-note { background: none; border: 1px solid #888; border-left-width: 4px; color: #000; }
  .kb-ui, .kb-key { background: none; color: #000; }
  /* On paper a link is no use without its address. */
  .kb-article a { color: #000; }
  .kb-article a::after { content: " (" attr(href) ")"; font-size: .88em; word-break: break-all; }
}
