/* MÉTIER — outil de recherche d'emploi, mise en page liste + volet de détail.
   Fond gris clair, surfaces blanches, une couleur d'accent : la sarcelle du logo. */

:root {
  --bg: #f3f2f0;
  --surface: #ffffff;
  --hover: #f0efed;
  --ink: #1f2328;
  --ink-2: #4b5159;
  --ink-3: #6b7178;
  --line: #e1dfdb;
  --line-strong: #c9c6c0;
  --accent: #0b7a7c;
  --accent-dark: #075f61;
  --accent-tint: #dcefef;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: var(--accent); }
svg { flex-shrink: 0; }
code { font-size: 0.92em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 24px; } }
.narrow { max-width: 820px; }
.muted { color: var(--ink-3); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 10; padding: 8px 12px; background: var(--ink); color: #fff; }
.skip-link:focus { top: 8px; }

/* ---------- Boutons ---------- */

.fav-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 8px; background: none;
  color: var(--ink-3); cursor: pointer;
}
.fav-btn:hover { background: var(--hover); color: var(--ink); }
.fav-btn.is-saved { color: var(--accent); }
.bm-icon { width: 20px; height: 20px; }
.fav-form { margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: auto; height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 8px;
  font: 600 15px var(--font);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 120ms ease-out, border-color 120ms ease-out;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { background: var(--hover); color: var(--ink); }
.btn-outline.is-saved { border-color: var(--accent); color: var(--accent); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; height: 46px; }

/* ---------- En-tête ---------- */

.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 12px 24px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: #2b3a4a; text-decoration: none; font-weight: 600; font-size: 22px; letter-spacing: 0.06em; }
.logo { width: 66px; height: 22px; }
.topbar-spacer { flex: 1; }
.topbar-nav { display: flex; align-items: center; gap: 16px; }
.nav-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.nav-link:hover { color: var(--accent); }
.nav-link .bm-icon { width: 18px; height: 18px; }
.nav-muted { color: var(--ink-2); font-weight: 500; }
.count { color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.count::before { content: "("; } .count::after { content: ")"; }

@media (max-width: 479px) {
  .brand span { display: none; }  /* le logo seul suffit sur petit écran */
  .topbar-nav { gap: 12px; }
}

.notice { padding: 10px 16px; background: #fff7e0; border-bottom: 1px solid var(--line); text-align: center; font-size: 14px; }

/* ---------- Barre de recherche « Quoi / Où » ---------- */

.searchbar {
  display: flex; align-items: center;
  max-width: 760px;
  background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.searchbar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.sb-field { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 0 12px; }
.sb-where { flex: 0 0 230px; border-left: 1px solid var(--line); }
.sb-icon { display: flex; color: var(--ink-3); }
.sb-icon svg { width: 18px; height: 18px; }
.sb-field input, .sb-field select {
  width: 100%; height: 44px; padding: 0;
  border: 0; outline: none; background: transparent;
  color: var(--ink); font: 15px var(--font);
}
.searchbar .btn { margin: 4px; }
.searchbar--big { max-width: 860px; }

/* Variante de la maquette : deux champs et un bouton séparés, sur une ligne à part. */
.searchrow { padding-top: 20px; }
.searchbar--split {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 220px; gap: 16px;
  max-width: none; background: none; border: 0; box-shadow: none;
}
.searchbar--split:focus-within { box-shadow: none; }
.searchbar--split .sb-field { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 14px; }
.searchbar--split .sb-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.searchbar--split .sb-where { flex-basis: auto; border-left: 1px solid var(--line-strong); }
.searchbar--split .sb-field input, .searchbar--split .sb-field select { height: 48px; }
.searchbar--split .sb-where .sb-icon { color: var(--accent); }
.searchbar--split .btn { margin: 0; height: 50px; border-radius: 6px; }
.searchbar--big .sb-field input, .searchbar--big .sb-field select { height: 54px; font-size: 16px; }
.searchbar--big .btn { height: 46px; padding: 0 22px; }

@media (max-width: 719px) {
  .searchbar--split { grid-template-columns: 1fr; gap: 8px; }
  .searchbar { flex-direction: column; align-items: stretch; }
  .sb-where { flex-basis: auto; border-left: 0; border-top: 1px solid var(--line); }
  .searchbar .btn { margin: 0 6px 6px; }
  .searchbar--split .btn { margin: 0; }
  .searchbar--split .sb-where { border-top: 1px solid var(--line-strong); }
}

/* ---------- Accueil ---------- */

.hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 44px 0 36px; }
.hero-title { font-size: clamp(26px, 3.6vw, 36px); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; max-width: 26ch; margin-bottom: 20px; text-wrap: balance; }
.hero-sub { margin-top: 14px; color: var(--ink-2); }
.hero-sub a { font-weight: 600; text-decoration: none; }
.hero-sub a:hover { text-decoration: underline; }

.home { display: grid; gap: 40px; padding-top: 32px; }
@media (min-width: 960px) { .home { grid-template-columns: minmax(0, 1fr) 340px; } }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.section-head a { font-weight: 600; text-decoration: none; }
.section-head a:hover { text-decoration: underline; }
.h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 12px; }
.h3 { font-size: 14px; font-weight: 600; color: var(--ink-2); margin: 16px 0 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink); text-decoration: none; font-size: 14px;
}
.chip:hover { border-color: var(--ink-3); }
.chip-n { color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- Cartes d'offre ---------- */

.cards { display: grid; gap: 10px; }
.card {
  position: relative;
  display: flex; gap: 12px;
  padding: 14px 16px 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 6px;
  transition: border-color 120ms ease-out, box-shadow 120ms ease-out;
}
.card:hover { border-color: var(--line-strong); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); }
.card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card-main { flex: 1; min-width: 0; padding-right: 36px; }
.card .fav-form { position: absolute; top: 10px; right: 10px; z-index: 1; }
.card-title { color: var(--ink); font-size: 17px; font-weight: 600; line-height: 1.3; text-decoration: none; }
.card-title::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }  /* toute la carte est cliquable */
.card-title:hover { text-decoration: underline; }
.card-company { margin-top: 2px; color: var(--ink); }
.card-place, .panel-place { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--ink-2); }
.card-place svg, .panel-place svg { width: 15px; height: 15px; color: var(--ink-3); }
.card-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.panel-head .card-tags { margin-top: 12px; }
.tag { padding: 2px 8px; background: var(--accent-tint); border-radius: 4px; font-size: 13px; font-weight: 500; color: var(--accent-dark); }
.card-date { font-size: 13px; color: var(--ink-2); white-space: nowrap; }

/* ---------- Résultats : liste + volet ---------- */

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 16px; }
.pill {
  appearance: none;
  height: 36px; padding: 0 34px 0 14px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%234b5159' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--ink); font: 500 14px var(--font);
  cursor: pointer; max-width: 100%;
}
.pill:hover { border-color: var(--ink-3); }
.filters-reset { font-size: 14px; font-weight: 600; text-decoration: none; }

.results-count { margin: 12px 0; font-size: 14px; color: var(--ink-2); }

.split { display: grid; gap: 16px; margin-top: 20px; }
.list-head { margin-bottom: 14px; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.split-detail { display: none; }
.back { margin: 16px 0 12px; font-size: 14px; font-weight: 600; }
.back a { text-decoration: none; }

/* Mobile : une offre choisie s'affiche seule, avec un lien retour. */
@media (max-width: 899px) {
  .has-selection .split-list, .has-selection .filters, .has-selection .results-count { display: none; }
  .has-selection .split-detail { display: block; }
  .results:not(.has-selection) .card.is-selected { border-color: var(--line); box-shadow: none; }
}
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 9fr) minmax(0, 11fr); align-items: start; }
  .split-list, .split-detail {
    position: sticky; top: 16px;
    height: calc(100vh - 32px); max-height: 980px;
    background: var(--surface); border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  }
  .split-list { display: flex; flex-direction: column; padding: 20px 16px 16px; }
  .list-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 4px 2px 2px; }
  .split-detail { display: block; overflow-y: auto; }
  .split-detail .back { display: none; }
  .split-detail .panel { border: 0; }
  .split .pager { padding: 16px 2px 0; }
}

.pager { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; }
.pager .btn { min-width: 136px; color: var(--accent-dark); border-color: var(--accent); }
.pager .btn:hover { background: var(--accent-tint); }
.pager .is-disabled { color: var(--ink-3); border-color: var(--line); background: var(--hover); cursor: default; }
.pager-pos { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- Panneau d'offre ---------- */

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.panel-head { margin: 0 28px; padding: 28px 0 24px; border-bottom: 1px solid var(--line); }
.panel-title { font-size: 26px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; text-wrap: balance; }
.panel-title a { color: var(--ink); text-decoration: none; }
.panel-title a:hover { text-decoration: underline; }
.panel-company { margin-top: 8px; font-size: 17px; }
.panel-place { font-size: 16px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 18px; }
.panel-actions .btn { min-width: 190px; height: 44px; border-radius: 4px; }
.panel-actions .fav-btn { color: var(--accent-dark); border-color: var(--accent); }
.panel-actions .fav-btn:hover { background: var(--accent-tint); }
.panel-body { padding: 24px 28px 28px; }
.panel-h3 { font-size: 19px; font-weight: 600; margin-bottom: 8px; }
.panel-body p { margin-top: 12px; line-height: 1.6; max-width: 70ch; }
.panel-body .panel-source { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }

.facts { margin: 0; }
.facts div { display: grid; gap: 2px 24px; padding: 11px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 560px) { .facts div { grid-template-columns: minmax(150px, 2fr) minmax(0, 3fr); } }
.facts dt { color: var(--ink-2); font-weight: 600; }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.detail { max-width: 860px; }
.related { margin-top: 32px; }

/* ---------- Pages simples ---------- */

.page-title { margin-top: 28px; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.empty { padding: 32px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; text-align: center; color: var(--ink-2); }
.empty-title { font-size: 18px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.empty p + p { margin-top: 8px; }

.auth { max-width: 420px; margin: 40px auto 0; padding: 32px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.auth-title { font-size: 24px; font-weight: 700; }
.auth-intro { margin-top: 6px; color: var(--ink-2); }
.auth .btn-block { margin-top: 24px; }
.auth-switch { margin-top: 20px; color: var(--ink-2); }
.field { margin-top: 16px; }
.field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.field input {
  width: 100%; height: 44px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: 15px var(--font);
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.form-error { margin-top: 16px; padding: 10px 12px; background: #fdecea; color: #8a1c12; border-radius: 8px; }

.footer { margin-top: 48px; background: var(--surface); border-top: 1px solid var(--line); }
.footer-inner { padding-top: 24px; padding-bottom: 32px; font-size: 14px; color: var(--ink-2); }
.footer-inner p + p { margin-top: 4px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.panel-body .panel-source { max-width: none; }
@media (max-width: 559px) {
  .panel-actions { gap: 10px; }
  .panel-actions .btn, .panel-actions .fav-form { flex: 1; min-width: 0; }
  .panel-actions .fav-form .btn { width: 100%; }
}
.panel-h3--gap { margin-top: 28px; }
