/* Openroles — component styles that sit alongside Tailwind utilities.
   Colors mirror the tailwind.config tokens in index.html. */
:root {
  --paper: #F1F4F2;
  --surface: #FFFFFF;
  --ink: #16353B;
  --muted: #587072;
  --line: #CCD7D3;
  --teal: #1F6F6B;
  --teal-dark: #16524F;
  --teal-soft: #DCEBE8;
  --marigold: #F4B42B;
  --marigold-soft: #FCEFC9;
  --danger: #B3261E;
  --ring: 0 0 0 3px var(--paper), 0 0 0 5px var(--teal);
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: calc(4rem + env(safe-area-inset-top, 0px)); }
body { min-height: 100vh; }
img { max-width: 100%; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 50;
  background: var(--ink); color: var(--paper); padding: .6rem 1rem; border-radius: 6px;
}
.skip-link:focus { top: 1rem; }

.site-header { top: env(safe-area-inset-top, 0px); }

/* ---------- Hero search: the signature element ---------- */
.hero-search-wrap { position: relative; }
.hero-search {
  width: 100%;
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 3px solid var(--ink);
  border-radius: 0;
  padding: .1em 0 .15em;
  font-size: clamp(2.4rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
  caret-color: var(--marigold);
}
.hero-search::placeholder { color: color-mix(in srgb, var(--muted) 45%, transparent); }
.hero-search:focus { outline: none; box-shadow: none; border-bottom-color: var(--teal); }
.hero-search:focus-visible { box-shadow: 0 3px 0 0 var(--marigold); border-radius: 0; }
.hero-search::-webkit-search-cancel-button { display: none; }

/* ---------- Buttons ---------- */
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 600; font-size: .9rem; border-radius: 8px; padding: .55rem 1rem;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--teal); color: #fff; border: 1px solid var(--teal); }
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn-secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-lg { padding: .8rem 1.4rem; font-size: 1rem; }

.icon-btn {
  display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; flex: none;
  border-radius: 999px; color: var(--muted); background: transparent; border: 0; cursor: pointer;
}
.icon-btn:hover { background: var(--teal-soft); color: var(--ink); }

.text-link { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Filter chips ---------- */
.chip-scroll {
  display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none;
  margin-inline: -1.25rem; padding-inline: 1.25rem; /* bleed to screen edge on mobile */
}
.chip-scroll::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .chip-scroll { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; } }

.chip {
  flex: none; font-size: .875rem; font-weight: 500; padding: .4rem .85rem;
  border-radius: 999px; border: 1px solid transparent; background: transparent;
  color: var(--muted); cursor: pointer;
}
.chip:hover { color: var(--ink); background: var(--teal-soft); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip-outline { border-color: var(--line); }
.chip-outline[aria-pressed="true"] { background: var(--teal-soft); color: var(--teal-dark); border-color: var(--teal); }

/* ---------- Switch ---------- */
.switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; user-select: none; }
.switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  position: relative; width: 2.4rem; height: 1.4rem; border-radius: 999px;
  background: var(--line); transition: background-color .15s ease; flex: none;
}
.switch-thumb {
  position: absolute; top: .2rem; left: .2rem; width: 1rem; height: 1rem; border-radius: 999px;
  background: #fff; transition: transform .15s ease;
}
.switch-input:checked + .switch-track { background: var(--teal); }
.switch-input:checked + .switch-track .switch-thumb { transform: translateX(1rem); }
.switch-input:focus-visible + .switch-track { box-shadow: var(--ring); }

.select-sm {
  background: transparent; border: 1px solid var(--line); border-radius: 6px;
  padding: .3rem .5rem; color: var(--ink); font-size: .875rem;
}

/* ---------- Job list: rows, not cards ---------- */
.job-list { list-style: none; margin: 0; padding: 0; }
.job-list > li + li { border-top: 1px solid var(--line); }
.job-list:focus { outline: none; }

.job-row {
  width: 100%; display: flex; align-items: center; gap: 1rem; text-align: left;
  padding: 1.1rem .75rem; margin-inline: -.75rem; width: calc(100% + 1.5rem);
  background: transparent; border: 0; border-radius: 10px; cursor: pointer; color: inherit;
}
.job-row:hover { background: var(--surface); }
.job-row:hover .job-title { color: var(--teal-dark); }

.job-title { font-family: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif; font-weight: 600; font-size: 1.125rem; line-height: 1.3; }

.job-row-meta { display: none; align-items: center; gap: .6rem; flex: none; }
@media (min-width: 640px) { .job-row-meta { display: flex; } }
.salary { font-size: .875rem; font-weight: 500; min-width: 7.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.posted { font-size: .8125rem; color: var(--muted); min-width: 3rem; text-align: right; }

.monogram {
  display: inline-grid; place-items: center; flex: none;
  width: 2.75rem; height: 2.75rem; border-radius: 12px;
  font-family: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  font-weight: 800; font-size: 1rem; letter-spacing: -0.02em;
  background: var(--teal-soft); color: var(--teal-dark);
}
.monogram-lg { width: 3.5rem; height: 3.5rem; font-size: 1.25rem; border-radius: 14px; }

.tag {
  display: inline-flex; align-items: center; font-size: .78rem; font-weight: 500;
  padding: .2rem .6rem; border-radius: 6px; background: var(--teal-soft); color: var(--teal-dark);
}
.tag-quiet { background: transparent; border: 1px solid var(--line); color: var(--muted); }

.badge-new {
  font-size: .72rem; font-weight: 600; padding: .1rem .45rem; border-radius: 4px;
  background: var(--marigold); color: var(--ink);
}

/* ---------- Dialog sheets ---------- */
.sheet {
  width: min(46rem, 100%); max-height: min(92vh, 100%);
  padding: 0; border: 0; border-radius: 16px; background: var(--surface); color: var(--ink);
}
.sheet::backdrop { background: rgba(22, 53, 59, .45); backdrop-filter: blur(2px); }
.sheet-body { display: flex; flex-direction: column; }
.sheet-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding: 1.5rem 1.5rem 1rem;
}
@media (min-width: 768px) { .sheet-header { padding: 2rem 2rem 1.25rem; } }
.sheet-footer {
  position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
  padding: 1rem 1.5rem calc(1rem + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--line);
}
@media (min-width: 768px) { .sheet-footer { padding-inline: 2rem; } }

/* Bottom sheet on phones */
@media (max-width: 639px) {
  .sheet { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 16px 16px 0 0; max-height: 94vh; }
}
@media (prefers-reduced-motion: no-preference) {
  .sheet[open] { animation: sheet-in .2s ease-out; }
  @media (max-width: 639px) { .sheet[open] { animation-name: sheet-up; } }
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(8px) scale(.99); } }
@keyframes sheet-up { from { transform: translateY(100%); } }

/* ---------- Job description typography ---------- */
.prose-job { max-width: 68ch; line-height: 1.65; }
.prose-job h3 { font-family: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif; font-weight: 600; font-size: 1.15rem; margin: 1.75rem 0 .5rem; }
.prose-job h3:first-child { margin-top: 0; }
.prose-job p { margin: 0 0 .9rem; }
.prose-job ul { margin: 0; padding-left: 1.2rem; list-style: disc; }
.prose-job li { margin-bottom: .4rem; }
.prose-job li::marker { color: var(--teal); }

/* ---------- Form ---------- */
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.form-section { font-family: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif; font-weight: 600; font-size: 1.05rem; margin-bottom: .25rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field > label { font-size: .875rem; font-weight: 600; }
.field input:not([type="checkbox"]), .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 8px; padding: .65rem .8rem;
}
.field textarea { resize: vertical; min-height: 6rem; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field-hint { font-size: .8rem; color: var(--muted); }
.field-error { font-size: .8rem; color: var(--danger); min-height: 0; }
.field-error:empty { display: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); z-index: 60;
  transform: translate(-50%, 150%); opacity: 0;
  background: var(--ink); color: var(--paper); padding: .75rem 1.1rem; border-radius: 10px;
  font-size: .9rem; font-weight: 500; max-width: calc(100% - 2rem);
  transition: transform .2s ease, opacity .2s ease; pointer-events: none;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
