/* ==========================================================================
   Jobs
   ========================================================================== */

.jobs__toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.search {
    flex: 1;
    min-width: 280px;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 52px;
    padding: 0 18px;
    border-radius: 14px;
    background: var(--color-surface);
}

.search__icon {
    flex: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-text-faint);
    border-radius: 50%;
    position: relative;
    display: inline-block;
}

.search__icon::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 7px;
    background: var(--color-text-faint);
    transform: rotate(-45deg);
    left: 14px;
    top: 11px;
}

.search__input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text);
}

.chip {
    height: 44px;
    padding: 0 18px;
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 13.5px;
    background: var(--color-surface);
    color: var(--color-text);
    transition: all 0.2s;
    position: relative;
}

.chip.is-active {
    background: var(--color-dark);
    color: #fff;
}

/* Blinking border light on any active chip (format chips + the "hot"
   toggle), coloured to match that chip's own active background — no
   colour is introduced that isn't already on the button. */
.chip.is-active {
    --chip-light: var(--color-dark);
}

.chip.is-active::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    border: 1.5px solid var(--chip-light);
    box-shadow: 0 0 9px 1px var(--chip-light);
    pointer-events: none;
    animation: chipBorderBlink 1.3s ease-in-out infinite;
}

@keyframes chipBorderBlink {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .chip.is-active::before {
        animation: none;
        opacity: 0.85;
    }
}

.chip--hot {
    font-weight: 700;
    border: 1.5px solid var(--color-brand);
    background: transparent;
    color: var(--color-brand);
}

.chip--hot.is-active {
    background: var(--color-brand);
    color: #fff;
    --chip-light: var(--color-brand);
}

.jobs__layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    align-items: start;
}

.job-categories {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: sticky;
    top: 150px;
}

.job-categories__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    text-align: left;
    font-weight: 700;
    font-size: 14px;
    background: transparent;
    color: var(--color-text);
    transition: all 0.2s;
}

.job-categories__item.is-active {
    background: var(--color-brand);
    color: #fff;
}

.job-categories__count {
    font-weight: 700;
    font-size: 12px;
    opacity: 0.55;
}

.job-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.job-card {
    position: relative;
    /* keeps the decoration/content z-index below self-contained, so a card's
       raised content can never paint over a neighbouring card */
    isolation: isolate;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    padding: 24px;
    min-height: 196px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border: none;
    text-align: left;
    transition: transform 0.3s, box-shadow 0.3s;
}

.job-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card);
}

@keyframes jobCardIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.job-card.is-entering {
    animation: jobCardIn 0.45s cubic-bezier(.16, .8, .3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
    .job-card.is-entering {
        animation: none;
    }
}

/* Card decoration. ::before is the category pattern (filled in by the
   .job-card--* modifiers below), ::after the big floating blob — both are
   purely visual, so they stay out of the markup. The ring blob at the
   bottom-left is the one shape that still needs an element: three
   decorations, only two pseudo-elements. */
.job-card::before,
.job-card::after {
    content: '';
    position: absolute;
    z-index: 0;
    pointer-events: none;
}

.job-card::before {
    inset: 0;
}

.job-card::after {
    right: -46px;
    top: -46px;
    width: 170px;
    height: 170px;
    border-radius: var(--card-blob);
    background: var(--card-soft);
    opacity: 0.75;
    animation: floatShape 9s ease-in-out infinite alternate;
}

@keyframes floatShape {
    from {
        transform: translate(0, 0) scale(1);
    }
    to {
        transform: translate(-16px, 12px) scale(1.14);
    }
}

.job-card__blob {
    position: absolute;
    left: -24px;
    bottom: -34px;
    width: 90px;
    height: 90px;
    border-radius: var(--card-blob-2);
    border: 16px solid var(--card-soft);
    opacity: 0.4;
    pointer-events: none;
}

.job-card__top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.job-card__tag {
    display: inline-flex;
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.75);
    color: var(--card-accent);
    font-weight: 700;
    font-size: 10.5px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ui-kit.css [hidden] and this rule have equal specificity, so the display
   below can win and leave the badge on screen; make hidden explicit */
.job-card__hot[hidden] {
    display: none;
}

.job-card__hot {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: var(--radius-pill);
    background: var(--color-brand);
    color: #fff;
    font-weight: 800;
    font-size: 10px;
    letter-spacing: 1px;
}

.job-card__title {
    position: relative;
    z-index: 1;
    margin: 14px 0 0;
    font-weight: 800;
    font-size: 20px;
    line-height: 1.15;
    letter-spacing: -0.3px;
    color: var(--color-text);
    max-width: 300px;
}

.job-card__meta {
    position: relative;
    z-index: 1;
    margin-top: 7px;
    font-weight: 600;
    font-size: 13px;
    color: rgba(22, 23, 31, 0.55);
}

.job-card__bottom {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.job-card__salary {
    font-weight: 800;
    font-size: 15px;
    color: var(--color-text);
}

.job-card__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.job-card__hh {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    border-radius: var(--radius-pill);
    border: none;
    background: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(22, 23, 31, 0.08);
    font-weight: 700;
    font-size: 12px;
    color: var(--color-text);
}

/* the red "hh" square in front of the label */
.job-card__hh::before {
    content: 'hh';
    flex: none;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: #D6001C;
    color: #fff;
    font-weight: 900;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.5px;
}

.job-card__arrow {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--card-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}

/* Category modifiers — colors + patterns driven entirely by CSS, JS only toggles the class */

.job-card--dev {
    --card-bg: #EEF1FB;
    --card-soft: #C7D2F4;
    --card-accent: #3B5BDB;
    --card-blob: 28% 72% 64% 36% / 45% 30% 70% 55%;
    --card-blob-2: 50%;
}
.job-card--dev::before {
    background:
            repeating-linear-gradient(90deg, rgba(59, 91, 219, 0.07) 0 1px, transparent 1px 22px),
            repeating-linear-gradient(0deg, rgba(59, 91, 219, 0.07) 0 1px, transparent 1px 22px);
}

.job-card--sales {
    --card-bg: #FFF1E8;
    --card-soft: #FFCDA8;
    --card-accent: #E8702A;
    --card-blob: 50%;
    --card-blob-2: 30%;
}
.job-card--sales::before {
    background: repeating-linear-gradient(45deg, rgba(232, 112, 42, 0.07) 0 10px, transparent 10px 26px);
}

.job-card--marketing {
    --card-bg: #FCEEF4;
    --card-soft: #F4BBD2;
    --card-accent: #D6336C;
    --card-blob: 62% 38% 55% 45% / 45% 60% 40% 55%;
    --card-blob-2: 50%;
}
.job-card--marketing::before {
    background: repeating-radial-gradient(circle at 88% 12%, rgba(214, 51, 108, 0.08) 0 2px, transparent 2px 20px);
}

.job-card--support {
    --card-bg: #EBF6F0;
    --card-soft: #B9E2CD;
    --card-accent: #2F9E64;
    --card-blob: 40% 60% 60% 40% / 55% 45% 55% 45%;
    --card-blob-2: 50%;
}
.job-card--support::before {
    background: radial-gradient(rgba(47, 158, 100, 0.13) 1.5px, transparent 1.6px) 0 0 / 18px 18px repeat;
}

.job-card--ops {
    --card-bg: #F3EFFB;
    --card-soft: #D4C5F0;
    --card-accent: #7048B6;
    --card-blob: 24%;
    --card-blob-2: 24%;
}
.job-card--ops::before {
    background: repeating-linear-gradient(135deg, rgba(112, 72, 182, 0.07) 0 2px, transparent 2px 18px);
}

.job-card--hr {
    --card-bg: #FAF4E6;
    --card-soft: #EDD9A3;
    --card-accent: #B08900;
    --card-blob: 60% 40% 30% 70% / 50% 60% 40% 50%;
    --card-blob-2: 50%;
}
.job-card--hr::before {
    background: repeating-radial-gradient(circle at 15% 115%, rgba(176, 137, 0, 0.07) 0 8px, transparent 8px 20px);
}

.jobs__empty {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 44px;
    text-align: center;
}

.jobs__empty-title {
    font-weight: 800;
    font-size: 19px;
    color: var(--color-text);
    margin-bottom: 8px;
}

.jobs__empty-text {
    font-weight: 500;
    font-size: 14px;
    color: var(--color-text-muted);
}

/* ---- Responsive ------------------------------------------------------------ */

@media (max-width: 900px) {
    .jobs__layout {
        grid-template-columns: 1fr;
    }

    .job-categories {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
    }
}

@media (max-width: 720px) {
    .job-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Modals
   (the event modal's tags reuse .tag / .tag--accent, defined in life.css)
   ========================================================================== */

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.modal.is-open {
    display: flex;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 13, 18, 0.62);
    backdrop-filter: blur(6px);
    border: none;
    cursor: pointer;
}

.modal__panel {
    position: relative;
    width: 100%;
    max-width: 700px;
    max-height: 86vh;
    overflow: auto;
    background: #fff;
    border-radius: 24px;
    padding: 40px;
}

.modal__close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--color-surface);
    font-size: 16px;
    cursor: pointer;
    color: var(--color-text);
    z-index: 5;
}

.modal__close:hover {
    background: var(--color-surface-hover);
}

.job-detail__top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.job-detail__title {
    margin: 16px 0 0;
    font-weight: 800;
    font-size: 30px;
    line-height: 1.1;
    letter-spacing: -0.5px;
    color: var(--color-text);
}

.job-detail__meta {
    margin-top: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text-muted);
}

.job-detail__about {
    margin: 18px 0 0;
    font-weight: 500;
    font-size: 15px;
    line-height: 1.55;
    color: var(--color-text-secondary);
}

.job-detail__subhead {
    margin: 26px 0 12px;
    font-weight: 800;
    font-size: 16px;
    color: var(--color-text);
}

.job-detail__list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.job-detail__list-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 500;
    font-size: 14.5px;
    line-height: 1.45;
    color: var(--color-text);
}

/* bullet — a flex item like the old <span>, so the 10px gap still applies */
.job-detail__list-item::before {
    content: '';
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-brand);
    margin-top: 6px;
}

.job-detail__list--req .job-detail__list-item::before {
    background: var(--color-dark);
}

.job-detail__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.job-detail__hh {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 50px;
    padding: 0 20px;
}

/* the display above would otherwise win over the hidden attribute */
.job-detail__hh[hidden] {
    display: none;
}

.job-detail__hh-badge {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #D6001C;
    color: #fff;
    font-weight: 900;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.5px;
}

/* event modal (dark) */

.modal--event .modal__panel {
    max-width: 820px;
    max-height: 88vh;
    background: var(--color-dark);
    border-radius: 24px;
    padding: 0;
}

.modal--event .modal__close {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.modal--event .modal__close:hover {
    background: rgba(255, 255, 255, 0.24);
}

.event-detail__media {
    height: 340px;
    position: relative;
    background: #1C1D26;
}

.event-detail__body {
    padding: 34px 40px 40px;
}

.event-detail__tags {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.event-detail__title {
    margin: 0;
    font-weight: 800;
    font-size: 30px;
    line-height: 1.1;
    letter-spacing: -0.5px;
    color: #fff;
}

.event-detail__text {
    margin: 16px 0 0;
    font-weight: 500;
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--color-text-on-dark-secondary);
}
