/* ============================================================
   МосРабота — современный дизайн, двухпанельная выдача.
   Акцент на высокооплачиваемых профессиях.
   ============================================================ */

:root {
    --brand: #C8102E;         /* московский красный */
    --brand-dark: #9c0c23;
    --brand-tint: #fbeaec;
    --text: #161c2b;
    --muted: #5b6472;
    --border: #e6e8ee;
    --border-soft: #eef0f5;
    --bg: #f6f8fc;
    --surface: #ffffff;
    --salary: #0a7c53;
    --shadow: 0 1px 2px rgba(22,28,43,.06), 0 6px 20px rgba(22,28,43,.05);
    --shadow-sm: 0 1px 3px rgba(22,28,43,.08);
    --radius: 14px;
    --maxw: 980px;   /* единая ширина колонки: хедер, поиск, фильтры, выдача — по одной линии */
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0; background: var(--bg); color: var(--text);
    font-family: var(--font); font-size: 15px; line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); 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: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar__inner { display: flex; align-items: center; gap: 24px; height: 62px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo__svg { display: block; border-radius: 9px; box-shadow: 0 2px 8px rgba(200,16,46,.28); }
.logo__text { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; color: var(--brand); }
.logo__text b { color: var(--text); font-weight: 800; margin-left: 2px; }
.topnav { margin-left: auto; display: flex; gap: 20px; }
.topnav a { color: var(--text); font-weight: 600; font-size: .95rem; }

/* ---- Полоса поиска ---- */
.searchband { background: var(--surface); border-bottom: 1px solid var(--border); padding: 16px 0; }
.hsearch {
    display: flex; align-items: stretch; background: var(--surface);
    border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm);
    padding: 5px;
}
.hsearch__field { display: flex; align-items: center; flex: 1; min-width: 0; padding: 0 14px; }
.hsearch__ico { font-size: 1rem; margin-right: 8px; opacity: .7; }
.hsearch__input { border: 0; outline: none; background: transparent; flex: 1; min-width: 0; height: 48px; font-size: 1.02rem; color: var(--text); }
.hsearch__input::placeholder { color: #97a0af; }
.hsearch__divider { width: 1px; background: var(--border); margin: 9px 0; }
.hsearch__btn { border: 0; cursor: pointer; white-space: nowrap; background: var(--brand); color: #fff; font-size: 1.02rem; font-weight: 700; padding: 0 28px; border-radius: 10px; }
.hsearch__btn:hover { background: var(--brand-dark); }

main { padding: 20px 22px 60px; }

/* ---- Панель метро (главная) ---- */
.metro { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px 20px; margin-bottom: 18px; }
.metro__head { margin-bottom: 12px; }
.metro__title { font-size: 1.08rem; font-weight: 800; margin: 0; letter-spacing: -0.01em; }
.metro__sub { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.metro__lines { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px 22px; }
.metroline { min-width: 0; }
.metroline__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.metroline__badge { flex: 0 0 auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; color: #fff; font-weight: 800; font-size: .8rem; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.metroline__badge--other { background: #8a94a6; }
.metroline__name { font-weight: 700; font-size: .9rem; color: var(--text); }
.metroline__stations { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.mstation { display: flex; align-items: center; gap: 8px; padding: 4px 8px; margin: 0 -8px; border-radius: 7px; color: var(--text); font-size: .9rem; }
.mstation:hover { background: var(--brand-tint); text-decoration: none; }
.mstation__dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0,0,0,.05); }
.mstation__dot--other { background: #8a94a6; }
.mstation__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mstation__count { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.mdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }

/* ---- Заголовок результатов ---- */
.results-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.results-head__count { font-size: 1.3rem; margin: 0; font-weight: 800; letter-spacing: -0.01em; }
.sort { font-size: .9rem; color: var(--muted); display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.sort a { color: var(--brand); }
.sort a.is-active { color: var(--text); font-weight: 700; text-decoration: underline; }

/* ---- Панель фильтров сверху (горизонтальные выпадающие списки) ---- */
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.fdrop { position: relative; }
.fdrop > summary {
    list-style: none; cursor: pointer; user-select: none; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    padding: 9px 14px; font-size: .92rem; font-weight: 600; color: var(--text);
    box-shadow: var(--shadow-sm);
}
.fdrop > summary::-webkit-details-marker { display: none; }
.fdrop > summary::after { content: "▾"; color: var(--muted); font-size: .8rem; }
.fdrop > summary:hover { border-color: var(--brand); }
.fdrop[open] > summary { border-color: var(--brand); color: var(--brand); }
.fdrop > summary b { color: var(--brand); font-weight: 700; }
.fdrop__menu {
    position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 230px; max-width: 320px;
    max-height: 60vh; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 8px 12px;
}
.filterbar__reset { margin-left: auto; color: var(--muted); font-size: .88rem; font-weight: 600; align-self: center; }
.filterbar__reset:hover { color: var(--brand); }

.facet { list-style: none; margin: 0; padding: 0; }
.facet__item a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; margin: 0 -6px; border-radius: 8px; color: var(--text); font-size: .92rem; }
.facet__item a:hover { background: var(--brand-tint); text-decoration: none; }
.facet__item.is-active a { color: var(--brand); font-weight: 700; }
.facet__count { color: var(--muted); font-size: .82rem; }

/* ---- Список вакансий (одна колонка, карточка со сниппетом) ---- */
.results-list { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.jobcard { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; transition: box-shadow .12s, border-color .12s; box-shadow: var(--shadow-sm); }
.jobcard:hover { border-color: #f0c0c8; box-shadow: var(--shadow); }
.jobcard__title { display: block; font-size: 1.12rem; font-weight: 700; line-height: 1.3; color: var(--brand); margin-bottom: 4px; }
/* растянутая ссылка: клик по всей карточке ведёт на страницу вакансии */
.jobcard__title::after { content: ""; position: absolute; inset: 0; }
.jobcard__company { font-size: .9rem; color: var(--text); margin-bottom: 6px; }
.jobcard__employer { font-weight: 500; }
.jobcard__city { color: var(--muted); }
.jobcard__city::before { content: "·"; margin: 0 6px; color: var(--border); }
.jobcard__salary { color: var(--salary); font-weight: 800; font-size: 1rem; margin-bottom: 7px; }
.jobcard__snippet { margin: 8px 0 0; color: #5a6270; font-size: .9rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.jobcard__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.jobcard__date { font-size: .8rem; color: var(--muted); }
.jobcard__more { font-size: .85rem; font-weight: 700; color: var(--brand); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.tag { font-size: .78rem; color: #3b4a63; background: #eef1f7; border-radius: 5px; padding: 2px 8px; }

/* ---- Пагинация ---- */
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.pager__link { min-width: 38px; height: 38px; padding: 0 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; color: var(--brand); font-weight: 600; }
.pager__link:hover { border-color: var(--brand); text-decoration: none; }
.pager__link.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager__gap { color: var(--muted); padding: 0 4px; }

/* ---- Деталь вакансии (полная страница) ---- */
.detail { max-width: 820px; }
.detail__title { font-size: 1.5rem; margin: 0 0 8px; font-weight: 800; line-height: 1.25; }
.detail__salary { font-size: 1.2rem; color: var(--salary); font-weight: 800; }
.detail__salary.is-muted { color: var(--muted); font-weight: 500; font-size: 1rem; }
.detail__company { margin: 9px 0; font-size: 1.02rem; }
.detail__company strong { font-weight: 700; }
.apply { display: inline-block; margin: 16px 0 6px; background: var(--brand); color: #fff; padding: 12px 28px; border-radius: 10px; font-weight: 700; }
.apply:hover { background: var(--brand-dark); text-decoration: none; }
.detail__section { margin-top: 22px; }
.detail__section h2 { font-size: 1.05rem; margin: 0 0 7px; }
.detail__section p { margin: 0; color: #333c4a; }
.detail__contacts ul { margin: 0; padding-left: 20px; }
.detail__meta { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--border-soft); color: var(--muted); font-size: .85rem; }
.back { display: inline-block; margin-bottom: 12px; color: var(--brand); font-weight: 600; }

/* На отдельной странице вакансии деталь — в белой карточке */
main > .detail, .back + .detail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 32px; box-shadow: var(--shadow); }

/* ---- Пусто ---- */
.empty { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px 24px; text-align: center; color: var(--muted); }
.empty h2 { margin: 0 0 8px; color: var(--text); }

/* ---- Подвал ---- */
.footer { border-top: 1px solid var(--border); background: var(--surface); padding: 28px 0; margin-top: 20px; }
.footer__inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.logo--footer .logo__text { font-size: 1.1rem; }
.footer__tagline { color: var(--muted); font-size: .88rem; margin: 8px 0 0; max-width: 540px; }
.footer__links { display: flex; gap: 18px; align-items: center; }
.footer__links a { color: var(--text); font-weight: 600; font-size: .9rem; }

/* ---- Адаптив ---- */
@media (max-width: 760px) {
    .filterbar { gap: 8px; }
    .fdrop, .fdrop > summary { width: 100%; }
    .fdrop > summary { justify-content: space-between; }
    .fdrop__menu { left: 0; right: 0; min-width: 0; max-width: none; }
    .filterbar__reset { margin-left: 0; }
    .hsearch { flex-direction: column; }
    .hsearch__divider { width: auto; height: 1px; margin: 0 14px; }
    .hsearch__btn { margin: 6px 5px 5px; padding: 12px; }
    .topnav { display: none; }
}

/* ---- Топ-20 профессий на главной ---- */
.landing-top { margin: 22px 0; }
.landing-top__title { font-size: 1.15rem; font-weight: 800; margin: 0 0 14px; color: var(--text); }
.topprof { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 10px; }
.topprof__link { display: flex; align-items: center; gap: 11px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 13px; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s, border-color .15s; }
.topprof__link:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-1px); border-color: rgba(200,16,46,.30); }
.topprof__rank { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: var(--brand-tint); color: var(--brand); font-weight: 800; font-size: .85rem; }
.topprof__name { flex: 1 1 auto; min-width: 0; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topprof__count { flex: none; color: var(--muted); font-size: .82rem; font-weight: 600; white-space: nowrap; }
@media (max-width: 640px) { .topprof { grid-template-columns: 1fr; } }
