/* Listing cards use the portal palette in both themes. */
:root body :is(.job-listing .results-grid,.featured-jobs) .job-card {
  padding: 24px clamp(20px, 2vw, 32px);
  column-gap: clamp(18px, 2.4vw, 36px);
  border-radius: 14px;
}
:root body :is(.job-listing,.featured-jobs) .job-card .job-card-summary {
  display: grid;
  gap: 9px;
  min-width: 0;
}
:root body :is(.job-listing,.featured-jobs) .job-card .job-tags {
  position: static;
  grid-area: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
:root body :is(.job-listing,.featured-jobs) .job-card .job-tags > span {
  position: relative;
  box-sizing: border-box;
  padding: 4px 21px 4px 9px;
  border-radius: 6px;
  max-width: 100%;
  overflow-wrap: anywhere;
  clip-path: polygon(0 0,calc(100% - 9px) 0,100% 50%,calc(100% - 9px) 100%,0 100%);
}
:root body :is(.job-listing,.featured-jobs) .job-card .job-tags > span::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: .65;
}
:root body .job-card.sponsored-card .job-card-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
:root body .job-card.sponsored-card .job-card-actions .sponsored-label { margin: 0; }
@media (max-width: 767px) {
  :root body :is(.job-listing .results-grid,.featured-jobs) .job-card {
    padding: 24px;
    column-gap: 10px;
    row-gap: 0;
  }
  :root body :is(.job-listing,.featured-jobs) .job-card h3 {
    margin: 12px 0 5px;
    font-size: 18px;
    line-height: 1.3;
  }
  :root body :is(.job-listing,.featured-jobs) .job-card .job-card-summary { margin-top: 10px; }
  :root body :is(.job-listing,.featured-jobs) .job-card .job-card-actions {
    width: 100%;
    justify-self: stretch;
    margin-top: 16px;
  }
  :root body :is(.job-listing,.featured-jobs) .job-card .job-card-actions :is(.quick-view,.sponsored-apply,.sponsored-action,.sponsored-history-action) {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    box-sizing: border-box;
  }
}

/* Both layers follow the same silhouette, including the pointed edge. */
html:root body :is(.job-listing,.featured-jobs) .job-card .job-tags > span {
  --tag-face: var(--job-tag-bg,var(--paper));
  --tag-edge: color-mix(in srgb,currentColor 40%,var(--tag-face));
  isolation: isolate;
  background: var(--tag-edge);
  color: var(--job-tag-ink,var(--muted));
  border: 0;
  min-height: 26px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  padding: 5px 25px 5px 11px;
}
html:root body :is(.job-listing,.featured-jobs) .job-card .job-tags > span::before {
  content: "";
  position: absolute;
  inset: 1px 1.5px 1px 1px;
  z-index: -1;
  border-radius: 5px;
  clip-path: inherit;
  background: var(--tag-face);
}
html:root body :is(.job-listing,.featured-jobs) .job-card .job-tags > span.compensation-chip { font-weight: 500; }
html:root body :is(.job-listing,.featured-jobs) .job-card .job-tags > span[data-tag-tone=purple] {
  --tag-face: color-mix(in srgb,var(--blue) 8%,var(--paper));
  --job-tag-ink: var(--link);
}
html:root body .job-card .job-card-actions .sponsored-label { align-self: center; }
@media(min-width: 768px) {
  html:root body .job-listing .results-grid .job-card {
    grid-template-columns: 52px minmax(0,1fr) minmax(150px,max-content);
    column-gap: 26px;
    row-gap: 3px;
    padding: 23px 26px;
  }
  html:root body .job-listing .job-card > :is(h3,.job-card-summary,.job-card-meta,.job-salary,.discovery-reason) {
    border-inline: 1px solid var(--line);
    padding-inline: clamp(16px,2vw,30px);
  }
  html:root body .job-listing .job-card h3 { font-size: clamp(19px,1.55vw,23px); font-weight: 700; line-height: 1.3; }
  html:root body .job-listing .job-card .job-card-meta { padding-block: 4px; }
  html:root body .job-listing .job-card .job-card-summary { grid-row: 3 / 5; gap: 10px; }
  html:root body .job-listing .job-card :is(.job-intro,.company-name,.job-place) { font-size: 14px; }
  html:root body .job-listing .job-card .job-card-actions :is(.quick-view,.sponsored-action) { min-height: 44px; font-size: 14px; }
}
@media(max-width:767px) {
  html:root body :is(.job-listing,.featured-jobs) .job-card .job-card-actions :is(.quick-view,form.sponsored-apply,.sponsored-action,.sponsored-history-action) {
    width: 100%; max-width: 100%; min-height: 44px;
  }
  html:root body :is(.job-listing,.featured-jobs) .job-card h3 { font-size: 20px; line-height: 1.25; }
  html:root body :is(.job-listing,.featured-jobs) .job-card :is(.job-place,.company-name,.job-intro) { font-size: 14px; }
}

.listing-action-column { display: contents; }
@media (min-width: 768px) {
  html:root body .job-listing .job-card > .listing-action-column {
    grid-column: 3;
    grid-row: 1 / -1;
    align-self: stretch;
    justify-self: stretch;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
  }
  html:root body .job-listing .job-card .listing-action-column > :is(.job-actions,.sponsored-personal-save,.job-card-actions) {
    position: static;
    align-self: center;
    justify-content: center;
    align-items: center;
    margin: 0;
  }
}

html:root body .job-card.sponsored-card .job-card-top .sponsored-brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-self: start;
  align-self: start;
  grid-column: 1;
  grid-row: 1 / 4;
  gap: 6px;
  width: max-content;
}
html:root body .job-card.sponsored-card h3 > .sponsored-label {
  display: inline-block;
  margin: 0 0 0 3px;
  vertical-align: middle;
  font-size: 11px;
  line-height: 1.35;
  letter-spacing: normal;
  white-space: nowrap;
  max-width: none;
}
html:root body .job-card.sponsored-card h3 > .job-title-link { display: inline; }
html:root body .job-card.sponsored-card .sponsored-brand > .company-avatar { align-self: center; margin: 0; }
@media (min-width: 768px) {
  html:root body .job-listing .results-grid .job-card.sponsored-card {
    grid-template-columns: max-content minmax(0,1fr) minmax(150px,max-content);
  }
  html:root body .job-listing .results-grid .job-card {
    grid-template-rows: repeat(6, auto);
    align-content: stretch;
  }
  html:root body .job-listing .results-grid .job-card .job-card-top .job-company {
    grid-area: 1 / 1 / -1 / 2;
    align-self: stretch;
    justify-self: stretch;
    width: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
  }
  html:root body .job-listing .results-grid .job-card .job-company > .company-avatar {
    align-self: center;
    margin: 0;
  }
}
@media (max-width: 767px) {
  html:root body .job-card.sponsored-card .job-card-top .sponsored-brand {
    grid-row: 1;
    grid-column: 1 / 3;
  }
}

html:root body .job-card .job-card-summary > .job-intro {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  white-space: normal;
}
@media (max-width: 767px) {
  html:root body .job-card .job-card-summary > .job-intro,
  html:root body .job-card .job-card-summary:not(:has(.job-tags > *)) {
    display: none;
  }
  html:root body .job-card .job-card-summary > .job-intro + .job-tags {
    margin-top: 0;
  }
}
