/**
 * Portal presentation overrides. Loaded after the existing compiled styles.
 * Sheet visibility, positioning and view switching stay in portal.min.css/JS.
 */

.astro-main--portal {
    background: #f5f7fb;
    color: #172b4d;
    padding: 0;
}

/* The hero is shared by the portal and the server-rendered home view. */
.astro-hero {
    background: linear-gradient(120deg, var(--astro-primary-dark, #0f1d30), var(--astro-primary, #162e5b));
    padding: 36px 20px 26px;
    text-align: center;
}

.astro-hero .astro-hero__content {
    margin: 0 auto 24px;
    max-width: 760px;
}

.astro-hero .astro-hero__eyebrow {
    color: #93e1ca;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.astro-hero .astro-hero__title {
    color: #fff;
    font-size: clamp(28px, 3.8vw, 44px);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.15;
    margin: 0 0 14px;
    text-wrap: balance;
}

.astro-hero .astro-hero__sub {
    color: #d0dbea;
    font-size: clamp(14px, 1.5vw, 16px);
    line-height: 1.65;
    margin: 0 auto;
    max-width: 640px;
    text-wrap: pretty;
}

.astro-hero .astro-hero__search {
    margin: 0 auto 22px;
    max-width: 960px;
    text-align: left;
    width: 100%;
}

.astro-hero .astro-hero__search-row {
    max-width: 960px;
    min-width: 0;
    width: 100%;
}

.astro-hero .astro-hero__search-box {
    background: #fff;
    border: 1px solid #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgb(5 18 39 / 12%);
    min-height: 52px;
    min-width: 0;
    padding: 10px 16px;
    transition: box-shadow 160ms ease, border-color 160ms ease;
}

.astro-hero .astro-hero__search-box svg {
    opacity: 1;
    stroke: #536885;
}

.astro-hero .astro-hero__search-box input {
    color: #172b4d;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    min-width: 0;
    padding: 0;
}

.astro-hero .astro-hero__search-box input::placeholder {
    color: #66778f;
    opacity: 1;
}

.astro-hero .astro-hero__search-box:focus-within {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgb(147 197 253 / 45%);
}

.astro-hero .astro-hero__dept-combo {
    background: rgb(255 255 255 / 9%);
    border: 1px solid rgb(255 255 255 / 28%);
    border-radius: 12px;
    min-height: 52px;
    padding: 10px 14px;
}

.astro-hero .astro-hero__dept-label {
    color: #fff;
    font-size: 15px;
    line-height: 1.5;
    min-width: 0;
}

.astro-hero .astro-hero__dept-icon,
.astro-hero .astro-hero__dept-chevron {
    color: #d2e1f3;
    opacity: 1;
}

.astro-hero .astro-hero__dept-icon {
    height: 22px;
    width: 22px;
}

.astro-hero .astro-hero__actions {
    gap: 10px;
}

.astro-hero .astro-hero__btn {
    background: var(--astro-accent, #4fc4a0);
    border: 1px solid transparent;
    border-radius: 12px;
    color: #102d35;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    min-height: 52px;
    padding: 12px 22px;
    transition: background 160ms ease, box-shadow 160ms ease;
}

.astro-hero .astro-hero__btn:hover {
    background: #7bd9bc;
    color: #102d35;
    box-shadow: 0 4px 14px rgb(5 18 39 / 15%);
}

.astro-hero .astro-hero__filter-btn {
    border: 1px solid rgb(255 255 255 / 28%);
    border-radius: 12px;
    height: 52px;
    width: 52px;
}

.astro-hero :is(.astro-hero__btn, .astro-hero__filter-btn, .astro-hero__dept-combo):focus-visible {
    outline: 3px solid #a7d3ff;
    outline-offset: 4px;
}

.astro-hero .astro-hero__stats {
    background: transparent;
    border-top: 1px solid rgb(255 255 255 / 14%);
    margin: 0 auto;
    max-width: 640px;
    padding: 18px 0 0;
    width: 100%;
}

.astro-hero .astro-hero__stat {
    flex: 1;
    min-width: 0;
    padding: 0 10px;
}

.astro-hero .astro-hero__stat + .astro-hero__stat {
    border-left-color: rgb(255 255 255 / 18%);
}

.astro-hero .astro-hero__stat-value {
    color: #fff;
    font-size: clamp(17px, 2vw, 22px);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 5px;
    white-space: nowrap;
}

.astro-hero .astro-hero__stat-label {
    color: #c0cee1;
    font-size: 12px;
    line-height: 1.4;
}

/* Department options retain their existing mobile sheet/desktop dropdown. */
.astro-hero .astro-hero__dept-dropdown {
    background: #fff;
    color: #172b4d;
    text-align: left;
}

.astro-hero .astro-hero-dept-sheet-header {
    border-color: #e2e8f0;
    padding: 0 20px 14px;
}

.astro-hero .astro-hero-dept-sheet-title {
    color: #172b4d;
    font-size: 17px;
    font-weight: 700;
}

.astro-hero .astro-hero-dept-sheet-close {
    background: #f0f4f9;
    border-radius: 10px;
    color: #314764;
    height: 44px;
    width: 44px;
}

.astro-hero .astro-hero-dept-option {
    color: #243b5a;
    font-size: 15px;
    line-height: 1.45;
    min-height: 46px;
    padding: 12px 18px;
}

.astro-hero .astro-hero-dept-option + .astro-hero-dept-option {
    border-top-color: #edf1f6;
}

.astro-hero .astro-hero-dept-option.is-active {
    background: #edf4ff;
    color: var(--astro-primary, #162e5b);
    font-weight: 600;
}

.astro-hero :is(.astro-hero-dept-sheet-close, .astro-hero-dept-option):focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: -3px;
}

/* Results and the existing list/grid view classes. */
.astro-main--portal .astro-portal-layout {
    gap: 24px;
    margin: 0 auto;
    max-width: 1300px;
    padding: 28px 16px 48px;
}

.astro-main--portal .astro-portal-main {
    min-width: 0;
}

.astro-main--portal .astro-portal-section-head {
    padding: 0 0 18px;
}

.astro-main--portal .astro-portal-section-title {
    color: #172b4d;
    font-size: clamp(21px, 2.2vw, 26px);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.3;
    margin: 0;
}

.astro-main--portal .astro-sort-bar {
    background: #fff;
    border: 1px solid #e0e7f0;
    border-radius: 12px;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-bottom: 16px;
    padding: 10px 12px;
}

.astro-main--portal .astro-sort-bar__results {
    color: #5b6b82;
    font-size: 14px;
    line-height: 1.5;
}

.astro-main--portal .astro-sort-bar__results strong {
    color: #172b4d;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.astro-main--portal .astro-sort-bar__right {
    gap: 10px;
    margin-left: auto;
    min-width: 0;
}

.astro-main--portal .astro-view-toggle {
    gap: 4px;
    margin-right: 0;
}

.astro-main--portal .astro-view-toggle__btn {
    background: #fff;
    border: 1px solid #dce4ef;
    border-radius: 9px;
    color: #5b6b82;
    height: 44px;
    width: 44px;
}

.astro-main--portal .astro-view-toggle__btn.is-active {
    background: var(--astro-primary, #162e5b);
    border-color: var(--astro-primary, #162e5b);
    color: #fff;
}

.astro-main--portal .astro-sort-wrap {
    border: 1px solid #dce4ef;
    border-radius: 9px;
    min-height: 44px;
    padding: 10px 12px;
}

.astro-main--portal .astro-sort-wrap__label {
    color: #314764;
    font-size: 13px;
    font-weight: 500;
}

.astro-main--portal .astro-sort-wrap__icon {
    height: 16px;
    width: 16px;
}

.astro-main--portal .astro-sort-dropdown {
    border-color: #dce4ef;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgb(22 46 91 / 15%);
    min-width: 210px;
}

.astro-main--portal .astro-sort-option {
    font-size: 14px;
    min-height: 46px;
    padding: 12px 14px;
}

.astro-main--portal .astro-active-chips {
    gap: 8px;
    padding: 0 0 16px;
}

.astro-main--portal .astro-chip {
    background: #eaf1fc;
    border: 1px solid #cdddf4;
    color: #214d86;
    font-size: 12px;
    gap: 2px;
    line-height: 1.4;
    max-width: 100%;
    padding: 0 0 0 12px;
    white-space: normal;
}

.astro-main--portal .astro-chip--salary {
    background: #e8f5ef;
    border-color: #b9dfcd;
    color: #225c47;
}

.astro-main--portal .astro-chip__remove {
    flex-shrink: 0;
    font-size: 18px;
    min-height: 44px;
    min-width: 44px;
    opacity: 1;
}

.astro-main--portal .astro-cards-list {
    gap: 16px;
    min-height: 0;
    padding: 0;
}

.astro-main--portal .astro-cards-list.astro-cards-list--grid {
    grid-template-columns: minmax(0, 1fr);
}

.astro-main--portal .astro-empty-state {
    background: #fff;
    border: 1px dashed #ccd8e7;
    border-radius: 16px;
    color: #5b6b82;
    font-size: 15px;
    gap: 14px;
    grid-column: 1 / -1;
    max-width: none;
    padding: 52px 24px;
    width: 100%;
}

.astro-main--portal .astro-empty-state svg {
    color: #6c8fb8;
    height: 48px;
    opacity: 1;
    width: 48px;
}

.astro-main--portal .astro-empty-state strong {
    color: #172b4d;
    font-size: 19px;
    line-height: 1.4;
}

.astro-main--portal .astro-empty-state span {
    color: #5b6b82;
    line-height: 1.7;
    max-width: 460px;
}

.astro-main--portal .astro-loading {
    font-size: 14px;
    grid-column: 1 / -1;
    padding: 48px 16px;
}

.astro-main--portal .astro-pagination {
    padding: 28px 0 8px;
}

.astro-main--portal .astro-pagination .page-numbers {
    gap: 7px;
    justify-content: center;
}

.astro-main--portal .astro-pagination .page-numbers :is(a, button, span) {
    border: 1px solid #dce4ef;
    border-radius: 10px;
    color: #314764;
    font-size: 14px;
    height: 44px;
    min-width: 44px;
    padding: 0 12px;
}

.astro-main--portal .astro-pagination .page-numbers .current {
    background: var(--astro-primary, #162e5b);
    border-color: var(--astro-primary, #162e5b);
    color: #fff;
}

.astro-main--portal .astro-pagination .page-numbers .dots {
    border-color: transparent;
    color: #66778f;
    min-width: 24px;
    padding: 0 2px;
}

.astro-main--portal :is(.astro-view-toggle__btn, .astro-chip__remove, .astro-sort-wrap, .astro-sort-option):focus-visible,
.astro-main--portal .astro-pagination :is(a, button):focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 3px;
}

/* JS can move this container to body on mobile, so anchor styles to it. */
.astro-filter-sheet {
    background: #fff;
    border-color: #dce4ef;
    box-shadow: 0 8px 28px rgb(22 46 91 / 7%);
    color: #243b5a;
}

.astro-filter-sheet .astro-filter-sheet__header {
    border-color: #e2e8f0;
    padding: 8px 20px 16px;
}

.astro-filter-sheet .astro-filter-sheet__heading {
    color: var(--astro-primary, #162e5b);
    gap: 10px;
}

.astro-filter-sheet .astro-filter-sheet__title {
    color: #172b4d;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

.astro-filter-sheet .astro-filter-sheet__close {
    background: #f0f4f9;
    border-radius: 10px;
    color: #314764;
    height: 44px;
    width: 44px;
}

.astro-filter-sheet .astro-filter-sheet__body {
    padding: 20px 18px 4px;
}

.astro-filter-sheet .astro-filter-section {
    margin-bottom: 20px;
}

.astro-filter-sheet .astro-filter-salary-input__label {
    color: #526780;
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 6px;
}

.astro-filter-sheet .astro-filter-salary-input__field {
    border-color: #d6e0ec;
    border-radius: 10px;
    height: 46px;
    padding: 0 10px;
}

.astro-filter-sheet .astro-filter-salary-input__prefix {
    color: #526780;
    font-size: 13px;
}

.astro-filter-sheet .astro-filter-salary-input__field input,
.astro-filter-sheet .astro-filter-keyword input,
.astro-filter-sheet .astro-filter-ms-search input {
    color: #243b5a;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    min-width: 0;
}

.astro-filter-sheet .astro-filter-salary-inputs__sep {
    color: #66778f;
    padding-bottom: 12px;
}

.astro-filter-sheet .astro-filter-dual-range {
    height: 44px;
}

.astro-filter-sheet .astro-filter-multiselect {
    border: 1px solid #dce4ef;
    border-radius: 11px;
}

.astro-filter-sheet .astro-filter-ms-trigger {
    min-height: 48px;
    padding: 12px;
}

.astro-filter-sheet .astro-filter-ms-trigger__text {
    color: #314764;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.5;
    text-transform: none;
}

.astro-filter-sheet .astro-filter-ms-search,
.astro-filter-sheet .astro-filter-keyword {
    min-height: 48px;
    padding: 10px 12px;
}

.astro-filter-sheet .astro-filter-keyword {
    border: 1px solid #dce4ef;
    border-radius: 10px;
}

.astro-filter-sheet .astro-filter-ms-search input::placeholder,
.astro-filter-sheet .astro-filter-keyword input::placeholder {
    color: #66778f;
    opacity: 1;
}

.astro-filter-sheet .astro-filter-ms-option {
    gap: 10px;
    min-height: 48px;
    padding: 11px 12px;
}

.astro-filter-sheet .astro-filter-ms-opt-left {
    min-width: 0;
}

.astro-filter-sheet .astro-filter-ms-option-label {
    color: #243b5a;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.astro-filter-sheet .astro-filter-ms-option-count {
    color: #66778f;
    font-size: 12px;
    line-height: 1.4;
}

.astro-filter-sheet .astro-filter-ms-chip {
    font-size: 12px;
    line-height: 1.4;
    max-width: 100%;
    padding: 0 0 0 10px;
    overflow-wrap: anywhere;
}

.astro-filter-sheet .astro-filter-ms-chip-x {
    flex-shrink: 0;
    font-size: 17px;
    min-height: 44px;
    min-width: 44px;
    opacity: 1;
}

.astro-filter-sheet .astro-filter-sheet__footer {
    background: #fff;
    border-color: #e2e8f0;
    gap: 8px;
    padding: 14px 18px max(18px, env(safe-area-inset-bottom, 0px));
}

.astro-filter-sheet :is(.astro-filter-btn-apply, .astro-filter-btn-clear) {
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    min-height: 48px;
    padding: 11px 10px;
}

.astro-filter-sheet .astro-filter-btn-clear {
    border: 1px solid #d6e0ec;
    color: #526780;
    width: 42%;
}

.astro-filter-sheet .astro-filter-btn-apply {
    background: var(--astro-primary, #162e5b);
    color: #fff;
}

.astro-filter-sheet .astro-filter-btn-apply:disabled {
    opacity: 0.5;
}

.astro-filter-sheet :is(button, [tabindex], input[type="range"]):focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 3px;
}

.astro-filter-sheet :is(.astro-filter-keyword, .astro-filter-ms-search, .astro-filter-salary-input__field):focus-within {
    border-color: #4382d5;
    box-shadow: 0 0 0 3px rgb(37 99 235 / 13%);
}

@media (min-width: 768px) {
    .astro-hero {
        padding: 48px 28px 30px;
    }

    .astro-hero .astro-hero__search-row {
        align-items: stretch;
        gap: 12px;
    }

    .astro-hero .astro-hero__dept-combo {
        max-width: 220px;
        min-width: 160px;
    }

    .astro-hero .astro-hero__stat {
        padding: 0 26px;
    }

    .astro-main--portal .astro-portal-layout {
        padding: 32px 24px 56px;
    }

    .astro-filter-sheet {
        border: 1px solid #dce4ef;
        border-radius: 16px;
        width: 280px;
    }

    .astro-filter-sheet .astro-filter-sheet__header {
        padding: 18px;
    }

    .astro-filter-sheet .astro-filter-sheet__footer {
        border-radius: 0 0 16px 16px;
        padding: 14px;
    }
}

@media (min-width: 1024px) {
    .astro-hero {
        padding: 56px 32px 32px;
    }

    .astro-main--portal .astro-cards-list.astro-cards-list--grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 379px) {
    .astro-hero {
        padding-right: 16px;
        padding-left: 16px;
    }

    .astro-hero .astro-hero__stat {
        padding-right: 6px;
        padding-left: 6px;
    }

    .astro-hero .astro-hero__stat-value {
        font-size: 16px;
    }

    .astro-hero .astro-hero__stat-label {
        font-size: 11px;
    }

    .astro-main--portal .astro-pagination .page-numbers {
        gap: 5px;
    }
}
