/* =============================================================================
   Careers listing — responsive UI (mobile → desktop, all breakpoints)
   Loads after Kindflow; uses .haft-careers-* and .haft-careers-section scoping
   ============================================================================= */

/* Safe areas (notched devices) + consistent horizontal padding */
.haft-careers-banner .container-large,
.haft-careers-intro-section .w-container,
.haft-careers-values .w-container,
.haft-careers-open-wrap .w-container,
.haft-careers-section .w-container {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

/* ----- Hero banner ----- */
.haft-careers-banner .banner-title-wrap {
    max-width: min(100%, 52rem);
}

.haft-careers-banner .banner-subtitle {
    font-size: clamp(0.8125rem, 2.1vw, 0.9375rem);
    letter-spacing: 0.06em;
}

.haft-careers-banner .banner-title {
    font-size: clamp(1.65rem, 5vw, 2.85rem);
    line-height: 1.12;
    word-wrap: break-word;
    hyphens: auto;
}

/* ----- Intro ----- */
.haft-careers-intro-section {
    padding: clamp(1.25rem, 4vw, 2.75rem) 0 0;
}

.haft-careers-intro {
    max-width: min(48rem, 100%);
    font-size: clamp(0.9375rem, 2.15vw, 1.0625rem);
    line-height: 1.65;
}

.haft-careers-intro p {
    margin-bottom: 0.75em;
}

.haft-careers-intro p:last-child {
    margin-bottom: 0;
}

/* ----- “Why work with HAFT” ----- */
.haft-careers-values {
    padding: clamp(1.5rem, 5vw, 2.75rem) 0 clamp(1rem, 3vw, 1.5rem);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.92) 0%, rgba(255, 255, 255, 0) 100%);
}

.haft-careers-values-title {
    font-size: clamp(1.35rem, 4vw, 1.9rem);
    font-weight: 700;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.haft-careers-values-lede {
    max-width: min(40rem, 100%);
    margin: 0 0 clamp(1.25rem, 3vw, 1.85rem);
    line-height: 1.6;
    font-size: clamp(0.9375rem, 2vw, 1rem);
    opacity: 0.88;
}

.haft-careers-values-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1rem, 3vw, 1.35rem);
}

@media screen and (min-width: 640px) {
    .haft-careers-values-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (min-width: 1024px) {
    .haft-careers-values-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.haft-careers-value-card {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: clamp(10px, 2vw, 14px);
    padding: clamp(1.1rem, 3vw, 1.4rem) clamp(1rem, 2.5vw, 1.35rem) clamp(1.25rem, 3vw, 1.5rem);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition:
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
    min-height: 0;
}

.haft-careers-value-card:hover {
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.09);
}

.haft-careers-value-icon {
    display: inline-block;
    font-size: 0.75rem;
    opacity: 0.45;
    margin-bottom: 0.35rem;
}

.haft-careers-value-heading {
    font-size: clamp(1rem, 2.5vw, 1.08rem);
    font-weight: 600;
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.haft-careers-value-text {
    margin: 0;
    font-size: clamp(0.9rem, 2vw, 0.95rem);
    line-height: 1.55;
    opacity: 0.9;
}

/* ----- Open positions header ----- */
.haft-careers-open-wrap {
    padding: clamp(1.15rem, 3.5vw, 2rem) 0 clamp(0.65rem, 2vw, 1rem);
}

.haft-careers-open-header {
    max-width: min(40rem, 100%);
}

.haft-careers-section-title {
    font-size: clamp(1.25rem, 3.5vw, 1.65rem);
    font-weight: 700;
    margin: 0 0 0.4rem;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.haft-careers-section-lede {
    margin: 0;
    line-height: 1.55;
    font-size: clamp(0.9rem, 2vw, 1rem);
    opacity: 0.85;
}

/* ----- Listing section: calmer vertical rhythm than default Kindflow event-section ----- */
.haft-careers-section.event-section {
    padding-top: clamp(2rem, 6vw, 4.5rem);
    padding-bottom: clamp(2rem, 5.5vw, 4rem);
}

/* Theme sets .event-area { max-width: 80% } under 767px — too narrow for job cards */
.haft-careers-section .event-area {
    max-width: 100% !important;
    width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Match Kindflow .container at 1280px+ — avoid a narrow 940px strip on large monitors */
@media screen and (min-width: 992px) {
    .haft-careers-intro-section .w-layout-blockcontainer.container,
    .haft-careers-values .w-layout-blockcontainer.container,
    .haft-careers-open-wrap .w-layout-blockcontainer.container,
    .haft-careers-section .w-layout-blockcontainer.container {
        max-width: min(1200px, 100%);
    }
}

/* Job grid: auto-fit columns so large screens get 2–3 balanced cards without huge empty gutters */
.haft-careers-section .haft-careers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1rem, 2.5vw, 1.75rem);
    width: 100%;
    align-items: stretch;
}

@media screen and (min-width: 640px) {
    .haft-careers-section .haft-careers-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    }
}

.haft-careers-section .haft-careers-grid > .w-dyn-item {
    display: flex;
    min-width: 0;
}

.haft-careers-section .haft-careers-grid > .w-dyn-item > .event-card {
    flex: 1 1 auto;
    width: 100%;
    min-height: 100%;
}

/* Defensive: hide listing image if old markup or cache still includes it */
.haft-careers-section .event-card-image-link,
.haft-careers-section .event-card-image {
    display: none !important;
}

/* ----- Text-only job cards (no listing image — avoids Kindflow image stretch bugs) ----- */
.haft-careers-section .event-card.haft-career-card--text-only {
    display: flex !important;
    flex-flow: column nowrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    width: 100%;
    min-width: 0;
    height: auto !important;
    margin-bottom: 0;
    box-sizing: border-box;
    overflow: hidden;
    padding: clamp(1.1rem, 3.2vw, 1.5rem);
    border-radius: clamp(14px, 2.5vw, 18px);
    gap: 0 !important;
}

.haft-careers-section .event-card.haft-career-card--text-only .event-card-line-break {
    display: none !important;
}

/* Kill Kindflow .event-card-area { justify-content: space-around; align-items: center } */
.haft-careers-section .event-card.haft-career-card--text-only .haft-career-card-area,
.haft-careers-section .event-card.haft-career-card--text-only .event-card-area {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: clamp(0.85rem, 2.5vw, 1.15rem);
    grid-column-gap: 0 !important;
    grid-row-gap: 0 !important;
}

/* ≥600px: body left, CTA right — align to start so multi-line roles don’t float oddly on wide cards */
@media screen and (min-width: 600px) {
    .haft-careers-section .event-card.haft-career-card--text-only .haft-career-card-area,
    .haft-careers-section .event-card.haft-career-card--text-only .event-card-area {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
    }

    .haft-careers-section .event-card.haft-career-card--text-only .event-content-wrap {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        max-width: none !important;
        padding-right: clamp(0.5rem, 2vw, 1.25rem);
    }

    .haft-careers-section .event-card.haft-career-card--text-only .event-card-button-wrap {
        flex: 0 0 auto !important;
        align-self: flex-start !important;
        margin-top: 0.15rem;
        padding-top: 0 !important;
    }
}

.haft-careers-section .event-card.haft-career-card--text-only .event-content-wrap {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.haft-career-card {
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.haft-career-card:hover {
    transform: translateY(-2px);
}

.haft-career-card-org {
    margin: 0.2rem 0 0.45rem;
    font-size: clamp(0.85rem, 2vw, 0.9rem);
    opacity: 0.76;
    line-height: 1.35;
}

.haft-careers-section .event-card-title.font-large {
    font-size: clamp(1.05rem, 2.8vw, 1.32rem);
    line-height: 1.28;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.haft-careers-section .event-card-content {
    font-size: clamp(0.9rem, 2.1vw, 0.98rem);
    line-height: 1.55;
    margin-top: 0.35rem;
}

/* Meta: stacked rows with icon + text */
.haft-careers-section .event-details-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.haft-careers-section .event-details-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    min-width: 0;
}

.haft-careers-section .event-post-details-icon-wrap {
    flex-shrink: 0;
}

.haft-careers-section .event-details-text {
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    line-height: 1.45;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

/* CTA */
.haft-careers-section .event-card.haft-career-card--text-only .event-card-button-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: stretch;
    width: 100%;
    padding-top: 0.15rem;
}

@media screen and (min-width: 600px) {
    .haft-careers-section .event-card.haft-career-card--text-only .event-card-button-wrap {
        width: auto;
        justify-content: flex-end;
    }
}

.haft-careers-section .event-card-button-wrap .primary-button {
    min-height: 44px;
    padding: 0.65rem 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.9rem, 2vw, 0.95rem);
    box-sizing: border-box;
    width: 100%;
    white-space: normal !important;
    text-align: center;
    line-height: 1.25;
}

@media screen and (min-width: 600px) {
    .haft-careers-section .event-card-button-wrap .primary-button {
        width: auto;
        min-width: 8.5rem;
    }
}

/* Empty state */
.haft-careers-empty {
    text-align: center;
}

.haft-careers-empty-inner {
    padding: clamp(2rem, 6vw, 3rem) clamp(1rem, 4vw, 1.75rem);
    border: 1px dashed rgba(15, 23, 42, 0.15);
    border-radius: clamp(12px, 2vw, 16px);
    background: rgba(248, 250, 252, 0.65);
}

.haft-careers-empty-title {
    font-size: clamp(1.05rem, 3vw, 1.2rem);
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.haft-careers-empty-text {
    margin: 0 auto;
    max-width: 34rem;
    line-height: 1.6;
    font-size: clamp(0.9rem, 2.2vw, 1rem);
    opacity: 0.88;
}

/* Pagination: wrap + touch targets */
.haft-careers-section .haft-events-laravel-pagination {
    margin-top: clamp(1.5rem, 4vw, 2.5rem);
    padding-top: clamp(1.25rem, 3vw, 1.75rem);
}

.haft-careers-section .haft-events-laravel-pagination nav,
.haft-careers-section .haft-events-laravel-pagination .pagination,
.haft-careers-section .haft-events-laravel-pagination .paginations {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem 0.5rem;
    row-gap: 0.5rem;
    width: 100%;
}

.haft-careers-section .haft-events-laravel-pagination .pager {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem 0.65rem !important;
    row-gap: 0.5rem !important;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.haft-careers-section .haft-events-laravel-pagination .pager li {
    display: flex;
    align-items: center;
    justify-content: center;
}

.haft-careers-section .haft-events-laravel-pagination a,
.haft-careers-section .haft-events-laravel-pagination span:not(.page-dotted) {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0.35rem 0.55rem;
}

.haft-careers-section .haft-events-laravel-pagination .page-dotted {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 0.25rem;
}

/* Career detail — single apply CTA (icon + email), no duplicate rich-text mailto */
.haft-career-detail-summary .haft-career-apply-email {
    margin-top: 1.25rem;
    padding-top: 0.25rem;
}

.haft-career-detail-summary .haft-career-email-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    max-width: 100%;
    text-transform: none !important;
    letter-spacing: normal !important;
    box-sizing: border-box;
}

.haft-career-detail-summary .haft-career-email-btn__icon {
    display: flex;
    flex-shrink: 0;
    line-height: 0;
}

.haft-career-detail-summary .haft-career-email-btn__icon svg {
    display: block;
}

.haft-career-detail-summary .haft-career-email-btn__text {
    font-size: clamp(0.9rem, 2vw, 0.98rem);
    font-weight: 600;
    word-break: break-all;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .haft-career-card,
    .haft-careers-value-card {
        transition: none !important;
    }

    .haft-career-card:hover {
        transform: none;
    }
}
