/* Cayman Jobs
   Palette and structure borrow from Admiralty nautical charts of the Cayman Bank:
   harbour-navy ink on pale sea-glass paper, with chart magenta -- the colour charts
   reserve for lights, buoys and cautions -- carrying every deadline signal on the page. */

:root {
  --ink:       #102A38;
  --ink-2:     #4A6675;
  --ink-3:     #7C939E;
  --paper:     #E6EBE9;
  --surface:   #FBFCFB;
  --chart:     #B03A6E;
  --chart-dim: #F2E3EA;
  --sea:       #2F7D6E;
  --sand:      #A8801C;
  --line:      rgba(16, 42, 56, 0.14);
  --line-soft: rgba(16, 42, 56, 0.08);

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body:    "Public Sans", ui-sans-serif, system-ui, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --rail: 15.5rem;
  --gut: clamp(1rem, 3vw, 2.25rem);
}

* { box-sizing: border-box; }

/* Class-level `display` beats the [hidden] UA rule, so state the intent once here rather
   than remembering to guard every component that toggles visibility. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: var(--chart); text-underline-offset: 2px; }

.wrap { width: min(1180px, 100% - (var(--gut) * 2)); margin-inline: auto; }

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

:where(a, button, input, select, summary):focus-visible {
  outline: 2px solid var(--chart);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- masthead ---------- */

.masthead {
  background: var(--ink);
  color: var(--paper);
  padding-block: clamp(1.5rem, 4vw, 2.75rem) clamp(1.5rem, 3vw, 2rem);
  /* Depth-sounding dots, the numbers scattered across a chart's water. */
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.07) 1px, transparent 0);
  background-size: 22px 22px;
}

.brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.4rem; }

.brand-mark {
  width: .95rem; height: .95rem; border-radius: 50%;
  background: var(--chart);
  box-shadow: 0 0 0 4px rgba(176, 58, 110, .22);
}

.brand-name {
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.masthead-lede {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.5rem, 4.2vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  max-width: 20ch;
  margin: 0 0 .7rem;
}

/* The live count sits on its own line: mono figures set inside the display sentence made
   the two faces fight and broke the line in the wrong place. */
.masthead-count {
  font-family: var(--mono);
  font-size: .82rem;
  letter-spacing: .04em;
  color: rgba(230, 235, 233, .62);
  margin: 0 0 1.5rem;
}

.lede-count { color: var(--chart); font-weight: 600; font-size: 1.05rem; }

.searchbar { position: relative; max-width: 44rem; }

.searchbar input {
  width: 100%;
  padding: .95rem 2.75rem .95rem 1.1rem;
  font-family: var(--body);
  font-size: 1.02rem;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(0,0,0,.2);
}

.searchbar input::placeholder { color: var(--ink-3); }

.search-clear {
  position: absolute; right: .45rem; top: 50%; transform: translateY(-50%);
  width: 1.9rem; height: 1.9rem;
  display: grid; place-items: center;
  font-size: 1.3rem; line-height: 1;
  color: var(--ink-2); background: none; border: 0; cursor: pointer;
}

.search-clear:hover { color: var(--chart); }

.quickchips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

.chip {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .04em;
  color: var(--paper);
  padding: .38rem .7rem;
  background: transparent;
  border: 1px solid rgba(230, 235, 233, .3);
  border-radius: 100px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.chip:hover { border-color: var(--paper); }

.chip[aria-pressed="true"] {
  background: var(--chart);
  border-color: var(--chart);
  color: #fff;
}

/* ---------- layout ---------- */

.layout {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  padding-block: clamp(1.75rem, 4vw, 2.75rem) 4rem;
}

/* ---------- filter rail ---------- */

.rail { position: sticky; top: 1.25rem; }

/* Above the breakpoint the disclosure is always open and its summary is redundant, so the
   heading role passes to .rail-head instead. */
.rail-summary { display: none; }

.rail-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--ink);
}

.rail-title {
  font-family: var(--mono); font-size: .74rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
}

.linkbtn {
  font-family: var(--body); font-size: .82rem;
  color: var(--chart); background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}

.fset { border: 0; border-bottom: 1px solid var(--line-soft); margin: 0; padding: 1rem 0; }

.fset legend {
  font-family: var(--mono); font-size: .7rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2);
  padding: 0; margin-bottom: .5rem;
}

.row {
  display: flex; align-items: center; gap: .55rem;
  padding: .2rem 0; font-size: .9rem; cursor: pointer;
}

.row input { accent-color: var(--chart); margin: 0; flex: none; }

.row:hover span { color: var(--chart); }

/* Fifteen districts is more than the rail should show at full height, so the list scrolls
   within itself rather than pushing every other filter off the screen. */
.loclist { max-height: 13.5rem; overflow-y: auto; margin-right: -.35rem; padding-right: .35rem; }

.row-loc { gap: .45rem; }

.loccount {
  margin-left: auto;
  font-family: var(--mono); font-style: normal;
  font-size: .7rem; color: var(--ink-3);
}

.row-loc:hover .loccount { color: var(--chart); }

.fact-loc { color: var(--sea); font-weight: 500; }

.tag-wt { color: #fff; background: var(--ink-2); }

.fullselect {
  width: 100%;
  font-family: var(--body); font-size: .85rem;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 2px;
  padding: .4rem .5rem;
  cursor: pointer;
}

.salaryrow { display: flex; align-items: center; gap: .4rem; }

.salaryrow input {
  flex: 1; min-width: 0;
  font-family: var(--mono); font-size: .9rem;
  padding: .4rem .5rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
}

.unit { font-family: var(--mono); font-size: .72rem; color: var(--ink-3); }

.hint { font-size: .74rem; line-height: 1.4; color: var(--ink-3); margin: .5rem 0 0; }

/* ---------- results ---------- */

.ledger-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--ink);
}

.count { font-family: var(--mono); font-size: .8rem; font-weight: 500; margin: 0; }

.sortwrap select {
  font-family: var(--body); font-size: .85rem;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 2px;
  padding: .35rem 1.6rem .35rem .55rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%234A6675' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .5rem center;
  background-size: .6rem;
}

.ledger { list-style: none; margin: 0; padding: 0; }

/* The deadline gutter: every listing is anchored by the time left to apply. */
.job {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 0 1.1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.job-when {
  font-family: var(--mono);
  font-size: .95rem;
  font-weight: 600;
  text-align: right;
  color: var(--ink-2);
  padding-right: .9rem;
  border-right: 2px solid var(--line);
  line-height: 1.3;
}

.job-when small {
  display: block;
  font-size: .62rem; font-weight: 400; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3);
}

.job.is-urgent .job-when { color: var(--chart); border-right-color: var(--chart); border-right-width: 4px; }
.job.is-urgent .job-when small { color: var(--chart); }
.job.is-closed .job-when { color: var(--ink-3); }

.job-title {
  font-family: var(--display);
  font-size: 1.12rem; font-weight: 600; letter-spacing: -0.01em;
  line-height: 1.25; margin: 0 0 .12rem;
}

.job-employer { font-size: .88rem; color: var(--ink-2); margin: 0 0 .5rem; }

.job-facts { display: flex; flex-wrap: wrap; gap: .3rem .95rem; font-family: var(--mono); font-size: .78rem; }

.fact { color: var(--ink-2); white-space: nowrap; }
.fact-pay { color: var(--ink); font-weight: 500; }

.job-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }

.tag {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .05em;
  padding: .17rem .45rem; border-radius: 2px;
  color: var(--ink-2); background: rgba(16,42,56,.06);
}

.tag-new { color: #fff; background: var(--sea); }
.tag-multi { color: #fff; background: var(--sand); }

.job-meta {
  display: flex; flex-wrap: wrap; gap: .2rem .9rem;
  margin-top: .5rem;
  font-family: var(--mono); font-size: .72rem;
  color: var(--ink-2);
}

.job-meta em {
  font-style: normal;
  color: var(--ink-3);
  letter-spacing: .04em;
}

.job details { margin-top: .6rem; }

.job summary {
  font-size: .82rem; color: var(--chart); cursor: pointer;
  width: fit-content; list-style: none;
}

.job summary::-webkit-details-marker { display: none; }
.job summary::after { content: " ↓"; }
.job details[open] summary::after { content: " ↑"; }

.job-desc {
  margin: .6rem 0 0;
  padding: .85rem 1rem;
  font-size: .88rem;
  white-space: pre-wrap;
  background: var(--surface);
  border-left: 2px solid var(--chart-dim);
  border-radius: 0 2px 2px 0;
}

/* ---------- states ---------- */

.empty { padding: 3rem 0; text-align: center; }
.empty h3 { font-family: var(--display); font-size: 1.2rem; margin: 0 0 .4rem; }
.empty p { color: var(--ink-2); margin: 0 0 1rem; }

.btn {
  font-family: var(--body); font-size: .88rem;
  color: var(--paper); background: var(--ink);
  border: 0; border-radius: 2px; padding: .55rem 1.1rem; cursor: pointer;
}

.btn:hover { background: var(--chart); }

.more { display: block; margin: 1.75rem auto 0; }

.skeleton { height: 5.4rem; border-bottom: 1px solid var(--line-soft); }

.skeleton::after {
  content: ""; display: block; height: 1rem; width: 40%;
  margin-top: 1.5rem; border-radius: 2px;
  background: linear-gradient(90deg, var(--line-soft), rgba(16,42,56,.14), var(--line-soft));
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}

@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--line);
  padding-block: 1.75rem 3rem;
  font-size: .82rem;
  color: var(--ink-2);
}

.foot p { margin: 0 0 .35rem; max-width: 60ch; }
.foot-meta { font-family: var(--mono); font-size: .72rem; color: var(--ink-3); }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; }

  .rail-summary {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem .9rem;
    font-family: var(--mono);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 2px;
    cursor: pointer;
    list-style: none;
  }

  .rail-summary::-webkit-details-marker { display: none; }
  .rail-summary::after { content: "+"; margin-left: auto; font-size: 1.1rem; }
  .rail[open] .rail-summary::after { content: "–"; }

  .rail-active {
    font-size: .7rem; letter-spacing: .04em;
    padding: .1rem .4rem; border-radius: 100px;
    color: #fff; background: var(--chart);
  }

  .rail[open] .rail-summary { margin-bottom: .75rem; }
  .job { grid-template-columns: 3.4rem minmax(0, 1fr); gap: 0 .8rem; }
  .job-when { font-size: .85rem; padding-right: .6rem; }
}

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