/* ═══════════════════════════════════════════
   CAREERS
   Layered on styles.css + landing.css + team.css (for the .is-tight hero).
   The roles sit in a cream reading section (see READING THEME in
   styles.css), so cards are white with the light-theme tokens.
   One card per open role: title, meta chips and Apply on top; the job
   description folds open underneath once it has been written.
═══════════════════════════════════════════ */

.job-count {
  font-family: 'Work Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.job-list { display: grid; gap: 1rem; }

.job-card {
  background: #FFFFFF;
  border: 1px solid #E6DCCD;
  box-shadow: 0 1px 2px rgba(43,29,22,0.04);
  border-radius: 16px;
  padding: 1.4rem 1.6rem;
  /* Clear the fixed nav when arriving via /company/careers/#role */
  scroll-margin-top: 6.5rem;
  transition: border-color 0.3s;
}
.job-card:hover,
.job-card:target { border-color: #B8860B; }

.job-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}
.job-title {
  font-family: 'Work Sans', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-light);
  line-height: 1.3;
  margin: 0 0 0.6rem;
}
/* Title with the vacancy badge beside it. */
.job-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.7rem;
  margin: 0 0 0.6rem;
}
.job-title-row .job-title { margin: 0; }
/* Colour by count: green = several seats, rust = a single seat left. */
.job-openings {
  --open-ink: #8A6308;
  --open-rgb: 184,134,11;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--open-ink);
  background: rgba(var(--open-rgb),0.12);
  border: 1px solid rgba(var(--open-rgb),0.35);
  border-radius: 999px;
  padding: 0.22rem 0.7rem 0.22rem 0.6rem;
  line-height: 1.5;
  white-space: nowrap;
}
.job-openings.is-many { --open-ink: #1F6B43; --open-rgb: 46,139,87; }
.job-openings.is-one  { --open-ink: #9A3412; --open-rgb: 194,65,12; }
.job-openings-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: rgb(var(--open-rgb));
  animation: job-openings-pulse 2s ease-out infinite;
}
@keyframes job-openings-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(var(--open-rgb),0.5); }
  70%  { box-shadow: 0 0 0 0.4rem rgba(var(--open-rgb),0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--open-rgb),0); }
}
@media (prefers-reduced-motion: reduce) {
  .job-openings-dot { animation: none; }
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.job-meta li {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: #FBF8F3;
  border: 1px solid #E6DCCD;
  border-radius: 999px;
  padding: 0.24rem 0.68rem;
  line-height: 1.5;
}
.job-apply { flex-shrink: 0; }

.job-summary {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 72ch;
  margin: 1rem 0 0;
}

/* Placeholder while the JD is being written. */
.job-pending {
  display: inline-block;
  margin: 1rem 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border: 1px dashed rgba(138,99,8,0.45);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
}

/* ── Job description, folded ── */
.job-jd { margin-top: 1rem; border-top: 1px solid #EFE7DA; }
.job-jd > summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 0 0.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold-light);
}
.job-jd > summary::-webkit-details-marker { display: none; }
.job-jd > summary::after { content: '+'; font-size: 1.05rem; line-height: 1; }
.job-jd[open] > summary::after { content: '\2212'; }
.job-jd > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.job-jd-body { max-width: 74ch; padding-top: 0.4rem; }
.job-jd-body h3 {
  font-family: 'Work Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-light);
  margin: 1.1rem 0 0.45rem;
}
.job-jd-body h3:first-child { margin-top: 0.6rem; }
/* Sub-groups inside a section, e.g. "Requirements and analysis" */
.job-jd-body h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
  margin: 0.8rem 0 0.35rem;
}
.job-jd-body p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0 0 0.45rem;
}
.job-jd-body p a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.job-jd-body ul { margin: 0; padding-left: 1.15rem; }
.job-jd-body li {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

/* ── Open application line, empty state ── */
.job-other,
.job-none {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 1.6rem 0 0;
}
.job-eeo { font-size: 0.82rem; color: var(--text-muted); margin: 0.5rem 0 0; }
.job-other a,
.job-none a { color: var(--gold); }
.job-other a:hover,
.job-none a:hover { color: var(--gold-light); }

@media (max-width: 640px) {
  .job-card { padding: 1.2rem 1.2rem 1.3rem; }
  .job-head { flex-direction: column; align-items: flex-start; }
}

/* ── Apply dialog ──
   A native <dialog>: focus is trapped and Esc closes it for free. The panel
   is a .contact-form, so it takes the site's form styling from styles.css
   (the light card from the site-wide theme) and only layout is added here. */
.job-apply { border: 0; cursor: pointer; }
.apply-dialog {
  width: min(640px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-light);
  overflow: auto;
}
.apply-dialog::backdrop { background: rgba(8, 3, 1, 0.72); backdrop-filter: blur(3px); }
.apply-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.apply-top .form-title { margin-bottom: 1.25rem; }
#applyRole { color: var(--gold-light); }
.apply-close {
  flex-shrink: 0;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid rgba(184,134,11,0.3);
  background: transparent;
  color: var(--text-light);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.apply-close:hover { border-color: var(--gold); color: var(--gold-light); }
.apply-hint { font-weight: 400; color: var(--text-muted); margin-left: 0.35rem; }
.apply-form input[type="file"] { padding: 0.55rem 0.75rem; cursor: pointer; }
.apply-form input[type="file"]::file-selector-button {
  margin-right: 0.8rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid rgba(184,134,11,0.4);
  border-radius: 6px;
  background: rgba(184,134,11,0.1);
  color: var(--gold-light);
  font: inherit;
  cursor: pointer;
}
.apply-form [aria-invalid="true"] { border-color: rgba(226,101,75,0.75) !important; }
.apply-consent {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0.25rem 0 1rem;
  cursor: pointer;
}
.apply-consent input { margin-top: 0.2rem; accent-color: #B8860B; flex-shrink: 0; }
.apply-consent input[aria-invalid="true"] { outline: 2px solid rgba(226,101,75,0.75); outline-offset: 2px; }
.apply-consent a { color: var(--gold-light); }
.form-msg a { color: inherit; text-decoration: underline; }

@media (max-width: 640px) {
  .apply-form { padding: 1.25rem; }
  .apply-form .form-row { grid-template-columns: 1fr; gap: 0; }
}

/* After a successful send: confirmation and Close only. */
.apply-done { display: none; width: 100%; justify-content: center; }
.apply-form.is-sent .form-row,
.apply-form.is-sent .form-group,
.apply-form.is-sent .apply-consent,
.apply-form.is-sent .form-submit { display: none; }
.apply-form.is-sent .apply-done { display: flex; }

/* Honeypot field: off-screen rather than display:none, which some bots skip. */
.apply-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
