/* Страница /salary/<профессия>. Хиро и заголовки — как на сервисных страницах (service_landing.css),
   карточки — .cv-analysis-container, сетка с отступом 12px, карточки вакансий — стандартные из листинга. */

.sp-hero {
    padding: 32px 0;
    text-align: center;
}

.sp-title {
    margin: 0 0 12px;
    color: var(--text-color);
    font-size: var(--fs-32);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-32);
    letter-spacing: var(--ls-32);
}

.sp-subtitle {
    max-width: 800px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: var(--fs-16);
    line-height: var(--lh-16);
    letter-spacing: var(--ls-16);
}

.sp-landing > * + * {
    margin-top: 40px;
}

.sp-landing :where(h2, h3, p) {
    margin: 0;
}

/* ---------- Сетки ---------- */

.sp-grid {
    display: grid;
    gap: 12px;
    align-items: stretch;
}

.sp-grid + .sp-grid {
    margin-top: 12px;
}

.sp-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Одна карточка в двухколоночной сетке (нет ответов специалистов) — на всю ширину */
.sp-grid--two > :only-child {
    grid-column: 1 / -1;
}

.sp-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

/* ---------- Плитки ---------- */

.sp-tile {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 20px;
    border-radius: 24px;
    background: var(--surface-primary);
}

/* Плитка формата: тег сверху, сумма и подпись прижаты к низу, плитка растянута по высоте строки */
.sp-tile .job-tag {
    align-self: flex-start;
    margin-bottom: auto;
}

.sp-tile-label {
    color: var(--text-muted);
    font-size: var(--fs-14);
    line-height: var(--lh-14);
    letter-spacing: var(--ls-14);
}

/* Шрифты как у KPI-плиток аналитики рынка (.ma-kpi-label / .ma-kpi-value / .ma-kpi-delta) */
.sp-tile-value {
    color: var(--text-color);
    font-size: var(--fs-32);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-32);
    letter-spacing: var(--ls-32);
    white-space: nowrap;
}

.sp-tile-value small {
    margin-left: 4px;
    color: var(--text-muted);
    font-size: var(--fs-14);
    font-weight: var(--fw-regular);
    line-height: var(--lh-14);
    letter-spacing: var(--ls-14);
}

.sp-up {
    color: var(--accent-color);
}

.sp-down {
    color: var(--danger);
}

/* ---------- Секции ---------- */

.sp-section-head {
    margin-bottom: 12px;
}

.sp-section-head .cv-analysis-title {
    margin-bottom: 4px;
}

/* Вакансии: на десктопе кнопка справа от заголовка, ниже 1280px — под карточками на всю ширину */
.sp-jobs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "head btn"
        "jobs jobs";
    column-gap: 12px;
    align-items: start;
}

.sp-jobs-head {
    grid-area: head;
}

.sp-jobs-grid {
    grid-area: jobs;
}

.sp-all-jobs {
    grid-area: btn;
    white-space: nowrap;
}

.sp-section-sub {
    color: var(--text-muted);
    font-size: var(--fs-14);
    line-height: var(--lh-14);
    letter-spacing: var(--ls-14);
}

.sp-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    padding: 20px;
}

.sp-text p {
    color: var(--text-color);
    font-size: var(--fs-16);
    line-height: var(--lh-16);
    letter-spacing: var(--ls-16);
}

.sp-text p + p {
    margin-top: 8px;
}

/* Текст и таблица внутри карточки с данными — под разделителем, без пустых полуколонок */
.sp-card-text {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--filter-divider);
}

.sp-grid--format-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.sp-grid--format-layout .sp-grid--formats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* «За рубежом» — отдельная полоса под форматами: цифра слева, пояснение справа */
.sp-abroad {
    flex-direction: row;
    align-items: center;
    gap: 24px;
    margin-top: 12px;
}

.sp-abroad-figure {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 6px;
    min-width: 200px;
}

.sp-abroad-figure .job-tag {
    align-self: flex-start;
    margin-bottom: 0;
}

.sp-abroad-text {
    flex: 1 1 auto;
    min-width: 0;
}

.sp-tag-abroad {
    background: var(--surface-secondary);
    color: var(--text-color);
}

/* Единственная плитка формата занимает всю ширину, текст под ней внутри плитки */
.sp-tile--wide {
    justify-content: flex-start;
}

.sp-tile--wide .job-tag {
    margin-bottom: 0;
}

.sp-tile--wide .sp-card-text {
    width: 100%;
}

/* ---------- Бары по грейдам ---------- */

.sp-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sp-bar {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 168px;
    gap: 12px;
    align-items: center;
    font-size: var(--fs-14);
    line-height: var(--lh-14);
    letter-spacing: var(--ls-14);
}

.sp-bar-name {
    color: var(--text-muted);
}

.sp-bar-track {
    position: relative;
    height: 28px;
    border-radius: 8px;
    background: var(--surface-secondary);
}

.sp-bar-range {
    position: absolute;
    top: 0;
    bottom: 0;
    border-radius: 8px;
    background: var(--accent-color);
    opacity: 0.25;
}

.sp-bar-median {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 2px;
    background: var(--accent-color);
}

.sp-bar-value {
    color: var(--text-color);
    font-weight: var(--fw-semibold);
    text-align: right;
}

.sp-bar-value span {
    display: block;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: var(--fs-12);
    font-weight: var(--fw-regular);
    line-height: var(--lh-12);
    letter-spacing: var(--ls-12);
}

/* ---------- Таблицы (города, noscript-тренд) ---------- */

.sp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-14);
    line-height: var(--lh-14);
    letter-spacing: var(--ls-14);
}

.sp-table-caption {
    padding-bottom: 8px;
    color: var(--text-muted);
    text-align: left;
    caption-side: top;
}

.sp-table th,
.sp-table td {
    padding: 10px 0;
    border-bottom: 1px solid var(--filter-divider);
    text-align: left;
    font-weight: var(--fw-regular);
    color: var(--text-color);
}

.sp-table tr:last-child th,
.sp-table tr:last-child td {
    border-bottom: 0;
}

.sp-table-muted {
    color: var(--text-muted);
    white-space: nowrap;
}

.sp-table-value {
    font-weight: var(--fw-semibold);
    text-align: right !important;
    white-space: nowrap;
}

/* ---------- Динамика ---------- */

.sp-chart-container {
    border-radius: 0;
    background: transparent;
    height: 260px;
}

.sp-legend {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: var(--fs-12);
    line-height: var(--lh-12);
}

.sp-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 50%;
    vertical-align: -1px;
}

.sp-legend-dot--jobs {
    background: var(--accent-color);
}

.sp-legend-dot--abroad {
    background: var(--salary-my-color, #7B61FF);
}

.sp-legend-dot--answers {
    background: var(--text-muted);
}

/* ---------- Ответы специалистов ---------- */

.sp-answers-value {
    margin: 6px 0 8px;
}

.sp-my-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.sp-my-title {
    margin-bottom: 4px;
}

.sp-my-btn {
    flex: 0 0 auto;
}

/* ---------- Ссылки и методика ---------- */

.sp-links {
    justify-content: flex-start;
}

.sp-links-title {
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: var(--fs-14);
    font-weight: var(--fw-medium);
    line-height: var(--lh-14);
    letter-spacing: var(--ls-14);
}

.sp-links a {
    display: block;
    padding: 4px 0;
    color: var(--text-color);
    font-size: var(--fs-14);
    line-height: var(--lh-14);
    letter-spacing: var(--ls-14);
    text-decoration: none;
}

.sp-links a:hover,
.sp-links-more {
    color: var(--accent-color);
}

.sp-method {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: var(--fs-12);
    line-height: var(--lh-12);
    letter-spacing: var(--ls-12);
}

/* ---------- Адаптив: только два режима — десктоп ≥1280px и мобилка <1280px ---------- */

@media (max-width: 1279px) {
    /* Как на остальных страницах: одна колонка контента шириной до 600px */
    .sp-hero,
    .sp-landing {
        width: 100%;
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }

    .sp-landing > * + * {
        margin-top: 32px;
    }

    .sp-title {
        font-size: var(--fs-24);
        line-height: var(--lh-24);
        letter-spacing: var(--ls-24);
    }

    .sp-tile,
    .sp-card {
        padding: 16px;
    }

    /* Как KPI-плитки аналитики на мобилке: одна колонка, значение 24px */
    .sp-tiles,
    .sp-grid--two,
    .sp-grid--format-layout,
    .sp-grid--format-layout .sp-grid--formats {
        grid-template-columns: 1fr;
    }

    .sp-tile-value {
        font-size: var(--fs-24);
        line-height: var(--lh-24);
        letter-spacing: var(--ls-24);
    }

    .sp-bar {
        grid-template-columns: 48px minmax(0, 1fr) 136px;
        gap: 8px;
    }

    .sp-my-card,
    .sp-abroad {
        flex-direction: column;
        align-items: flex-start;
    }

    .sp-abroad {
        gap: 16px;
    }

    .sp-jobs {
        grid-template-columns: 1fr;
        grid-template-areas:
            "head"
            "jobs"
            "btn";
    }

    .sp-all-jobs {
        width: 100%;
        margin-top: 12px;
        text-align: center;
    }
}
