/* The job board on the office's pages: a listing as the public reads it
   (job_board/_listing), the task lines of the posting and edit forms, and
   the contact details ContactScrubber found, marked in the typed text. */

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

/* The listing on the preview before posting: a dashed frame with a
   "Preview" tab (data-label), so it never reads as the posted listing. */
.board-preview-frame {
  position: relative;
  margin-top: 0.75rem;
  padding: 1.5rem 1rem 1rem;
  border: 2px dashed color-mix(in srgb, var(--color-warning) 70%, transparent);
  border-radius: 0.5rem;
}

.board-preview-frame::before {
  content: attr(data-label);
  position: absolute;
  top: -0.75rem;
  left: 0.75rem;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  background: var(--color-warning);
  color: var(--color-warning-content);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.board-task-line {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
}

.board-task-line > label {
  min-height: 2rem;
}

.board-finding-text {
  color: var(--color-error);
  overflow-wrap: anywhere;
}

.board-finding {
  padding: 0 0.125rem;
  border-radius: 0.25rem;
  background: color-mix(in srgb, var(--color-error) 18%, transparent);
  color: inherit;
  font-weight: 600;
}

/* The non-solicit agreement: a checkbox beside its wording. */
.board-agreement {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

/* One request on the poster's offer, and one on the asking company's
   Requests tab. */
.board-request-row {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.75rem 0;
  min-width: 0;
}

@media (min-width: 640px) {
  .board-request-row {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}

/* A public question on a listing, with the poster's answer set off under
   it; a hidden one (only the poster sees it) is greyed. */
.board-question {
  display: grid;
  gap: 0.375rem;
  padding: 0.75rem 0;
  min-width: 0;
}

.board-question-hidden {
  opacity: 0.6;
}

.board-answer {
  display: grid;
  gap: 0.25rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-field, 0.5rem);
  background: var(--color-base-200);
}

/* One job board thread in a list: the other business, the listing and the
   last message, with when on the right. */
.board-thread-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.5rem;
  min-width: 0;
  border-radius: var(--radius-field, 0.5rem);
}

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

.board-thread-unread {
  background: color-mix(in srgb, var(--color-warning) 6%, transparent);
}

/* Small words around the filters: a field's label, a hint under it, and
   the note when there is no company address or place to measure from. */
.board-filter-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--color-base-content) 70%, transparent);
}

.board-filter-hint {
  font-size: 0.75rem;
  line-height: 1.35;
  color: color-mix(in srgb, var(--color-base-content) 65%, transparent);
}

.board-filter-note {
  display: flex;
  align-items: flex-start;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: color-mix(in srgb, var(--color-base-content) 75%, transparent);
}

/* The board's map and a listing's own: one-mile circles around fuzzed
   points, a status line (loading failed, nothing to show, more than the
   map shows) and the note on what a circle means. */
.board-map-wrap {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}

.board-map {
  width: 100%;
  height: min(32rem, 65vh);
  min-height: 18rem;
  border: 1px solid var(--color-base-300);
  border-radius: var(--radius-box, 0.75rem);
  overflow: hidden;
  z-index: 0;
}

.board-map-small {
  height: 16rem;
  min-height: 12rem;
}

.board-map-status:empty {
  display: none;
}

.board-map-status {
  font-size: 0.875rem;
  color: color-mix(in srgb, var(--color-base-content) 75%, transparent);
}

/* Each type of work's tone: the circles and the legend's swatches read
   the same custom property. Tone 8 is Other. The stroke stays solid so a
   circle has an outline whatever its color. */
.board-map-wrap {
  --board-tone-0: var(--color-primary);
  --board-tone-1: #d97706;
  --board-tone-2: #2563eb;
  --board-tone-3: #c026d3;
  --board-tone-4: #dc2626;
  --board-tone-5: #7c3aed;
  --board-tone-6: #65a30d;
  --board-tone-7: #92400e;
  --board-tone-8: #475569;
}

.board-map-tone-0 { --board-tone: var(--board-tone-0); }
.board-map-tone-1 { --board-tone: var(--board-tone-1); }
.board-map-tone-2 { --board-tone: var(--board-tone-2); }
.board-map-tone-3 { --board-tone: var(--board-tone-3); }
.board-map-tone-4 { --board-tone: var(--board-tone-4); }
.board-map-tone-5 { --board-tone: var(--board-tone-5); }
.board-map-tone-6 { --board-tone: var(--board-tone-6); }
.board-map-tone-7 { --board-tone: var(--board-tone-7); }
.board-map-tone-8 { --board-tone: var(--board-tone-8); }

.board-map-circle {
  stroke: var(--board-tone, var(--color-primary));
  fill: var(--board-tone, var(--color-primary));
  cursor: pointer;
}

/* A Near search's radius ring: dashed, under everything, never clickable. */
.board-map-ring {
  stroke: var(--color-secondary);
  fill: var(--color-secondary);
}

/* Pins: the visitor's position, the company address, a Place; the one
   the search measures from wears a ring. */
.board-map-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-base-100);
  border-radius: 9999px;
  color: #ffffff;
  box-shadow: 0 1px 4px rgb(15 23 42 / 0.45);
  cursor: pointer;
}

.board-map-pin svg {
  width: 1rem;
  height: 1rem;
  color: #ffffff;
  fill: currentColor;
}

.board-map-pin-position { background: #2563eb; }
.board-map-pin-company { background: var(--color-secondary); }
.board-map-pin-place { background: var(--color-accent); }

.board-map-pin-selected {
  outline: 3px solid var(--color-primary);
  outline-offset: 1px;
}

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

/* The map's own buttons (Expand map, Center, Fit all jobs, Legend). */
.board-map-control-button {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.25rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--color-base-300);
  border-radius: 0.5rem;
  background: var(--color-base-100);
  color: var(--color-base-content);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.18);
  cursor: pointer;
}

/* Leaflet's own stylesheet loads later and gives its controls cursor: auto. */
.leaflet-container .board-map-control-button,
.leaflet-container .board-map-legend-row {
  cursor: pointer;
}

.board-map-control-button:hover {
  background: var(--color-base-200);
}

.board-map-control-button:focus-visible,
.board-map-legend-check:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.board-map-control-button[hidden],
.board-map-legend [hidden] {
  display: none;
}

.board-map-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Center and Fit all jobs live in the full-screen map; Expand map outside it. */
.board-map:not(.board-map-full) .board-map-tools-control,
.board-map-full .board-map-expand {
  display: none;
}

/* The legend: a card in the map's corner, its button alone on a phone
   until opened. */
.board-map-legend {
  display: grid;
  justify-items: end;
  gap: 0.375rem;
  max-width: min(16rem, calc(100vw - 5rem));
}

.board-map-legend-panel {
  display: grid;
  gap: 0.5rem;
  width: 100%;
  max-height: min(22rem, 55vh);
  overflow-y: auto;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--color-base-300);
  border-radius: 0.75rem;
  background: var(--color-base-100);
  color: var(--color-base-content);
  box-shadow: 0 2px 8px rgb(15 23 42 / 0.18);
}

.board-map-legend-group {
  display: grid;
  gap: 0.125rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.board-map-legend-heading {
  padding: 0 0 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-base-content) 70%, transparent);
}

.board-map-legend-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.75rem;
  font-size: 0.8125rem;
  cursor: pointer;
}

.board-map-legend-check {
  cursor: pointer;
}

.board-map-legend-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.board-map-legend-hint {
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}

.board-map-legend-count {
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--color-base-content) 70%, transparent);
}

.board-map-swatch {
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  border: 2px solid var(--board-tone);
  border-radius: 9999px;
  background: color-mix(in srgb, var(--board-tone) 35%, transparent);
}

.board-map-swatch-pin {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 9999px;
  color: #ffffff;
}

.board-map-swatch-pin svg {
  width: 0.6875rem;
  height: 0.6875rem;
  color: #ffffff;
  fill: currentColor;
}

/* Expand map: the same map in a full-screen dialog (iOS Safari too). */
.board-map-frame {
  position: relative;
  min-width: 0;
}

.board-map-dialog {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--color-base-100);
  color: var(--color-base-content);
}

.board-map-dialog[open] {
  display: flex;
  flex-direction: column;
}

/* The page behind the full-screen map stays put. */
html:has(.board-map-dialog[open]) {
  overflow: hidden;
}

.board-map-dialog::backdrop {
  background: rgb(15 23 42 / 0.6);
}

.board-map-dialog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(0.5rem + env(safe-area-inset-top)) calc(1rem + env(safe-area-inset-right)) 0.5rem calc(1rem + env(safe-area-inset-left));
  border-bottom: 1px solid var(--color-base-300);
}

.board-map-dialog-title {
  font-size: 1rem;
  font-weight: 700;
}

.board-map-button {
  cursor: pointer;
}

.board-map-dialog-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.board-map-dialog .board-map.board-map-full {
  flex: 1;
  height: auto;
  min-height: 0;
  border: 0;
  border-radius: 0;
}

.board-map-popup {
  display: grid;
  gap: 0.125rem;
  min-width: 10rem;
  max-width: 16rem;
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.board-map-popup-title {
  font-size: 0.875rem;
}

.board-map-popup-link {
  margin-top: 0.25rem;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
}

/* One job board alert on Job board > Alerts. */
.board-alert-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 0;
  min-width: 0;
}

/* Its buttons: ghost buttons need no gap of their own to stay apart. */
.board-alert-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.board-alert-row + .board-alert-row {
  border-top: 1px solid var(--color-base-200);
}

.board-alert-trades {
  display: grid;
  gap: 0.25rem 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr));
}

/* A board message hidden for review: both sides read the placeholder. */
.board-message-hidden {
  background-color: var(--color-base-200);
  color: color-mix(in oklab, var(--color-base-content) 60%, transparent);
  font-style: italic;
}

/* The public job board (signed out, the marketing layout): the board's own
   cards and filters inside the marketing page's container. */
.board-public-container {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

.board-public-narrow {
  max-width: 48rem;
}

.board-public-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
}

.board-public-title-sm {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.board-public-lead {
  font-size: 1.0625rem;
  color: color-mix(in srgb, var(--color-base-content) 78%, transparent);
}

.board-public-muted {
  color: color-mix(in srgb, var(--color-base-content) 72%, transparent);
}

.board-public-note {
  display: grid;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-box, 0.75rem);
  background: var(--color-base-200);
  font-size: 0.9375rem;
}

.board-public-note h2 {
  font-size: 1.0625rem;
  font-weight: 600;
}

.board-public-note ul {
  list-style: disc;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.25rem;
}

/* The job board is still being tested: a "Beta" pill beside each board
   heading (shared/_beta_badge), with Report an issue next to it. The pill
   alone sits on the sidebar's Job board entry (.beta-badge-sm). */
.beta-note {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.beta-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.0625rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--color-warning) 60%, transparent);
  border-radius: 9999px;
  background: color-mix(in srgb, var(--color-warning) 18%, transparent);
  color: var(--color-base-content);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.25rem;
  white-space: nowrap;
}

.beta-badge-sm {
  color: inherit;
  padding: 0 0.375rem;
  font-size: 0.625rem;
  line-height: 1rem;
}

.beta-report-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: color-mix(in srgb, var(--color-base-content) 70%, transparent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.beta-report-link:hover {
  color: var(--color-base-content);
}
