/* Careers page (templates/pages/careers.php) and role pages (post-types/jobs). Roles read as Challenge Hub cards. */
.careers-page {
    background: #e3e9f5;
    color: #0f172a;
}

.careers-page ::selection {
    background: #ccfbf1;
    color: #0f172a;
}

.careers-container {
    width: calc(100% - (2 * var(--bambu-container-gutter, 24px)));
    max-width: var(--bambu-container-max-width, 1290px);
    margin-inline: auto;
}

.careers-narrow {
    max-width: 880px;
}

.careers-section {
    padding: 64px 0;
}

/* The first section follows the hero closely so the first row of roles fits a 900px-high screen. */
.careers-page > .careers-section:first-of-type {
    padding-top: 32px;
}

/* Hero copy clears the shared hero's decorative icons and reads at full contrast. */
.careers-page .hero-sub {
    max-width: 34rem;
    color: #e2e8f0;
    font-size: 17px;
    line-height: 1.6;
    text-wrap: pretty;
}

/* The hero buttons scroll within the page: a down arrow, not the external-link arrow of the shared hero. */
.careers-page .hero-ctas a > span {
    display: none;
}

.careers-page .hero-ctas a::after {
    content: "";
    width: 14px;
    height: 14px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M6 13l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M6 13l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.careers-section + .careers-section,
.careers-process + .careers-section {
    padding-top: 0;
}

.careers-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid #dce5ee;
}

.careers-section-head h2 {
    margin: 0;
    color: #0f172a;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.careers-section-head p {
    max-width: 62ch;
    margin: 6px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    text-wrap: pretty;
}

.careers-section-head h2,
.careers-apply-head h2,
.careers-card h3 {
    text-wrap: balance;
}

.careers-page a:focus-visible,
.careers-page button:focus-visible,
.careers-page select:focus-visible {
    outline: 2px solid #3ba295;
    outline-offset: 2px;
}

/* ---------- Filters (native selects: right on every phone) ---------- */
.careers-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.careers-filter select {
    min-height: 40px;
    padding: 10px 36px 10px 15px;
    border: 1px solid #dce5ee;
    border-radius: 8px;
    background: #fff 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='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 13px center / 12px no-repeat;
    color: #08162d;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.careers-filter select:hover {
    border-color: #94a3b8;
}

.careers-filter select.is-set {
    border-color: #3ba295;
    background-color: #f0fdfa;
    color: #042f2e;
    font-weight: 600;
}

.careers-head-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 16px;
}

.careers-count {
    margin: 0;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ---------- Challenge cards ---------- */
.careers-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.careers-card {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 10px;
    padding: 22px 24px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.careers-card[hidden] {
    display: none;
}

.careers-card:hover {
    border-color: #99f6e4;
    box-shadow: 0 12px 24px -16px rgba(15, 23, 42, 0.3);
    transform: translateY(-2px);
}

.careers-card:focus-within {
    border-color: #3ba295;
}

.careers-card-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.careers-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 9999px;
    background: #dcfce7;
    color: #166534;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.careers-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #16a34a;
}

.careers-status.is-closed {
    background: #f1f5f9;
    color: #475569;
}

.careers-status.is-closed i {
    background: #94a3b8;
}

.careers-team {
    padding: 3px 10px;
    border-radius: 9999px;
    background: #f0fdfa;
    color: #0f766e;
    font-size: 12px;
    font-weight: 600;
}

.careers-team.is-dark {
    background: rgba(255, 255, 255, 0.1);
    color: #a7f3d0;
}

.careers-card h3 {
    margin: 2px 0 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

/* The whole card opens the role; the title link stretches over it. */
.careers-card-link {
    color: #0f172a;
    text-decoration: none;
}

.careers-card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
}

.careers-card-link:focus-visible {
    outline: none;
}

.careers-card:hover .careers-card-link {
    color: #0f766e;
}

.careers-card-challenge {
    margin: 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
}

.careers-card-challenge strong,
.careers-job-challenge strong {
    font-weight: 700;
}

.careers-card-challenge strong {
    color: #0f172a;
}

.careers-card-foot {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}

.careers-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin: 0;
}

.careers-card-meta div {
    display: grid;
    gap: 2px;
}

.careers-card-meta dt {
    color: #94a3b8;
    font-size: 11px;
}

.careers-card-meta dd {
    margin: 0;
    color: #1e293b;
    font-size: 13px;
    font-weight: 600;
}

.careers-card-go {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #1f7a46;
    font-size: 13px;
    font-weight: 700;
}

.careers-card-go svg {
    transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.careers-card:hover .careers-card-go svg {
    transform: translateX(3px);
}

.careers-empty {
    padding: 40px 24px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.6);
    text-align: center;
}

.careers-empty[hidden] {
    display: none;
}

.careers-empty h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
}

.careers-empty p {
    max-width: 52ch;
    margin: 0 auto 16px;
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
}

.careers-link-button {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 18px;
    border: 2px solid #35ad68;
    border-radius: 9999px;
    background: #fff;
    color: #35ad68;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 160ms ease;
}

.careers-link-button:hover {
    background: #f0fdf4;
}

/* ---------- How we hire ---------- */
.careers-process {
    padding: 0 0 64px;
}

.careers-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    padding: 28px 32px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    background: #fff;
    list-style: none;
    counter-reset: careers-step;
}

.careers-steps li {
    position: relative;
    padding-right: 24px;
    counter-increment: careers-step;
}

.careers-steps li::before {
    content: counter(careers-step);
    display: grid;
    width: 32px;
    height: 32px;
    border: 2px solid #14b8a6;
    border-radius: 50%;
    background: #f0fdfa;
    color: #0f766e;
    font-size: 14px;
    font-weight: 800;
    place-items: center;
}

/* Line to the next step, in the brand gradient. */
.careers-steps li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 15px;
    right: 8px;
    left: 44px;
    height: 2px;
    background: linear-gradient(90deg, #35ad68, #227caf);
}

.careers-steps h3 {
    margin: 14px 0 4px;
    font-size: 17px;
    font-weight: 700;
}

.careers-steps p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.careers-steps span {
    display: inline-block;
    margin-top: 8px;
    color: #0f766e;
    font-size: 12px;
    font-weight: 600;
}

/* ---------- Role page ---------- */
.careers-job .hero .careers-card-badges {
    position: relative;
    z-index: 1;
    margin-bottom: 14px;
}

.careers-job .hero-title {
    max-width: 22ch;
    font-size: clamp(36px, 5vw, 56px);
    line-height: 1.08;
}

.careers-job-challenge {
    max-width: 36rem;
    color: #e2e8f0;
    font-size: 17px;
    line-height: 1.6;
}

.careers-job-challenge strong {
    color: #fff;
}

.careers-job-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}

.careers-job-body {
    min-width: 0;
    padding: 40px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    background: #fff;
}

.careers-closed {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    padding: 16px 20px;
    border-radius: 12px;
    background: #f8fafc;
    color: #334155;
    font-size: 14px;
    line-height: 1.6;
}

.careers-closed p {
    margin: 0;
}

.careers-prose {
    max-width: 70ch;
    color: #334155;
    font-size: 16px;
    line-height: 1.7;
}

.careers-prose > :first-child {
    margin-top: 0;
}

.careers-prose h2,
.careers-prose h3 {
    margin: 32px 0 12px;
    color: #0f172a;
    font-weight: 700;
    line-height: 1.3;
}

.careers-prose h2 {
    font-size: 22px;
}

.careers-prose h3 {
    font-size: 18px;
}

.careers-prose p,
.careers-prose ul,
.careers-prose ol {
    margin: 0 0 16px;
}

.careers-prose ul,
.careers-prose ol {
    padding-left: 22px;
}

.careers-prose ul {
    list-style: disc;
}

.careers-prose ol {
    list-style: decimal;
}

.careers-prose li + li {
    margin-top: 6px;
}

.careers-prose li::marker {
    color: #3ba295;
}

.careers-prose a {
    color: #0f766e;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.careers-job-aside {
    position: sticky;
    top: 96px;
}

.careers-details {
    display: grid;
    gap: 16px;
    padding: 24px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    background: #fff;
}

.careers-details h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.careers-details dl {
    display: grid;
    margin: 0;
}

.careers-details dl div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-top: 1px solid #f1f5f9;
    font-size: 14px;
}

.careers-details dt {
    color: #64748b;
}

.careers-details dd {
    margin: 0;
    color: #0f172a;
    font-weight: 600;
    text-align: right;
}

.careers-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.careers-back:hover {
    color: #0f766e;
}

/* ---------- Application form (same field language as Contact) ---------- */
.careers-apply {
    padding: 40px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    scroll-margin-top: 96px;
}

.careers-apply-head {
    margin-bottom: 24px;
}

.careers-apply-head h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.careers-apply-head p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

.careers-form {
    display: grid;
    gap: 20px;
}

.careers-form[hidden] {
    display: none;
}

.careers-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.careers-form-alert {
    margin: 0;
    padding: 12px 16px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 14px;
    font-weight: 600;
}

.careers-form-alert[hidden] {
    display: none;
}

.careers-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.careers-field {
    min-width: 0;
}

.careers-field-full {
    grid-column: 1 / -1;
}

.careers-field > label:first-child:not(.careers-consent) {
    display: block;
    margin-bottom: 8px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
}

.careers-required {
    color: #dc2626;
}

.careers-field input[type="text"],
.careers-field input[type="email"],
.careers-field input[type="tel"],
.careers-field input[type="url"],
.careers-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dce5ee;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font-family: inherit;
    font-size: 16px; /* 16px or more: iOS does not zoom into the field. */
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.careers-field textarea {
    min-height: 130px;
    line-height: 1.6;
    resize: vertical;
}

.careers-field input:focus,
.careers-field textarea:focus {
    border-color: #3ba295;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 162, 149, 0.15);
}

.careers-field.has-error input,
.careers-field.has-error textarea,
.careers-field.has-error .careers-file {
    border-color: #f87171;
}

.careers-field-error {
    margin: 6px 0 0;
    color: #dc2626;
    font-size: 12px;
}

.careers-field-error:empty {
    display: none;
}

.careers-file {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.careers-file:hover {
    border-color: #3ba295;
}

.careers-file:focus-within {
    border-color: #3ba295;
    box-shadow: 0 0 0 3px rgba(59, 162, 149, 0.15);
}

.careers-file input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.careers-file-button {
    flex: none;
    padding: 8px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
}

.careers-file-name {
    min-width: 0;
    overflow: hidden;
    color: #64748b;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.careers-file-name.is-chosen {
    color: #0f172a;
    font-weight: 600;
}

.careers-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #475569;
    font-size: 14px;
    line-height: 22px;
    cursor: pointer;
}

.careers-consent span {
    line-height: 22px;
}

.careers-consent input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 3px 0 0;
    accent-color: #0d9488;
}

.careers-consent a {
    color: #0f766e;
    font-weight: 600;
}

.careers-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 28px;
    border: 0;
    border-radius: 9999px;
    background: linear-gradient(90deg, #35ad68 0%, #1da095 28%, #227caf 55%, #7855a2 85%, #87516f 100%);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    transition: opacity 200ms ease, transform 200ms ease;
}

.careers-form .careers-submit {
    justify-self: start;
}

.careers-submit:hover:not(:disabled) {
    opacity: 0.88;
    transform: translateY(-1px);
}

.careers-submit:disabled {
    cursor: progress;
    opacity: 0.6;
}

.careers-submit [hidden] {
    display: none;
}

.careers-apply-success {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    border: 1px solid #99f6e4;
    border-radius: 12px;
    background: #f0fdfa;
    outline: none;
}

.careers-apply-success[hidden] {
    display: none;
}

.careers-apply-success-icon {
    display: grid;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0d9488;
    color: #fff;
    place-items: center;
}

.careers-apply-success h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
}

.careers-apply-success p {
    margin: 0;
    color: #334155;
    font-size: 14px;
    line-height: 1.6;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .careers-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .careers-job-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .careers-job-aside {
        position: static;
        order: -1;
    }
}

@media (max-width: 900px) {
    .careers-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px 0;
    }

    .careers-steps li:nth-child(2n)::after {
        display: none;
    }
}

@media (max-width: 767px) {
    /* The shared hero art is cropped to its centre on phones, right where its people icon sits behind the
       copy: show the right-hand side of the art instead and darken the copy side. */
    .careers-page .hero {
        background:
            linear-gradient(90deg, rgba(7, 17, 39, 0.9) 0%, rgba(7, 17, 39, 0.55) 70%, rgba(7, 17, 39, 0.2) 100%),
            #071127 url('/wp-content/uploads/2026/09/ambient-decorative-curve-lines.png') 100% center / cover no-repeat;
    }

    .careers-section {
        padding: 40px 0;
    }

    .careers-process {
        padding-bottom: 40px;
    }

    .careers-section-head h2 {
        font-size: 26px;
    }

    .careers-filters {
        width: 100%;
    }

    .careers-filter {
        flex: 1 1 140px;
    }

    .careers-filter select {
        width: 100%;
    }

    .careers-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .careers-steps {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding: 20px;
    }

    /* Vertical rail on phones. */
    .careers-steps li {
        display: grid;
        grid-template-columns: 32px minmax(0, 1fr);
        column-gap: 14px;
        padding: 0 0 22px;
    }

    .careers-steps li::before {
        grid-row: 1 / span 3;
    }

    .careers-steps li:not(:last-child)::after,
    .careers-steps li:nth-child(2n)::after {
        display: block;
        top: 36px;
        bottom: 4px;
        left: 15px;
        right: auto;
        width: 2px;
        height: auto;
        background: linear-gradient(180deg, #35ad68, #227caf);
    }

    .careers-steps h3 {
        margin-top: 5px;
    }

    .careers-steps li:last-child {
        padding-bottom: 0;
    }

    .careers-job-body,
    .careers-apply {
        padding: 24px 20px;
    }

    .careers-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .careers-form .careers-submit {
        justify-self: stretch;
    }
}

@media (prefers-reduced-motion: reduce) {
    .careers-card,
    .careers-card-go svg,
    .careers-submit {
        transition: none;
    }

    .careers-card:hover {
        transform: none;
    }
}
