/* ============================================================
   OFFRES D'EMPLOI — espace travailleur (/space/offres)
   Mise en page « job board » : recherche, liste, fiche détaillée.
   Adaptatif par container queries (largeur réelle de la zone de
   contenu, sidebar ou non) + fallback media queries.
   Noir & blanc, accent orange réservé à l'urgence.
   ============================================================ */

.profile-main.is-wide { max-width: 1320px; }

.jb {
    --jb-card: var(--deep-blue, #fff);
    --jb-ink: var(--p-ink, #000);
    --jb-line: var(--border, rgba(0,0,0,.12));
    --jb-soft: var(--surf-1, rgba(0,0,0,.035));
    --jb-soft-2: var(--surf-2, rgba(0,0,0,.06));
    --jb-accent: #000;
    --jb-accent-ink: #fff;
    --jb-urgent: #b45309;
    --jb-ok: #15803d;
    --jb-radius: 16px;
    container-type: inline-size;
    container-name: jb;
    display: flex; flex-direction: column; gap: 1rem;
    color: var(--jb-ink);
}
:root[data-theme="dark"] .jb { --jb-accent: #fff; --jb-accent-ink: #000; }
.jb svg.lucide, .jb i[data-lucide] { width: 16px; height: 16px; flex-shrink: 0; stroke-width: 2; }

/* ── En-tête ─────────────────────────────────────────── */
.jb-hero {
    display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; flex-wrap: wrap;
    padding-bottom: 1.1rem; border-bottom: 1px solid var(--jb-line);
}
.jb-kicker { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; margin-bottom: .45rem; }
.jb-hero h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 3.2vw, 2.2rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.jb-hero p { font-size: .95rem; margin-top: .4rem; max-width: 560px; line-height: 1.55; }
.jb-stat { display: flex; align-items: baseline; gap: .45rem; padding: .6rem 1rem; border-radius: 12px; background: var(--jb-card); border: 1px solid var(--jb-line); white-space: nowrap; }
.jb-stat strong { font-family: var(--font-display); font-size: 1.5rem; line-height: 1; }
.jb-stat span { font-size: .82rem; font-weight: 500; }

/* ── Barre de recherche (une seule « pilule ») ───────── */
.jb-search {
    display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: stretch;
    background: var(--jb-card); border: 1px solid var(--jb-line); border-radius: 14px;
    box-shadow: 0 10px 30px -24px rgba(0,0,0,.45);
    overflow: hidden;
}
.jb-field { display: flex; align-items: center; gap: .55rem; padding: 0 1rem; min-height: 54px; border-right: 1px solid var(--jb-line); min-width: 0; }
.jb-field:focus-within { background: var(--jb-soft); }
.jb-field input, .jb-field select {
    flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
    font: inherit; font-size: .92rem; color: var(--jb-ink); padding: .9rem 0; appearance: none; -webkit-appearance: none; cursor: pointer;
}
.jb-field input { cursor: text; }
.jb-field input::placeholder { color: var(--jb-ink); opacity: .55; }
.jb-field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right center; padding-right: 1.2rem; }
:root[data-theme="dark"] .jb-field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.jb-field select option { color: #000; background: #fff; }
.jb-search-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    margin: .4rem; padding: 0 1.4rem; border: 0; border-radius: 10px; cursor: pointer;
    background: var(--jb-accent); color: var(--jb-accent-ink); font: inherit; font-size: .9rem; font-weight: 700;
    transition: opacity .15s ease, transform .15s ease;
}
.jb-search-btn:hover { opacity: .88; }
.jb-search-btn:active { transform: scale(.98); }

/* Filtres actifs */
.jb-active { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .82rem; }
.jb-active-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .4rem .3rem .75rem; border-radius: 50px; background: var(--jb-soft-2); font-weight: 600; }
.jb-active-chip a { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: var(--jb-ink); }
.jb-active-chip a:hover { background: var(--jb-line); }
.jb-active-chip svg, .jb-active-chip i { width: 13px !important; height: 13px !important; }
.jb-clear { margin-left: .25rem; font-weight: 600; text-decoration: underline; color: var(--jb-ink); }

/* Alertes, verrou, vide */
.jb-alert { display: flex; gap: .6rem; align-items: center; padding: .8rem 1rem; border-radius: 12px; font-size: .9rem; font-weight: 500; background: rgba(21,128,61,.08); border: 1px solid rgba(21,128,61,.28); color: var(--jb-ok); }
.jb-locked, .jb-empty {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: .6rem;
    padding: 3rem 1.5rem; border-radius: var(--jb-radius); border: 1px dashed var(--jb-line); background: var(--jb-card);
}
.jb-locked .jb-empty-icon, .jb-empty .jb-empty-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--jb-soft-2); }
.jb-empty-icon svg, .jb-empty-icon i { width: 24px !important; height: 24px !important; }
.jb-locked h3, .jb-empty h3 { font-size: 1.1rem; font-weight: 700; }
.jb-locked p, .jb-empty p { font-size: .9rem; max-width: 420px; line-height: 1.55; }
.jb-locked .btn { margin-top: .4rem; }

/* ── Disposition liste / détail ──────────────────────── */
.jb-results { font-size: .85rem; font-weight: 600; }
.jb-layout { display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: start; }

/* Liste */
.jb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.jb-card {
    position: relative; display: grid; grid-template-columns: 44px 1fr; gap: .9rem;
    padding: 1rem 1.1rem; border-radius: 14px; border: 1px solid var(--jb-line); background: var(--jb-card); color: var(--jb-ink);
    transition: border-color .15s ease, box-shadow .2s ease, transform .15s ease;
}
.jb-card:hover { border-color: var(--jb-ink); box-shadow: 0 12px 28px -22px rgba(0,0,0,.45); }
.jb-card:focus-visible { outline: 2px solid var(--jb-ink); outline-offset: 2px; }
.jb-card.is-active { border-color: var(--jb-ink); box-shadow: inset 4px 0 0 var(--jb-accent), 0 14px 30px -24px rgba(0,0,0,.5); }
.jb-logo { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--jb-accent); color: var(--jb-accent-ink); font-family: var(--font-display); font-weight: 700; font-size: .95rem; letter-spacing: .02em; }
.jb-logo.is-lg { width: 56px; height: 56px; border-radius: 14px; font-size: 1.15rem; }
.jb-card-body { min-width: 0; }
.jb-card-top { display: flex; justify-content: space-between; gap: .6rem; align-items: flex-start; }
.jb-card h3 { font-size: 1rem; font-weight: 700; line-height: 1.3; letter-spacing: -.005em; overflow-wrap: anywhere; }
.jb-pills { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0 .55rem; }
.jb-pill { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem; border-radius: 50px; background: var(--jb-soft-2); font-size: .76rem; font-weight: 600; white-space: nowrap; }
.jb-pill svg, .jb-pill i { width: 13px !important; height: 13px !important; }
.jb-excerpt { font-size: .86rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.jb-card-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .65rem; font-size: .76rem; font-weight: 500; }
.jb-due { font-weight: 700; }
.jb-due.is-urgent { color: var(--jb-urgent); }
.jb-badge-ok { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .55rem; border-radius: 50px; font-size: .7rem; font-weight: 700; color: var(--jb-ok); background: rgba(21,128,61,.09); white-space: nowrap; }
.jb-badge-ok svg, .jb-badge-ok i { width: 12px !important; height: 12px !important; }

/* Détail */
.jb-detail {
    display: none;
    border-radius: var(--jb-radius); border: 1px solid var(--jb-line); background: var(--jb-card);
    box-shadow: 0 24px 50px -40px rgba(0,0,0,.55); overflow: hidden;
}
.jb.has-selection .jb-detail { display: block; }
.jb.has-selection .jb-list, .jb.has-selection .jb-results, .jb.has-selection .jb-search,
.jb.has-selection .jb-active, .jb.has-selection .jb-hero { display: none; }
.jb-back { display: inline-flex; align-items: center; gap: .35rem; font-size: .86rem; font-weight: 700; color: var(--jb-ink); margin-bottom: 1rem; }
.jb-d-head { padding: 1.4rem 1.4rem 1.2rem; border-bottom: 1px solid var(--jb-line); }
.jb-d-title { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; }
.jb-d-title h2 { font-family: var(--font-display); font-size: clamp(1.3rem, 2.6vw, 1.7rem); font-weight: 700; line-height: 1.2; letter-spacing: -.015em; overflow-wrap: anywhere; }
.jb-d-sub { font-size: .84rem; margin-top: .3rem; }
.jb-d-head .jb-pills { margin: 1rem 0 0; }
.jb-d-cta-top { margin-top: 1.1rem; }

.jb-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-bottom: 1px solid var(--jb-line); }
.jb-facts > div { padding: .95rem 1.4rem; border-top: 1px solid var(--jb-line); }
.jb-facts > div:nth-child(-n+2) { border-top: 0; }
.jb-facts > div:nth-child(odd) { border-right: 1px solid var(--jb-line); }
.jb-facts dt { display: flex; align-items: center; gap: .35rem; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .3rem; }
.jb-facts dt svg, .jb-facts dt i { width: 14px !important; height: 14px !important; }
.jb-facts dd { font-size: .98rem; font-weight: 700; overflow-wrap: anywhere; }
.jb-facts dd small { display: block; font-size: .76rem; font-weight: 700; color: var(--jb-urgent); margin-top: .1rem; }
.jb-facts dd small.is-calm { color: var(--jb-ink); font-weight: 500; }

.jb-section { padding: 1.25rem 1.4rem; border-bottom: 1px solid var(--jb-line); }
.jb-section h3 { display: flex; align-items: center; gap: .45rem; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .75rem; }
.jb-text { font-size: .95rem; line-height: 1.75; overflow-wrap: anywhere; }
.jb-text em { opacity: .7; }

.jb-d-foot { padding: 1.25rem 1.4rem 1.4rem; display: flex; flex-direction: column; gap: .9rem; }
.jb-apply { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; }
.jb-apply p { font-size: .86rem; line-height: 1.5; flex: 1 1 240px; }
.jb-apply-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .85rem 1.6rem; border-radius: 12px; border: 0; cursor: pointer;
    background: var(--jb-accent); color: var(--jb-accent-ink); font: inherit; font-size: .95rem; font-weight: 700;
    box-shadow: 0 10px 24px -14px rgba(0,0,0,.6); transition: opacity .15s ease, transform .15s ease;
}
.jb-apply-btn:hover { opacity: .9; }
.jb-apply-btn:active { transform: scale(.98); }
.jb-apply-btn svg, .jb-apply-btn i { width: 18px !important; height: 18px !important; }
.jb-applied { display: flex; gap: .7rem; align-items: flex-start; padding: .9rem 1rem; border-radius: 12px; background: rgba(21,128,61,.07); border: 1px solid rgba(21,128,61,.25); color: var(--jb-ok); }
.jb-applied svg, .jb-applied i { width: 22px !important; height: 22px !important; }
.jb-applied strong { display: block; font-size: .95rem; }
.jb-applied span { font-size: .85rem; color: var(--jb-ink); }
.jb-privacy { display: flex; gap: .5rem; align-items: flex-start; font-size: .8rem; line-height: 1.5; }
.jb-privacy svg, .jb-privacy i { width: 15px !important; height: 15px !important; margin-top: .1rem; }

/* Bouton d'action collant en bas (petits écrans) */
.jb-sticky-cta { position: sticky; bottom: 0; z-index: 5; padding: .75rem 1rem; background: var(--jb-card); border-top: 1px solid var(--jb-line); box-shadow: 0 -10px 24px -18px rgba(0,0,0,.4); }
.jb-sticky-cta .jb-apply-btn { width: 100%; }
.jb-d-cta-top { display: none; }

/* ══ Largeur moyenne : barre de recherche sur 2 lignes ═══ */
@container jb (max-width: 760px) {
    .jb-search { grid-template-columns: 1fr 1fr; }
    .jb-field.is-q { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--jb-line); }
    .jb-field.is-country { border-right: 0; }
    .jb-search-btn { grid-column: 1 / -1; min-height: 46px; }
}
@container jb (max-width: 480px) {
    .jb-search { grid-template-columns: 1fr; }
    .jb-field { border-right: 0 !important; border-bottom: 1px solid var(--jb-line); }
    .jb-facts { grid-template-columns: 1fr; }
    .jb-facts > div { border-right: 0 !important; border-top: 1px solid var(--jb-line) !important; }
    .jb-facts > div:first-child { border-top: 0 !important; }
    .jb-card { grid-template-columns: 1fr; gap: .6rem; }
    .jb-card .jb-logo { display: none; }
    .jb-d-title { grid-template-columns: 1fr; }
    .jb-d-title .jb-logo { width: 44px; height: 44px; }
    .jb-d-head, .jb-section, .jb-d-foot { padding-left: 1.1rem; padding-right: 1.1rem; }
    .jb-facts > div { padding-left: 1.1rem; padding-right: 1.1rem; }
}

/* ══ Grande largeur : liste + fiche côte à côte ═════════ */
@container jb (min-width: 860px) {
    .jb-layout { grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); gap: 1.25rem; }
    .jb-detail { display: block; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
    .jb.has-selection .jb-list, .jb.has-selection .jb-results, .jb.has-selection .jb-search,
    .jb.has-selection .jb-active, .jb.has-selection .jb-hero { display: revert; }
    .jb.has-selection .jb-list { display: flex; }
    .jb.has-selection .jb-search { display: grid; }
    .jb.has-selection .jb-hero, .jb.has-selection .jb-active { display: flex; }
    .jb-back { display: none; }
    .jb-d-cta-top { display: block; }
    .jb-sticky-cta { display: none; }
}
@container jb (min-width: 1100px) {
    .jb-layout { grid-template-columns: minmax(340px, 430px) minmax(0, 1fr); }
    .jb-d-head { padding: 1.75rem 1.9rem 1.4rem; }
    .jb-section, .jb-d-foot { padding-left: 1.9rem; padding-right: 1.9rem; }
    .jb-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .jb-facts > div { padding-left: 1.9rem; padding-right: 1.9rem; border-right: 1px solid var(--jb-line) !important; border-top: 1px solid var(--jb-line) !important; }
    .jb-facts > div:nth-child(-n+3) { border-top: 0 !important; }
    .jb-facts > div:nth-child(3n) { border-right: 0 !important; }
}

/* Fallback sans container queries */
@supports not (container-type: inline-size) {
    @media (min-width: 1200px) {
        .jb-layout { grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); }
        .jb-detail { display: block; position: sticky; top: 1rem; }
        .jb.has-selection .jb-list { display: flex; }
        .jb.has-selection .jb-search { display: grid; }
        .jb.has-selection .jb-hero, .jb.has-selection .jb-active { display: flex; }
        .jb-back, .jb-sticky-cta { display: none; }
        .jb-d-cta-top { display: block; }
    }
}

@media (prefers-reduced-motion: reduce) {
    .jb-card, .jb-apply-btn, .jb-search-btn { transition: none; }
}
