/* ═══════════════════════════════════════════════════════════════
   Crosslinked — Stylesheet
   A tool, not a brochure. Information-dense, professional, clean.
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  --font-display: 'Newsreader', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --bg: #F8F7F4;
  --bg-white: #FFFFFF;
  --bg-muted: #F0EFEB;
  --bg-hover: #EAE9E5;

  --text: #1B1B18;
  --text-secondary: #55534E;
  --text-tertiary: #8A8884;

  --border: #E5E4E0;
  --border-strong: #D0CFCB;

  --accent: #1B1B18;
  --accent-inv: #FFFFFF;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);

  --radius: 8px;
  --radius-sm: 5px;

  /* Tag palette */
  --tag-material: #FEF3C7; --tag-material-t: #92400E;
  --tag-technique: #DBEAFE; --tag-technique-t: #1E40AF;
  --tag-sector: #D1FAE5;   --tag-sector-t: #065F46;
  --tag-process: #FDE8EF;  --tag-process-t: #9D174D;
  --tag-salary: #ECFDF5;   --tag-salary-t: #047857;
  --tag-visa: #EDE9FE;     --tag-visa-t: #5B21B6;
  --tag-default: #F3F4F6;  --tag-default-t: #4B5563;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: #D4CFC6;
}

/* ─── HEADER ─── */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.logo__icon { flex-shrink: 0; }

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav__tab {
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}
.nav__tab:hover { color: var(--text); background: var(--bg-muted); }
.nav__tab.is-active { color: var(--text); background: var(--bg-muted); font-weight: 600; }

.nav__link {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: color 0.12s, background 0.12s;
}
.nav__link:hover { color: var(--text); background: var(--bg-muted); }

.nav__cta {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-inv);
  background: var(--accent);
  text-decoration: none;
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  margin-left: 8px;
  transition: opacity 0.12s;
}
.nav__cta:hover { opacity: 0.85; }

.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav__hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

/* ─── TOOLBAR / SEARCH ─── */

.toolbar {
  border-bottom: 1px solid var(--border);
  background: var(--bg-white);
}

.toolbar__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar__left { flex: 1; min-width: 280px; }
.toolbar__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.toolbar__tagline {
  font-family: var(--font-display);
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.sort {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sort__label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.sort__select {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
}
.sort__select:focus { border-color: var(--border-strong); }

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 16px;
  flex: 1;
  max-width: 560px;
  transition: border-color 0.15s;
}
.search:focus-within { border-color: var(--border-strong); }
.search svg { flex-shrink: 0; color: var(--text-tertiary); }

.search__input {
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  width: 100%;
}
.search__input::placeholder { color: var(--text-tertiary); }

.toolbar__meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.toolbar__sep { color: var(--border-strong); }

/* ─── MOBILE FILTER TOGGLE ─── */

.mobile-filter-toggle {
  display: none;
  width: 100%;
  padding: 10px 24px;
  background: var(--bg-white);
  border: none;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
}
.mobile-filter-toggle__badge {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--accent);
  color: var(--accent-inv);
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 6px;
}
.mobile-filter-toggle__badge:empty { display: none; }

/* ─── LAYOUT ─── */

.layout {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 256px 1fr;
  min-height: calc(100vh - 200px);
}

/* ─── FILTERS SIDEBAR ─── */

.filters {
  border-right: 1px solid var(--border);
  padding: 20px 20px 40px;
  overflow-y: auto;
  max-height: calc(100vh - 120px);
  position: sticky;
  top: 54px;
}

.filters__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.filters__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
}

.filters__clear {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.filters__clear:hover { color: var(--text); }

/* Facets */

.facet { margin-bottom: 22px; }

.facet__title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.facet__options { display: flex; flex-direction: column; gap: 1px; }

.facet__option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s;
  font-size: 0.82rem;
}
.facet__option:hover { background: var(--bg-hover); }

.facet__option input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.facet__val {
  flex: 1;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.facet__ct {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.facet__overflow { margin-top: 1px; }

.facet__more {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  margin-top: 4px;
}
.facet__more:hover { color: var(--text); text-decoration: underline; }

/* ─── RESULTS ─── */

.results {
  padding: 20px 24px 48px;
}

/* Active filter chips */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.chips:empty { margin-bottom: 0; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.chip__x {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 0.9rem;
  line-height: 1;
  padding: 0 0 0 2px;
}
.chip__x:hover { color: var(--text); }

/* Job list grid */

.job-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 10px;
}

/* ─── JOB CARD ─── */

@keyframes cardIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.job {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: cardIn 0.2s ease both;
}
.job:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.job__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.job__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.job__meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin-top: 2px;
  line-height: 1.5;
}

.job__sep {
  color: var(--border-strong);
  margin: 0 5px;
}

.job__time {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
}

.job__salary {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: #047857;
}

.job__summary {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Tags */

.tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 3px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.tag--material  { background: var(--tag-material);  color: var(--tag-material-t); }
.tag--technique { background: var(--tag-technique); color: var(--tag-technique-t); }
.tag--sector    { background: var(--tag-sector);    color: var(--tag-sector-t); }
.tag--process   { background: var(--tag-process);   color: var(--tag-process-t); }
.tag--salary    { background: var(--tag-salary);    color: var(--tag-salary-t); }
.tag--visa      { background: var(--tag-visa);      color: var(--tag-visa-t); }
.tag--default   { background: var(--tag-default);   color: var(--tag-default-t); }

.job__apply {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 0;
  border-bottom: 1.5px solid transparent;
  transition: border-color 0.12s;
}
.job__links {
  display: flex;
  gap: 12px;
  align-self: flex-end;
  flex-wrap: wrap;
}

.job:hover .job__apply { border-color: var(--text); }
.job__apply svg { width: 13px; height: 13px; }

/* Freshness badge */
.job__badge {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.job__badge--new {
  background: #ECFDF5;
  color: #047857;
}
.job__badge--aging {
  background: var(--tag-default);
  color: var(--text-tertiary);
}

/* Dim older cards */
.job--aging {
  opacity: 0.7;
}
.job--aging:hover { opacity: 1; }

/* Loading, empty, load-more */

.results__status {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-tertiary);
  font-size: 0.88rem;
}

.results__more {
  display: block;
  margin: 20px auto 0;
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 28px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.results__more:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

/* ─── VIEWS ─── */

.view { display: none; }
.view.is-active { display: block; }

/* ─── INSIGHTS ─── */

.insights {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.insights__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.stat-card__val {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
}

.stat-card__label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.insights__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
}

.insight-panel {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}

.insight-panel__title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
  cursor: pointer;
  padding: 3px 6px;
  margin-left: -6px;
  margin-right: -6px;
  border-radius: var(--radius-sm);
  transition: background 0.1s;
}
.bar-row:hover { background: var(--bg-muted); }

.bar-row__label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  width: 140px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row__track {
  flex: 1;
  height: 7px;
  background: var(--bg-muted);
  border-radius: 4px;
  overflow: hidden;
}

.bar-row__fill {
  height: 100%;
  border-radius: 4px;
  background: var(--border-strong);
  transition: width 0.4s ease;
}

.bar-row__ct {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-tertiary);
  width: 34px;
  text-align: right;
  flex-shrink: 0;
}

/* ─── ALERTS ─── */

.alerts {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 48px;
}

.alerts__inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.alerts__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

.alerts__sub {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.alerts__form {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.alerts__form input {
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--bg);
  width: 220px;
  transition: border-color 0.12s;
}
.alerts__form input:focus { border-color: var(--border-strong); }

.alerts__form button {
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 9px 18px;
  background: var(--accent);
  color: var(--accent-inv);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity 0.12s;
  white-space: nowrap;
}
.alerts__form button:hover { opacity: 0.85; }

/* ─── FOOTER ─── */

.footer {
  padding: 28px 24px;
}

.footer__inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer__tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.footer__links {
  display: flex;
  gap: 16px;
}

.footer__links a {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-decoration: none;
}
.footer__links a:hover { text-decoration: underline; }

.footer__copy {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

/* ─── RESPONSIVE ─── */

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .filters.is-open { display: block; }

  .mobile-filter-toggle { display: block; }

  .job-list {
    grid-template-columns: 1fr;
  }

  .nav { display: none; }
  .nav.is-open {
    display: flex;
    position: absolute;
    top: 54px;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    flex-direction: column;
    gap: 4px;
    z-index: 99;
  }
  .nav.is-open .nav__tab,
  .nav.is-open .nav__link { text-align: left; }
  .nav.is-open .nav__cta { align-self: flex-start; margin-left: 0; }

  .nav__hamburger { display: flex; }
}

@media (max-width: 600px) {
  .toolbar__inner {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar__left { min-width: 0; }
  .toolbar__right { align-items: stretch; }
  .search { max-width: none; }
  .toolbar__meta { justify-content: center; }
  .sort { justify-content: center; }

  .insights__grid { grid-template-columns: 1fr; }
  .insights__stats { grid-template-columns: repeat(2, 1fr); }

  .alerts__inner {
    flex-direction: column;
    text-align: center;
  }
  .alerts__form { width: 100%; }
  .alerts__form input { flex: 1; width: auto; }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }
}
