/* WorkRussia public UI. Existing logo, markup, behaviour and layout are retained.
   Load after wr-all / wr-growth-quality and before the homepage-specific sheet. */
:is(.wr-main, .site-header, .wr-footer, .wr-drawer, .wr-cookie) {
  --wr-brand-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --wr-brand-blue: #007bb0;
  --wr-brand-hover: #006a9a;
  --wr-brand-ink: #182b3a;
  --wr-brand-muted: #526571;
  --wr-brand-paper: #f5f7fa;
  --wr-brand-surface: #fff;
  --wr-brand-line: #dce5eb;
  --wr-brand-pale: #eaf3f8;
  --wr-brand-link: #006a9a;
  --wr-brand-focus: #007bb0;
  --wr-brand-error: #e11d2e;
  --font: var(--wr-brand-font);
  --ink: var(--wr-brand-ink);
  --ink-2: var(--wr-brand-muted);
  --text: var(--wr-brand-ink);
  --gs-text: var(--wr-brand-ink);
  --muted: var(--wr-brand-muted);
  --paper: var(--wr-brand-paper);
  --surface: var(--wr-brand-surface);
  --surface-soft: var(--wr-brand-paper);
  --line: var(--wr-brand-line);
  --hairline: var(--wr-brand-line);
  --hairline-strong: var(--wr-brand-line);
  --blue-50: var(--wr-brand-pale);
  --blue-600: var(--wr-brand-blue);
  --blue-700: var(--wr-brand-hover);
  --white: #fff;
  --glass: var(--wr-brand-surface);
  --glass-strong: var(--wr-brand-surface);
  --glass-border: var(--wr-brand-line);
  --shadow-glass: none;
  --shadow-lift: none;
  --shadow-button: none;
  font-family: var(--wr-brand-font);
  color: var(--wr-brand-ink);
}

/* Scoped tokens also survive a late load of the existing dark stylesheet. */
html.wr-dk[data-theme="dark"] :is(.wr-main, .site-header, .wr-footer, .wr-drawer, .wr-cookie) {
  --wr-brand-ink: #eaf1f5;
  --wr-brand-muted: #a9bac6;
  --wr-brand-paper: #101e28;
  --wr-brand-surface: #172b38;
  --wr-brand-line: #345163;
  --wr-brand-pale: #203c4c;
  --wr-brand-link: #77c9ec;
  --wr-brand-focus: #77c9ec;
  --wr-brand-error: #ff8993;
  color-scheme: dark;
}

.wr-main { background: var(--wr-brand-paper); }

/* Only the existing, decorative background layer is hidden. No functional
   hidden, open, menu, authentication or sticky states are redefined here. */
.bg-orbs { display: none !important; }

.wr-main :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .btn, .input, .select,
  .wr-input, .wr-filter__input, .wr-filter__select, .wr-salary, .wr-fcard__salary),
.site-header :is(.btn, input, button),
.wr-footer :is(h2, button),
.wr-drawer :is(.btn, button),
.wr-cookie :is(.btn, button) { font-family: var(--wr-brand-font); }

.wr-main :is(h2, .h2) {
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.025em;
  color: var(--wr-brand-ink);
}
.wr-main :is(h3, .h3) {
  font-size: 20px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -.015em;
  color: var(--wr-brand-ink);
}
.wr-main .wr-content { line-height: 1.7; color: var(--wr-brand-ink); }
.wr-main .wr-content h2 { font-size: 24px; line-height: 1.3; }
.wr-main .wr-content h3 { font-size: 20px; line-height: 1.35; }
.wr-main .wr-content :is(b, strong) { font-family: var(--wr-brand-font); }
.wr-main :is(.muted, .wr-meta-line, .wr-crumbs, .wr-fcard__emp, .wr-fcard__city,
  .wr-fcard__label, .wr-city-tile__meta) { color: var(--wr-brand-muted); }
.wr-main :is(.wr-content, .wr-search-faq__answer, .wr-search-faq__reading) a {
  color: var(--wr-brand-link);
  text-underline-offset: 3px;
}

/* Solid surfaces: a thin border replaces layered blur and floating shadows. */
.wr-main :is(.glass, .glass-strong, .wr-list-card, .wr-fcard, .wr-side-box,
  .wr-bento__item, .wr-city-tile, .wr-emp-item, .wr-related-item,
  .wr-filter, .wr-brief, .wr-vac-head, .wr-search-faq__list) {
  background: var(--wr-brand-surface);
  border-color: var(--wr-brand-line);
  border-radius: 16px;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.wr-main :is(.wr-vac-head, .wr-search-card, .wr-steps, .wr-search-faq__list) {
  border-radius: 24px;
}
.wr-main :is(.wr-card-link, .wr-bento__item, .wr-city-tile):hover {
  border-color: var(--wr-brand-blue);
  box-shadow: none !important;
  transform: none;
}
.wr-main :is(.wr-list-card__title, .wr-fcard__title),
.wr-main .wr-card-link h2 {
  font-family: var(--wr-brand-font);
  font-size: 18px !important;
  font-weight: 650;
  line-height: 1.4 !important;
  letter-spacing: -.015em !important;
  color: var(--wr-brand-ink);
}
.wr-main :is(.wr-salary, .wr-fcard__salary) {
  color: var(--wr-brand-ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.wr-main :is(.wr-fcard__tag, .wr-brief dl > div, .wr-steps li) {
  background: var(--wr-brand-paper);
  border-color: var(--wr-brand-line);
  color: var(--wr-brand-ink);
}
.wr-main .wr-fcard__foot { border-color: var(--wr-brand-line); }
.wr-main :is(.wr-fcard__go, .wr-bento__go) {
  background: var(--wr-brand-pale);
  color: var(--wr-brand-link);
}
.wr-main :is(.wr-fcard:hover, .wr-fcard:focus-visible) .wr-fcard__go {
  background: var(--wr-brand-blue);
  color: #fff;
}

/* Category size and ordering remain owned by the existing layout. No category
   receives a special promotional colour or a gradient in this visual layer. */
.wr-main a.wr-bento__item--xl,
.wr-main a.wr-bento__item--xl:is(:visited, :hover, :focus, :active) {
  background: var(--wr-brand-surface) !important;
  color: var(--wr-brand-ink) !important;
}
.wr-main a.wr-bento__item--xl :is(.wr-bento__name, .wr-bento__meta, .wr-bento__meta b) {
  color: var(--wr-brand-ink) !important;
}
.wr-main .wr-bento__item :is(.wr-bento__icon, .wr-bento__go) {
  color: var(--wr-brand-link);
}
.wr-main .wr-bento__item--xl .wr-bento__go { background: var(--wr-brand-pale); }
.wr-main .wr-bento__meta { color: var(--wr-brand-muted); }
.wr-main .wr-subbox:not(.is-done) {
  background: var(--wr-brand-pale);
  border-color: var(--wr-brand-line);
  border-radius: 16px;
  box-shadow: none;
}

/* Actions have a consistent touch target. Disabled and busy states are kept. */
:is(.wr-main, .site-header, .wr-footer, .wr-drawer, .wr-cookie) .btn {
  min-height: 44px;
  border-radius: 12px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: none !important;
  text-shadow: none;
}
:is(.wr-main, .site-header, .wr-drawer, .wr-cookie) .btn-primary {
  background: var(--wr-brand-blue);
  border-color: var(--wr-brand-blue);
  color: #fff;
}
:is(.wr-main, .site-header, .wr-drawer, .wr-cookie) .btn-primary:is(:hover, :focus-visible) {
  background: var(--wr-brand-hover) !important;
  border-color: var(--wr-brand-hover) !important;
  color: #fff;
}
:is(.wr-main, .site-header, .wr-drawer, .wr-cookie) .btn-ghost {
  background: transparent;
  border-color: var(--wr-brand-line);
  color: var(--wr-brand-ink) !important;
}
:is(.wr-main, .site-header, .wr-drawer, .wr-cookie) .btn-ghost:is(:hover, :focus-visible) {
  background: var(--wr-brand-pale) !important;
  border-color: var(--wr-brand-blue) !important;
  color: var(--wr-brand-link) !important;
}
.wr-main :is(.input, .select, .wr-input, .wr-filter__input, .wr-filter__select) {
  border-color: var(--wr-brand-line);
  border-radius: 12px;
  background: var(--wr-brand-surface);
  color: var(--wr-brand-ink);
  min-height: 44px;
  font-size: 16px;
}
.wr-main :is(.input, .wr-input, .wr-filter__input)::placeholder { color: var(--wr-brand-muted); }
.wr-main :is(.input, .select, .wr-input, .wr-filter__input, .wr-filter__select):focus {
  border-color: var(--wr-brand-focus);
  box-shadow: 0 0 0 3px var(--wr-brand-pale);
}
.wr-main .wr-input:user-invalid,
.wr-main :is(.wr-input, .input)[aria-invalid="true"] { border-color: var(--wr-brand-error); }
.wr-main .wr-form-error { color: var(--wr-brand-error); }
.wr-main .wr-filter__opt { min-height: 44px; box-sizing: border-box; }
.wr-main .wr-filter__opt:hover { background: var(--wr-brand-pale); }
.wr-main .wr-filter__opt input { accent-color: var(--wr-brand-blue); }
.wr-main .wr-pager :is(a, span) { border-radius: 12px; }

/* Public chrome only: preserve positioning, breakpoints and menu visibility. */
header.site-header, footer.wr-footer {
  background: var(--wr-brand-surface);
  border-color: var(--wr-brand-line);
  box-shadow: none;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.site-header .nav-links a {
  border-radius: 12px;
  font-weight: 550;
  color: var(--wr-brand-muted);
}
.site-header .nav-links a:is(:hover, .is-active) {
  background: var(--wr-brand-pale);
  color: var(--wr-brand-link);
}
.site-header :is(.wr-theme-btn, .wr-burger),
.wr-drawer .wr-drawer__close {
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  background: var(--wr-brand-surface);
  border-color: var(--wr-brand-line);
  color: var(--wr-brand-ink);
}
.site-header .wr-theme-btn { flex-basis: 44px; }
html.wr-dk[data-theme="dark"] .site-header .wr-theme-btn {
  color: var(--wr-brand-ink);
  border-color: var(--wr-brand-line);
}
html.wr-dk[data-theme="dark"] .site-header .wr-theme-btn:hover,
.site-header .wr-theme-btn:hover { background: var(--wr-brand-pale); color: var(--wr-brand-link); }
nav.wr-drawer {
  background: var(--wr-brand-surface);
  box-shadow: -8px 0 32px rgb(24 43 58 / 12%);
}
nav.wr-drawer > a:not(.btn) { color: var(--wr-brand-ink); border-color: var(--wr-brand-line); }
nav.wr-drawer > a:not(.btn):hover { background: var(--wr-brand-pale); color: var(--wr-brand-link); }
footer.wr-footer h2.wr-footer__h { font-size: 18px; line-height: 1.4; letter-spacing: -.01em; }
footer.wr-footer :is(a, .wr-link-btn) { color: var(--wr-brand-muted); }
footer.wr-footer :is(a, .wr-link-btn):hover { color: var(--wr-brand-link); }
footer.wr-footer .wr-legal { color: var(--wr-brand-muted); }

.wr-main .wr-modal__box,
div.wr-cookie {
  background: var(--wr-brand-surface);
  border: 1px solid var(--wr-brand-line);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgb(24 43 58 / 16%);
}
.wr-main .wr-tabs { background: var(--wr-brand-paper); }
.wr-main .wr-tabs__btn { min-height: 44px; font-family: var(--wr-brand-font); }
.wr-main .wr-tabs__btn.is-active { background: var(--wr-brand-surface); color: var(--wr-brand-ink); box-shadow: none; }
.wr-main .wr-modal__close { min-width: 44px; min-height: 44px; }

/* Advertising retains its copy, disclosure, links, order and measured layout.
   The secondary offer stays quieter than the employer-contact action. */
.wr-main .wr-cardpromo.wr-cardpromo--secondary {
  background: var(--wr-brand-paper);
  border-color: var(--wr-brand-line);
  border-radius: 16px;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.wr-main .wr-cardpromo--secondary .wr-cardpromo__cta {
  background: transparent;
  border-color: var(--wr-brand-line);
  color: var(--wr-brand-ink);
  border-radius: 12px;
  min-height: 44px;
  box-shadow: none;
}
.wr-main .wr-cardpromo--secondary .wr-cardpromo__cta:hover {
  background: var(--wr-brand-pale);
  color: var(--wr-brand-link);
  border-color: var(--wr-brand-blue);
}
.wr-main .wr-adlabel { color: var(--wr-brand-muted); }
.wr-main :is(.wr-adchip, .wr-adlabel__tag) { background: var(--wr-brand-pale); color: var(--wr-brand-muted); }

/* Higher specificity and a narrow important are intentional: the legacy dark
   sheet otherwise replaces focus outlines after a theme switch. */
:is(.wr-main, .site-header, .wr-footer, .wr-drawer, .wr-cookie)
  :is(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--wr-brand-focus) !important;
  outline-offset: 3px;
}

/* The legacy 1fr track retains min-content width: a long listing can push the
   entire tablet grid past its container. Keep the existing layouts, but allow
   the flexible tracks and their immediate children to shrink inside them. */
.wr-main .wr-listing { grid-template-columns: 300px minmax(0, 1fr); }
.wr-main .wr-listing.wr-listing--full { grid-template-columns: minmax(0, 1fr); }
.wr-main .wr-listing > *,
.wr-main .wr-list-card__grid > * { min-width: 0; max-width: 100%; }
.wr-main .wr-list-card__grid { grid-template-columns: auto minmax(0, 1fr) auto; }
@media (max-width: 1024px) {
  /* Legacy <=980px .wr-grid-sidebar sets 1fr!important on this same node. */
  .wr-main .wr-listing { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 640px) {
  .wr-main .wr-list-card__grid { grid-template-columns: auto minmax(0, 1fr); }
}
/* Preserve the existing card-level salary placement at 500–720px. */
@container (min-width: 500px) and (max-width: 720px) {
  .wr-main .wr-list-card__grid { grid-template-columns: auto minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .wr-main :is(.wr-vac-head, .wr-search-card, .wr-steps, .wr-search-faq__list) { border-radius: 16px; }
  .wr-main :is(h2, .h2) { font-size: 24px; }
  .wr-main .wr-content h2 { font-size: 22px; }
}

/* At 360px, give the unchanged logo room by tightening guest actions only. */
@media (max-width: 380px) {
  .site-header .nav-actions { gap: 6px; }
  .site-header .user-menu--guest > .user-menu__toggle {
    padding-inline: 8px;
    min-height: 44px;
    border-radius: 12px;
    background: var(--wr-brand-surface);
    border-color: var(--wr-brand-line);
    color: var(--wr-brand-ink);
  }
}
