/**
 * Job Board Styles - Modern & Responsive
 */

:root {
    --jobvite-primary: #4B667C;
    --jobvite-secondary: #f4f7fa;
    --jobvite-text: #333;
    --jobvite-text-light: #666;
    --jobvite-border: #e1e1e1;
    --jobvite-white: #ffffff;
    --jobvite-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    --jobvite-apply-color: #4B667C;
}

.job-board-container {
    /* Full-bleed so the board isn't capped by a boxed Elementor container (which
       defaults to ~1140px). The inner form/results center at the main JL content
       width (1352px = 1512 design − 2×80 margins), aligning with the featured band.
       calc() margins avoid the horizontal overflow a fixed 100vw width causes. */
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: 56px;
    margin-bottom: 56px;
    padding: 0 20px;
    box-sizing: border-box;
    font-family: 'Open Sans', sans-serif;
    color: var(--jobvite-text);
}

.job-board-form,
.job-board-results {
    max-width: 1352px;
    margin-left: auto;
    margin-right: auto;
}

/* Filter Bar — single row: Role Category · Location · Job Type · Search */
.job-board-form {
    margin-bottom: 40px;
}

/* Plain filter row on the page background (no card), matching the mock. */
.job-board-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 24px;
}

.filter-group {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--jobvite-text-light);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.filter-group select {
    width: 100%;
    height: 46px;
    box-sizing: border-box;
    padding: 12px 40px 12px 16px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background-color: var(--jobvite-white);
    color: var(--jobvite-text);
    font-size: 14px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.search-jobs-button {
    /* flex:1 0 0 per the Figma spec — grows to share the filter row. */
    flex: 1 0 0;
    /* !important on the flex props too — the Elementor kit's form-button rule
       otherwise forces display:block, dropping the icon onto its own line. */
    display: flex !important;
    align-items: center !important;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 20px;
    /* !important overrides the Elementor kit's form-button styling (which otherwise
       renders it as a pink/accent outlined button). */
    background: var(--jobvite-primary) !important;
    color: var(--jobvite-white) !important;
    border: none !important;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s;
}

.search-jobs-button:hover,
.search-jobs-button:focus,
.search-jobs-button:active {
    background: #3d5468 !important;
    color: var(--jobvite-white) !important;
}

.search-jobs-button .search-icon {
    flex-shrink: 0;
    display: block;
    width: 14px;
    height: 14px;
}

.job-board-active-filters {
    margin-top: 16px;
}

.clear-filters-link {
    font-size: 13px;
    color: var(--jobvite-text-light);
    text-decoration: none;
}

.clear-filters-link:hover {
    text-decoration: underline;
}

/* Job Listings — category sections with a card grid */
.job-category-section {
    margin-bottom: 56px;
}

.job-category-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 20px;
    margin-bottom: 32px;
    border-bottom: 1px solid #E5E7EB;
}

.job-category-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #F3F4F6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--jobvite-primary);
}

.job-category-heading {
    flex: 1;
    min-width: 0;
}

/* Title + count share a row on desktop (space-between), stack on mobile. */
.job-category-heading-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.job-category-title {
    margin: 0;
    font-family: "Gotham Office", "Gotham", "Inter", sans-serif;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--jobvite-primary);
}

.job-category-desc {
    margin: 4px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: #6B7280;
    white-space: nowrap;
}

.job-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.job-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: #FFF;
}

.job-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.job-card-title {
    margin: 0;
    font-family: "Gotham Office", "Gotham", "Inter", sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    color: #1A1D23;
}

.job-card-meta {
    font-size: 12px;
    gap: 20px;
}

/* Job Detail Meta Block */
.job-detail-meta {
    margin: 2em 0;
    padding: 25px;
    background: var(--jobvite-secondary);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: center;
}

.job-detail-meta .meta-item {
    display: flex;
    flex-direction: column;
}

.job-detail-meta .meta-item strong {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--jobvite-text-light);
    margin-bottom: 5px;
}

.job-detail-meta .meta-item span {
    font-size: 16px;
    font-weight: 600;
}

.job-detail-meta .apply-button {
    margin-left: auto;
}

/* Featured Positions */
.job-board-featured {
    /* Full-bleed light band with a bottom divider, matching the mock — spans the
       viewport even when the widget lives inside a boxed Elementor container.
       Overridable via the widget's Style > Section controls. */
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
    /* Robust full-bleed: pull the margins out to the viewport edges without forcing
       a 100vw width, which overflows inside a narrower/padded (boxed) container. */
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 56px 20px 64px;
    box-sizing: border-box;
    font-family: 'Open Sans', sans-serif;
    color: var(--jobvite-text);
}

/* Canonical JL section heading size (matches the theme's .jl-split__heading —
   Figma H4) so the board's headings sit consistently with the rest of the site. */
.featured-title {
    text-align: center;
    font-family: "Gotham Office", "Gotham", "Inter", sans-serif;
    font-size: clamp(1.75rem, 2.12vw, 2rem); /* 28px min → 32px at 1512px */
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #343333;
    margin: 0 0 20px;
}

/* Matches the theme's centered divider variant (.jl-cards__divider--narrow):
   128px × 2px, slate fading symmetrically to transparent at both ends. */
.featured-title::after {
    content: "";
    display: block;
    width: 128px;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--e-global-color-slate, #4b667c) 50%, transparent);
    margin: 20px auto 0;
}

.featured-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    max-width: 1352px;
    margin: 40px auto 0;
}

/* Card spec sourced from the design system (Borders/border-primary #E5E7EB).
   Cards flex to share the row (up to 400px each) so 3 sit across in a normal
   boxed container and wrap to 2 / 1 as space shrinks — no full-width container
   required. */
.featured-card {
    display: flex;
    flex: 1 1 300px;
    min-width: 0;
    max-width: 400px;
    padding: 24px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    background: #FFF;
}

.featured-card-head {
    align-self: stretch;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.featured-card-title {
    margin: 0;
    font-family: "Gotham Office", "Gotham", "Inter", sans-serif;
    font-size: 20px;
    font-weight: 350;
    line-height: 28px;
    letter-spacing: -0.5px;
    color: #1A1D23;
}

.featured-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
    font-family: "Gotham Office", "Gotham", "Inter", sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    letter-spacing: -0.492px;
    color: #6B7280;
}

.featured-card-location,
.featured-card-type {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.featured-card-meta .meta-icon {
    display: inline-flex;
    align-items: center;
    color: #6B7280;
}

.featured-card-meta .meta-icon svg {
    width: 16px;
    height: 16px;
}

.featured-card-excerpt {
    margin: 0;
    font-family: "Gotham Office", "Gotham", "Inter", sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 22.75px;
    letter-spacing: -0.492px;
    color: #6B7280;
}

.featured-card-link,
.job-card-link {
    margin-top: auto;
    align-self: flex-start;
    /* inline-flex (not flex) so the button stays sized to its label, not full-width. */
    display: inline-flex;
    height: 32px;
    padding: 6.75px 12px 8.25px 12px;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    border-radius: 4px;
    background: #4B667C;
    /* !important beats the project-wide `a { color: slate !important }` reset in the theme's style.css. */
    color: #FFFFFF !important;
    text-align: center;
    font-family: "Gotham Office", "Gotham", "Inter", sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    letter-spacing: 0.55px;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.2s;
}

/* Keep the label white in every link state — beats the theme's
   `a:hover, a:focus { color: dark-navy !important }` (specificity 0,1,1);
   these 0,2,0 rules win. Without :focus/:active the text recolors after a click. */
.featured-card-link:link,
.featured-card-link:visited,
.featured-card-link:hover,
.featured-card-link:focus,
.featured-card-link:active,
.job-card-link:link,
.job-card-link:visited,
.job-card-link:hover,
.job-card-link:focus,
.job-card-link:active {
    color: #FFFFFF !important;
}

.featured-card-link:hover,
.job-card-link:hover {
    background: #3d5468;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .job-board-container {
        margin-top: 40px;
        margin-bottom: 40px;
        padding: 0 24px;
    }

    .job-board-featured {
        padding: 40px 24px;
    }

    .featured-cards {
        gap: 40px;
        width: 100%;
        max-width: 100%;
    }

    .featured-card {
        max-width: 100%;
    }

    .job-board-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 24px;
    }

    .search-jobs-button {
        width: 100%;
    }

    /* One column, 40px between stacked cards (mock). */
    .job-cards-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .job-category-section {
        margin-bottom: 40px;
    }

    /* Stack title over count on mobile (mock: title / count / description). */
    .job-category-heading-row {
        flex-direction: column;
        gap: 2px;
    }

    .job-category-desc {
        white-space: normal;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .job-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   Non-Crew: Departments section (GSOC/Base toggle + card grid)
   ========================================================================== */
.job-departments {
    padding: 56px 20px 72px;
}

.job-departments-inner {
    max-width: 1352px;
    margin: 0 auto;
    text-align: center;
}

/* Canonical JL section heading size (matches the theme's .jl-split__heading —
   Figma H4) so the departments heading sits consistently with the rest of the site. */
.job-departments-title {
    text-align: center;
    font-family: "Gotham Office", "Gotham", "Inter", sans-serif;
    font-size: clamp(1.75rem, 2.12vw, 2rem); /* 28px min → 32px at 1512px */
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #1A1D23;
    margin: 0;
}

.job-departments-title::after {
    content: "";
    display: block;
    width: 128px;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--e-global-color-slate, #4b667c) 50%, transparent);
    margin: 20px auto 0;
}

/* Segmented toggle — inline-grid with equal (1fr) columns so both segments are
   exactly the same width regardless of label length. */
.job-departments-toggle {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 6px;
    margin: 40px auto 48px;
    padding: 6px;
    background: #F9FAFB;
    border: 1px solid #E9EBEE;
    border-radius: 14px;
    max-width: 100%;
    vertical-align: middle;
}

.dept-toggle-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 11px 24px;
    /* Neutralize the Elementor kit's global button styling (pink accent, block
       display) so the segmented toggle reads correctly. */
    border: 0 !important;
    border-radius: 10px !important;
    background: transparent !important;
    color: #6B7280 !important;
    font-family: "Gotham Office", "Gotham", "Inter", sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.dept-toggle-btn:hover,
.dept-toggle-btn:focus {
    color: #1A1D23 !important;
    background: transparent !important;
}

.dept-toggle-btn.is-active {
    background: #FFFFFF !important;
    color: #1A1D23 !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 2px 5px rgba(16, 24, 40, 0.08) !important;
}

.dept-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    color: #9CA3AF;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}

.dept-toggle-icon svg {
    display: block;
    width: 17px;
    height: 17px;
}

.dept-toggle-label {
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
}

.dept-toggle-btn.is-active .dept-toggle-icon {
    color: var(--jobvite-primary, #4B667C);
    border-color: var(--jobvite-primary, #4B667C);
}

/* Card grid */
.job-departments-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    text-align: left;
    /* Stretch every card to the tallest in the row (grid default). The button
       row pins to the bottom (see .dept-card-divider) so buttons still align. */
    align-items: stretch;
}

.job-departments-grid[hidden] {
    display: none;
}

.job-departments-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #6B7280;
    font-size: 16px;
    margin: 0;
    padding: 24px 0;
}

.dept-card {
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border: 1px solid #EBEDF0;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.dept-card:hover,
.dept-card:focus {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(16, 24, 40, 0.12);
    border-color: #E0E3E8;
}

.dept-card-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 11;
    background: #EEF1F4;
    overflow: hidden;
}

.dept-card-img {
    position: absolute;
    inset: 0;
    /* !important beats the theme's global `img { height: auto }`, which would
       otherwise collapse the image to its intrinsic height and expose the
       media container's background below it. */
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    object-fit: cover;
    display: block;
}

.dept-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;   /* fill the (grid-stretched) card height so the button can pin to the bottom */
    padding: 36px;
}

.dept-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.dept-card-title {
    font-family: "Gotham Office", "Gotham", "Inter", sans-serif;
    font-size: 30px;
    font-weight: 400;
    line-height: 1.2;
    color: #1A1D23;
    letter-spacing: -0.5px;
}

.dept-card-icons {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    color: #1A1D23;
}

.dept-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1A1D23;
}

.dept-card-desc {
    font-size: 17px;
    line-height: 1.6;
    color: #6B7280;
    margin: 20px 0 0;
}

.dept-card-divider {
    display: block;
    height: 1px;
    background: #E5E7EB;
    /* Fixed 28px above (after the copy) and below, so the divider keeps its
       spacing on every card. The button (not the divider) pins to the bottom. */
    margin: 28px 0;
}

/* "View Positions" — outlined button, not a text link */
.dept-card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    /* Pin the button to the bottom of the (equal-height) card so buttons line
       up across the row, without disturbing the divider's spacing above. */
    margin-top: auto;
    padding: 14px 30px;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    font-family: "Gotham Office", "Gotham", "Inter", sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #374151 !important;
    background: transparent;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.dept-card:hover .dept-card-link,
.dept-card:focus .dept-card-link {
    background: var(--jobvite-primary, #4B667C);
    border-color: var(--jobvite-primary, #4B667C);
    color: #FFFFFF !important;
}

/* Tablet */
@media (max-width: 1024px) {
    .job-departments-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 640px) {
    .job-departments-toggle {
        grid-auto-flow: row;
        width: 100%;
    }

    .dept-toggle-btn {
        justify-content: flex-start;
    }

    .job-departments-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .dept-card-body {
        padding: 28px;
    }

    .dept-card-title {
        font-size: 26px;
    }
}
