/*
 * Abacus job portal: only loaded on nodes with the [abacusjobportal:...]
 * shortcode, i.e. on the pages delivered by the portal. Plain CSS, no build
 * step. The portal content lives in .jobportal #abacus-app (light DOM).
 *
 * The portal nests all its rules in `abacusjobportal { ... }` and loads them
 * after this file, so component rules here carry #abacus-app to win.
 *
 * Portal classes used here: system-font1-3 = headings, system-font4 = text,
 * system-font6 = buttons/list, .btn, FormKit (.formkit-*), wizard-*.
 * xs breakpoint of the theme: max-width 667px.
 */
.jobportal #abacus-app {
  width: 100%;
  max-width: 100%;
  margin: 0 0 40px;

  /* FormKit (search, filters, application form) */
  --fk-font-family: "Droid Sans", Arial, sans-serif;
  --fk-font-family-label: var(--fk-font-family);
  --fk-font-family-legend: var(--fk-font-family);
  --fk-font-family-input: var(--fk-font-family);
  --fk-font-family-option: var(--fk-font-family);
  --fk-font-family-help: var(--fk-font-family);
  --fk-font-family-message: var(--fk-font-family);
  --fk-color-primary: #1a1919;
  --fk-color-border: #1a1919;
  --fk-color-border-focus: #1a1919;
  --fk-border-radius: 0;
}

.jobportal img,
.jobportal iframe {
  max-width: 100%;
  height: auto;
}

/* ---------- Typography ---------- */
.jobportal #abacus-app,
.jobportal #popup-content,
.jobportal .system-standard-font,
.jobportal .system-font4,
.jobportal .system-font5,
.jobportal .system-font6 {
  font-family: "Droid Sans", Arial, sans-serif;
}

.jobportal h1,
.jobportal h2,
.jobportal h3,
.jobportal h4,
.jobportal .system-font1,
.jobportal .system-font2,
.jobportal .system-font3 {
  font-family: Bitter, "Times New Roman", Times, serif;
  color: #1a1919;
}

.jobportal #portalcontent h1 {
  margin: 0 0 24px;
  font-size: 36px;
  line-height: 44px;
  text-align: left;
}

.jobportal #portalcontent .p-4:has(h1) {
  padding: 0;
}

.jobportal .system-font4 {
  font-size: 21px;
  line-height: 30px;
  color: #1a1919;
}

/* ---------- Buttons ---------- */
.jobportal #abacus-app .btn,
.jobportal #abacus-app input.btn {
  display: inline-block;
  min-height: 44px;
  padding: 6px 16px;
  border: 4px solid #1a1919;
  border-radius: 0;
  outline: 0;
  background-color: #fff;
  color: #1a1919;
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 3px 8px 0 rgba(26, 25, 25, .15), 0 3px 8px 0 rgba(0, 0, 0, .08);
  transition: background-color .15s, color .15s;
  cursor: pointer;
}

/* buttons built in the designer wrap their label in a <p> */
.jobportal #abacus-app .btn p {
  margin: 0;
  font: inherit;
  color: inherit;
}

.jobportal #abacus-app .btn:hover,
.jobportal #abacus-app .btn:active,
.jobportal #abacus-app input.btn:hover {
  background-color: #1a1919;
  color: #fff;
}

.jobportal #abacus-app .btn:focus-visible {
  outline: 2px solid #1a1919;
  outline-offset: 2px;
}

.jobportal #abacus-app .btn.hide {
  display: none;
}

/* secondary (Zurück, Mehr anzeigen) */
.jobportal #abacus-app .btn.btn-system2 {
  border-width: 2px;
  padding: 8px 16px;
  font-weight: 400;
  box-shadow: none;
}

/* ---------- Form elements (FormKit) ---------- */
.jobportal #abacus-app .formkit-outer {
  margin-bottom: 16px;
}

.jobportal #abacus-app .formkit-outer .formkit-label,
.jobportal #abacus-app .agreement .label,
.jobportal #abacus-app .agreement .label span {
  font-size: 16px;
  line-height: 24px;
  color: #1a1919;
}

.jobportal #abacus-app .formkit-outer .formkit-label {
  padding-bottom: 4px;
  font-weight: 700;
}

.jobportal #abacus-app .formkit-outer .formkit-inner {
  min-height: 50px;
  border: 2px solid #1a1919;
  border-radius: 0;
  outline: 0;
  background-color: #fff;
  box-shadow: none;
}

.jobportal #abacus-app .formkit-outer .formkit-inner:focus-within {
  box-shadow: 0 0 0 3px rgba(26, 25, 25, .2);
}

.jobportal #abacus-app .formkit-outer .formkit-input,
.jobportal #abacus-app .formkit-outer .formkit-placeholder,
.jobportal #abacus-app .formkit-outer .formkit-no-files {
  font-size: 16px;
  line-height: 24px;
  color: #1a1919;
}

/* lists inside form elements (dropdown options, selected files): no theme
   bullet (chevron), no 21px list font */
.jobportal #abacus-app .formkit-outer li::before {
  content: none;
}

.jobportal #abacus-app .formkit-outer li,
.jobportal #abacus-app .formkit-outer li * {
  font-size: 16px;
  line-height: 24px;
}

/* dropdown options: selected = grey, hover/keyboard focus = black */
.jobportal #abacus-app .formkit-listitem {
  color: #1a1919;
}

.jobportal #abacus-app .formkit-listitem .formkit-option {
  color: inherit;
}

.jobportal #abacus-app .formkit-listitem[aria-selected="true"] {
  background-color: #eee;
  color: #1a1919;
}

.jobportal #abacus-app .formkit-listitem:hover,
.jobportal #abacus-app .formkit-listitem[data-is-active="true"] {
  background-color: #1a1919;
  color: #fff;
}

.jobportal #abacus-app .formkit-outer .formkit-input::placeholder {
  color: #5d5d5d;
}

.jobportal #abacus-app .formkit-outer .formkit-messages,
.jobportal #abacus-app .formkit-outer .formkit-message,
.jobportal #abacus-app .formkit-outer .formkit-help {
  font-size: 14px;
  line-height: 20px;
}

/* checkbox (privacy agreement) */
.jobportal #abacus-app .agreement {
  margin-top: 8px;
}

.jobportal #abacus-app .agreement .formkit-outer {
  margin-bottom: 0;
}

.jobportal #abacus-app .agreement .formkit-outer .formkit-inner {
  min-height: 0;
  border: 0;
}

.jobportal #abacus-app .agreement .formkit-decorator {
  border: 2px solid #1a1919 !important; /* portal sets it with !important */
  border-radius: 0;
}

/* ---------- Job overview ---------- */
.jobportal #abacus-app job-advertisement search-bar,
.jobportal #abacus-app job-advertisement filter-bar {
  display: block;
}

.jobportal #abacus-app ul.advertisement {
  margin: 28px 0 0;
  padding: 0;
  border-top: 4px solid #1a1919;
  list-style: none;
}

.jobportal #abacus-app ul.advertisement > li {
  margin: 0;
  padding: 18px 0;
  border-bottom: 1px solid #ccc;
  background: none;
}

.jobportal #abacus-app ul.advertisement > li::before {
  content: none;
}

/* first field = job title, the others form one meta line */
.jobportal #abacus-app ul.advertisement .fields {
  flex-flow: row wrap;
  align-items: baseline;
  column-gap: 0;
}

.jobportal #abacus-app ul.advertisement .fields > div {
  display: flex;
  align-items: baseline;
  font-size: 16px;
  line-height: 24px;
  color: #5d5d5d;
}

.jobportal #abacus-app ul.advertisement .fields > div p,
.jobportal #abacus-app ul.advertisement .fields > div a {
  margin: 0;
  border: 0;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  text-decoration: none;
}

.jobportal #abacus-app ul.advertisement .fields > div:first-child {
  flex: 0 0 100%;
  margin-bottom: 2px;
  font-size: 24px;
  line-height: 32px;
  color: #1a1919;
}

.jobportal #abacus-app ul.advertisement .fields > div:first-child,
.jobportal #abacus-app ul.advertisement .fields > div:first-child a,
.jobportal #abacus-app ul.advertisement .fields > div:first-child p {
  font-family: Bitter, "Times New Roman", Times, serif;
  font-weight: 700;
}

.jobportal #abacus-app ul.advertisement .fields > div:first-child a:hover p {
  text-decoration: underline;
}

.jobportal #abacus-app ul.advertisement .fields > div:nth-child(n+3)::before {
  content: "\00b7";
  margin: 0 8px;
}

.jobportal #abacus-app ul.advertisement .link {
  padding-bottom: 0;
}

.jobportal #abacus-app .show-more-button {
  padding: 20px 0 0;
}

/* separator line of the portal page, the list has its own borders */
.jobportal #portalcontent .p-4:has(> .line-separator:only-child) {
  display: none;
}

/* ---------- Job advertisement ---------- */
.jobportal #portalcontent div[label] {
  max-width: 820px;
}

.jobportal #portalcontent div[label]:not(:empty) {
  margin-bottom: 30px;
}

.jobportal #portalcontent div[label] p {
  margin: 0 0 15px;
}

/* a bold line right before a list works as sub heading */
.jobportal #portalcontent div[label] > p:has(+ ul) > strong:only-child {
  display: block;
  margin-top: 10px;
  font-family: Bitter, "Times New Roman", Times, serif;
  font-size: 24px;
  line-height: 32px;
}

.jobportal #portalcontent div[label] ul {
  margin: 0 0 15px;
}

.jobportal #portalcontent div[label] a {
  color: #1a1919;
  text-decoration: underline;
}

/* apply button below the advertisement */
.jobportal #portalcontent .p-4:has(> a.btn) {
  justify-content: flex-start;
  padding: 0;
}

/* ---------- Application process (wizard) ---------- */
.jobportal #abacus-app ul.wizard-tabs {
  display: flex;
  height: auto;
  margin: 0 0 32px;
  padding: 0;
  border-bottom: 4px solid #1a1919;
  list-style: none;
  counter-reset: jobportal-step;
}

.jobportal #abacus-app li.wizard-tab {
  flex: 1 1 0;
  align-items: center;
  width: auto;
  height: auto;
  margin: 0;
  padding: 12px 16px;
  border-radius: 0;
  background: none;
  color: #5d5d5d;
  text-align: left;
  counter-increment: jobportal-step;
}

.jobportal #abacus-app li.wizard-tab::before {
  content: counter(jobportal-step);
  position: static;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  margin: 0 10px 0 0;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: none;
  color: inherit;
  font-family: "Droid Sans", Arial, sans-serif;
  font-size: 15px;
  line-height: 26px;
  font-weight: 700;
  text-align: center;
}

.jobportal #abacus-app li.wizard-tab p {
  margin: 0;
  font-size: 16px;
  line-height: 22px;
  color: inherit;
}

.jobportal #abacus-app li.wizard-tab.active {
  background-color: #1a1919;
  color: #fff;
}

.jobportal #abacus-app li.wizard-tab.active p {
  font-weight: 700;
}

.jobportal #abacus-app section.toggle {
  margin: 0;
  padding: 0 0 24px !important; /* theme: #page section:last-of-type */
  border: 0;
  border-radius: 0;
}

.jobportal #abacus-app section.toggle > .text {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ccc;
  font-size: 28px;
  line-height: 36px;
}

.jobportal #abacus-app section.toggle > .text h2 {
  margin: 0;
  font-size: inherit;
  line-height: inherit;
  text-align: left;
}

.jobportal #abacus-app section.toggle > .text button {
  border: 0;
  background: none;
  color: #1a1919;
  cursor: pointer;
}

/* file uploads: label left, button right */
.jobportal #abacus-app input-file .formkit-wrapper {
  align-items: center;
  height: auto;
}

.jobportal #abacus-app input-file .formkit-outer .formkit-label {
  padding-bottom: 0;
}

.jobportal #abacus-app input-file .formkit-outer .formkit-inner {
  height: auto;
  min-height: 44px;
  cursor: pointer;
}

/* postcode narrow, city wide (the designer has the two widths the other way round) */
.jobportal #abacus-app .flex-row > div:has(> input-field[name$="_Zip"]) {
  flex-basis: 25%;
}

.jobportal #abacus-app .flex-row > div:has(> input-field[name$="_City"]) {
  flex-basis: 75%;
}

.jobportal #abacus-app .wizard-step .buttons,
.jobportal #abacus-app .wizard-step .buttons-first-step {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

/* ---------- Smartphone ---------- */
@media (max-width: 667px) {
  .jobportal #portalcontent h1 {
    font-size: 30px;
    line-height: 36px;
  }

  .jobportal .system-font4 {
    font-size: 16px;
    line-height: 24px;
  }

  .jobportal #abacus-app .filters .filter,
  .jobportal #abacus-app .filters .formkit-outer,
  .jobportal #abacus-app .filters .formkit-wrapper {
    width: 100%;
    max-width: none;
  }

  .jobportal #abacus-app ul.advertisement > li {
    flex-direction: column;
    align-items: flex-start;
    row-gap: 12px;
  }

  .jobportal #abacus-app ul.advertisement .fields > div:first-child,
  .jobportal #portalcontent div[label] > p:has(+ ul) > strong:only-child {
    font-size: 21px;
    line-height: 28px;
  }

  .jobportal #abacus-app li.wizard-tab {
    flex: 0 0 auto;
    padding: 10px 12px;
  }

  .jobportal #abacus-app li.wizard-tab.active {
    flex: 1 1 auto;
  }

  .jobportal #abacus-app li.wizard-tab:not(.active)::before {
    margin-right: 0;
  }

  .jobportal #abacus-app li.wizard-tab:not(.active) p {
    display: none;
  }

  .jobportal #abacus-app section.toggle > .text {
    font-size: 24px;
    line-height: 30px;
  }

  .jobportal #abacus-app input-file .formkit-wrapper {
    flex-direction: column;
    align-items: stretch;
    row-gap: 4px;
  }

  .jobportal #abacus-app input-file .formkit-outer .formkit-inner {
    width: 100%;
  }
}
