/* ===== Списки проектов: резиденты (макет residents) и витрина инноваций (макет showcase) ===== */
.pj { padding-top: 72px; padding-bottom: 112px; }
.pj-row { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.pj-side { flex: 1 1 280px; align-self: stretch; }
.pj-main { flex: 999 1 640px; min-width: 0; }
.pj-count { margin-bottom: 20px; font-size: 14px; color: var(--muted); }
.pj-count b { color: var(--text); }
.pj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.pj-grid [hidden] { display: none; }
.pj-empty { display: none; grid-column: 1 / -1; margin: 0; padding: 40px; border-radius: 24px; background: #fff; border: 1px dashed #C5CFDC; text-align: center; color: var(--muted); }
.pj-grid.is-empty .pj-empty { display: block; }
.pj-more { margin-top: 32px; }
.pj-more[hidden], .pj-foot [hidden] { display: none; }

/* Фильтр */
.pf { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 24px; }
.pf h4 { margin: 0 0 10px; font-size: 12px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.ck { display: flex; flex-wrap: wrap; gap: 6px; }
.ck button { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font: 700 13px Manrope, sans-serif; color: var(--text); cursor: pointer; text-align: left; }
.ck button:hover { border-color: var(--navy); }
.ck button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.fbtn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 1.5px solid #C5CFDC; background: #fff; font: 800 14px Manrope, sans-serif; color: var(--text); cursor: pointer; }
.fbtn:hover { border-color: var(--navy); }
.pf-toggle { display: none; }
.pf-reset { align-self: flex-start; padding: 0; border: 0; background: none; font: 800 14px Manrope, sans-serif; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.pf-reset[hidden] { display: none; }

/* Витрина: фильтр — кнопки с выпадающими списками в карточке над сеткой */
.pj-bar-wrap { padding-top: 56px; }
.pj-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.pf-bar { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
.pf-dd { position: relative; }
.pf-dd > summary { list-style: none; }
.pf-dd > summary::-webkit-details-marker { display: none; }
.pf-dd[open] > summary { border-color: var(--navy); }
.pf-dd[open] > summary svg { transform: rotate(180deg); }
.pf-dd > .pf-group { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; width: max-content; max-width: min(520px, 80vw); padding: 16px; border-radius: 20px; background: #fff; border: 1px solid var(--line); box-shadow: 0 24px 48px -24px rgba(14,34,64,.35); }
.pj-io { padding-top: 48px; }

/* Карточка резидента */
.rc { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; text-decoration: none; color: var(--text); transition: transform .15s, box-shadow .15s; }
.rc:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -20px rgba(14,34,64,.35); color: var(--text); }
.rc .im { position: relative; height: 190px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff; border-bottom: 1px solid var(--line); }
.rc .im img { width: 100%; height: 100%; object-fit: contain; padding: 14px; box-sizing: border-box; }
.rc .ini { font-family: Unbounded, sans-serif; font-weight: 800; font-size: 40px; color: #C5CFDC; }
.res { position: absolute; top: 14px; left: 14px; min-height: 26px; padding: 0 10px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; display: inline-flex; align-items: center; }
.rc .bd, .ic .bd { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.rc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-tags .tag { min-height: 26px; padding: 0 10px; font-size: 11px; }
.tag-dir { background: var(--accent-bg); color: #B8331D; }
.rc .t, .ic .t { margin: 0; font-family: Unbounded, sans-serif; font-weight: 600; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.rc .d, .ic .d { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* Карточка витрины */
.pj-grid-io { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.ic { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; text-decoration: none; color: var(--text); transition: transform .15s, box-shadow .15s; }
.ic:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -20px rgba(14,34,64,.35); color: var(--text); }
.ic-ph { height: 200px; background: #E7ECF3; }
.ic-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.noimg { display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--navy); }
.ic .bd { padding: 22px 24px 26px; }
.ic .sub { font-weight: 700; font-size: 14px; color: var(--accent); }
.ic .d { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ic .go { margin-top: auto; font-weight: 800; font-size: 14px; color: var(--accent); }
.tag-new { align-self: flex-start; background: var(--accent); color: #fff; }
.ic.wide { grid-column: span 2; flex-direction: row; }
.ic.wide .ic-ph { flex: 0 0 50%; height: auto; min-height: 320px; }
.ic.wide .t { font-size: 24px; letter-spacing: -.5px; }
.ic.wide .d { -webkit-line-clamp: 5; }
.pj-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 32px; font-size: 14px; color: var(--muted); }
.pj-foot b { color: var(--text); }

@media (prefers-reduced-motion: reduce) { .rc, .ic { transition: none; } .rc:hover, .ic:hover { transform: none; } }
@media (max-width: 900px) {
  .ic.wide { grid-column: auto; flex-direction: column; }
  .ic.wide .ic-ph { flex: none; height: 200px; min-height: 0; }
}

/* Мобильная: «Резидент» — сразу, город и направление — под кнопкой */
@media (max-width: 767px) {
  .pj { padding-top: 32px; padding-bottom: 56px; }
  .pj-row { display: block; }
  .pf { position: static; gap: 14px; }
  .pf .pf-more { display: none; }
  .pf.pf-open .pf-more { display: block; }
  .pf-toggle { display: inline-flex; align-self: flex-start; min-height: 44px; }
  .pf.pf-open .pf-toggle svg { transform: rotate(180deg); }
  .ck button { min-height: 40px; }
  .pj-main { margin-top: 24px; }
  .pj-grid { grid-template-columns: 1fr; gap: 12px; }
  .rc { flex-direction: row; border-radius: 20px; }
  .rc:hover { transform: none; }
  .rc .im { flex: 0 0 104px; height: auto; min-height: 104px; border-bottom: 0; border-right: 1px solid var(--line); }
  .rc .im img { padding: 10px; }
  .rc .ini { font-size: 28px; }
  .res { top: 8px; left: 8px; min-height: 20px; padding: 0 7px; font-size: 9px; }
  .rc .bd { padding: 14px 14px 16px; gap: 6px; }
  .rc .t { font-size: 14px; }
  .rc .d { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .pj-more { width: 100%; margin-top: 20px; }

  .pj-bar-wrap { padding-top: 32px; }
  .pf-bar { gap: 8px; }
  .pf-dd .fbtn { min-height: 44px; padding: 0 16px; }
  .pf-dd > .pf-group { position: fixed; top: auto; bottom: 16px; left: 16px; right: 16px; width: auto; max-width: none; max-height: 60vh; overflow: auto; }
  .pj-io { padding-top: 32px; }
  .pj-grid-io { gap: 14px; }
  .ic { border-radius: 20px; }
  .ic:hover { transform: none; }
  .ic-ph, .ic.wide .ic-ph { height: 180px; }
  .ic .bd { padding: 18px 18px 20px; }
  .ic.wide .t { font-size: 18px; }
  .pj-foot { flex-direction: column; align-items: stretch; text-align: center; }
  .pj-foot .pill { width: 100%; }
}
