/* ══════════════════════════════════════════════════════════════════════
   Job Browser — Warm Editorial Theme
   Libre Baskerville (serif display) + Source Sans 3 (body)
   ══════════════════════════════════════════════════════════════════════ */

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

:root {
  --bg:          #f6f3ee;
  --bg-card:     #ffffff;
  --bg-hover:    #fdfcfa;
  --bg-input:    #ffffff;
  --bg-tag:      #f0ece5;
  --border:      #e2ddd4;
  --border-focus: #b8a88a;

  --text:        #2c2824;
  --text-body:   #4a433c;
  --text-dim:    #8a8078;
  --text-muted:  #b5ad9f;

  --accent:      #c4653a;
  --accent-soft: rgba(196, 101, 58, 0.08);

  --green:       #4a8c5c;
  --green-bg:    rgba(74, 140, 92, 0.09);
  --blue:        #4a6fa5;
  --blue-bg:     rgba(74, 111, 165, 0.09);

  --radius:      8px;
  --radius-sm:   5px;
  --radius-lg:   12px;
  --shadow-sm:   0 1px 3px rgba(44, 40, 36, 0.06);
  --shadow-lg:   0 12px 48px rgba(44, 40, 36, 0.14);

  --serif:       'Libre Baskerville', Georgia, serif;
  --sans:        'Source Sans 3', 'Segoe UI', sans-serif;
  --mono:        'IBM Plex Mono', Consolas, monospace;
}

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.65;
  min-height: 100vh;
}

/* ── Header ────────────────────────────────────────────────────────── */

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

.header-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0.9rem 2rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.logo {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  text-decoration: none;
}

.logo-mark {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  position: relative;
  top: -1px;
}

.header-stats {
  display: flex;
  gap: 2rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.stat-item { display: flex; align-items: baseline; gap: 0.3rem; }
.stat-num { font-family: var(--mono); font-weight: 500; color: var(--text); }

/* ── Main ──────────────────────────────────────────────────────────── */

.main { max-width: 1060px; margin: 0 auto; padding: 1.8rem 2rem; }

/* ── Search ────────────────────────────────────────────────────────── */

.search-box { position: relative; margin-bottom: 1.2rem; }

.search-icon {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-muted);
}

.search-box input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem 0.75rem 2.6rem;
  font-family: var(--sans);
  font-size: 0.93rem;
  color: var(--text);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-box input::placeholder { color: var(--text-muted); }

/* ── Filters ───────────────────────────────────────────────────────── */

.filters { margin-bottom: 1.8rem; }

.filter-row {
  display: flex; gap: 2.5rem; flex-wrap: wrap; align-items: flex-start;
}

.filter-group label {
  display: block; font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-dim); margin-bottom: 0.4rem;
}

.btn-group { display: flex; gap: 0.3rem; }

.btn {
  font-family: var(--sans); font-size: 0.78rem; font-weight: 500;
  padding: 0.32rem 0.75rem; border-radius: 99px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-dim); cursor: pointer; transition: all 0.15s;
}

.btn:hover { border-color: var(--border-focus); color: var(--text-body); }
.btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.site-chips { display: flex; gap: 0.3rem; flex-wrap: wrap; }

.chip {
  font-family: var(--sans); font-size: 0.76rem; font-weight: 500;
  padding: 0.28rem 0.65rem; border-radius: 99px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-dim); cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; gap: 0.35rem;
}

.chip:hover { border-color: var(--border-focus); color: var(--text-body); }
.chip.active { background: var(--text); border-color: var(--text); color: #fff; }

.chip-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ── Results ───────────────────────────────────────────────────────── */

.results-header {
  font-size: 0.78rem; color: var(--text-dim);
  margin-bottom: 0.6rem; font-weight: 500;
}

.job-list {
  display: flex; flex-direction: column; gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.job-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.85rem 1.1rem;
  background: var(--bg-card);
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  transition: background 0.12s;
}

.job-row:hover { background: var(--bg-hover); }

.site-badge {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-weight: 700; color: #fff;
  letter-spacing: 0.03em; flex-shrink: 0;
}

.job-info { min-width: 0; }

.job-title {
  font-family: var(--serif); font-weight: 700; font-size: 0.92rem;
  line-height: 1.35; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color 0.12s;
}

.job-row:hover .job-title { color: var(--accent); }

.job-meta {
  display: flex; gap: 0.75rem;
  font-size: 0.72rem; color: var(--text-dim); margin-top: 0.15rem;
}

.job-badges { display: flex; gap: 0.3rem; flex-shrink: 0; }

.badge {
  font-size: 0.6rem; font-weight: 700; padding: 0.18rem 0.5rem;
  border-radius: 99px; letter-spacing: 0.04em; text-transform: uppercase;
}

.badge-analysed { background: var(--green-bg); color: var(--green); }
.badge-new { background: var(--blue-bg); color: var(--blue); }

/* ── Pagination ────────────────────────────────────────────────────── */

.pagination {
  display: flex; justify-content: center; gap: 0.2rem;
  margin-top: 1.8rem; padding-bottom: 2rem;
}

.page-btn {
  font-family: var(--mono); font-size: 0.76rem;
  padding: 0.38rem 0.6rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent;
  color: var(--text-dim); cursor: pointer; transition: all 0.12s;
  min-width: 32px; text-align: center;
}

.page-btn:hover { background: var(--bg-card); border-color: var(--border); color: var(--text); }
.page-btn.active { background: var(--text); color: #fff; border-color: var(--text); }
.page-btn:disabled { opacity: 0.25; cursor: default; pointer-events: none; }

/* ── Detail page ───────────────────────────────────────────────────── */

.detail-page { padding-top: 1.4rem; padding-bottom: 3rem; }

.back-link {
  display: inline-flex; align-items: center; gap: 0.45rem;
  color: var(--accent); text-decoration: none;
  font-size: 0.82rem; font-weight: 600; margin-bottom: 1rem;
}

.back-link:hover { text-decoration: underline; }

.detail-shell {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.6rem;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1.4rem;
}

.detail-main { min-width: 0; }

.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-header {
  display: flex; gap: 1rem; align-items: flex-start;
  margin-bottom: 1.8rem; padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--border);
}

.detail-badge {
  width: 42px; height: 42px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #fff; flex-shrink: 0;
  background: var(--text-dim);
}

.site-theme--need-staffing { background: #2563eb; }
.site-theme--hero-interim-professionals { background: #dc2626; }
.site-theme--staffinghouse { background: #059669; }
.site-theme--synprofs { background: #7c3aed; }
.site-theme--ncim-jobs { background: #0891b2; }
.site-theme--fixedtoday { background: #d97706; }
.site-theme--circle8 { background: #be185d; }
.site-theme--flextender { background: #4f46e5; }
.site-theme--default { background: #6b7280; }

.detail-title-area { flex: 1; min-width: 0; }

.detail-title {
  font-family: var(--serif); font-size: 1.3rem; font-weight: 700;
  line-height: 1.3; color: var(--text); margin-bottom: 0.45rem;
}

.detail-meta {
  display: flex; gap: 1rem; flex-wrap: wrap;
  font-size: 0.76rem; color: var(--text-dim);
}

.detail-link {
  display: inline-flex; align-items: center; gap: 0.25rem;
  color: var(--accent); text-decoration: none;
  font-size: 0.8rem; font-weight: 600; margin-top: 0.55rem;
}

.detail-link:hover { text-decoration: underline; }

.meta-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.meta-card h3 {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.8rem;
}

.meta-list {
  display: grid;
  gap: 0.7rem;
}

.meta-item-label {
  font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 0.12rem;
}

.meta-item-value {
  color: var(--text);
  font-size: 0.88rem;
  word-break: break-word;
}

.detail-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.detail-note {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  color: var(--text-body);
  font-size: 0.86rem;
}

.analysis-section { margin-bottom: 1.8rem; }

.analysis-section h3 {
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-dim); margin-bottom: 0.7rem;
  padding-bottom: 0.45rem; border-bottom: 1px solid var(--border);
}

.analysis-sections {
  display: grid;
  gap: 1rem;
}

.analysis-subsection {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(240, 236, 229, 0.35));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.95rem;
}

.analysis-subtitle {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.55rem;
}

.analysis-field {
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  grid-column: span 4;
}

.analysis-field--wide { grid-column: span 6; }
.analysis-field--full { grid-column: 1 / -1; }

.analysis-label {
  font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); margin-bottom: 0.2rem;
}

.analysis-value { font-size: 0.86rem; color: var(--text); word-break: break-word; }
.analysis-value ul { padding-left: 1rem; margin: 0.1rem 0 0; }
.analysis-value li { font-size: 0.8rem; margin-bottom: 0.1rem; color: var(--text-body); }

.raw-text {
  background: var(--bg); border-radius: var(--radius);
  padding: 1.1rem; font-size: 0.8rem; line-height: 1.7;
  color: var(--text-body); white-space: pre-wrap;
  max-height: 420px; overflow-y: auto;
}

.raw-text::-webkit-scrollbar { width: 5px; }
.raw-text::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.loading, .empty-state {
  text-align: center; padding: 3rem 1.5rem;
  color: var(--text-dim); font-size: 0.9rem;
}

.empty-state-icon { font-size: 1.8rem; margin-bottom: 0.5rem; opacity: 0.4; }

/* ── Responsive ────────────────────────────────────────────────────── */

@media (max-width: 700px) {
  .header-inner { padding: 0.8rem 1.2rem; }
  .main { padding: 1.2rem; }
  .filter-row { flex-direction: column; gap: 0.8rem; }
  .job-row { grid-template-columns: 36px 1fr; gap: 0.7rem; padding: 0.75rem 0.9rem; }
  .job-badges { display: none; }
  .header-stats { display: none; }
  .detail-header { flex-direction: column; }
  .detail-shell { padding: 1.2rem; }
  .detail-layout { grid-template-columns: 1fr; }
  .analysis-grid { grid-template-columns: 1fr; }
  .analysis-field,
  .analysis-field--wide,
  .analysis-field--full { grid-column: auto; }
}
