/*
 * Speechmatics theme for the Ashby-hosted job board (jobs.ashbyhq.com/speechmatics).
 *
 * Upload in Ashby: Admin > Job Boards > Theme > Custom CSS.
 * Pair with these Theme settings so Ashby's own colour logic agrees:
 *   Brand Color         #29A383   (Radix jade-9)
 *   Brand Color (Dark)  #0D3C48   (Radix cyan-12, hover)
 *
 * Values mirror the speechmatics.com design system:
 *   Headings  PP Telegraf (self-hosted on speechmatics.com, CORS open)
 *   Body      DM Sans
 *   Neutrals  Radix "sand" scale; accent links in Radix "jade"
 *
 * Only `.ashby-*` classes are stable. Ashby's hashed classes (e.g. _button_zyh3g_28)
 * change without notice, so this file never targets them.
 */

@import url("https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600&display=swap");

@font-face {
  font-family: "PP_Telegraf";
  src: url("https://www.speechmatics.com/static/fonts/PPTelegraf-VariableUpright.woff2")
    format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Speechmatics tokens */
  --sm-fg: #21201c; /* sand-12 */
  --sm-fg-muted: #63635e; /* sand-11 */
  --sm-border: rgba(33, 32, 28, 0.16); /* card border */
  --sm-border-hover: rgba(33, 32, 28, 0.3);
  --sm-border-input: #cfceca; /* sand-7 */
  --sm-surface: #f9f9f8; /* sand-2 */
  --sm-card-bg: #ffffff;
  --sm-card-hover-bg: rgba(41, 41, 5, 0.03);
  --sm-primary: #29a383; /* jade-9 — Ashby "Brand Color" */
  --sm-primary-hover: #0d3c48; /* cyan-12 — Ashby "Brand Color (Dark)" */
  --sm-link: #208368; /* jade-11, AA on white */
  --sm-link-hover: #1d6b56;
  --sm-focus: #29a383; /* jade-9 */
  --sm-heading: "PP_Telegraf", "DM Sans", sans-serif;
  --sm-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica,
    Arial, sans-serif;

  /* Ashby variables */
  --colorAppBackground: var(--sm-surface);
  --colorPrimary900: var(--sm-primary-hover);
  --colorPrimary600: var(--sm-primary);
  --widthMaxContent: 1080px;
  --widthMaxJobBoard: 1080px;
  --borderRadiusContainer: 8px;
  --borderRadiusControl: 4px;
  --borderRadiusButton: 4px;
  --fontFamily: var(--sm-body);
}

body {
  font-family: var(--sm-body);
  color: var(--sm-fg);
  background-color: var(--sm-surface);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Header logo ----------
 * Swaps Ashby's "Speechmatics" text for the wordmark. The header has no .ashby-*
 * class, so this hooks onto its link back to speechmatics.com (stable, set by us).
 * The text stays in the DOM (font-size: 0) so screen readers still announce it.
 * If a logo is ever uploaded in Ashby's Theme settings, delete this block.
 */
a[href="https://www.speechmatics.com/"] > p
{
  display: block;
  width: 205px;
  height: 22px;
  margin: 0;
  background: url("https://www.speechmatics.com/static/assets/logos/logo_speechmatics_black.svg")
    no-repeat center / contain;
  color: transparent;
  font-size: 0;
  line-height: 0;
}

/* ---------- Headings ---------- */

.ashby-job-board-heading,
.ashby-job-posting-heading,
.ashby-department-heading,
.ashby-application-form-section-header-title {
  font-family: var(--sm-heading);
  color: var(--sm-fg);
}

.ashby-job-board-heading {
  font-size: 3rem;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.ashby-job-board-heading-count {
  font-family: var(--sm-body);
  font-weight: 400;
  color: var(--sm-fg-muted);
}

.ashby-job-posting-heading {
  font-size: 2.5rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* Ashby's validator rejects clamp(), so headings step down with a media query. */
@media (max-width: 640px) {
  .ashby-job-board-heading {
    font-size: 2rem;
  }

  .ashby-job-posting-heading {
    font-size: 1.75rem;
  }
}

.ashby-department-heading {
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-top: 2.5rem;
}

.ashby-department-heading-level,
.ashby-job-posting-brief-department-heading-level {
  font-family: var(--sm-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--sm-fg-muted);
  text-transform: none;
  letter-spacing: 0;
}

/* ---------- Filters ---------- */

.ashby-job-board-filters-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--sm-fg-muted);
}

.ashby-job-board-reset-filters-label {
  font-size: 0.875rem;
  color: var(--sm-link);
}

.ashby-job-board-reset-filters-label:hover {
  color: var(--sm-link-hover);
}

.ashby-job-board-filter {
  font-family: var(--sm-body);
  font-size: 0.875rem;
  color: var(--sm-fg);
  background-color: #fff;
  border: 1px solid var(--sm-border-input);
  border-radius: 4px;
}

.ashby-job-board-filter:hover {
  border-color: var(--sm-border-hover);
}

.ashby-job-board-filter:focus-visible {
  outline: 2px solid var(--sm-focus);
  outline-offset: 1px;
}

/* ---------- Job list cards ---------- */

.ashby-job-posting-brief {
  margin-bottom: 12px;
  padding: 20px 24px;
  background-color: var(--sm-card-bg);
  border: 1px solid var(--sm-border);
  border-radius: 8px;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.ashby-job-posting-brief:hover {
  border-color: var(--sm-border-hover);
  background-color: #fff;
  box-shadow: 0 1px 2px rgba(33, 32, 28, 0.06);
}

.ashby-job-posting-brief-title {
  font-family: var(--sm-heading);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--sm-fg);
}

.ashby-job-posting-brief:hover .ashby-job-posting-brief-title {
  color: var(--sm-primary-hover);
}

.ashby-job-posting-brief-details {
  margin-top: 4px;
  font-size: 0.875rem;
  color: var(--sm-fg-muted);
}

/* ---------- Job posting page ---------- */

.ashby-job-board-back-to-all-jobs-button {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--sm-fg-muted);
}

.ashby-job-board-back-to-all-jobs-button:hover {
  color: var(--sm-fg);
}

.ashby-job-posting-left-pane {
  color: var(--sm-fg);
}

.ashby-job-posting-left-pane h2 {
  font-family: var(--sm-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sm-fg-muted);
}

.ashby-job-posting-right-pane-tab-slider {
  background-color: var(--sm-primary);
}

.ashby-job-posting-right-pane a[role="tab"],
.ashby-job-posting-right-pane-overview-tab,
.ashby-job-posting-right-pane-application-tab {
  font-family: var(--sm-body);
  font-weight: 500;
}

/* Rich-text job description */
.ashby-job-posting-description {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--sm-fg);
}

.ashby-job-posting-description h1,
.ashby-job-posting-description h2,
.ashby-job-posting-description h3 {
  font-family: var(--sm-heading);
  font-weight: 500;
  color: var(--sm-fg);
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-top: 2rem;
}

.ashby-job-posting-description h1 {
  font-size: 1.75rem;
}

.ashby-job-posting-description h2 {
  font-size: 1.5rem;
}

.ashby-job-posting-description h3 {
  font-size: 1.25rem;
}

.ashby-job-posting-description strong {
  font-weight: 600;
}

.ashby-job-posting-description a {
  color: var(--sm-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ashby-job-posting-description a:hover {
  color: var(--sm-link-hover);
}

.ashby-job-posting-description li::marker {
  color: var(--sm-fg-muted);
}

/* ---------- Application form ---------- */

.ashby-application-form-section-header-title {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.ashby-application-form-section-header-description,
.ashby-application-form-question-description,
.ashby-application-form-texting-consent-description {
  color: var(--sm-fg-muted);
}

.ashby-application-form-question-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--sm-fg);
}

.ashby-application-form-input-text,
.ashby-application-form-input-textarea,
.ashby-application-form-input-date input,
.ashby-application-form-input-autocomplete input,
.ashby-application-form-input-dropdown-select {
  font-family: var(--sm-body);
  color: var(--sm-fg);
  background-color: #fff;
  border: 1px solid var(--sm-border-input);
  border-radius: 4px;
}

.ashby-application-form-input-text:hover,
.ashby-application-form-input-textarea:hover {
  border-color: var(--sm-border-hover);
}

.ashby-application-form-input-text:focus,
.ashby-application-form-input-textarea:focus,
.ashby-application-form-input-date input:focus,
.ashby-application-form-input-autocomplete input:focus {
  border-color: var(--sm-focus);
  box-shadow: 0 0 0 1px var(--sm-focus);
  outline: none;
}

/* Yes / No toggle */
.ashby-application-form-input-yesno-option {
  font-weight: 500;
  color: var(--sm-fg-muted);
  border-color: var(--sm-border-input);
}

.ashby-application-form-input-yesno-option:first-child {
  border-radius: 4px 0 0 4px;
}

.ashby-application-form-input-yesno-option:last-child {
  border-radius: 0 4px 4px 0;
}

.ashby-application-form-input-yesno-option[aria-pressed="true"] {
  color: #fff;
  background-color: var(--sm-primary);
  border-color: var(--sm-primary);
}

/* Radios and checkboxes */
.ashby-application-form-input-radio-group-option-radio,
.ashby-application-form-input-checkbox-group-option-checkbox {
  accent-color: var(--sm-primary);
}

/* File upload */
.ashby-application-form-input-file-dropzone,
.ashby-application-form-autofill-input-root {
  background-color: #fff;
  border: 1px dashed var(--sm-border-hover);
  border-radius: 8px;
}

.ashby-application-form-autofill-input-title {
  font-family: var(--sm-heading);
  font-weight: 500;
  color: var(--sm-fg);
}

.ashby-application-form-autofill-input-description,
.ashby-application-form-input-file-dropzone-instructions {
  color: var(--sm-fg-muted);
}

.ashby-application-form-input-file-dropzone-upload,
.ashby-application-form-autofill-uploader button {
  font-family: var(--sm-body);
  font-weight: 500;
  color: var(--sm-primary);
  border: 1px solid var(--sm-primary);
  border-radius: 4px;
}

/* Submit — matches the site's primary button */
.ashby-application-form-submit-button {
  font-family: var(--sm-body);
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  background-color: var(--sm-primary);
  border-radius: 4px;
  transition: background-color 150ms ease;
}

.ashby-application-form-submit-button:hover {
  background-color: var(--sm-primary-hover);
}

.ashby-application-form-submit-button:focus-visible {
  outline: 2px solid var(--sm-focus);
  outline-offset: 2px;
}

.ashby-application-form-success-container,
.ashby-application-form-failure-container {
  font-family: var(--sm-body);
  color: var(--sm-fg);
}
