/* Общие части экранов решения, кейса и поиска: полоса пути, карточка кейса, боковые карточки, фильтры, заглушки. */

/* ---------- Полоса пути «Контекст → Подход → Решение» ---------- */
.sp-path { box-sizing: border-box; max-width: 1180px; display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px 0; padding: 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-2xl); background: var(--surface-sunken); }
.sp-path__step { position: relative; flex: 1 1 260px; min-width: 0; }
.sp-path__seg { display: flex; align-items: center; gap: 16px; width: 100%; height: 100%; min-height: 76px; box-sizing: border-box; padding: 14px 18px 14px 20px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, 0.06); color: var(--ink); font-family: inherit; text-align: left; cursor: pointer; }
.sp-path__seg:hover { background: rgba(255, 255, 255, 0.1); }
.sp-path__seg .sp-step { align-self: flex-start; padding-top: 1px; }
.sp-path__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sp-path__label { font-size: 11px; line-height: 15px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); }
.sp-path__value { font-size: 16px; line-height: 22px; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sp-path__chev { flex: none; color: var(--ink-2); transition: transform 0.15s; }
.sp-path__seg[aria-expanded="true"] .sp-path__chev { transform: rotate(180deg); }
.sp-path__arrow { display: flex; align-items: center; justify-content: center; flex: 0 0 30px; color: rgba(255, 255, 255, 0.3); }

/* Выпадающий список (как на главной), но открывается вниз */
.sp-dd { position: absolute; left: 0; top: calc(100% + 8px); z-index: 40; width: 440px; max-width: calc(100vw - 32px); box-sizing: border-box; padding: 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-popover); }
.sp-dd[hidden] { display: none; }
.sp-dd--right { left: auto; right: 0; }
.sp-dd__search { position: relative; }
.sp-dd__search svg { position: absolute; left: 14px; top: 14px; color: var(--ink-faint); pointer-events: none; }
.sp-dd__search input { display: block; box-sizing: border-box; width: 100%; height: 44px; padding: 0 14px 0 40px; border: 1px solid var(--line); border-radius: var(--radius-m); background: rgba(255, 255, 255, 0.04); color: var(--ink); font-family: inherit; font-size: 14px; }
.sp-dd__search input::placeholder { color: var(--ink-faint); }
.sp-dd__search input:focus { outline: none; border-color: var(--accent); }
.sp-dd__list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 320px; overflow-y: auto; overscroll-behavior: contain; }
.sp-dd__opt { display: block; padding: 10px 12px; border-radius: var(--radius-s); font-size: 14px; line-height: 19px; color: var(--ink); text-decoration: none; }
.sp-dd__opt:hover, .sp-dd__opt:focus-visible { background: rgba(255, 255, 255, 0.06); color: var(--ink-strong); outline: none; }
.sp-dd__opt.is-selected { color: var(--accent); font-weight: 600; }
.sp-dd__empty { padding: 10px 12px; font-size: 14px; line-height: 19px; color: var(--ink-muted); }
.sp-dd__empty[hidden], .sp-dd__list li[hidden] { display: none; }

/* ---------- Карточка кейса ---------- */
.sp-casegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.sp-casegrid__cell { min-width: 0; }
.sp-casegrid__cell[hidden] { display: none; }
.sp-casecard { display: flex; flex-direction: column; gap: 18px; height: 100%; min-height: 228px; box-sizing: border-box; padding: 24px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: var(--radius-2xl); background: var(--surface); color: var(--ink); text-decoration: none; }
.sp-casecard:hover { border-color: rgba(240, 86, 106, 0.6); background: var(--surface-hover); }
.sp-casecard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sp-casecard__meta { font-size: 13px; line-height: 18px; color: var(--ink-muted); overflow-wrap: anywhere; }
.sp-casecard__brand { font-weight: 600; color: var(--ink); margin-right: 4px; }
.sp-casecard__idea { flex: none; font-size: 18px; line-height: 1.4; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.sp-casecard__tags { margin-top: -4px; font-size: 13px; line-height: 18px; color: var(--ink-muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sp-casecard__foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 12px; margin-top: auto; }
.sp-casecard__chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; max-width: 100%; }
.sp-casecard__go { flex: none; margin-left: auto; color: var(--ink-faint); }
.sp-casecard:hover .sp-casecard__go { color: var(--accent); }

.sp-tag { display: inline-flex; align-items: center; max-width: 100%; box-sizing: border-box; padding: 3px 10px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: var(--radius-s); font-size: 12px; line-height: 16px; color: var(--ink-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sp-badge { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; box-sizing: border-box; padding: 4px 10px 4px 8px; border-radius: var(--radius-s); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-badge svg { flex: none; }
.sp-badge--award { background: var(--accent-soft); color: var(--accent-text); }
.sp-badge--more { padding: 4px 8px; background: var(--accent-soft); color: var(--accent-text); }
.sp-badge--ok { background: var(--success-soft); color: var(--success); }

/* ---------- Боковые карточки ---------- */
.sp-sidecard { box-sizing: border-box; padding: 28px; border: 1px solid var(--line-strong); border-radius: var(--radius-3xl); }
.sp-sidecard--sunken { background: var(--surface-sunken); }
.sp-sidecard__head { display: flex; align-items: center; gap: 12px; }
.sp-sidecard__head h2 { margin: 0; font-size: 12px; line-height: 16px; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 500; color: var(--ink-muted); }
.sp-sidecard__name { display: block; margin-top: 18px; font-size: 18px; line-height: 1.4; font-weight: 500; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.sp-sidecard__name:hover { color: var(--ink-strong); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.sp-sidecard__text { margin: 8px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink-muted); white-space: pre-line; }
.sp-sidecard__text--clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.sp-sidecard__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.sp-sidecard__num { margin-right: 6px; font-family: var(--font-display); font-size: 22px; line-height: 1; font-weight: 400; color: var(--accent); }
.sp-sidecard__foot a { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ink); text-decoration: none; }
.sp-sidecard__foot a:hover { color: var(--ink-strong); }
.sp-sidelist { list-style: none; margin: 16px -12px 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-sidelist a { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: var(--radius-m); font-size: 15px; line-height: 1.45; color: var(--ink); text-decoration: none; }
.sp-sidelist a:hover { background: rgba(255, 255, 255, 0.05); }
.sp-sidelist a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 500; }
.sp-sidelist a > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.sp-sidelist__n { flex-shrink: 0; font-size: 13px; font-weight: 400; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.sp-sidelist a[aria-current="page"] .sp-sidelist__n { color: var(--accent-text); }

/* ---------- Поля фильтров ---------- */
.sp-filter { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sp-filter__label { font-size: 13px; line-height: 18px; color: var(--ink-2); }
.sp-toggle { display: inline-flex; align-items: center; gap: 8px; height: 44px; box-sizing: border-box; padding: 0 18px 0 12px; border: 1px solid var(--line-control); border-radius: var(--radius-pill); background: transparent; color: var(--ink-2); font-family: inherit; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.sp-toggle:hover { background: rgba(255, 255, 255, 0.06); }
.sp-toggle__mark { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; box-sizing: border-box; border: 1.5px solid var(--ink-2); border-radius: 50%; color: transparent; }
.sp-toggle[aria-pressed="true"] { border-color: var(--accent); color: var(--ink-strong); background: var(--accent-soft); }
.sp-toggle[aria-pressed="true"] .sp-toggle__mark { border-color: var(--accent-fill); background: var(--accent-fill); color: var(--on-accent); }

/* ---------- Пусто, «показать ещё» ---------- */
.sp-empty { margin-top: 20px; padding: 40px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius-2xl); text-align: center; }
.sp-empty[hidden] { display: none; }
.sp-empty__title { margin: 0; font-size: 18px; line-height: 1.4; font-weight: 500; }
.sp-empty__text { margin: 8px 0 16px; font-size: 14px; color: var(--ink-muted); }
.sp-more { display: flex; justify-content: center; margin-top: 32px; }
.sp-more[hidden] { display: none; }

/* ---------- Заглушка для гостя: силуэты карточек и приглашение войти ---------- */
.sp-lockgrid { position: relative; display: grid; margin-top: 28px; }
.sp-lockgrid__ghosts { grid-area: 1 / 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.sp-lockgrid::after { content: ""; grid-area: 1 / 1; background-image: linear-gradient(180deg, rgba(18, 15, 28, 0.25) 0%, rgba(18, 15, 28, 0.78) 55%, var(--bg) 100%); pointer-events: none; }
.sp-ghostcard { display: flex; flex-direction: column; gap: 14px; min-height: 228px; box-sizing: border-box; padding: 24px; border: 1px solid rgba(255, 255, 255, 0.06); border-radius: var(--radius-2xl); background: var(--surface); }
.sp-ghostcard span { display: block; height: 14px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.12); }
.sp-ghostcard span:nth-child(1) { width: 40%; height: 10px; }
.sp-ghostcard span:nth-child(2) { width: 85%; }
.sp-ghostcard span:nth-child(3) { width: 60%; }
.sp-ghostcard .sp-ghostcard__chips { margin-top: auto; width: 55%; height: 24px; border-radius: var(--radius-s); background: rgba(255, 255, 255, 0.06); }
.sp-lockcard { grid-area: 1 / 1; align-self: start; justify-self: center; position: relative; z-index: 1; width: 100%; max-width: 600px; margin-top: 96px; box-sizing: border-box; padding: 40px; border: 1px solid var(--line-strong); border-radius: var(--radius-3xl); background: var(--surface); text-align: center; }
.sp-lockcard .sp-modal__icon { margin: 0 auto; }
.sp-lockcard__title { margin: 20px 0 0; font-family: var(--font-display); font-size: 24px; line-height: 1.25; font-weight: 500; }
.sp-lockcard__text { margin: 12px auto 0; max-width: 460px; font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.sp-lockcard__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }

/* ---------- Окно ---------- */
.sp-modal[hidden] { display: none; }
.sp-modal__close { border: 0; color: var(--ink-2); }
.sp-modal__close:hover { background: rgba(255, 255, 255, 0.08); }
html.sp-modal-open { overflow: hidden; }

/* ---------- Телефон ---------- */
@media (max-width: 960px) {
  .sp-path__arrow { display: none; }
}
@media (max-width: 760px) {
  .sp-path { flex-direction: column; gap: 0; padding: 6px; }
  .sp-path__step { flex: none; }
  .sp-path__seg { min-height: 44px; padding: 10px 12px; gap: 10px; align-items: center; background: transparent; }
  .sp-path__step + .sp-path__arrow + .sp-path__step .sp-path__seg, .sp-path__step ~ .sp-path__step .sp-path__seg { border-top: 1px solid var(--line); border-radius: 0; }
  .sp-path__step:last-child .sp-path__seg { background: rgba(255, 255, 255, 0.06); border-radius: 12px; border-top: 0; }
  .sp-path__seg .sp-step { align-self: center; padding-top: 0; }
  .sp-path__text { flex-direction: row; align-items: center; gap: 12px; }
  .sp-path__label { flex: 0 0 72px; }
  .sp-path__value { font-size: 15px; }
  .sp-dd, .sp-dd--right { left: 0; right: 0; width: auto; max-width: none; }
  .sp-sidecard { padding: 22px 18px; border-radius: var(--radius-2xl); }
  .sp-lockcard { margin-top: 40px; padding: 28px 20px; }
  .sp-lockcard__actions .sp-btn { width: 100%; white-space: normal; text-align: center; min-height: 52px; height: auto; padding-top: 13px; padding-bottom: 13px; line-height: 1.4; }
  .sp-casecard { min-height: 0; gap: 14px; padding: 20px; }
  .sp-casecard__idea { font-size: 17px; }
}
