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

   Ported from the marketing kit, branch feat/kunnskapsbase at commit c0e1dd9:
   template web-16 version 0.3. Loaded after help.css (tokens, header, footer,
   buttons, product cards) and topic-page.css (tiles, topic cards, the empty
   state), 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 search
   button, the status dot and text links, never next to indigo. Pink only on
   indigo.
   ========================================================================== */

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

.kb-page .kb-display {
  max-width: 760px;
  margin-bottom: var(--kb-space-3);
  font-size: 66px;
  line-height: 76px;
  text-wrap: balance;
}

.kb-page .kb-button--primary {
  background-color: var(--kb-blue);
  color: var(--kb-white);
}

/* ===== kb-hero: joined to the indigo nav, so the two read as one band =====
   The shelf (hjelpesenter-svar-forankret) has no ground line: its books run
   to the bottom of the viewBox and the frame cuts the last 10 of 400 units,
   so the books stand flat on the hero's lower edge and that edge is the shelf.
   The frame ends at the container's right edge. Below 1188 px the shelf moves
   under the examples and still stands on the edge. */
.kb-hero {
  position: relative;
  padding: var(--kb-space-6) 0 var(--kb-space-7);
  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: 600px;
  margin: 0 0 var(--kb-space-5);
  font-size: 18px;
  line-height: 28px;
  color: var(--kb-seashell);
}
.kb-hero__art {
  position: absolute;
  z-index: 0;
  right: var(--kb-space-6);
  bottom: calc(-1 * var(--kb-space-7));
  width: min(432px, calc(100% - 848px));
  aspect-ratio: 600 / 390;
  overflow: hidden;
  pointer-events: none;
}
.kb-page .kb-hero__art img {
  width: 100%;
  height: auto;
}

/* ===== kb-search ===== */
.kb-search {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0;
  border: 1px solid var(--kb-border);
  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-blue);
  outline-offset: 2px;
}
.kb-search.is-open {
  border-radius: var(--kb-radius-md) var(--kb-radius-md) 0 0;
}
.kb-search__field {
  display: flex;
  align-items: center;
  gap: var(--kb-space-2);
  padding: var(--kb-space-2);
}
.kb-page .kb-search__field input {
  flex: 1;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 0 var(--kb-space-3);
  border: 0;
  background: transparent;
  box-shadow: none;
  font-family: inherit;
  font-size: 18px;
  line-height: 28px;
  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 opens over the content below, so the page does not jump. */
.kb-search__results {
  position: absolute;
  z-index: 5;
  left: -1px;
  right: -1px;
  top: calc(100% - var(--kb-radius-md));
  padding-top: var(--kb-space-2);
  border: 1px solid var(--kb-border);
  border-top: 0;
  border-radius: 0 0 var(--kb-radius-md) var(--kb-radius-md);
  background-color: var(--kb-white);
  box-shadow: 0 16px 32px rgba(69, 9, 90, 0.12);
}
.kb-search__inner {
  border-top: 1px solid var(--kb-border);
}
.kb-page .kb-search__group {
  padding: var(--kb-space-3) var(--kb-space-4) 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--kb-indigo-70);
}
.kb-page .kb-search__results ul {
  padding: var(--kb-space-1) var(--kb-space-2) var(--kb-space-2);
}
.kb-search__results li a {
  display: block;
  padding: var(--kb-space-2) var(--kb-space-3);
  border-radius: var(--kb-radius-sm);
  text-decoration: none;
}
.kb-search__results li a:hover,
.kb-search__results li a[aria-selected='true'] {
  background-color: var(--kb-seashell);
}
.kb-search__title {
  display: block;
}
.kb-search__title mark {
  border-radius: 2px;
  background-color: #dbd3d1;
  color: inherit;
}
.kb-search__path {
  display: block;
  font-size: 14px;
  line-height: 20px;
  color: var(--kb-indigo-70);
}
.kb-page .kb-search__empty {
  padding: var(--kb-space-4);
  color: var(--kb-text);
}
.kb-search__foot {
  padding: var(--kb-space-3) var(--kb-space-4);
  border-top: 1px solid var(--kb-border);
  font-size: 14px;
  line-height: 20px;
}

.kb-search-try {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--kb-space-2);
  margin-top: var(--kb-space-4);
  font-size: 14px;
  line-height: 20px;
  color: var(--kb-seashell);
}
.kb-page .kb-search-try ul {
  display: contents;
}
.kb-search-try a {
  display: inline-block;
  padding: var(--kb-space-1) var(--kb-space-3);
  border: 1px solid var(--kb-on-dark-line);
  border-radius: var(--kb-radius-sm);
  color: var(--kb-seashell);
  text-decoration: none;
}
.kb-search-try a:hover {
  text-decoration: underline;
}

/* ===== Sections ===== */
.kb-section {
  padding: var(--kb-space-7) 0;
}
.kb-section--white {
  background-color: var(--kb-white);
}
.kb-section-head {
  margin-bottom: var(--kb-space-5);
}
.kb-page .kb-section-head p {
  margin-top: var(--kb-space-1);
}
.kb-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--kb-space-3) var(--kb-space-5);
}

/* ===== 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;
}

/* ===== kb-topics on the front page: titles are h3 under the section head ===== */
.kb-topic h3 a {
  text-decoration: none;
}
.kb-topic h3 a::after {
  content: '';
  position: absolute;
  inset: 0;
}
.kb-topic:hover h3 a {
  text-decoration: underline;
}
.kb-page .kb-all-topics {
  margin-top: var(--kb-space-4);
}

/* ===== kb-popular: the first article as one big card, the rest numbered ===== */
.kb-page .kb-popular {
  display: grid;
  grid-template-columns: minmax(0, 5fr) repeat(2, minmax(0, 3.5fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: var(--kb-space-4);
}
.kb-page .kb-popular li {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--kb-space-4);
  padding: var(--kb-space-4);
  border-radius: var(--kb-radius-md);
  background-color: var(--kb-seashell);
}
.kb-popular li:focus-within {
  outline: 2px solid var(--kb-blue);
  outline-offset: 2px;
}
.kb-page .kb-popular :focus-visible {
  outline: none;
}
.kb-popular__no {
  font-size: 36px;
  line-height: 46px;
  color: var(--kb-indigo-70);
}
.kb-popular a {
  text-decoration: none;
}
.kb-popular a::after {
  content: '';
  position: absolute;
  inset: 0;
}
.kb-popular li:hover a {
  text-decoration: underline;
}
.kb-popular__meta {
  display: block;
  margin-top: var(--kb-space-1);
  font-size: 14px;
  line-height: 20px;
  color: var(--kb-indigo-70);
}
/* Five small cards fill two columns; the last spans both when the count is even. */
.kb-page .kb-popular li:last-child:nth-child(even) {
  grid-column: span 2;
}
.kb-page .kb-popular .kb-popular__lead {
  grid-column: 1;
  grid-row: 1 / span 3;
  justify-content: flex-start;
  gap: var(--kb-space-5);
  padding: var(--kb-space-6) var(--kb-space-5);
  overflow: hidden;
}
.kb-page .kb-popular .kb-popular__lead:only-child {
  grid-column: 1 / -1;
  grid-row: auto;
}
.kb-page .kb-popular__lead img {
  position: absolute;
  right: var(--kb-space-4);
  bottom: var(--kb-space-3);
  width: 300px;
  height: auto;
  pointer-events: none;
}
.kb-popular__lead .kb-popular__no {
  font-size: 66px;
  line-height: 76px;
}
.kb-popular__lead .kb-popular__title {
  display: block;
  max-width: 360px;
  font-size: 34px;
  line-height: 44px;
}
.kb-popular__lead .kb-popular__meta {
  margin-top: var(--kb-space-3);
}

/* ===== kb-integrations: the ERP systems, each a search, under the product cards ===== */
.kb-page .kb-integrations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--kb-space-2);
  margin-top: var(--kb-space-5);
  font-size: 14px;
  line-height: 20px;
}
.kb-integrations li:first-child {
  margin-right: var(--kb-space-2);
  color: var(--kb-indigo-70);
}
.kb-integrations a {
  display: block;
  padding: var(--kb-space-1) var(--kb-space-3);
  border: 1px solid var(--kb-border);
  border-radius: var(--kb-radius-sm);
  background: var(--kb-white);
  text-decoration: none;
}
.kb-integrations a:hover {
  text-decoration: underline;
}

@media (max-width: 1187px) {
  .kb-hero {
    padding-bottom: 0;
  }
  .kb-hero__art {
    position: static;
    width: 360px;
    max-width: 100%;
    margin: calc(-1 * var(--kb-space-7)) 0 0 auto;
  }
}
/* Narrow tablets: the examples reach under the shelf, so it is not pulled up. */
@media (max-width: 859px) {
  .kb-hero__art {
    margin-top: 0;
  }
}
@media (max-width: 1100px) {
  .kb-page .kb-popular {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* Equal rows would stretch every small card to the lead card's height. */
  .kb-page .kb-popular {
    grid-auto-rows: auto;
  }
  .kb-page .kb-popular .kb-popular__lead {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}
@media (max-width: 640px) {
  .kb-page .kb-display {
    font-size: 40px;
    line-height: 50px;
  }
  .kb-hero {
    padding: var(--kb-space-6) 0 0;
  }
  .kb-page .kb-hero__lead {
    font-size: 16px;
    line-height: 26px;
  }
  .kb-hero__art {
    width: 280px;
    margin-top: calc(-1 * var(--kb-space-3));
  }
  .kb-page .kb-search__field input {
    padding: 0 var(--kb-space-2);
    font-size: 16px;
  }
  .kb-search__field .kb-button {
    padding: var(--kb-space-2) var(--kb-space-3);
  }
  .kb-page .kb-search__group {
    padding: var(--kb-space-3) var(--kb-space-3) 0;
  }
  .kb-search__foot {
    padding: var(--kb-space-3);
  }
  .kb-section {
    padding: var(--kb-space-6) 0;
  }
  .kb-page .kb-popular {
    grid-template-columns: minmax(0, 1fr);
  }
  .kb-page .kb-popular {
    gap: var(--kb-space-3);
  }
  .kb-page .kb-popular li:last-child:nth-child(even) {
    grid-column: auto;
  }
  .kb-page .kb-popular li {
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    gap: var(--kb-space-3);
    padding: var(--kb-space-3) var(--kb-space-4);
  }
  .kb-popular__no {
    flex: none;
    width: 32px;
    font-size: 28px;
    line-height: 34px;
  }
  .kb-page .kb-popular .kb-popular__lead {
    flex-direction: column;
    padding: var(--kb-space-4);
  }
  .kb-page .kb-popular__lead img {
    position: static;
    align-self: flex-end;
    width: 140px;
    margin-top: calc(-1 * var(--kb-space-3));
  }
  .kb-popular__lead .kb-popular__no {
    font-size: 40px;
    line-height: 50px;
  }
  .kb-popular__lead .kb-popular__title {
    font-size: 24px;
    line-height: 34px;
  }
}
