/* /salary/<профессия>: грейды, формат работы, за рубежом, города (макет Figma 1504:399–1504:494). */

/* ---------- Грейды ---------- */

.sp-grades {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.sp-grade {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 168px;
    align-items: center;
    column-gap: 12px;
    padding: 0 8px;
}

.sp-grade-name {
    color: var(--text-muted);
    font-size: var(--fs-14);
    line-height: var(--lh-14);
}

.sp-grade-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    box-sizing: border-box;
    height: 40px;
    padding-right: 12px;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(77, 178, 136, 0.1) 0%, var(--accent-color) 100%);
    color: #FFFFFF;
    font-size: var(--fs-14);
    font-weight: var(--fw-semibold);
    line-height: 1;
    white-space: nowrap;
}

.sp-grade-range {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.sp-grade-range b {
    color: var(--text-color);
    font-size: var(--fs-14);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-14);
}

.sp-grade-range span,
.sp-format-meta,
.sp-abroad-meta {
    color: var(--text-muted);
    font-size: var(--fs-12);
    line-height: var(--lh-12);
}

/* ---------- Формат работы: ступеньки ---------- */

.sp-formats {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    max-width: 1000px;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 12px 20px 20px;
    border-radius: 24px 24px 0 0;
    background: var(--surface-primary);
}

.sp-format {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    box-sizing: border-box;
    height: calc(120px + var(--sp-step, 0) * 20px);
    padding: 12px 16px;
    border-radius: 20px;
    background: var(--surface-secondary);
}

.sp-format .job-tag {
    margin: 0;
}

.sp-format-value,
.sp-abroad-value {
    color: var(--text-color);
    font-size: var(--fs-32);
    font-weight: var(--fw-semibold);
    line-height: 39px;
    letter-spacing: var(--ls-32);
    white-space: nowrap;
}

.sp-abroad {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    max-width: 1000px;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 20px;
    border-top: 1px solid var(--filter-divider);
    border-radius: 0 0 24px 24px;
    background: var(--surface-primary);
}

/* Без плиток формата — «за рубежом» отдельной карточкой */
.sp-head + .sp-abroad {
    border-top: 0;
    border-radius: 24px;
}

.sp-abroad-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    font-size: var(--fs-14);
    line-height: var(--lh-14);
}

.sp-abroad-value {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ---------- Города ---------- */

.sp-cities {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 16px;
    max-width: 1000px;
    margin: 0 auto;
    padding-top: 20px;
}

.sp-city {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    flex: 0 1 300px;
    gap: 4px;
    min-width: 0;
    height: 204px;
    color: var(--text-muted);
    font-size: var(--fs-14);
    line-height: var(--lh-14);
    text-align: center;
}

.sp-city b {
    margin-top: 8px;
    color: var(--text-color);
    font-weight: var(--fw-semibold);
}

.sp-city-bar {
    display: flex;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    height: calc(144px * var(--sp-h, 1));
    padding-top: 12px;
    border-radius: 8px;
    background: linear-gradient(0deg, rgba(77, 178, 136, 0.1) 0%, var(--accent-color) 100%);
    color: #FFFFFF;
    font-size: var(--fs-14);
    font-weight: var(--fw-semibold);
    line-height: 1;
    white-space: nowrap;
}

@media (max-width: 1279px) {
    /* Грейд и диапазон — над полосой, полоса на всю ширину */
    .sp-grade {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "name range"
            "bar bar";
        row-gap: 6px;
        padding: 0;
    }

    .sp-grade-name { grid-area: name; }
    .sp-grade-track { grid-area: bar; }
    .sp-grade-range { grid-area: range; }

    .sp-grade-bar {
        height: 32px;
    }

    /* Формат: сетка 2×2 одинаковой высоты */
    .sp-formats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 12px;
        border-radius: 20px 20px 0 0;
    }

    .sp-format {
        height: 112px;
        padding: 12px;
        border-radius: 16px;
    }

    .sp-format-value,
    .sp-abroad-value {
        font-size: var(--fs-24);
        line-height: 1.2;
    }

    .sp-abroad {
        padding: 16px;
        border-radius: 0 0 20px 20px;
    }

    .sp-cities {
        gap: 8px;
    }

    .sp-city {
        flex: 1 1 0;
        font-size: var(--fs-12);
        line-height: var(--lh-12);
    }

    .sp-city-bar {
        font-size: var(--fs-12);
    }
}
