/* Colors and fonts follow sail.health's theme presets so the board reads as part of SAIL. */
:root {
  --royal: #002366;
  --blue: #0978d1;
  --orange: #cd673b;
  --orange-text: #a3461f;
  --sage: #478075;
  --cream: #f5f2c9;
  --ink: #1f2430;
  --muted: #5a6070;
  --rule: #dde3ec;
  --wash: #eef2f8;
  --paper: #ffffff;

  --display: "Sofia Sans Semi Condensed", "Arial Narrow", sans-serif;
  --body: "Titillium Web", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1120px;
  --gutter: 16px;
  --radius: 6px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.55;
}

a {
  color: var(--blue);
}

/* Elements hidden by the filter script must stay hidden even when a class sets display. */
[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

@media (min-width: 640px) {
  :root {
    --gutter: 32px;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -40px;
  background: var(--paper);
  color: var(--royal);
  padding: 6px 12px;
  z-index: 10;
}

.skip-link:focus {
  top: 8px;
}

.demo-banner {
  margin: 0;
  padding: 8px var(--gutter);
  background: var(--cream);
  color: var(--royal);
  font-weight: 600;
  text-align: center;
}

/* Masthead and hero share one royal band. */
.masthead {
  background: var(--royal);
  color: var(--paper);
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: var(--paper);
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1;
}

.brand-sail {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-jobs {
  font-weight: 400;
  color: var(--cream);
  padding-left: 10px;
  border-left: 2px solid var(--orange);
}

.masthead-link {
  color: #c9d6ef;
  font-size: 0.9375rem;
  text-decoration: none;
}

.masthead-link:hover {
  color: var(--paper);
  text-decoration: underline;
}

.hero {
  background: var(--royal);
  color: var(--paper);
  padding: 24px 0 48px;
  border-bottom: 4px solid var(--orange);
}

.hero h1 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.01em;
}

.lede {
  margin: 0 0 24px;
  max-width: 56ch;
  color: #d6e0f2;
  font-size: 1.125rem;
}

.cta-note {
  margin: 0;
  color: var(--cream);
  font-weight: 600;
}

.button {
  display: inline-block;
  padding: 10px 20px;
  border: 0;
  border-radius: var(--radius);
  background: var(--royal);
  color: var(--paper);
  font: 600 1rem/1.3 var(--body);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--blue);
}

.hero .button {
  background: var(--cream);
  color: var(--royal);
}

.hero .button:hover {
  background: var(--paper);
}

.button-quiet {
  background: var(--wash);
  color: var(--royal);
}

.button-quiet:hover {
  background: var(--rule);
}

.button-block {
  display: block;
  width: 100%;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Listing layout: filters beside results on wide screens, above them on narrow ones. */
.board {
  display: grid;
  gap: 32px;
  padding-top: 32px;
  padding-bottom: 64px;
}

@media (min-width: 900px) {
  .board {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 56px;
  }

  .filters {
    position: sticky;
    top: 24px;
  }
}

/* On phones the filter options fold under a toggle; on wide screens they are always open. */
.filter-groups > summary {
  margin-top: 16px;
  color: var(--royal);
  font-family: var(--display);
  font-size: 1.0625rem;
  font-weight: 700;
  cursor: pointer;
}

@media (min-width: 900px) {
  .filter-groups > summary {
    display: none;
  }
}

.filters fieldset {
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}

.filter-label {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  color: var(--royal);
  font-family: var(--display);
  font-size: 1.0625rem;
  font-weight: 700;
}

input[type="search"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  position: relative;
  cursor: pointer;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip > span {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.9375rem;
}

.chip:hover > span {
  border-color: var(--royal);
}

.chip input:checked + span {
  border-color: var(--royal);
  background: var(--royal);
  color: var(--paper);
}

.chip input:focus-visible + span {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.chip-count {
  margin-left: 2px;
  color: var(--muted);
  font-size: 0.8125rem;
}

.chip input:checked + span .chip-count {
  color: #c9d6ef;
}

.filters .link-button {
  margin-top: 20px;
  font-size: 0.9375rem;
}

/* Results. The left column of each row is the deadline, the thing applicants plan around. */
.status {
  margin: 0 0 8px;
  color: var(--muted);
}

.postings {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--royal);
}

.posting {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 16px;
  padding: 20px 8px;
  border-bottom: 1px solid var(--rule);
}

.posting:hover {
  background: var(--wash);
}

@media (min-width: 640px) {
  .posting {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 24px;
    padding: 24px 12px;
  }
}

.when {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.when-label {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.8125rem;
}

.when-date {
  color: var(--royal);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .when-date {
    font-size: 1.875rem;
  }
}

.when-year {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.875rem;
}

.when-rolling {
  color: var(--sage);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
}

.is-closing .when-date {
  color: var(--orange);
}

.when-note {
  margin-top: 2px;
  color: var(--orange-text);
  font-size: 0.875rem;
  font-weight: 600;
}

.posting-title {
  margin: 0 0 2px;
  font-family: var(--display);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.15;
}

.posting-title a {
  color: var(--royal);
  text-decoration: none;
}

.posting-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.posting:hover .posting-title a {
  text-decoration: underline;
}

.posting-org {
  margin: 0 0 6px;
  font-weight: 600;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.9375rem;
}

.tags li + li::before {
  content: "·";
  padding: 0 8px;
}

.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 3px;
  background: var(--cream);
  color: var(--royal);
  font-family: var(--display);
  font-size: 0.875rem;
  font-weight: 700;
  vertical-align: 0.2em;
}

.empty {
  padding: 32px 0;
  color: var(--muted);
}

.empty p {
  margin: 0 0 12px;
}

/* Posting detail page. */
.detail {
  padding-top: 24px;
  padding-bottom: 64px;
}

.back {
  margin: 0 0 24px;
}

.back a::before {
  content: "← ";
}

.detail-head {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--royal);
}

.detail-org {
  margin: 0 0 6px;
  color: var(--sage);
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
}

.detail-head h1 {
  margin: 0;
  max-width: 28ch;
  color: var(--royal);
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.05;
}

.detail-grid {
  display: grid;
  gap: 32px;
}

@media (min-width: 900px) {
  .detail-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 56px;
  }

  .detail-facts {
    order: 2;
    align-self: start;
    position: sticky;
    top: 24px;
  }
}

.detail-facts {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--wash);
}

.detail-facts dl {
  margin: 20px 0 0;
}

.detail-facts dt {
  color: var(--muted);
  font-size: 0.875rem;
}

.detail-facts dd {
  margin: 0 0 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.detail-facts .when-note {
  display: block;
}

.prose {
  max-width: 68ch;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2,
.prose h3 {
  margin: 1.6em 0 0.4em;
  color: var(--royal);
  font-family: var(--display);
  line-height: 1.15;
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
}

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 24px 0 40px;
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer p {
  margin: 0 0 6px;
  max-width: 72ch;
}

.site-footer a {
  color: var(--muted);
}
