/*
 * G2i / Ashby — For Talent theme v3 (revised for the Ashby CSS uploader)
 * Upload this file in Admin > Job Boards > Theme (Job Board) > Custom CSS.
 * Based on app/tokens.css, home/shared.tsx, and for-talent/open-roles.tsx.
 * Uses Ashby's documented variables and public ashby-* class hooks.
 * White buttons, links, and focus states; brand gradient accents retained.
 * Uses explicit responsive font sizes, disabled attributes, and scoped focus rules.
 * Logos remain an Ashby theme setting: use the new light G2i mark on dark.
 */

@font-face {
  font-family: 'ABC Diatype';
  src: url('https://www.g2i.ai/fonts/abc-diatype/ABCDiatype-Regular.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'ABC Diatype';
  src: url('https://www.g2i.ai/fonts/abc-diatype/ABCDiatype-Medium.woff2') format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  /* Semantic aliases for the existing G2i palette. */
  --surface-page: #1f1f1f;
  --surface-panel: #161616;
  --surface-inset: #090909;
  --surface-hover: #252525;
  --text-primary: #e6e6e6;
  --text-heading: #ffffff;
  --text-secondary: #c0c0c0;
  --text-muted: #9a9a9a;
  --border-subtle: #343434;
  --border-control: #656565;
  --accent: #ffffff;
  --accent-hover: #e6e6e6;
  --accent-gradient: linear-gradient(
    90deg,
    #fffee4 0%,
    #fffdac 25%,
    #aefc8b 50%,
    #b6fbf1 75%,
    #addbfb 100%
  );

  /* Ashby's native variables also cover dropdowns and other shared controls. */
  --colorAppBackground: var(--surface-page);
  --colorNeutral000: var(--surface-panel);
  --colorNeutral100: var(--surface-page);
  --colorNeutral200: var(--border-subtle);
  --colorNeutral300: #3c3c3c;
  --colorNeutral400: var(--border-control);
  --colorNeutral500: var(--text-muted);
  --colorNeutral600: var(--text-muted);
  --colorNeutral700: var(--text-secondary);
  --colorNeutral800: var(--text-primary);
  --colorNeutral900: var(--text-heading);
  --colorNeutral100Transparent: #1f1f1f00;
  --colorNeutral600Transparent: #9a9a9a40;
  --colorNeutralShadow: transparent;
  --colorPrimary000: var(--surface-inset);
  --colorPrimary600: var(--accent) !important;
  --colorPrimary900: var(--accent-hover) !important;
  --colorPrimaryShadow: transparent;
  --colorNegative600: #ff9b84;
  --colorPrimary500A: #ffffff1f;
  --colorSecondary900: #ffffff;
  --colorShadowPrimaryXLight: #ffffff14;
  --colorShadowPrimaryLight: #ffffff29;
  --fontFamily: 'ABC Diatype', Arial, Helvetica, sans-serif;
  --fontWeightNormal: 400;
  --fontWeightLightBold: 500;
  --fontWeightMediumBold: 500;
  --fontWeightHeavyBold: 500;
  --widthMaxContent: 1120px;
  --widthMaxJobBoard: 760px;
  --borderRadiusContainer: 8px;
  --borderRadiusControl: 8px;
  --borderRadiusButton: 8px;
  color-scheme: dark;
}

body {
  background-color: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--fontFamily);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.ashby-job-board-heading,
.ashby-job-posting-heading {
  color: var(--text-heading);
  font-size: 42px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.012em;
  padding-block: 24px 12px;
  overflow-wrap: anywhere;
}

.ashby-job-board-heading-count {
  color: var(--text-muted);
  font-weight: 400;
}

.ashby-department-heading,
.ashby-job-posting-brief-department-heading {
  color: var(--text-heading);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.003em;
  margin-top: 40px;
  margin-bottom: 16px;
}

.ashby-job-board-filters-label,
.ashby-job-board-reset-filters-label,
.ashby-job-posting-brief-details {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
}

.ashby-job-board-reset-filters-label[disabled] {
  opacity: 0.5;
  cursor: default;
}

.ashby-job-board-filter {
  min-height: 44px;
  color: var(--text-primary) !important;
  background-color: var(--surface-panel);
  border: 1px solid var(--border-control);
  border-color: var(--border-control) !important;
  border-radius: 8px;
  font-size: 14px;
}

.ashby-job-posting-brief {
  /* Transparent border exposes the gradient layer on hover, without layout shift. */
  background:
    linear-gradient(var(--surface-panel), var(--surface-panel)) padding-box,
    linear-gradient(var(--border-subtle), var(--border-subtle)) border-box;
  border: 1px solid transparent !important;
  border-radius: 8px;
  box-shadow: none;
  padding: 24px !important;
  margin: 0 0 12px !important;
  transition: background-color 200ms ease;
}

.ashby-job-posting-brief:hover,
a:focus > .ashby-job-posting-brief {
  background:
    linear-gradient(var(--surface-panel), var(--surface-panel)) padding-box,
    var(--accent-gradient) border-box;
}

.ashby-job-posting-brief-title {
  color: var(--text-heading);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.45;
  margin-bottom: 12px;
}

/* A quiet divider below the header, matching the reference layout. */
.ashby-job-posting-header {
  background-color: var(--surface-page);
  border-bottom: 1px solid var(--border-subtle);
}

/* Open columns: no panel boxes or doubled vertical border. */
.ashby-job-posting-left-pane,
.ashby-job-posting-description-container,
.ashby-application-form-container {
  color: var(--text-primary);
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.ashby-job-posting-left-pane h2 {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.ashby-job-posting-left-pane p {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.5;
}

.ashby-job-posting-description {
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.ashby-job-posting-description h1,
.ashby-job-posting-description h2,
.ashby-job-posting-description h3,
.ashby-job-posting-description h4 {
  color: var(--text-heading);
  font-weight: 400;
  line-height: 1.2;
  margin-block: 32px 16px;
}

.ashby-job-posting-description h2 {
  font-size: 26px;
  letter-spacing: -0.006em;
}

.ashby-job-posting-description h1 strong,
.ashby-job-posting-description h2 strong,
.ashby-job-posting-description h3 strong,
.ashby-job-posting-description h4 strong {
  font-weight: inherit;
}

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

.ashby-job-posting-right-pane [role='tab'] {
  color: var(--text-muted);
  font-weight: 400;
}

.ashby-job-posting-right-pane [role='tab'][aria-selected='true'] {
  color: var(--text-heading);
}

.ashby-job-posting-right-pane-tab-slider {
  background: var(--accent-gradient);
  height: 2px;
  border-radius: 2px;
}

.ashby-job-posting-right-pane-overview-tab,
.ashby-job-posting-right-pane-application-tab {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ashby-job-board-back-to-all-jobs-button {
  color: var(--text-primary) !important;
}

.ashby-job-board-back-to-all-jobs-button svg {
  fill: currentColor;
}

.ashby-application-form-field-entry {
  margin-bottom: 28px;
}

.ashby-application-form-question-title,
.ashby-application-form-section-header-title {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}

.ashby-application-form-question-description,
.ashby-application-form-section-header-description,
.ashby-application-form-input-file-dropzone-instructions {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Empty rich-text descriptions must not reserve a line below a label. */
.ashby-application-form-question-description {
  display: contents;
  margin: 0;
  padding: 0;
}

.ashby-application-form-question-description p {
  margin-top: 0;
  margin-bottom: 12px;
}

.ashby-application-form-question-description p:empty {
  display: none;
}

.ashby-application-form-input-text,
.ashby-application-form-input-textarea,
.ashby-application-form-input-autocomplete,
.ashby-application-form-input-dropdown-select,
.ashby-application-form-input-date {
  color: var(--text-primary);
  background-color: var(--surface-inset);
  border: 1px solid var(--border-control);
  border-radius: 8px;
  min-height: 48px;
  font-size: 16px;
  line-height: 1.45;
  padding: 12px 14px;
}

.ashby-application-form-input-text::placeholder,
.ashby-application-form-input-textarea::placeholder,
.ashby-application-form-input-autocomplete::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

/* Keep a single drop area frame, rather than two nested dashed borders. */
.ashby-application-form-input-file {
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

.ashby-application-form-input-file-dropzone {
  background-color: var(--surface-inset);
  border: 1px dashed var(--border-control);
  border-radius: 8px;
  padding: 24px;
}

.ashby-application-form-input-file-dropzone-upload,
.ashby-application-form-input-yesno-option {
  color: var(--text-primary);
  background: var(--border-subtle);
  border: 1px solid var(--border-control);
  border-radius: 8px;
  min-height: 44px;
  font-size: 14px;
  box-shadow: none;
}

/* Separate choices avoid Ashby's overlapping segmented-control corners. */
.ashby-application-form-input-yesno {
  display: inline-flex;
  gap: 12px;
  overflow: visible;
}

.ashby-application-form-input-yesno-option {
  margin: 0 !important;
  padding: 12px 20px;
  border: 1px solid var(--border-control) !important;
  border-radius: 8px !important;
  background: var(--surface-inset);
  color: var(--text-primary);
}

.ashby-application-form-input-yesno-option:hover {
  border-color: var(--text-secondary) !important;
}

.ashby-application-form-input-yesno-option[aria-pressed='true'] {
  color: var(--surface-inset) !important;
  background: var(--text-heading) !important;
  border-color: var(--text-heading) !important;
}

.ashby-application-form-input-yesno-option:focus {
  outline: 2px solid var(--text-heading);
  outline-offset: 3px;
  box-shadow: none;
  z-index: 1;
}

.ashby-application-form-submit-button,
.ashby-job-posting-description-container > a > button {
  color: var(--surface-page) !important;
  background: var(--text-heading) !important;
  border: 1px solid var(--text-heading);
  border-radius: 8px;
  min-height: 48px;
  font-size: 14px;
  font-weight: 500;
  padding: 14px 24px;
  box-shadow: none;
  transition: filter 200ms ease;
}

.ashby-application-form-submit-button:not([disabled]):hover,
.ashby-job-posting-description-container > a > button:not([disabled]):hover {
  color: var(--surface-inset) !important;
  background: var(--accent-gradient) !important;
  border-color: transparent;
  box-shadow: none;
}

.ashby-application-form-submit-button svg,
.ashby-job-posting-description-container > a > button svg,
.ashby-application-form-input-file-dropzone-upload svg {
  fill: currentColor;
}

.ashby-application-form-submit-button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Ashby's privacy panel is the sibling immediately after the form fields. */
.ashby-application-form-container + div {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 16px 0 24px;
}

.ashby-application-form-container + div a {
  color: var(--text-heading) !important;
}

.ashby-application-form-container [aria-invalid='true'] {
  border-color: #ff9b84;
}

.ashby-job-board-filter:focus,
.ashby-job-board-reset-filters-label:focus,
.ashby-job-board-back-to-all-jobs-button:focus,
.ashby-job-posting-brief:focus,
.ashby-job-posting-right-pane-application-tab:focus,
.ashby-job-posting-right-pane-overview-tab:focus,
.ashby-application-form-input-text:focus,
.ashby-application-form-input-textarea:focus,
.ashby-application-form-input-autocomplete:focus,
.ashby-application-form-input-dropdown-select:focus,
.ashby-application-form-input-date:focus,
.ashby-application-form-input-file-dropzone-upload:focus,
.ashby-application-form-submit-button:focus {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* Keep selected filter text, borders, and its adjacent chevron neutral. */
.ashby-job-board-filter + div svg {
  fill: var(--text-primary) !important;
}

.ashby-job-board-filter:focus {
  outline: 2px solid var(--text-secondary);
  outline-offset: 4px;
  box-shadow: none !important;
}

/* Smaller job titles and more breathing room between the metadata and copy. */
.ashby-job-posting-heading {
  font-size: 32px;
  font-weight: 500;
  line-height: 1.25;
  padding-top: 28px;
  padding-bottom: 12px;
}

@media (min-width: 768px) {
  .ashby-job-posting-right-pane {
    min-width: 0;
    padding-left: 20px;
  }

  .ashby-job-posting-left-pane {
    padding-right: 20px;
  }
}

@media (min-width: 768px) and (max-width: 1200px) {
  .ashby-job-board-heading,
  .ashby-job-posting-heading {
    font-size: 34px;
  }

  .ashby-job-posting-heading {
    font-size: 30px;
  }
}

@media (max-width: 767px) {
  .ashby-job-board-heading,
  .ashby-job-posting-heading {
    font-size: 26px;
    padding-top: 16px;
  }

  .ashby-job-posting-brief {
    padding: 20px !important;
  }

  .ashby-job-posting-description {
    font-size: 16px;
  }

  .ashby-job-posting-right-pane {
    padding-left: 0;
  }

  .ashby-job-posting-description h2 {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ashby-job-posting-brief,
  .ashby-application-form-submit-button {
    transition: none;
  }
}
