/* ==========================================================================
   resume.css — раздел «Резюме» (T118, SPEC-RESUME).
   Подключается шаблонами content/resume_list, content/resume_item,
   controllers/content/category_view и item_form (только тип resume).
   Цвета и радиусы — токены tokens.css, обе темы наследуются автоматически.
   ========================================================================== */

/* --- Переключатель «Вакансии | Резюме» в разделе «Работа» ------------------ */

.m-work-switch {
  display: inline-flex;
  gap: 2px;
  margin: 0 0 16px;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--track);
}

.m-work-switch__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: var(--r-pill);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.m-work-switch__item:hover { color: var(--ink); text-decoration: none; }

.m-work-switch__item.is-active {
  background: var(--card);
  color: var(--ink);
  font-weight: 800;
  box-shadow: var(--seg-shadow);
}

.m-work-switch__item:focus-visible {
  outline: 3px solid var(--accent-ink);
  outline-offset: 2px;
}

/* --- Шапка с двумя кнопками ------------------------------------------------- */

.m-section-head__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Вторая (неглавная) кнопка: стеклянная пилюля рядом с оранжевой. */
.m-addbtn--ghost {
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.m-addbtn--ghost:hover {
  background: var(--surface);
  filter: none;
}

/* --- Шапка списка: счётчик и сортировка ------------------------------------ */

.m-resume-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 14px;
}

.m-resume-list-count {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.m-resume-sort {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: var(--chip);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

/* --- Чипы сфер (появятся после заливки дерева, Q67) ----------------------- */

.m-resume-spheres {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.m-resume-sphere {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  background: var(--chip);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.m-resume-sphere:hover { text-decoration: none; }

.m-resume-sphere.is-active {
  background: var(--ink);
  color: var(--on-ink);
}

/* --- Сетка карточек --------------------------------------------------------- */

.m-resume-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px 12px;
}

@media (min-width: 640px) {
  .m-resume-list { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1180px) {
  .m-resume-list { grid-template-columns: repeat(3, 1fr); gap: 18px 16px; }
}

.m-resume-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--card-nested);
  border: 1px solid var(--card-nested-line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.m-resume-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
}

.m-resume-card__sphere {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-resume-card__file {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.m-resume-card__file svg { width: 15px; height: 15px; }

.m-resume-card__title {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  text-decoration: none;
}

.m-resume-card__title:hover { color: var(--accent-ink); text-decoration: none; }

.m-resume-card__salary {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.m-resume-card__salary b { font-size: 19px; }

.m-resume-card__muted {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.m-resume-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.m-resume-card__chips li {
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--chip);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.m-resume-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: auto 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

/* --- Панель фильтра: график (checkbox list) --------------------------------- */

.m-body .filter-panel.resume-filter .input_checkbox_list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.m-body .filter-panel.resume-filter .input_checkbox_list label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.m-body .filter-panel.resume-filter .input_checkbox_list input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--coral);
}

/* --- Постраничность ---------------------------------------------------------- */

.m-pagebar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 22px 0 0;
}

.m-pagebar__item,
.m-pagebar__gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--chip);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.m-pagebar__item:hover { text-decoration: none; }

.m-pagebar__item.is-active {
  background: var(--ink);
  color: var(--on-ink);
}

.m-pagebar__gap { background: none; }

/* --- Страница резюме --------------------------------------------------------- */

.m-resume-title {
  margin: 0 0 18px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
}

.m-resume-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

@media (min-width: 1024px) {
  .m-resume-page { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
}

.m-resume-main { min-width: 0; }

.m-resume-summary {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 16px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--card-nested-line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}

.m-resume-summary__salary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.m-resume-summary__label { color: var(--muted); font-size: 14px; font-weight: 700; }

.m-resume-summary__value { color: var(--ink); font-size: 28px; font-weight: 800; }

.m-resume-summary__value small { font-size: 15px; font-weight: 700; }

.m-resume-summary__muted { color: var(--muted); font-size: 16px; font-weight: 700; }

.m-resume-summary__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.m-resume-summary__facts li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
}

.m-resume-summary__facts span { color: var(--muted); font-size: 12px; font-weight: 700; }

.m-resume-summary__facts b { color: var(--ink); font-size: 15px; font-weight: 800; }

.m-resume-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.m-resume-chips li {
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--chip);
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
}

.m-resume-block {
  margin: 0 0 16px;
  padding: 20px;
  background: var(--card-nested);
  border: 1px solid var(--card-nested-line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}

.m-resume-block__title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
}

.m-resume-block__text {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
}

.m-resume-block__text p { margin: 0 0 12px; }
.m-resume-block__text p:last-child { margin-bottom: 0; }

.m-resume-block__text img { max-width: 100%; height: auto; }

.m-resume-skills {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}

/* --- Боковая карточка контактов --------------------------------------------- */

.m-resume-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.m-resume-contacts,
.m-resume-safe {
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--card-nested-line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}

.m-resume-contacts__title,
.m-resume-safe__title {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 800;
}

.m-resume-contact,
.m-resume-file {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin: 0 0 10px;
  padding: 10px 14px;
  border-radius: 18px;
  background: var(--card-nested);
  border: 1px solid var(--card-nested-line);
  color: var(--ink);
  text-decoration: none;
}

.m-resume-contact:hover,
.m-resume-file:hover { background: var(--surface); text-decoration: none; }

.m-resume-contact__icon,
.m-resume-file__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.m-resume-contact__icon svg,
.m-resume-file__icon svg { width: 22px; height: 22px; }

.m-resume-contact__body,
.m-resume-file__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.m-resume-contact__label,
.m-resume-file__label { color: var(--muted); font-size: 12px; font-weight: 700; }

.m-resume-contact__value { font-size: 16px; font-weight: 800; }

.m-resume-file__name {
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-resume-write {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 6px;
  border-radius: var(--r-pill);
  background: var(--orange-fill);
  box-shadow: var(--orange-shadow);
  color: var(--orange-ink);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.m-resume-write:hover { text-decoration: none; filter: brightness(1.05); }

.m-resume-contacts__empty { margin: 0; color: var(--muted); font-size: 14px; }

/* Плашка гостю: телефон и файл скрыты до входа. */
.m-resume-locked {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.m-resume-locked__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.m-resume-locked__icon svg { width: 24px; height: 24px; }

.m-resume-locked__title { margin: 0; font-size: 15px; font-weight: 800; }

.m-resume-locked__text { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.m-resume-locked__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 4px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  background: var(--orange-fill);
  box-shadow: var(--orange-shadow);
  color: var(--orange-ink);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.m-resume-locked__btn:hover { text-decoration: none; filter: brightness(1.05); }

.m-resume-safe__list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.m-resume-safe__list li { margin: 0 0 6px; }
.m-resume-safe__list li:last-child { margin-bottom: 0; }

/* --- Блок «Как составить резюме» над формой -------------------------------- */

.m-resume-help {
  margin: 0 0 18px;
  padding: 0 18px;
  background: var(--card);
  border: 1px solid var(--card-nested-line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}

.m-resume-help__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.m-resume-help__summary::-webkit-details-marker { display: none; }

.m-resume-help__summary::after {
  content: "";
  width: 20px;
  height: 20px;
  margin-left: auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .2s ease;
}

.m-resume-help[open] .m-resume-help__summary::after { transform: rotate(180deg); }

.m-resume-help__list {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}

.m-resume-help__list li { margin: 0 0 8px; }
.m-resume-help__list li:last-child { margin-bottom: 0; }

/* --- Срок публикации и продление (T121) -------------------------------------- */

.m-resume-expiry {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}

.m-resume-expiry.is-archived { background: var(--danger-bg); }

.m-resume-expiry__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--accent-ink);
}

.m-resume-expiry.is-archived .m-resume-expiry__text { color: var(--danger-ink); }

.m-resume-expiry__text b { font-size: 15px; }

.m-resume-expiry__btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.m-resume-expiry__btn:hover { filter: brightness(1.06); }
.m-resume-expiry__btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

@media (max-width: 639px) {
  .m-resume-expiry { flex-direction: column; align-items: stretch; padding: 14px 16px; }
  .m-resume-expiry__btn { width: 100%; }
}

/* --- Телефон ----------------------------------------------------------------- */

@media (max-width: 639px) {
  .m-resume-card { padding: 16px; }
  .m-section-head__actions { width: 100%; }
  .m-section-head__actions .m-addbtn { flex: 1 1 auto; }
  .m-work-switch { display: flex; width: 100%; }
  .m-work-switch__item { flex: 1 1 0; padding: 0 12px; }
  .m-resume-list-head { flex-wrap: wrap; gap: 8px; }
  .m-resume-page { gap: 14px; }
  .m-resume-summary,
  .m-resume-block,
  .m-resume-contacts,
  .m-resume-safe { padding: 16px; }
  .m-resume-write,
  .m-resume-locked__btn { width: 100%; }
  .m-body .filter-panel .fields .field { min-width: 100%; flex: 1 1 100%; }
}
