/* Shared styling for the public careers site (job listing, job detail/apply,
   application success). Pairs with kubenine-nav-footer.css, which supplies
   the exact kubenine.com header/footer + design tokens (--background,
   --foreground, --brand-orange, etc.) this file builds on. */

body {
  margin: 0;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--default-font-family);
}
a { text-decoration: none; color: inherit; }
*, *::before, *::after { box-sizing: border-box; }

.careers-grid-bg {
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ---- Hero (listing + job detail share this) ---- */

.careers-hero {
  position: relative;
  overflow: hidden;
  padding: 64px 32px 48px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 83, 31, 0.18), transparent 55%),
    radial-gradient(circle at 90% 30%, rgba(81, 72, 224, 0.15), transparent 55%);
}
.careers-hero-inner { max-width: 1280px; margin: 0 auto; }
.careers-hero .back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted-foreground); margin-bottom: 18px;
}
.careers-hero .back-link:hover { color: var(--foreground); }
.careers-hero .eyebrow {
  display: inline-block; font-size: 11.5px; letter-spacing: 2.5px; font-weight: 600;
  color: var(--brand-orange); text-transform: uppercase; margin-bottom: 16px;
}
.careers-hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: 44px; line-height: 1.15; margin: 0 0 16px;
}
.careers-hero h1 .grad {
  background: linear-gradient(90deg, var(--brand-orange), var(--brand-magenta), var(--brand-indigo));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.careers-hero p.lede {
  color: var(--muted-foreground); font-size: 15px; line-height: 1.6; max-width: 540px; margin: 0;
}
.careers-hero .job-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.job-badge {
  font-size: 12px; padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(151, 149, 149, 0.2);
  color: rgba(255, 255, 255, 0.85);
}

/* ---- Job listing grid ---- */

.jobs-section { max-width: 1280px; margin: 0 auto; padding: 40px 32px 80px; }
.jobs-count { font-size: 13px; color: var(--muted-foreground); margin: 0 0 24px; }

.job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  align-items: stretch; /* every card in a row stretches to the row's tallest */
}

.job-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px;
  backdrop-filter: blur(20px);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.job-card:hover { transform: translateY(-3px); border-color: rgba(255, 83, 31, 0.4); }

.job-card h3 {
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
  margin: 0 0 12px;
  /* clamp to 2 lines so titles of any length take the same space */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: calc(1.3em * 2);
}

.job-card .job-badges { margin-bottom: 14px; }

.job-card .job-desc {
  font-size: 13.5px; color: var(--muted-foreground); line-height: 1.6;
  margin: 0 0 20px;
  /* clamp to 3 lines so description length doesn't change card height */
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; min-height: calc(1.6em * 3);
}

.job-card .apply-btn {
  margin-top: auto; /* pins the button to the bottom regardless of content above */
  align-self: flex-start;
  display: inline-block; font-size: 13px; font-weight: 600; padding: 10px 22px;
  border-radius: 999px; color: #fff;
  background-image: linear-gradient(270deg, var(--brand-indigo) 0%, var(--brand-orange) 100%);
  box-shadow: rgba(255, 83, 31, 0.5) 0 10px 40px -12px;
  transition: filter 0.2s, transform 0.2s;
}
.job-card .apply-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }

.jobs-empty {
  text-align: center; padding: 64px 24px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--border);
}
.jobs-empty .icon { font-size: 2.5rem; margin-bottom: 1rem; }
.jobs-empty h2 { font-family: var(--font-display); font-size: 20px; margin: 0 0 8px; }
.jobs-empty p { color: var(--muted-foreground); margin: 0; }

/* ---- Job detail + apply ---- */

.job-layout {
  max-width: 1280px; margin: 0 auto; padding: 40px 32px 80px;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start;
}
.job-desc-col h2 { font-family: var(--font-display); font-size: 18px; margin: 0 0 12px; }
.job-desc-col .job-description-body { font-size: 14px; color: var(--muted-foreground); line-height: 1.75; }
.job-desc-col .job-description-body p { margin: 0 0 20px; }
.job-desc-col .job-description-body ul,
.job-desc-col .job-description-body ol { margin: 0 0 20px; padding-left: 20px; line-height: 1.9; }

.apply-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 28px; position: sticky; top: 96px;
}
.apply-card h3 { font-family: var(--font-display); font-size: 17px; margin: 0 0 18px; }

.apply-card .form-group { margin-bottom: 16px; }
.apply-card label {
  display: block; font-size: 12px; color: var(--muted-foreground); margin-bottom: 6px;
}
.apply-card label.required-field::after { content: "*"; color: var(--destructive); margin-left: 4px; }

.apply-card .form-control {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  background: color-mix(in oklab, var(--background) 60%, transparent);
  border: 1px solid var(--input); color: var(--foreground);
  font-family: var(--default-font-family); font-size: 13.5px;
}
.apply-card .form-control:focus { outline: none; border-color: var(--brand-orange); }
.apply-card select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 1em;
  padding-right: 34px;
}
.apply-card textarea.form-control { min-height: 90px; resize: vertical; }

.file-drop {
  border: 1px dashed var(--input); border-radius: 10px; padding: 18px; text-align: center;
  cursor: pointer; background: color-mix(in oklab, var(--background) 60%, transparent);
  transition: border-color 0.15s;
}
.file-drop:hover { border-color: var(--brand-orange); }
.file-drop-icon { display: block; margin: 0 auto 8px; color: var(--brand-orange); }
.file-drop-text {
  font-size: 13px; font-weight: 600; color: var(--foreground);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-drop-sub { font-size: 11.5px; color: var(--muted-foreground); margin-top: 2px; }
.file-drop.has-file { border-style: solid; border-color: var(--brand-orange); }
.file-drop.has-file .file-drop-icon { color: var(--brand-orange); }

.apply-card .form-text { font-size: 12px; color: var(--muted-foreground); margin-top: 6px; }
.apply-card .field-errors {
  font-size: 12px; color: var(--destructive); margin-top: 6px;
}
.apply-card .form-alert {
  background: color-mix(in oklab, var(--destructive) 15%, transparent);
  border: 1px solid var(--destructive); color: var(--foreground);
  padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px;
}

.apply-card .btn-apply {
  margin-top: 6px; width: 100%; text-align: center; padding: 13px;
  border-radius: 999px; font-weight: 600; font-size: 13.5px; color: #fff;
  border: none; cursor: pointer;
  background-image: linear-gradient(270deg, var(--brand-indigo) 0%, var(--brand-orange) 100%);
  box-shadow: rgba(255, 83, 31, 0.5) 0 10px 40px -12px;
  transition: filter 0.2s, transform 0.2s;
}
.apply-card .btn-apply:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); }
.apply-card .btn-apply:disabled { opacity: 0.5; cursor: not-allowed; }

.closed-banner {
  background: color-mix(in oklab, var(--destructive) 15%, transparent);
  border: 1px solid var(--destructive); color: var(--foreground);
  padding: 10px 16px; border-radius: 8px; font-size: 13px; margin-top: 16px;
}

@media (max-width: 860px) {
  .job-layout { grid-template-columns: 1fr; }
  .apply-card { position: static; }
}

/* ---- Application success ---- */

.success-wrap {
  max-width: 640px; margin: 0 auto; padding: 80px 32px 100px; text-align: center;
}
.success-icon {
  width: 72px; height: 72px; border-radius: 999px; margin: 0 auto 28px;
  background: color-mix(in oklab, var(--brand-orange) 15%, transparent);
  border: 1px solid rgba(255, 83, 31, 0.4);
  display: flex; align-items: center; justify-content: center;
}
.success-icon svg { width: 32px; height: 32px; color: var(--brand-orange); }
.success-wrap h1 { font-family: var(--font-display); font-size: 26px; margin: 0 0 14px; }
.success-wrap p { color: var(--muted-foreground); font-size: 14.5px; line-height: 1.7; margin: 0 0 18px; }
.success-code {
  display: inline-block; font-family: var(--font-mono); font-size: 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 18px; margin: 6px 0 24px; color: var(--brand-orange);
}

/* ---- Mobile nav sheet (matches kubenine.com's mobile menu behavior) ---- */

.kn-mobile-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.kn-mobile-backdrop.is-open { opacity: 1; pointer-events: auto; }

.kn-mobile-sheet {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: 75%; max-width: 320px;
  background: var(--popover); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s ease;
}
.kn-mobile-sheet.is-open { transform: translateX(0); }

.kn-mobile-sheet .sheet-header {
  position: relative; padding: 16px; font-size: 15px; font-weight: 600;
  font-family: var(--font-display); border-bottom: 1px solid var(--border);
}
.kn-mobile-sheet .sheet-close {
  position: absolute; top: 10px; right: 10px; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; border: none; background: transparent; color: var(--foreground);
  cursor: pointer;
}
.kn-mobile-sheet .sheet-close:hover { background: rgba(255, 255, 255, 0.08); }

.kn-mobile-sheet nav { display: flex; flex-direction: column; gap: 2px; padding: 16px; overflow-y: auto; }
.kn-mobile-sheet nav a {
  padding: 10px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--foreground); transition: background-color 0.15s ease;
}
.kn-mobile-sheet nav a:hover { background: rgba(255, 255, 255, 0.05); }
.kn-mobile-sheet .sheet-divider { height: 1px; background: var(--border); margin: 8px 0; }
.kn-mobile-sheet .sheet-label {
  padding: 0 12px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--muted-foreground); margin: 0;
}
.kn-mobile-sheet .sheet-footer { margin-top: auto; padding: 16px; }

body.kn-menu-open { overflow: hidden; }

@media (max-width: 640px) {
  .careers-hero { padding: 44px 20px 32px; }
  .careers-hero h1 { font-size: 32px; }
  .jobs-section { padding: 28px 20px 60px; }
  .job-layout { padding: 28px 20px 60px; }
  .success-wrap { padding: 56px 20px 72px; }
}
