/* Public job board (/{lang}/jobs): Fabskill colors and fonts (landing page + dashboard ui-kit) */
:root {
    --jb-navy: #0a102f;
    --jb-purple: #7547ce;
    --jb-purple-hover: #6438bd;
    --jb-purple-light: #a259ff;
    --jb-purple-soft: #f0ebfb;
    --jb-text: #1f1d2b;
    --jb-body: #58666e;
    --jb-muted: #66647b; /* 5.3:1 on the page background (was 3.9:1) */
    --jb-border: #ecebf3;
    --jb-bg: #f7f6fb;
    --jb-radius: 16px;
    --jb-font-title: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    --jb-font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

body {
    margin: 0;
    font-family: var(--jb-font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--jb-text);
    background: var(--jb-bg);
    -webkit-font-smoothing: antialiased;
}

[dir="rtl"] body,
[dir="rtl"] {
    --jb-font-title: 'Noto Sans Arabic', 'Plus Jakarta Sans', sans-serif;
    --jb-font: 'Noto Sans Arabic', 'Inter', sans-serif;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

.jb-container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- buttons ---------- */
.jb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 22px;
    border-radius: 10px;
    border: 1px solid transparent;
    font: 700 15px/1 var(--jb-font-title);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}

.jb-btn--primary {
    background: var(--jb-purple);
    color: #fff;
}

.jb-btn--primary:hover {
    background: var(--jb-purple-hover);
}

.jb-btn--ghost {
    color: #fff;
    border-color: rgba(255, 255, 255, .7);
    min-height: 44px; /* tap target */
    padding: 0 16px;
    font-size: 14px;
}

.jb-btn--ghost:hover {
    background: rgba(255, 255, 255, .12);
    border-color: #fff;
}

.jb-btn--outline {
    background: #fff;
    color: var(--jb-purple);
    border-color: var(--jb-border);
}

.jb-btn--outline:hover {
    border-color: var(--jb-purple);
}

.jb-btn:focus-visible,
.jb-job a:focus-visible,
.jb-chip:focus-visible {
    outline: 3px solid var(--jb-purple-light);
    outline-offset: 2px;
}

/* ---------- hero ---------- */
.jb-hero {
    position: relative;
    /* no overflow: hidden, the skill suggestions drop below the hero */
    z-index: 2;
    color: #fff;
    padding-bottom: 72px;
    background:
        radial-gradient(38% 60% at 12% 18%, rgba(162, 89, 255, .55), transparent 70%),
        radial-gradient(30% 50% at 88% 22%, rgba(252, 106, 220, .32), transparent 70%),
        radial-gradient(45% 60% at 70% 95%, rgba(117, 71, 206, .55), transparent 70%),
        radial-gradient(35% 55% at 22% 100%, rgba(255, 167, 103, .22), transparent 70%),
        linear-gradient(135deg, #0a102f 0%, #1b1450 55%, #2a1763 100%);
}

/* soft grain so the gradient reads like a blurred photo */
.jb-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 4px 4px;
    pointer-events: none;
}

.jb-hero > * {
    position: relative;
}

.jb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 22px;
    padding-bottom: 22px;
}

.jb-brand {
    flex: 0 0 auto; /* the logo never shrinks (squeezed to ~20px wide on phones next to the menu) */
    display: inline-flex;
    min-height: 44px; /* tap target, however small the logo */
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: #fff;
}

/* the logo (home page) and "JOBS" (board) are two links; each fills the 44px tap target */
.jb-brand a {
    display: flex;
    align-items: center;
    align-self: stretch;
    color: inherit;
    text-decoration: none;
}

.jb-brand__label:hover {
    text-decoration: underline;
}

.jb-brand picture {
    display: flex;
    flex: 0 0 auto;
}

.jb-brand img {
    flex: 0 0 auto;
    height: 40px;
    width: auto;
}

.jb-brand__sep {
    width: 1px;
    height: 26px;
    background: rgba(255, 255, 255, .7);
}

.jb-brand__label {
    font: 800 13px/1 var(--jb-font-title);
    letter-spacing: .08em;
}

.jb-header__nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.jb-header__link {
    color: rgba(255, 255, 255, .85);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.jb-header__link:hover {
    color: #fff;
}

.jb-lang {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
}

.jb-lang a {
    min-width: 34px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    color: rgba(255, 255, 255, .8);
}

.jb-lang a.is-active {
    background: #fff;
    color: var(--jb-navy);
}

.jb-hero__body {
    text-align: center;
    padding-top: 56px;
}

.jb-hero__title {
    margin: 0 auto;
    max-width: 820px;
    font: 800 clamp(32px, 5vw, 56px)/1.1 var(--jb-font-title);
    letter-spacing: -0.02em;
}

.jb-hero__text {
    margin: 18px auto 0;
    max-width: 640px;
    font-size: clamp(16px, 2vw, 19px);
    color: rgba(255, 255, 255, .88);
}

/* ---------- search bar ---------- */
.jb-search {
    display: flex;
    align-items: stretch;
    gap: 0;
    max-width: 1000px;
    margin: 44px auto 0;
    padding: 10px;
    background: #fff;
    border-radius: var(--jb-radius);
    box-shadow: 0 20px 50px rgba(10, 16, 47, .35);
    text-align: start;
}

.jb-search__field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 0;
    min-width: 0;
    padding: 0 18px;
    color: var(--jb-text);
}

.jb-search__field + .jb-search__field {
    border-inline-start: 1px solid var(--jb-border);
}

.jb-search__field > svg {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: var(--jb-text);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.jb-search input {
    flex: 1;
    min-width: 0;
    height: 56px;
    border: 0;
    outline: none;
    background: transparent;
    font: 400 16px var(--jb-font);
    color: var(--jb-text);
}

.jb-search input:focus,
.jb-search input:focus-visible {
    outline: none;
    box-shadow: none;
}

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

.jb-search__submit {
    min-height: 58px;
    padding: 0 34px;
    font-size: 16px;
}

/* ---------- popular searches: skill chips ---------- */
.jb-popular {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 24px auto 0;
    max-width: 1000px;
    font-size: 15px;
    color: rgba(255, 255, 255, .88);
}

.jb-popular__chips {
    display: contents; /* large screens: the chips wrap with the label, as before */
}

/* login button: short label on phones only */
.jb-login__short {
    display: none;
}

.jb-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 6px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    backdrop-filter: blur(6px);
    transition: background-color .15s, border-color .15s;
}

[dir="rtl"] .jb-chip {
    padding: 6px 6px 6px 14px;
}

.jb-chip:hover {
    background: rgba(255, 255, 255, .2);
    border-color: rgba(255, 255, 255, .45);
}

.jb-chip img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

/* ---------- results ---------- */
.jb-main {
    padding-top: 48px;
    padding-bottom: 72px;
}

.jb-main__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 18px;
}

.jb-main__head h2 {
    margin: 0;
    font: 500 22px/1.3 var(--jb-font-title);
}

.jb-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fff;
    border: 1px solid var(--jb-border);
    border-radius: var(--jb-radius);
    box-shadow: 0 1px 2px rgba(10, 16, 47, .04);
    overflow: hidden;
}

.jb-job {
    position: relative;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 26px 32px;
    transition: background-color .15s;
}

.jb-job + .jb-job {
    border-top: 1px solid var(--jb-border);
}

.jb-job:hover {
    background: #fbfaff;
}

/* the job title link stretches over the whole card: logo, company and arrow all open the job */
.jb-job__title a::after {
    content: "";
    position: absolute;
    inset: 0;
}

.jb-job:hover .jb-job__title a {
    color: var(--jb-purple);
}

.jb-job__logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    padding: 6px;
    border-radius: 14px;
    border: 1px solid var(--jb-border);
    background: #fff;
}

.jb-job__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

/* no logo (or it failed to load): the company's initials on a brand tone */
.jb-job__initials {
    display: none;
    font: 800 26px/1 var(--jb-font-title);
    letter-spacing: .02em;
    color: var(--jb-tone-fg);
}

.jb-job__logo.is-fallback {
    padding: 0;
    border-color: transparent;
    background: linear-gradient(135deg, var(--jb-tone-bg) 0%, var(--jb-tone-bg2) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6), 0 1px 2px rgba(10, 16, 47, .06);
}

.jb-job__logo.is-fallback .jb-job__initials {
    display: block;
}

.jb-tone-0 { --jb-tone-bg: #f3eefd; --jb-tone-bg2: #e2d6fa; --jb-tone-fg: #6a3bc4; }
.jb-tone-1 { --jb-tone-bg: #eef0fd; --jb-tone-bg2: #d9ddfa; --jb-tone-fg: #2f3a9e; }
.jb-tone-2 { --jb-tone-bg: #fdeff9; --jb-tone-bg2: #f9d6ef; --jb-tone-fg: #ad2d90; }
.jb-tone-3 { --jb-tone-bg: #fff4ea; --jb-tone-bg2: #fde0c8; --jb-tone-fg: #b8521a; }
.jb-tone-4 { --jb-tone-bg: #eaf9fa; --jb-tone-bg2: #cdeff1; --jb-tone-fg: #127a83; }
.jb-tone-5 { --jb-tone-bg: #f0f1f6; --jb-tone-bg2: #dcdeea; --jb-tone-fg: #0a102f; }

.jb-job__body {
    flex: 1;
    min-width: 0;
}

.jb-job__title {
    margin: 0 0 6px;
    font: 700 20px/1.3 var(--jb-font-title);
}

.jb-job__title a {
    color: var(--jb-navy);
    text-decoration: none;
}

.jb-job__title a:hover {
    color: var(--jb-purple);
}

.jb-job__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 18px;
    margin: 0;
    color: var(--jb-text);
    font-size: 15px;
}

/* each detail: an icon and its text, kept together when the details wrap */
.jb-job__meta > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
}

.jb-job__icon {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    fill: none;
    stroke: var(--jb-muted);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* "at Company": a long name is cut with "…" inside the card (min-width: 0 lets it shrink), at the end of
   the name in its own direction (dir="auto") */
.jb-job__at {
    gap: .3em;
}

.jb-job__company {
    min-width: 0;
    max-width: 32ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--jb-text);
    font-weight: 600;
}

.jb-job__date {
    margin: 8px 0 0;
    color: var(--jb-muted);
    font-size: 14px;
}

.jb-job__go {
    flex: 0 0 auto;
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--jb-purple-soft);
    opacity: 0;
    transition: opacity .15s;
}

.jb-job:hover .jb-job__go {
    opacity: 1;
}

.jb-job__go svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--jb-purple);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

[dir="rtl"] .jb-job__go svg {
    transform: scaleX(-1);
}

/* ---------- empty state ---------- */
.jb-empty {
    padding: 56px 24px;
    text-align: center;
    background: #fff;
    border: 1px solid var(--jb-border);
    border-radius: var(--jb-radius);
}

.jb-empty svg {
    width: 48px;
    height: 48px;
    fill: none;
    stroke: var(--jb-purple);
    stroke-width: 1.6;
    stroke-linecap: round;
}

.jb-empty h3 {
    margin: 14px 0 6px;
    font: 700 20px var(--jb-font-title);
}

.jb-empty p {
    margin: 0 0 22px;
    color: var(--jb-body);
}

/* ---------- pagination ---------- */
/* "show more": to the app's search */
.jb-more {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

/* ---------- footer ---------- */
.jb-footer {
    padding: 28px 0;
    background: #fff;
    border-top: 1px solid var(--jb-border);
    color: var(--jb-muted);
    font-size: 14px;
}

.jb-footer .jb-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.jb-footer__link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--jb-purple);
    font-weight: 600;
    text-decoration: none;
}

.jb-footer__link:hover {
    text-decoration: underline;
}

/* logged-in candidate (header): photo or initials + first name */
.account-chip {
    gap: 8px;
    padding-inline-start: 4px;
}

.account-chip__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    overflow: hidden;
    border-radius: 50%;
    background: #f0ebfb;
    color: #7547ce;
    font-size: 11px;
    font-weight: 700;
}

.account-chip__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-chip__name {
    max-width: 14ch;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- small screens ---------- */
@media (max-width: 860px) {
    .jb-header__link {
        display: none;
    }

    .jb-search {
        flex-direction: column;
        padding: 8px;
    }

    .jb-search__field + .jb-search__field {
        border-inline-start: 0;
        border-top: 1px solid var(--jb-border);
    }

    .jb-search__submit {
        margin-top: 8px;
        width: 100%;
    }

    .jb-job {
        align-items: flex-start;
        gap: 16px;
        padding: 20px;
    }

    .jb-job__logo {
        width: 60px;
        height: 60px;
    }

    .jb-job__initials {
        font-size: 20px;
    }

    .jb-job__title {
        font-size: 17px;
    }

    .jb-job__meta {
        font-size: 14px;
    }

    /* language switch: 44px tap targets */
    .jb-lang a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        font-size: 13px;
    }

    .jb-job__go {
        display: none;
    }
}

@media (max-width: 520px) {
    /* sides only: the shorthand also reset the top/bottom padding of the sections that share this class
       (the results lost their 48px top space and "Dernières offres" touched the hero) */
    .jb-container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .jb-main {
        padding-top: 28px;
        padding-bottom: 48px;
    }

    /* the square logo (picture source), 36x36 */
    .jb-brand img {
        width: 36px;
        height: 36px;
    }

    .jb-brand__sep,
    .jb-brand .jb-brand__label {
        display: none;
    }

    .jb-btn--ghost {
        padding: 0 12px;
        font-size: 13px;
    }

    .jb-header__nav {
        gap: 10px;
    }

    .jb-hero {
        padding-bottom: 28px;
    }

    .jb-header {
        gap: 10px;
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .jb-hero__body {
        padding-top: 18px;
    }

    /* the hero fits the first screen with the start of the job list (it took the whole screen) */
    .jb-hero__title {
        font-size: 28px;
    }

    .jb-hero__text {
        margin-top: 12px;
        font-size: 15px;
    }

    .jb-search {
        margin-top: 22px;
    }

    .jb-login__full,
    .account-chip__name {
        display: none;
    }

    .jb-login__short {
        display: inline;
    }

    .jb-header__nav .account-chip {
        justify-content: center;
        width: 44px;
        padding: 0;
        border-radius: 50%;
    }

    /* popular searches: the label, then one row of chips that scrolls sideways, edge to edge */
    .jb-popular {
        flex-direction: column;
        flex-wrap: nowrap; /* with wrap, the column line took the chips' full width and the page scrolled sideways */
        align-items: stretch;
        gap: 10px;
        margin-top: 18px;
        font-size: 14px;
    }

    .jb-popular__chips {
        display: flex;
        gap: 8px;
        margin: 0 -16px;
        padding: 0 16px 4px;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        scroll-padding-inline: 16px; /* snap to the 16px margin, not the screen edge (the first chip was cut) */
        scrollbar-width: none;
    }

    .jb-popular__chips::-webkit-scrollbar {
        display: none;
    }

    .jb-popular__chips .jb-chip {
        min-height: 44px; /* tap target */
        scroll-snap-align: start;
    }
}

/* narrowest phones: a smaller logo and language switch so the header stays on one line */
@media (max-width: 380px) {
    .jb-lang a {
        min-width: 38px;
    }

    .jb-btn--ghost {
        padding: 0 10px;
    }
}

/* 320-360px phones: a bit of room around the header (it filled the full 320px width) */
@media (max-width: 360px) {
    .jb-header,
    .jb-header__nav {
        gap: 8px;
    }
}
