/* ============================================================
   Работа 50+  — доступная тема для аудитории старшего возраста.
   Приоритеты: крупный шрифт, высокий контраст, большие цели нажатия,
   тёплая спокойная палитра, ясные состояния фокуса.
   ============================================================ */

:root {
    --bg: #f4efe6;          /* тёплый кремовый фон */
    --surface: #ffffff;
    --surface-soft: #faf6ee;
    --border: #e2d9c8;
    --text: #211f1a;        /* почти чёрный, тёплый — высокий контраст */
    --muted: #5a5349;
    --accent: #1f6a8f;      /* спокойный «доверительный» синий */
    --accent-dark: #17516e;
    --accent-soft: #e7f0f5;
    --salary: #1f7a46;      /* зелёный — зарплата */
    --salary-soft: #e6f2ea;
    --focus: #c8541f;       /* тёплый оранжевый контур фокуса */
    --radius: 14px;
    --maxw: 1120px;
    --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Базовый размер шрифта; переключатель меняет класс на <html>. */
html { font-size: 18px; }
html.fs-2 { font-size: 20px; }
html.fs-3 { font-size: 23px; }

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 4px;
}

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---- Верхняя панель ---- */
.topbar {
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar__inner {
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: 84px;
    padding: 12px 0;
    flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 12px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo__mark {
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    font-size: 1.35rem;
    line-height: 1;
    padding: 12px 14px;
    border-radius: 12px;
    white-space: nowrap;
}
.logo__mark sup { font-size: .7em; }
.logo__text { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.logo__text b { color: var(--accent); font-weight: 800; }

.searchbar {
    display: flex;
    flex: 1;
    min-width: 280px;
    max-width: 680px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color .15s;
}
.searchbar:focus-within { border-color: var(--accent); }
.searchbar__input {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 0 18px;
    height: 58px;
    font-size: 1.05rem;
    outline: none;
    color: var(--text);
    min-width: 0;
}
.searchbar__input::placeholder { color: #8a8175; }
.searchbar__btn {
    border: 0;
    background: var(--accent);
    color: #fff;
    padding: 0 26px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}
.searchbar__btn:hover { background: var(--accent-dark); }

.fontsize { display: flex; align-items: center; gap: 4px; }
.fontsize__btn {
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 10px;
    cursor: pointer;
    line-height: 1;
    padding: 8px 12px;
    font-weight: 700;
}
.fontsize__btn:nth-child(1) { font-size: .95rem; }
.fontsize__btn:nth-child(2) { font-size: 1.15rem; }
.fontsize__btn:nth-child(3) { font-size: 1.4rem; }
.fontsize__btn:hover { border-color: var(--accent); }
.fontsize__btn.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

main { padding: 26px 22px 70px; }

/* ---- Приветственный блок ---- */
.hero {
    background: linear-gradient(135deg, var(--accent-soft), var(--surface-soft));
    border: 2px solid var(--border);
    border-radius: 18px;
    padding: 34px 36px;
    margin-bottom: 24px;
}
.hero__title { font-size: 2rem; margin: 0 0 10px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.hero__sub { font-size: 1.15rem; margin: 0; color: var(--muted); max-width: 760px; }

/* ---- Категории (плитки) ---- */
.categories { margin-bottom: 26px; }
.categories__title { font-size: 1.5rem; font-weight: 800; margin: 0 0 16px; letter-spacing: -0.01em; }
.tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    padding: 28px 16px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 16px;
    color: var(--text);
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.25;
    transition: border-color .15s, background .15s, transform .1s;
}
.tile:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    text-decoration: none;
    transform: translateY(-2px);
}
.tile__icon { font-size: 2.6rem; line-height: 1; }

/* ---- Быстрые фильтры (чипы) ---- */
.chips { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 2px solid var(--border);
    color: var(--text);
    padding: 11px 20px;
    border-radius: 40px;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.2;
    transition: all .15s;
}
.chip:hover { border-color: var(--accent); text-decoration: none; }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip__x { font-size: .85em; opacity: .85; }

/* ---- Раскладка ---- */
.layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: start;
}

/* ---- Фильтры ---- */
.filters { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 104px; }
.filters__block {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.filters__title {
    margin: 0 0 12px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}
.facet { list-style: none; margin: 0; padding: 0; }
.facet__item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 11px 12px;
    margin: 2px -12px;
    border-radius: 10px;
    color: var(--text);
    font-size: 1.02rem;
}
.facet__item a:hover { background: var(--surface-soft); text-decoration: none; }
.facet__item.is-active a { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
.facet__count { color: var(--muted); font-size: .95rem; font-weight: 400; }
.facet__item.is-active .facet__count { color: var(--accent-dark); }

/* ---- Фильтр города (автокомплит) ---- */
.cityfilter { display: flex; gap: 8px; }
.cityfilter__input {
    flex: 1;
    min-width: 0;
    height: 48px;
    padding: 0 14px;
    font-size: 1.02rem;
    color: var(--text);
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 10px;
    outline: none;
}
.cityfilter__input:focus { border-color: var(--accent); }
.cityfilter__btn {
    border: 0;
    background: var(--accent);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    padding: 0 18px;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
}
.cityfilter__btn:hover { background: var(--accent-dark); }
.cityfilter__reset {
    display: inline-block;
    margin-top: 12px;
    font-size: 1rem;
    color: var(--muted);
}
.cityfilter__popular { margin-top: 12px; font-size: .98rem; line-height: 1.9; }
.cityfilter__popular-label { color: var(--muted); margin-right: 4px; }
.cityfilter__popular a { margin-right: 12px; white-space: nowrap; }

/* ---- Результаты ---- */
.results__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.results__count { font-size: 1.5rem; margin: 0; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; }
.sort { font-size: 1rem; color: var(--muted); display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; }
.sort a { color: var(--accent); }
.sort a.is-active { color: var(--text); font-weight: 700; text-decoration: underline; }

.card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 26px;
    margin-bottom: 16px;
    transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: #cdbfa6; box-shadow: 0 6px 20px rgba(33,31,26,.08); }
.card__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}
.card__title { font-size: 1.4rem; margin: 0; font-weight: 700; line-height: 1.3; }
.card__title a { color: var(--text); }
.card__title a:hover { color: var(--accent); }
.card__salary {
    color: var(--salary);
    font-weight: 800;
    white-space: nowrap;
    font-size: 1.25rem;
    background: var(--salary-soft);
    padding: 4px 12px;
    border-radius: 8px;
}
.card__salary.is-muted { color: var(--muted); background: var(--surface-soft); font-weight: 600; font-size: 1rem; }
.card__company { margin-top: 10px; font-size: 1.08rem; }
.card__employer { font-weight: 600; }
.card__city { color: var(--muted); }
.card__snippet { margin: 14px 0 0; color: #3f3a31; font-size: 1.05rem; }
.card__foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    gap: 12px;
    flex-wrap: wrap;
}
.card__more { font-size: 1.05rem; font-weight: 700; }
.card__date { font-size: .98rem; color: var(--muted); }

.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.tag {
    font-size: 1rem;
    color: var(--accent-dark);
    background: var(--accent-soft);
    border-radius: 8px;
    padding: 5px 14px;
    font-weight: 600;
}

/* ---- Пагинация ---- */
.pager { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; align-items: center; }
.pager__link {
    min-width: 52px;
    height: 52px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 600;
}
.pager__link:hover { border-color: var(--accent); text-decoration: none; }
.pager__link.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager__gap { color: var(--muted); padding: 0 4px; }

/* ---- Пусто ---- */
.empty {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 56px 28px;
    text-align: center;
    color: var(--muted);
}
.empty h2 { margin: 0 0 10px; color: var(--text); font-size: 1.4rem; }
.empty p { font-size: 1.1rem; }

/* ---- Страница вакансии ---- */
.back { display: inline-block; margin-bottom: 18px; color: var(--accent); font-size: 1.08rem; font-weight: 600; }
.detail {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 18px;
    padding: 36px;
    max-width: 820px;
}
.detail__title { font-size: 2rem; margin: 0 0 14px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.detail__salary {
    font-size: 1.6rem; color: var(--salary); font-weight: 800;
    background: var(--salary-soft); display: inline-block; padding: 6px 16px; border-radius: 10px;
}
.detail__salary.is-muted { color: var(--muted); background: var(--surface-soft); font-weight: 600; font-size: 1.2rem; }
.detail__company { margin: 16px 0; font-size: 1.2rem; }
.detail__company strong { font-weight: 700; }
.apply {
    display: inline-block;
    margin: 24px 0 8px;
    background: var(--salary);
    color: #fff;
    padding: 16px 36px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.15rem;
}
.apply:hover { background: #186237; text-decoration: none; }
.detail__section { margin-top: 30px; }
.detail__section h2 { font-size: 1.25rem; margin: 0 0 10px; }
.detail__section p { margin: 0; color: #33302a; font-size: 1.1rem; }
.detail__contacts ul { margin: 0; padding-left: 22px; font-size: 1.1rem; }
.detail__contacts li { margin-bottom: 6px; }
.detail__meta { margin-top: 30px; padding-top: 20px; border-top: 2px solid var(--border); color: var(--muted); font-size: 1rem; }

/* ---- Подвал ---- */
.footer { border-top: 2px solid var(--border); background: var(--surface); padding: 30px 0; color: var(--muted); }
.footer__title { font-weight: 800; color: var(--text); font-size: 1.2rem; margin: 0 0 6px; }
.footer p { margin: 0; max-width: 760px; font-size: 1.02rem; }

/* ---- Адаптив ---- */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .filters { position: static; }
    .topbar__inner { min-height: 0; }
    .searchbar { order: 3; flex-basis: 100%; max-width: none; }
    .fontsize { margin-left: auto; }
    .tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
    .hero { padding: 24px; }
    .hero__title { font-size: 1.6rem; }
    .tiles { grid-template-columns: repeat(2, 1fr); }
    .tile { padding: 22px 12px; }
    .card__top { flex-direction: column; gap: 8px; }
    .card__salary { align-self: flex-start; }
    .detail { padding: 24px; }
    .detail__title { font-size: 1.6rem; }
}
