/* ═══════════════════════════════════════════════════════════
   Job Listing | Content
   ───────────────────────────────────────────────────────────
   The body of a job page, after event-detail's body split: the
   listing's rich-text sections on the left, a sticky dark panel
   on the right carrying the closing date (the headline), the
   role facts and the Enquire button.

   The panel is the only filled shape on the page, so the date
   and the CTA are where the eye lands. Same tokens and furniture
   as .mvs-event-detail__panel (dark ground, mixed-from-text rules
   and well, --global-radius-md corners).
   ═══════════════════════════════════════════════════════════ */

.job-listing-content {
  --jl-panel:      var(--hs-black);
  --jl-panel-text: var(--hs-white);
  --jl-panel-rule: color-mix(in srgb, var(--jl-panel-text) 22%, transparent);
  --jl-panel-well: color-mix(in srgb, var(--jl-panel-text) 10%, transparent);
  --jl-panel-mute: color-mix(in srgb, var(--jl-panel-text) 70%, transparent);
  --jl-pad:        clamp(1.5rem, 3.5cqi, 2.25rem);
  --jl-rule:       color-mix(in srgb, var(--hs-black) 12%, transparent);

  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--molecule-large);
  align-items: start;
  width: 100%;
}

/* Split once the stage has room for both; same threshold and panel width
   as event-detail, measured on the module stage container. */
@container stage (min-width: 60rem) {
  .job-listing-content {
    grid-template-columns: minmax(0, 1fr) minmax(20rem, 22rem);
    gap: var(--organism-tiny);
  }
  .job-listing-content--no-panel {
    grid-template-columns: minmax(0, 1fr);
  }
}

@supports not (container-type: inline-size) {
  @media (min-width: 60rem) {
    .job-listing-content { grid-template-columns: minmax(0, 1fr) minmax(20rem, 22rem); }
    .job-listing-content--no-panel { grid-template-columns: minmax(0, 1fr); }
  }
}

/* Stacked (narrow), the panel comes first: the closing date and the
   contact matter more on a phone than scrolling past the whole role. */
@container stage (max-width: 59.99rem) {
  .job-listing-content__panel { order: -1; }
}


/* ── Role copy ────────────────────────────────────────────── */

.job-listing-content__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.job-listing-content__section {
  display: flex;
  flex-direction: column;
  gap: var(--atom-large);
  padding-block: var(--molecule-standard);
  border-top: 1px solid var(--jl-rule);
  scroll-margin-top: calc(var(--mvs-sticky-top, 0px) + var(--molecule-small));
}

.job-listing-content__section:first-child {
  padding-top: 0;
  border-top: 0;
}

/* Section heading: the theme's heading face with a short brand bar above
   it, so each section reads as a chapter of the listing. */
.job-listing-content__heading {
  position: relative;
  margin: 0;
  padding-top: var(--atom-large);
  font-family: var(--font-family-heading);
  font-size: clamp(1.5rem, 3cqi, 2rem);
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  color: var(--heading-color);
}

.job-listing-content__heading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  inline-size: 2.5rem;
  block-size: 3px;
  border-radius: 3px;
  background: var(--hs-primary);
}

/* Beside the panel the column IS the measure, so the atom's 68ch would
   clamp it a second time. Without the panel the default comes back. */
.job-listing-content__body { --mvs-richtext-measure: none; }
.job-listing-content--no-panel .job-listing-content__body { --mvs-richtext-measure: 68ch; }


/* ── Panel ────────────────────────────────────────────────── */

.job-listing-content__panel {
  position: sticky;
  top: calc(var(--mvs-sticky-top, 0px) + var(--molecule-tiny));
  border-radius: var(--global-radius-md);
  background: var(--jl-panel);
  color: var(--jl-panel-text);
  overflow: clip;
}

.job-listing-content__panel-inner {
  display: flex;
  flex-direction: column;
  gap: var(--molecule-tiny);
  padding: var(--jl-pad);
}

.job-listing-content__panel-label,
.job-listing-content__closing-label,
.job-listing-content__contact-label {
  margin: 0;
  font-size: var(--pre-title-size);
  font-weight: var(--pre-title-weight);
  line-height: var(--pre-title-line-height);
  letter-spacing: var(--pre-title-tracking);
  text-transform: var(--pre-title-transform);
  color: var(--jl-panel-mute);
}

/* Closing date: raised on its own well like event-detail's lead price. */
.job-listing-content__closing {
  display: flex;
  flex-direction: column;
  gap: var(--atom-small);
  padding: var(--molecule-tiny);
  border-radius: var(--global-radius-sm);
  background: var(--jl-panel-well);
}

.job-listing-content__closing-date {
  font-family: var(--font-family-heading);
  font-size: clamp(1.75rem, 4cqi, 2.25rem);
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  color: var(--jl-panel-text);
}

.job-listing-content__closing-day {
  font-size: var(--font-size-sm);
  color: var(--jl-panel-mute);
}

/* Fact rows: label left, value right, hairline between. */
.job-listing-content__facts {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.job-listing-content__fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--molecule-tiny);
  padding-block: var(--atom-standard);
  font-size: var(--font-size-sm);
}

.job-listing-content__fact + .job-listing-content__fact {
  border-top: 1px solid var(--jl-panel-rule);
}

.job-listing-content__fact dt {
  margin: 0;
  font-weight: 400;
  color: var(--jl-panel-mute);
}

.job-listing-content__fact dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
  color: var(--jl-panel-text);
  overflow-wrap: anywhere;
}

.job-listing-content__contact {
  display: flex;
  flex-direction: column;
  gap: var(--atom-tiny);
  padding-top: var(--atom-standard);
  border-top: 1px solid var(--jl-panel-rule);
}

.job-listing-content__contact-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--jl-panel-text);
}

/* Full-width CTA, label left, icon hard right: the panel's one action. */
.job-listing-content__panel .mvsButton {
  display: flex;
  align-self: stretch;
  justify-content: space-between;
}

.job-listing-content__apply-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--atom-small);
  color: var(--jl-panel-text);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.job-listing-content__apply-link:hover { color: var(--hs-primary); }
.job-listing-content__apply-link i { font-size: 0.8em; }
