/* The job board as businesses browse it, signed in (app layout) and out
   (the marketing layout, page_stylesheets "job_board_browse"): the shared
   filter bar and its popovers, the phone's filter sheet, the cards, the
   list beside the map, the empty state, a listing page's layout and the
   public board's sign-up band and panels. */

/* ------------------------------------------------------------------
   Browsing: the shared filter bar, popovers, the phone's sheet, the
   result heading, cards, the list beside the map, the empty state.
   ------------------------------------------------------------------ */
.board-page {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.board-page-head,
.board-listing-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.board-frame {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

/* The bar sticks under the page's top while the list scrolls. */
.board-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  gap: 0.5rem;
  margin-inline: -0.25rem;
  padding: 0.5rem 0.25rem;
  background: var(--color-base-200);
}

.mkt .board-bar {
  top: var(--board-bar-top, 64px);
  background: var(--color-base-100);
}

.board-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-padding-inline: 0.25rem;
}

.board-bar-row::-webkit-scrollbar {
  display: none;
}

.board-bar-spacer {
  flex: 1 1 0;
}

/* One facet: a chip-like button, 44px tall on a phone, 36px from a tablet. */
.board-facet {
  position: relative;
  flex: none;
}

.board-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.75rem;
  max-width: 16rem;
  padding: 0 0.875rem;
  border: 1px solid var(--color-base-300);
  border-radius: 999px;
  background: var(--color-base-100);
  color: var(--color-base-content);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.board-chip:hover {
  border-color: color-mix(in srgb, var(--color-base-content) 35%, transparent);
}

.board-chip:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.board-chip[aria-expanded="true"],
.board-chip-on {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 10%, var(--color-base-100));
}

.board-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-chip-all {
  flex: none;
}

.board-view-toggle {
  display: none;
  flex: none;
}

@media (min-width: 768px) {
  .board-chip {
    min-height: 2.25rem;
  }

  .board-chip-all {
    display: none;
  }

  .board-bar-row {
    flex-wrap: wrap;
    overflow: visible;
  }

  .board-view-toggle {
    display: inline-flex;
  }
}

/* From 1280px the list and the map are side by side: no toggle needed. */
@media (min-width: 1280px) {
  .board-view-toggle {
    display: none;
  }
}

.board-chip-caret {
  opacity: 0.6;
}

/* A facet's popover (tablet and up). */
.board-popover {
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 0;
  z-index: 30;
  display: grid;
  gap: 0.75rem;
  width: min(20rem, calc(100vw - 2rem));
  padding: 0.875rem;
  border: 1px solid var(--color-base-300);
  border-radius: var(--radius-box, 0.75rem);
  background: var(--color-base-100);
  color: var(--color-base-content);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--color-base-content) 16%, transparent);
}

.board-facet-end .board-popover,
.board-popover-flip {
  left: auto;
  right: 0;
}

.board-pop-title {
  font-size: 0.9375rem;
  font-weight: 600;
}

.board-pop-section {
  display: grid;
  gap: 0.5rem;
}

.board-pop-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-base-content) 65%, transparent);
}

.board-pop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.board-options {
  display: grid;
  gap: 0.125rem;
}

.board-options-scroll {
  max-height: 16rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* One choice: at least 36px tall (24px minimum target, WCAG 2.2). */
.board-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-field, 0.5rem);
  font-size: 0.875rem;
  cursor: pointer;
}

.board-option:hover,
.board-option:focus-visible {
  background: var(--color-base-200);
}

.board-option-on {
  font-weight: 600;
  color: var(--color-primary);
}

.board-option-mark {
  opacity: 0.35;
}

.board-option-on .board-option-mark {
  opacity: 1;
}

.board-option-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.board-option-count {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--color-base-content) 75%, transparent);
}

.board-option-disabled {
  cursor: default;
  opacity: 0.45;
}

.board-option-disabled:hover {
  background: transparent;
}

.board-radius-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.board-radius-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.5rem;
  min-height: 2.25rem;
  padding: 0 0.75rem;
  border: 1px solid var(--color-base-300);
  border-radius: 999px;
  font-size: 0.875rem;
  cursor: pointer;
}

.board-radius-chip:hover {
  border-color: var(--color-primary);
}

.board-radius-chip-on,
.board-radius-pick:has(:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: var(--color-primary-content);
}

.board-radius-pick:has(:focus-visible) {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.board-date-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.board-date-pair legend {
  grid-column: 1 / -1;
  margin-bottom: 0.25rem;
}

.board-date-field {
  display: grid;
  gap: 0.25rem;
}

/* The applied filters: one removable chip per value, then Clear all. Under
   the sticky bar, not in it, so the bar stays one row on a phone. */
.board-applied {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
}

.board-bar + .board-applied {
  margin-top: -0.5rem;
}

.board-applied-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2rem;
  padding: 0 0.625rem 0 0.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-primary) 14%, var(--color-base-100));
  color: var(--color-base-content);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}

.board-applied-chip:hover {
  background: color-mix(in srgb, var(--color-primary) 24%, var(--color-base-100));
}

.board-applied-clear {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
}

.board-applied-clear:hover {
  text-decoration: underline;
}

/* The phone's filter sheet: full screen for every facet, a bottom sheet
   for one (data-only). */
.board-sheet {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--color-base-100);
  color: var(--color-base-content);
}

.board-sheet::backdrop {
  background: rgb(0 0 0 / 0.45);
}

.board-sheet:not([data-only="all"]) {
  top: auto;
  height: auto;
  max-height: 85dvh;
  border-radius: 1rem 1rem 0 0;
}

.board-sheet[data-only="location"] [data-sheet-section]:not([data-sheet-section="location"]),
.board-sheet[data-only="trades"] [data-sheet-section]:not([data-sheet-section="trades"]),
.board-sheet[data-only="dates"] [data-sheet-section]:not([data-sheet-section="dates"]),
.board-sheet[data-only="pay"] [data-sheet-section]:not([data-sheet-section="pay"]),
.board-sheet[data-only="sort"] [data-sheet-section]:not([data-sheet-section="sort"]) {
  display: none;
}

.board-sheet-form {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: inherit;
}

.board-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-base-300);
}

.board-sheet-title {
  font-size: 1.125rem;
  font-weight: 700;
}

.board-sheet-body {
  flex: 1 1 auto;
  display: grid;
  align-content: start;
  gap: 1.25rem;
  padding: 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.board-sheet-section {
  display: grid;
  gap: 0.625rem;
  min-width: 0;
}

.board-sheet-legend {
  margin-bottom: 0.25rem;
  font-size: 1rem;
  font-weight: 600;
}

.board-sheet-choices {
  display: grid;
}

.board-sheet-scroll {
  max-height: 14rem;
  overflow-y: auto;
}

.board-sheet-search,
.board-sheet-sub {
  display: grid;
  gap: 0.5rem;
}

/* 44px rows: thumb-sized. */
.board-sheet-choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  font-size: 0.9375rem;
  cursor: pointer;
}

.board-sheet-foot {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--color-base-300);
  background: var(--color-base-100);
}

/* The result heading, with Get alerts for this search. */
.board-results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.board-results-title {
  font-size: 1.0625rem;
  font-weight: 600;
}

/* The list and the map: one at a time below 1280px, side by side above. */
.board-split {
  position: relative;
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.board-split[data-current="list"] .board-map-pane,
.board-split[data-current="map"] .board-list-pane {
  display: none;
}

@media (min-width: 1280px) {
  .board-split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
    align-items: start;
  }

  .board-split[data-current] .board-map-pane,
  .board-split[data-current] .board-list-pane {
    display: block;
  }

  .board-map-pane {
    position: sticky;
    top: var(--board-map-top, 4.5rem);
  }

  .board-map-pane .board-map {
    height: calc(100dvh - 9rem);
    min-height: 24rem;
  }
}

.board-list-pane,
.board-map-pane {
  min-width: 0;
}

/* The phone's floating Map / List pill. */
.board-view-pill {
  position: fixed;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 25;
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  padding: 0 1.125rem;
  border-radius: 999px;
  background: var(--color-neutral);
  color: var(--color-neutral-content);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.25);
  transform: translateX(-50%);
}

.board-view-pill > span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.board-split[data-current="map"] .board-view-pill-map,
.board-split[data-current="list"] .board-view-pill-list {
  display: none;
}

@media (min-width: 768px) {
  .board-view-pill {
    display: none;
  }
}

/* Listing cards: one column beside the map, a grid when the list is alone. */
.board-cards {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
}

@media (min-width: 1280px) {
  .board-split .board-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

.board-card {
  min-width: 0;
  border: 1px solid var(--color-base-300);
  border-radius: var(--radius-box, 0.75rem);
  background: var(--color-base-100);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.board-card:hover,
.board-card:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--color-base-content) 10%, transparent);
}

.board-card-flash {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 45%, transparent);
}

.board-card-link {
  display: grid;
  gap: 0.375rem;
  height: 100%;
  padding: 1rem;
  min-width: 0;
  color: inherit;
}

.board-card-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-box, 0.75rem);
}

.board-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.board-trade-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  padding: 0 0.5rem;
  border-radius: 0.375rem;
  background: color-mix(in srgb, var(--color-primary) 12%, var(--color-base-100));
  color: color-mix(in srgb, var(--color-primary) 70%, var(--color-base-content));
  font-size: 0.75rem;
  font-weight: 600;
}

.board-card-pay {
  margin-left: auto;
  font-size: 1.0625rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.board-card-pay-none {
  font-size: 0.8125rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--color-base-content) 65%, transparent);
}

.board-card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.board-card-link:hover .board-card-title {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.board-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.375rem;
  font-size: 0.875rem;
  color: color-mix(in srgb, var(--color-base-content) 75%, transparent);
}

/* A card's time left (shared/_time_left) keeps its clock at every step, so
   it lines up with the place and visit lines' icons. */
.board-card-meta .time-left { gap: 0.375rem; }
.board-card-meta .time-left__icon { display: inline-block; }

.board-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.5rem;
  margin-top: 0.25rem;
  padding-top: 0.625rem;
  border-top: 1px solid var(--color-base-200);
  font-size: 0.8125rem;
}

.board-card-poster {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.board-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: color-mix(in srgb, var(--color-base-content) 70%, transparent);
}

.board-card-age {
  margin-left: auto;
  font-size: 0.75rem;
  color: color-mix(in srgb, var(--color-base-content) 75%, transparent);
}

.board-pages {
  display: flex;
  justify-content: center;
  padding-top: 1rem;
}

/* No match: what was searched and the ways to widen it. */
.board-empty {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  max-width: 36rem;
  margin: 0 auto;
  padding: 2.5rem 1rem;
  text-align: center;
}

.board-empty-icon {
  color: color-mix(in srgb, var(--color-base-content) 35%, transparent);
}

.board-empty-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.board-empty-body {
  color: color-mix(in srgb, var(--color-base-content) 75%, transparent);
}

.board-relax,
.board-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.board-empty-actions {
  margin-top: 0.5rem;
}

/* Under the marketing site's sticky nav (72px; 64px on a phone). */
.mkt .board-bar {
  --board-bar-top: 72px;
}

.mkt .board-map-pane {
  --board-map-top: 8.5rem;
}

/* A search box inside a filter: the bordered label shows the focus ring,
   so the bare input inside it doesn't draw a second one. */
.board-popover input[type="search"]:focus,
.board-sheet input[type="search"]:focus {
  outline: none;
  box-shadow: none;
}

/* Nothing matched: no empty map beside the suggestions. */
.board-split-empty .board-map-pane,
.board-split-empty .board-view-pill {
  display: none !important;
}

@media (min-width: 1280px) {
  .board-split-empty {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Grid children default to their content's width; the chip row scrolls
   inside its own box instead of widening the page. */
.board-page > *,
.board-frame > *,
.board-bar > * {
  min-width: 0;
}

/* Above the app's bottom tab bar on a phone. */
body:not(.mkt) .board-view-pill {
  bottom: calc(5.5rem + env(safe-area-inset-bottom));
}

/* On a phone the pill floats over the list: in the app nothing follows the
   list (the public board has its footer), so the list ends with room to
   scroll its last card clear of the pill. The chip row scrolls sideways:
   its right edge fades to say so, and its end padding keeps the last chip
   out of the fade once scrolled there. */
@media (max-width: 767.98px) {
  body:not(.mkt) .board-split:not(.board-split-empty)[data-current="list"] .board-list-pane {
    padding-bottom: 4.5rem;
  }

  .board-bar-row {
    padding-inline-end: 2rem;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent);
  }
}

/* A one-facet sheet's title already names it. */
.board-sheet:not([data-only="all"]) .board-sheet-legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* Whatever takes focus or is scrolled to lands below the sticky bar (and
   the marketing nav above it): board-filters keeps --board-bar-h at the
   bar's height. */
html:has(.board-bar) {
  scroll-padding-top: calc(var(--board-bar-h, 3.75rem) + 0.5rem);
}

html:has(body.mkt .board-bar) {
  scroll-padding-top: calc(72px + var(--board-bar-h, 3.75rem) + 0.5rem);
}

/* Scrolled to (a circle clicked, keyboard focus) clear of the sticky bar. */
.board-card {
  scroll-margin-top: 9rem;
}

/* Near me in the Location popover: a button that reads as one more option. */
.board-option-button {
  width: 100%;
  text-align: start;
}

/* Near me can't be saved as an alert: the hint takes the button's place. */
.board-alert-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.375rem;
  max-width: 22rem;
  font-size: 0.75rem;
  color: color-mix(in srgb, var(--color-base-content) 75%, transparent);
}

/* "Showing your types of work · Show all": the bare signed-in board's
   starting trades, from the company's board profile. */
.board-profile-trades {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: color-mix(in srgb, var(--color-base-content) 80%, transparent);
}

.board-bar + .board-profile-trades {
  margin-top: -0.5rem;
}

/* A public type of work's name: a link to its own page that reads as the
   checkbox's label (the box is the keyboard stop). */
.board-option-link {
  color: inherit;
  text-decoration: none;
}

.board-option-link:hover {
  text-decoration: underline;
}

/* A taken job: the listing card, quieter, with a Taken badge; it opens its
   type of work's page, not the listing (gone). */
.board-card-taken {
  background: var(--color-base-200);
}

.board-card-taken .board-card-title {
  color: color-mix(in srgb, var(--color-base-content) 82%, transparent);
}

.board-taken-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 1.5rem;
  padding: 0 0.5rem;
  border-radius: 0.375rem;
  background: color-mix(in srgb, var(--color-success) 14%, var(--color-base-100));
  color: color-mix(in srgb, var(--color-success) 70%, var(--color-base-content));
  font-size: 0.75rem;
  font-weight: 600;
}
