/* ==========================================================================
   Help centre front page.

   The hero with the big search and the status
   line, the problem tiles starting on the band, the seven category cards
   with Bank og filer twice as wide. Loaded after help.css (tokens, header,
   footer, buttons), so this file only has what the front page adds. Same rules: regular
   weight only, no tracked uppercase labels, left-border accents or arrows in
   buttons, and every selector starts with .kb-.

   Colour: the nav, the hero and the footer are indigo. Blue is the 404's
   search button, the status dot off the band and text links, never next to
   indigo. Pink only on indigo.

   The 404 (templates/system/help-404) uses the hero and the search from this
   file too, with a visible Søk button (help-search, view "page").
   ========================================================================== */

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

/* The same title size as the user guides' band (help.css, kb-product-head). */
.kb-page .kb-display {
  max-width: 760px;
  font-size: 40px;
  line-height: 50px;
  text-wrap: balance;
}

/* ===== kb-hero: joined to the indigo nav, the same short band as the user guides =====
   Title, one line, the search, the examples. No illustration: the topic cards
   start on the band below and carry the page's weight. */
.kb-hero {
  position: relative;
  padding: var(--kb-space-5) 0 var(--kb-space-5);
  background-color: var(--kb-indigo);
  color: var(--kb-seashell);
}
.kb-hero .kb-container {
  position: relative;
}
.kb-hero :focus-visible {
  outline-color: var(--kb-seashell);
}
.kb-page .kb-hero__lead {
  max-width: 640px;
  margin: var(--kb-space-2) 0 var(--kb-space-4);
  color: var(--kb-on-dark-muted);
}

/* ===== kb-search ===== */
.kb-search {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: var(--kb-radius-md);
  background-color: var(--kb-white);
  color: var(--kb-indigo);
  text-align: left;
}
.kb-search:focus-within {
  outline: 2px solid var(--kb-pink);
  outline-offset: 2px;
}
.kb-search.is-open {
  border-radius: var(--kb-radius-md) var(--kb-radius-md) 0 0;
}
/* 56 px high, the magnifier first and the "/" hint last. */
.kb-search__field {
  display: flex;
  align-items: center;
  gap: var(--kb-space-3);
  min-height: 56px;
  padding: var(--kb-space-2) var(--kb-space-3);
}
.kb-search__icon {
  flex: none;
  color: var(--kb-indigo);
}
.kb-search__key {
  flex: none;
  padding: 0 var(--kb-space-2);
  border: 1px solid var(--kb-border);
  border-radius: var(--kb-radius-sm);
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  color: var(--kb-indigo-70);
}
.kb-page .kb-search__field input {
  flex: 1;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-family: inherit;
  font-size: 16px;
  line-height: 26px;
  color: var(--kb-indigo);
}
.kb-page .kb-search__field input::placeholder {
  color: var(--kb-indigo-70);
  opacity: 1;
}
.kb-page .kb-search__field input:focus {
  outline: none;
}
.kb-search__field input::-webkit-search-cancel-button {
  display: none;
}
/* The suggestion list (help-chrome.css, .kb-suggest) hangs from the field's
   lower edge here, as one white shape with it. */
.kb-search .kb-suggest {
  left: -1px;
  right: -1px;
  top: calc(100% - var(--kb-radius-md));
  padding-top: var(--kb-radius-md);
  border-top: 0;
  border-radius: 0 0 var(--kb-radius-md) var(--kb-radius-md);
}
.kb-search .kb-suggest::before {
  content: '';
  display: block;
  height: 1px;
  margin: 0 calc(-1 * var(--kb-space-2)) var(--kb-space-2);
  background-color: var(--kb-border);
}

.kb-hero__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--kb-space-2) var(--kb-space-5);
  margin-top: var(--kb-space-4);
}
.kb-page .kb-hero__foot .kb-hero__lead {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
}
.kb-page .kb-hero .kb-status {
  color: var(--kb-on-dark-muted);
}
.kb-hero .kb-status .kb-textlink {
  color: var(--kb-seashell);
}
.kb-hero .kb-status__dot {
  background-color: var(--kb-seashell);
}
.kb-hero .kb-status[data-indicator='minor'] .kb-status__dot,
.kb-hero .kb-status[data-indicator='major'] .kb-status__dot,
.kb-hero .kb-status[data-indicator='maintenance'] .kb-status__dot {
  background-color: var(--kb-pink);
}

/* ===== Sections ===== */
.kb-section {
  padding: var(--kb-space-7) 0;
}
.kb-page .kb-section-title {
  margin-bottom: var(--kb-space-4);
}

/* ===== kb-section--seam: the problem tiles start on the indigo band ===== */
.kb-section.kb-section--seam {
  padding-top: 0;
  padding-bottom: 0;
  overflow-x: clip;
}
.kb-section--seam .kb-problems {
  position: relative;
  isolation: isolate;
  padding-top: var(--kb-space-4);
}
.kb-section--seam .kb-problems::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0;
  left: -100vmax;
  right: -100vmax;
  height: 72px;
  background-color: var(--kb-indigo);
}

/* ===== kb-problems: what readers come with, each to a real page ===== */
.kb-page .kb-problems {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--kb-space-3);
}
.kb-page .kb-problem {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--kb-space-3);
  padding: var(--kb-space-4);
  border-radius: var(--kb-radius-md);
  background-color: var(--kb-white);
  box-shadow: 0 1px 2px rgba(69, 9, 90, 0.06);
}
.kb-problem__icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--kb-radius-sm);
  background-color: var(--kb-seashell);
}
.kb-problem--codes .kb-problem__icon {
  background-color: var(--kb-pink);
}
.kb-problem__text {
  display: flex;
  flex-direction: column;
  gap: var(--kb-space-1);
}
.kb-page .kb-problem a {
  font-size: 18px;
  line-height: 26px;
  text-decoration: none;
}
.kb-problem a::after {
  content: '';
  position: absolute;
  inset: 0;
}
.kb-problem:hover a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.kb-problem:focus-within {
  outline: 3px solid var(--kb-pink);
  outline-offset: 0;
  box-shadow: 0 0 0 5px var(--kb-indigo);
}
.kb-page .kb-problem :focus-visible {
  outline: none;
}
.kb-problem__text span {
  font-size: 14px;
  line-height: 20px;
  color: var(--kb-indigo-70);
}

/* ===== kb-cats: the seven categories ===== */
.kb-page .kb-cats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--kb-space-3);
}
.kb-page .kb-cat {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--kb-space-3);
  padding: var(--kb-space-4);
  border-radius: var(--kb-radius-md);
  background-color: var(--kb-white);
}
.kb-page .kb-cat--wide {
  grid-column: span 2;
  background-color: var(--kb-indigo);
  color: var(--kb-seashell);
}
.kb-cat__icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--kb-radius-md);
  background-color: var(--kb-seashell);
}
.kb-cat--wide .kb-cat__icon {
  background-color: var(--kb-pink);
}
.kb-cat__body {
  display: flex;
  flex-direction: column;
  gap: var(--kb-space-2);
  min-width: 0;
}
.kb-page .kb-cat__title {
  font-size: 24px;
  line-height: 32px;
}
.kb-cat__title a {
  text-decoration: none;
}
.kb-cat__title a::after {
  content: '';
  position: absolute;
  inset: 0;
}
.kb-cat:hover .kb-cat__title a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.kb-cat:focus-within {
  outline: 2px solid var(--kb-blue);
  outline-offset: 2px;
}
.kb-page .kb-cat :focus-visible {
  outline: none;
}
.kb-page .kb-cat p {
  color: var(--kb-text);
}
.kb-page .kb-cat--wide p,
.kb-page .kb-cat--wide .kb-cat__title a {
  color: var(--kb-seashell);
}
.kb-page .kb-cat .kb-cat__meta {
  margin-top: auto;
  font-size: 14px;
  line-height: 20px;
  color: var(--kb-indigo-70);
}
.kb-page .kb-cat--wide .kb-cat__meta {
  color: var(--kb-on-dark-muted);
}
/* The sections of Bank og filer, as links above the card's own link. */
.kb-page .kb-cat__secs {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--kb-space-2);
}
.kb-page .kb-cat__secs a {
  display: inline-block;
  padding: var(--kb-space-1) var(--kb-space-3);
  border-radius: 16px;
  background-color: rgba(249, 240, 238, 0.14);
  color: var(--kb-seashell);
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
}
.kb-page .kb-cat__secs a:hover {
  text-decoration: underline;
}
.kb-page .kb-cat__secs a:focus-visible {
  outline: 2px solid var(--kb-pink);
  outline-offset: 2px;
}

/* ===== kb-empty: before the table has rows ===== */
.kb-empty {
  max-width: 720px;
  padding: var(--kb-space-5);
  border-radius: var(--kb-radius-md);
  background-color: var(--kb-white);
}
.kb-page .kb-empty p {
  margin: var(--kb-space-2) 0 var(--kb-space-3);
  color: var(--kb-text);
}

/* ===== kb-status: told in words, the dot only repeats it ===== */
.kb-page .kb-status {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--kb-space-2) var(--kb-space-3);
  font-size: 14px;
  line-height: 20px;
  color: var(--kb-text);
}
.kb-status__dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--kb-blue);
}
.kb-status[data-indicator='minor'] .kb-status__dot,
.kb-status[data-indicator='major'] .kb-status__dot,
.kb-status[data-indicator='maintenance'] .kb-status__dot {
  background-color: var(--kb-indigo);
}
.kb-status__text:empty {
  display: none;
}

@media (max-width: 1100px) {
  .kb-page .kb-cats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  /* The user guides' band title on phones (help.css, kb-product-head). */
  .kb-page .kb-display {
    font-size: 32px;
    line-height: 42px;
  }
  /* No keyboard to press it on. */
  .kb-search__key {
    display: none;
  }
  .kb-section {
    padding: var(--kb-space-6) 0;
  }
  .kb-page .kb-problems,
  .kb-page .kb-cats {
    grid-template-columns: minmax(0, 1fr);
  }
  .kb-page .kb-cat--wide {
    grid-column: auto;
  }
  .kb-page .kb-problem,
  .kb-page .kb-cat {
    padding: var(--kb-space-3) var(--kb-space-4);
  }
  .kb-page .kb-cat__title {
    font-size: 20px;
    line-height: 30px;
  }
}
