/*
 * Public careers board: the listing (/careers, /careers/<site>) and the job
 * page (/careers/jobs/:id). Self-contained (no Tailwind, no careers-brand.css)
 * but on the same navy + teal palette as the rest of the careers flow.
 * Prefix: .cb-
 */

:root {
    --cb-night: #061a2d;
    --cb-navy: #0a2540;
    --cb-harbor: #103a5b;
    --cb-teal: #4ec4cf;
    --cb-teal-deep: #3aa9b4;
    --cb-on-teal: #042330;
    --cb-text: #e6f1f5;
    --cb-bright: #ffffff;
    --cb-muted: #9bb3c4;
    --cb-rule: rgba(155, 179, 196, 0.18);
    --cb-rule-strong: rgba(155, 179, 196, 0.36);
    --cb-glow: rgba(78, 196, 207, 0.07);

    --cb-display: 'Dosis', 'Trebuchet MS', sans-serif;
    --cb-read: 'Literata', Georgia, 'Times New Roman', serif;

    --cb-wrap: 1120px;
    --cb-gutter: clamp(16px, 4vw, 40px);
}

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

html { -webkit-text-size-adjust: 100%; }

.cb-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--cb-navy);
    background-image: radial-gradient(circle at 20% 0%, var(--cb-harbor) 0%, var(--cb-navy) 55%, var(--cb-night) 100%);
    color: var(--cb-text);
    font-family: var(--cb-display);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.cb-body [hidden] { display: none !important; }

.cb-body ::selection { background: rgba(78, 196, 207, 0.35); color: var(--cb-bright); }

.cb-body a:focus-visible,
.cb-body button:focus-visible,
.cb-body input:focus-visible {
    outline: 2px solid var(--cb-teal);
    outline-offset: 2px;
}

.cb-sr {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.cb-skip {
    position: absolute;
    left: 12px; top: -60px;
    z-index: 30;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--cb-teal);
    color: var(--cb-on-teal);
    font-weight: 600;
    text-decoration: none;
}
.cb-skip:focus { top: 12px; }

.cb-wrap {
    width: 100%;
    max-width: calc(var(--cb-wrap) + 2 * var(--cb-gutter));
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--cb-gutter);
    padding-right: var(--cb-gutter);
}

.cb-page { flex: 1 0 auto; }

/* ---------- Page bar ---------- */

.cb-bar {
    background: rgba(10, 37, 64, 0.85);
    border-bottom: 1px solid var(--cb-rule);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.cb-bar-in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 60px;
}

.cb-bar-home,
.cb-bar-back,
.cb-bar-link {
    color: var(--cb-text);
    text-decoration: none;
    transition: color 0.15s ease;
}
.cb-bar-home {
    font-size: 21px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--cb-bright);
}
.cb-bar-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: -4px;
    font-size: 16px;
    font-weight: 500;
}
.cb-bar-link { font-size: 16px; font-weight: 500; text-align: right; }
.cb-bar-home:hover,
.cb-bar-back:hover,
.cb-bar-link:hover { color: var(--cb-teal); }

/* ---------- Buttons ---------- */

.cb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 28px;
    border: 0;
    border-radius: 8px;
    background: var(--cb-teal);
    color: var(--cb-on-teal);
    font-family: var(--cb-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 8px 22px -10px rgba(78, 196, 207, 0.7);
    transition: background-color 0.15s ease;
}
.cb-btn:hover { background: var(--cb-teal-deep); }

.cb-btn--quiet {
    background: transparent;
    color: var(--cb-text);
    border: 1px solid var(--cb-rule-strong);
    box-shadow: none;
    font-weight: 600;
}
.cb-btn--quiet:hover { background: var(--cb-glow); border-color: var(--cb-teal); color: var(--cb-bright); }

.cb-textbtn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--cb-teal);
    font-family: var(--cb-display);
    font-size: 17px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.cb-textbtn:hover { color: var(--cb-bright); }

/* ---------- Listing: headline ---------- */

.cb-hero {
    padding: clamp(40px, 7vw, 88px) 0 clamp(28px, 4vw, 44px);
}

.cb-title {
    margin: 0;
    font-size: clamp(40px, 1.6rem + 3.4vw, 64px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--cb-bright);
}

.cb-lede {
    max-width: 52ch;
    margin: 16px 0 0;
    font-family: var(--cb-read);
    font-size: 18px;
    line-height: 1.6;
    color: var(--cb-muted);
}

.cb-hero--empty .cb-btn { margin-top: 28px; }

/* ---------- Listing: filters ---------- */

.cb-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin-bottom: 20px;
}

.cb-search {
    position: relative;
    flex: 1 1 280px;
    max-width: 400px;
    color: var(--cb-muted);
}
.cb-search svg {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}
.cb-search input {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 40px;
    border: 1px solid var(--cb-rule-strong);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--cb-bright);
    font-family: var(--cb-display);
    font-size: 16px;
    font-weight: 500;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.cb-search input::placeholder { color: rgba(155, 179, 196, 0.8); }
.cb-search input:hover { border-color: rgba(155, 179, 196, 0.55); }
.cb-search input:focus { border-color: var(--cb-teal); background: rgba(255, 255, 255, 0.07); }
.cb-search input:focus-visible { outline-offset: 0; }

.cb-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.cb-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--cb-rule-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--cb-text);
    font-family: var(--cb-display);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.cb-chip:hover { border-color: var(--cb-teal); }
.cb-chip-n { color: var(--cb-muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.cb-chip[aria-pressed="true"] {
    background: var(--cb-teal);
    border-color: var(--cb-teal);
    color: var(--cb-on-teal);
}
.cb-chip[aria-pressed="true"] .cb-chip-n { color: rgba(4, 35, 48, 0.72); }

.cb-results {
    margin: 0 0 0 auto;
    color: var(--cb-muted);
    font-size: 15px;
    font-weight: 500;
}
.cb-results:empty { display: none; }

/* ---------- Job cards (listing + "Other open positions") ---------- */

.cb-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 20px;
}

.cb-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 22px 22px 20px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.045);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.cb-card:hover,
.cb-card:focus-within {
    border-color: var(--cb-teal);
    box-shadow: 0 14px 32px -14px rgba(78, 196, 207, 0.5);
}
.cb-card:hover { transform: translateY(-2px); }

.cb-card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.cb-tag {
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(78, 196, 207, 0.15);
    color: var(--cb-teal);
    font-size: 13px;
    font-weight: 600;
    line-height: 24px;
}

.cb-card-title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--cb-bright);
    overflow-wrap: anywhere;
}

/* The title link covers the whole card, so the card is one click target
   while screen readers hear just the job title. */
.cb-card-link {
    color: inherit;
    text-decoration: none;
}
.cb-card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 14px;
}
.cb-body .cb-card-link:focus-visible { outline: none; }
.cb-card-link:focus-visible::after {
    outline: 2px solid var(--cb-teal);
    outline-offset: 3px;
}

.cb-card-place {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 0;
    color: var(--cb-text);
    font-size: 16px;
    font-weight: 500;
}
.cb-card-place svg { flex: none; color: var(--cb-muted); }

.cb-card-text {
    margin: 14px 0 0;
    font-family: var(--cb-read);
    font-size: 15px;
    line-height: 1.6;
    color: var(--cb-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cb-card-foot { margin-top: auto; padding-top: 18px; }

.cb-card-facts {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 16px;
    margin: 0;
    padding-top: 14px;
    border-top: 1px solid var(--cb-rule);
    color: var(--cb-muted);
    font-size: 14px;
    font-weight: 500;
}
.cb-card-facts:empty { display: none; }
.cb-card-pay { color: var(--cb-text); }

.cb-card-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    margin-top: 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--cb-text);
    font-size: 15px;
    font-weight: 600;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.cb-card:hover .cb-card-cta,
.cb-card:focus-within .cb-card-cta {
    background: var(--cb-teal);
    color: var(--cb-on-teal);
}

.cb-new {
    padding: 0 8px;
    border: 1px solid rgba(78, 196, 207, 0.55);
    border-radius: 999px;
    color: var(--cb-teal);
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
}

.cb-nomatch {
    padding: 36px 24px 40px;
    border: 1px dashed var(--cb-rule-strong);
    border-radius: 14px;
    text-align: center;
}
.cb-nomatch p {
    margin: 0 0 10px;
    font-family: var(--cb-read);
    font-size: 18px;
    color: var(--cb-muted);
}

/* ---------- Job page ---------- */

.cb-job { padding-top: clamp(32px, 5vw, 64px); }

/* Header panel: the title plus the post's opening lines (subtitle,
   "Location: ..." facts), lifted out of the body by careers-job.js. Same
   surface as the listing cards. */
.cb-job-head {
    margin-bottom: clamp(28px, 3.5vw, 44px);
    padding: clamp(22px, 3vw, 32px) clamp(20px, 3vw, 34px);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.045);
}

.cb-job-title {
    margin: 0;
    max-width: 24ch;
    font-size: clamp(34px, 1.4rem + 2.2vw, 52px);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--cb-bright);
    overflow-wrap: anywhere;
}

.cb-job-intro > :first-child { margin-top: 14px; }

.cb-job-sub {
    margin: 0;
    color: var(--cb-text);
    font-size: 21px;
    font-weight: 500;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.cb-intro-facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 8px 20px;
    margin: 20px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--cb-rule);
}
.cb-intro-facts > div { display: contents; }
.cb-intro-facts dt {
    color: var(--cb-muted);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.45;
}
.cb-intro-facts dd {
    margin: 0;
    color: var(--cb-bright);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.cb-intro-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 0;
}

.cb-apply { width: 100%; }

/* Key facts, ruled like a drawing's title block. */
.cb-facts {
    margin: 0;
    border-top: 1px solid var(--cb-rule-strong);
    border-bottom: 1px solid var(--cb-rule-strong);
}
.cb-fact {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 12px;
    padding: 11px 0;
}
.cb-fact + .cb-fact { border-top: 1px solid var(--cb-rule); }
.cb-fact dt {
    color: var(--cb-muted);
    font-size: 15px;
    font-weight: 500;
}
.cb-fact dd {
    margin: 0;
    color: var(--cb-bright);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.cb-share-label {
    margin: 0 0 10px;
    color: var(--cb-muted);
    font-size: 15px;
    font-weight: 500;
}
.cb-share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cb-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 13px;
    border: 1px solid var(--cb-rule-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--cb-text);
    font-family: var(--cb-display);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.cb-share-btn:hover { border-color: var(--cb-teal); color: var(--cb-bright); }
.cb-share-btn.is-done { border-color: var(--cb-teal); color: var(--cb-teal); }

/* Role description: recruiter-written rich text, set for reading. */
.cb-main { min-width: 0; }

.cb-prose {
    max-width: 68ch;
    font-family: var(--cb-read);
    font-optical-sizing: auto;
    font-size: 17px;
    line-height: 1.72;
    color: var(--cb-text);
    overflow-wrap: break-word;
}
.cb-prose > * { margin: 0; }
.cb-prose > * + * { margin-top: 0.85em; }
.cb-prose h1, .cb-prose h2, .cb-prose h3, .cb-prose h4, .cb-prose h5, .cb-prose h6 {
    font-family: var(--cb-display);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.005em;
    color: var(--cb-bright);
}
.cb-prose > h1, .cb-prose > h2, .cb-prose > h3,
.cb-prose > h4, .cb-prose > h5, .cb-prose > h6 { margin-top: 1.75em; }
.cb-prose > h1 + *, .cb-prose > h2 + *, .cb-prose > h3 + *,
.cb-prose > h4 + *, .cb-prose > h5 + *, .cb-prose > h6 + * { margin-top: 0.5em; }
.cb-prose > :first-child { margin-top: 0; }

.cb-prose strong, .cb-prose b { font-weight: 600; color: var(--cb-bright); }
.cb-prose em, .cb-prose i { font-style: italic; }
.cb-prose a {
    color: var(--cb-teal);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.cb-prose a:hover { color: var(--cb-bright); }

.cb-prose ul, .cb-prose ol { padding-left: 1.35em; }
.cb-prose ul { list-style: disc; }
.cb-prose ol { list-style: decimal; }
.cb-prose li { padding-left: 0.25em; }
.cb-prose li + li { margin-top: 0.4em; }
.cb-prose li::marker { color: var(--cb-teal); }
.cb-prose ol > li::marker { font-family: var(--cb-display); font-weight: 600; }

/* Quill editor classes that reach the public page. */
.cb-prose .ql-indent-1 { margin-left: 1.5em; }
.cb-prose .ql-indent-2 { margin-left: 3em; }
.cb-prose .ql-indent-3 { margin-left: 4.5em; }
.cb-prose .ql-align-center { text-align: center; }
.cb-prose .ql-align-right { text-align: right; }
.cb-prose img { max-width: 100%; height: auto; }

.cb-sec {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--cb-rule);
}
.cb-sec-title {
    margin: 0 0 16px;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--cb-bright);
}

/* Other open positions */
.cb-more { margin-top: clamp(64px, 9vw, 112px); }
.cb-more-title {
    margin: 0 0 20px;
    font-size: 26px;
    font-weight: 600;
    color: var(--cb-bright);
}
.cb-more-all {
    display: inline-block;
    margin-top: 20px;
    color: var(--cb-teal);
    font-size: 17px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.cb-more-all:hover { color: var(--cb-bright); }

/* Phone: apply stays one tap away once the inline button scrolls off. */
.cb-applybar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 20;
    padding: 12px var(--cb-gutter) calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(6, 26, 45, 0.92);
    border-top: 1px solid var(--cb-rule);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 0.22s ease, visibility 0s linear 0.22s;
}
.cb-applybar[data-visible="true"] {
    transform: none;
    visibility: visible;
    transition: transform 0.22s ease;
}
.cb-applybar .cb-btn { width: 100%; }

/* ---------- Footer ---------- */

.cb-foot {
    margin-top: 96px;
    border-top: 1px solid var(--cb-rule);
    background: rgba(10, 37, 64, 0.9);
    color: var(--cb-muted);
    font-size: 14px;
}
.cb-foot p { margin: 0; padding: 22px 0; text-align: center; }

/* ---------- Layouts ---------- */

/* Job page, phone and tablet: one column; facts and Apply sit under the title. */
@media (max-width: 1023.98px) {
    .cb-job {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "title" "facts" "apply" "main" "share";
    }
    .cb-rail { display: contents; }
    .cb-job-head { grid-area: title; }
    .cb-facts {
        grid-area: facts;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 20px;
    }
    .cb-fact {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
        padding: 10px 0;
    }
    .cb-fact + .cb-fact { border-top: 0; }
    .cb-fact:nth-child(n + 3) { border-top: 1px solid var(--cb-rule); }
    .cb-fact:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .cb-apply { grid-area: apply; margin: 20px 0 36px; }
    .cb-main { grid-area: main; }
    .cb-share {
        grid-area: share;
        margin-top: 40px;
        padding-top: 24px;
        border-top: 1px solid var(--cb-rule);
    }
    .cb-body--job .cb-foot { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}

/* Job page, desktop: description beside a sticky rail. */
@media (min-width: 1024px) {
    .cb-job {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 312px;
        grid-template-areas: "title rail" "main rail";
        grid-template-rows: auto 1fr;
        column-gap: clamp(48px, 6vw, 88px);
        align-items: start;
    }
    .cb-job-head { grid-area: title; }
    .cb-job-title { max-width: none; }
    .cb-main { grid-area: main; }
    .cb-rail {
        grid-area: rail;
        position: sticky;
        top: 28px;
        display: flex;
        flex-direction: column;
        gap: 24px;
    }
    .cb-applybar { display: none; }
}

/* Phone */
@media (max-width: 639.98px) {
    .cb-bar-home { font-size: 19px; }
    .cb-bar-link, .cb-bar-back { font-size: 15px; }
    .cb-cards { gap: 14px; }
    .cb-card { padding: 18px 18px 16px; }
    .cb-card-title { font-size: 21px; }
    .cb-job-sub { font-size: 19px; }
    .cb-intro-facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .cb-intro-facts > div + div dt { margin-top: 10px; }
    .cb-search { max-width: none; flex-basis: 100%; }
    .cb-results { flex-basis: 100%; margin-left: 0; }
    .cb-prose { font-size: 16.5px; line-height: 1.7; }
}

@media (prefers-reduced-motion: reduce) {
    .cb-body *, .cb-body *::before, .cb-body *::after {
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
    }
    .cb-card:hover { transform: none; }
}
