/* Шоу-кейс блока «Для кого этот форум»: три способа показать темы */

body.who-lab .labbar__nav a,
body.who-lab .labfoot a:focus-visible { border-radius: 0; }

.who2-wrap {
  padding-top: clamp(8px, 1.2vw, 16px);
  padding-bottom: clamp(56px, 6.4vw, 96px);
}

/* — заголовок и лид — */

.who2-head {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 3.55fr);
  gap: clamp(36px, 4.8vw, 92px);
  align-items: start;
  padding-top: clamp(52px, 6.4vw, 100px);
}

.who2-title {
  margin: 0;
  font-family: var(--heading);
  font-weight: 400;
  font-size: clamp(42px, 5.4vw, 72px);
  line-height: .98;
  letter-spacing: -.02em;
  color: var(--ink);
}

.who2-first { color: inherit; }
.who2-accent { color: var(--violet); }

:root[data-who="panel"] .who2-title {
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1;
}

:root[data-who="panel"] .who2-first {
  color: #b1741c;
  background-image: linear-gradient(100deg, #7b3d0d 0%, #b1741c 52%, #d9a441 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

:root[data-who="panel"] .who2-accent {
  color: var(--ink);
  background: none;
  -webkit-text-fill-color: currentColor;
}

.who2-lead {
  margin: 5px 0 0;
  font-size: clamp(15px, 1.1vw, 17px);
  line-height: 1.6;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* — сетка сегментов — */

.who2-grid {
  --who-gap: clamp(44px, 5vw, 80px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  column-gap: var(--who-gap);
  margin: clamp(42px, 4.6vw, 66px) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: linear-gradient(var(--hairline), var(--hairline)) 0 50% / 100% 1px no-repeat;
}

.who2-item {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-block: clamp(26px, 2.7vw, 38px);
}

.who2-item::before {
  content: "";
  display: none;
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: calc(var(--who-gap) / -2);
  width: 1px;
  background: var(--hairline);
}

.who2-item:nth-child(3n + 2)::before,
.who2-item:nth-child(3n)::before { display: block; }

.who2-num {
  font-family: var(--text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .14em;
  color: var(--violet);
}

.who2-name {
  margin: clamp(14px, 1.4vw, 18px) 0 0;
  font-family: var(--heading);
  font-weight: 400;
  font-size: clamp(21px, 1.7vw, 26px);
  line-height: 1.16;
  letter-spacing: -.006em;
  color: var(--ink);
}

.who2-text {
  margin: 10px 0 0;
  max-width: 34ch;
  font-family: var(--text);
  font-size: clamp(14px, 1.05vw, 15.5px);
  line-height: 1.58;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* — ссылка, открывающая темы — */

.who2-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-top: auto;
  padding: clamp(22px, 2.4vw, 34px) 0 4px;
  border: 0;
  border-bottom: 1px solid var(--hairline-strong);
  background: none;
  font-family: var(--text);
  font-size: 12.5px;
  line-height: 1.3;
  letter-spacing: .03em;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}

.who2-trigger:hover,
.who2-item[data-open="true"] .who2-trigger {
  color: var(--violet);
  border-color: currentColor;
}

.who2-trigger:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}

.who2-trigger__icon {
  font-size: 12px;
  line-height: 1;
  transition: transform .25s ease;
}

.who2-item[data-open="true"] .who2-trigger__icon { transform: translate(3px, -3px); }

/* — содержимое тем — */

.who2-pop__kicker {
  margin: 0 0 8px;
  font-family: var(--text);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--violet);
}

.who2-topics {
  margin: 0;
  padding: 0;
  list-style: none;
}

.who2-topic__link {
  display: block;
  padding: 7px 0;
  border-top: 1px solid var(--hairline);
  color: inherit;
  text-decoration: none;
}

.who2-topic:first-child .who2-topic__link {
  padding-top: 0;
  border-top: 0;
}

.who2-topic__when {
  display: block;
  font-size: 9px;
  line-height: 1.3;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.who2-topic__name {
  display: block;
  margin-top: 3px;
  font-family: var(--heading);
  font-size: 15px;
  line-height: 1.16;
  letter-spacing: -.004em;
  color: var(--ink);
  transition: color .2s ease;
}

:root[data-who="card"] .who2-pop__kicker { display: none; }

.who2-topic__link:hover .who2-topic__name { color: var(--violet); }

.who2-pop__all {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding-bottom: 3px;
  border-bottom: 1px solid currentColor;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--violet);
  text-decoration: none;
}

.who2-pop__all:hover { color: var(--violet-deep, #45398f); }

/* — вариант 01: карточка над пунктом — */

:root[data-who="card"] .who2-pop {
  position: absolute;
  top: auto;
  bottom: calc(100% - 8px);
  left: 0;
  z-index: 30;
  width: min(372px, calc(100vw - 48px));
  padding: 14px 18px 12px;
  background: #efeeea;
  border: 1px solid var(--hairline-strong);
  box-shadow: 0 22px 50px rgba(23, 22, 19, .13);
  opacity: 0;
  visibility: hidden;
  transform: translateY(7px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}

:root[data-who="card"] .who2-item[data-open="true"] .who2-pop {
  opacity: 1;
  visibility: visible;
  transform: none;
}

:root[data-who="card"] .who2-pop::before {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 30px;
  width: 10px;
  height: 10px;
  background: #efeeea;
  border-right: 1px solid var(--hairline-strong);
  border-bottom: 1px solid var(--hairline-strong);
  transform: rotate(45deg);
}

:root[data-who="card"] .who2-item[data-side="bottom"] .who2-pop {
  top: calc(100% - 8px);
  bottom: auto;
  transform: translateY(-7px);
}

:root[data-who="card"] .who2-item[data-side="bottom"][data-open="true"] .who2-pop { transform: none; }

:root[data-who="card"] .who2-item[data-side="bottom"] .who2-pop::before {
  top: -6px;
  bottom: auto;
  border: 0;
  border-left: 1px solid var(--hairline-strong);
  border-top: 1px solid var(--hairline-strong);
}

@media (min-width: 1101px) {
  :root[data-who="card"] .who2-item:nth-child(3n) .who2-pop { left: auto; right: 0; }
  :root[data-who="card"] .who2-item:nth-child(3n) .who2-pop::before { left: auto; right: 30px; }
}

@media (min-width: 701px) and (max-width: 1100px) {
  :root[data-who="card"] .who2-item:nth-child(even) .who2-pop { left: auto; right: 0; }
  :root[data-who="card"] .who2-item:nth-child(even) .who2-pop::before { left: auto; right: 30px; }
}

/* — вариант 02: тёмная панель справа — */

:root[data-who="panel"] .who2-pop { display: none; }

:root[data-who="panel"] .who2-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 368px);
  gap: clamp(30px, 3.4vw, 54px);
  align-items: start;
  margin-top: clamp(34px, 3.6vw, 52px);
}

:root[data-who="panel"] .who2-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
  background:
    linear-gradient(var(--hairline), var(--hairline)) 0 33.333% / 100% 1px no-repeat,
    linear-gradient(var(--hairline), var(--hairline)) 0 66.666% / 100% 1px no-repeat;
}

:root[data-who="panel"] .who2-item:nth-child(3n + 2)::before,
:root[data-who="panel"] .who2-item:nth-child(3n)::before { display: none; }

:root[data-who="panel"] .who2-item:nth-child(even)::before { display: block; }

:root[data-who="panel"] .who2-num { color: #a96f1d; }

:root[data-who="panel"] .who2-trigger:hover,
:root[data-who="panel"] .who2-item[data-open="true"] .who2-trigger { color: #8a5310; }

:root[data-who="panel"] .who2-item[data-open="true"] {
  background: rgba(255, 255, 255, .2);
}

:root[data-who="panel"] .who2-panel {
  position: sticky;
  top: calc(var(--labbar-h) + 22px);
  min-height: 276px;
  padding: 28px 28px 26px;
  color: var(--cream);
  border: 1px solid rgba(244, 227, 198, .18);
  background:
    radial-gradient(120% 100% at 82% 8%, rgba(38, 154, 143, .42) 0%, rgba(38, 154, 143, 0) 58%),
    radial-gradient(90% 90% at 0% 90%, rgba(108, 90, 216, .36) 0%, rgba(108, 90, 216, 0) 62%),
    linear-gradient(112deg, #252b60 0%, #1d2c58 48%, #1d4257 100%);
}

.who2-panel__hint {
  margin: 0;
  max-width: 25ch;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(244, 227, 198, .58);
}

.who2-panel__body:empty { display: none; }

:root[data-who="panel"] .who2-panel .who2-pop__kicker {
  margin-bottom: 12px;
  font-size: 10.5px;
  color: var(--gold);
}

:root[data-who="panel"] .who2-panel .who2-topic__link { padding: 11px 0 12px; }

:root[data-who="panel"] .who2-panel .who2-topic__when { font-size: 10px; }

:root[data-who="panel"] .who2-panel .who2-topic__name {
  margin-top: 5px;
  font-size: 17px;
}

:root[data-who="panel"] .who2-panel .who2-pop__all { margin-top: 14px; }

:root[data-who="panel"] .who2-panel .who2-topic__link {
  border-top-color: rgba(244, 227, 198, .16);
}

:root[data-who="panel"] .who2-panel .who2-topic__when { color: rgba(244, 227, 198, .56); }

:root[data-who="panel"] .who2-panel .who2-topic__name { color: var(--cream); }

:root[data-who="panel"] .who2-panel .who2-topic__link:hover .who2-topic__name { color: var(--gold); }

:root[data-who="panel"] .who2-panel .who2-pop__all { color: var(--gold); }

/* — вариант 03: раскрытие на месте — */

:root[data-who="expand"] .who2-grid {
  border-bottom: 0;
  background: none;
}

:root[data-who="expand"] .who2-pop__kicker { display: none; }

:root[data-who="expand"] .who2-item { border-bottom: 1px solid var(--hairline); }

:root[data-who="expand"] .who2-num { color: #a96f1d; }

:root[data-who="expand"] .who2-pop {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .34s cubic-bezier(.22, .61, .36, 1);
}

:root[data-who="expand"] .who2-pop__inner {
  overflow: hidden;
  min-height: 0;
}

:root[data-who="expand"] .who2-item[data-open="true"] .who2-pop { grid-template-rows: 1fr; }

:root[data-who="expand"] .who2-item[data-open="true"] .who2-pop__body {
  padding: 16px 0 10px 18px;
  border-left: 1px solid var(--violet);
}

/* — адаптив — */

@media (max-width: 1100px) {
  .who2-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .who2-lead {
    justify-self: start;
    max-width: 46ch;
  }

  .who2-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 0;
    background: none;
  }

  .who2-item { border-bottom: 1px solid var(--hairline); }

  .who2-item:nth-child(3n + 2)::before,
  .who2-item:nth-child(3n)::before { display: none; }

  .who2-item:nth-child(even)::before { display: block; }

  :root[data-who="panel"] .who2-layout { grid-template-columns: minmax(0, 1fr); }

  :root[data-who="panel"] .who2-panel { display: none; }

  :root[data-who="panel"] .who2-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: auto;
    background: none;
  }

  :root[data-who="panel"] .who2-item::before { display: none; }

  :root[data-who="panel"] .who2-pop {
    position: static;
    display: grid;
    grid-template-rows: 0fr;
    width: auto;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: grid-template-rows .3s ease;
  }

  :root[data-who="panel"] .who2-pop::before { display: none; }

  :root[data-who="panel"] .who2-pop__inner {
    overflow: hidden;
    min-height: 0;
  }

  :root[data-who="panel"] .who2-item[data-open="true"] .who2-pop { grid-template-rows: 1fr; }

  :root[data-who="panel"] .who2-item[data-open="true"] .who2-pop__body {
    padding: 16px 0 8px 18px;
    border-left: 1px solid var(--hairline);
  }
}

@media (max-width: 700px) {
  .who2-title { font-size: clamp(38px, 10vw, 56px); }

  .who2-grid,
  :root[data-who="panel"] .who2-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: auto;
  }

  :root[data-who="panel"] .who2-grid { background: none; }

  :root[data-who="card"] .who2-pop__kicker { display: none; }

  .who2-item:nth-child(even)::before { display: none; }

  :root[data-who="card"] .who2-pop,
  :root[data-who="panel"] .who2-pop {
    position: static;
    display: grid;
    grid-template-rows: 0fr;
    width: auto;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: grid-template-rows .3s ease;
  }

  :root[data-who="card"] .who2-pop::before,
  :root[data-who="panel"] .who2-pop::before { display: none; }

  :root[data-who="card"] .who2-pop__inner,
  :root[data-who="panel"] .who2-pop__inner {
    overflow: hidden;
    min-height: 0;
  }

  :root[data-who="card"] .who2-item[data-open="true"] .who2-pop,
  :root[data-who="panel"] .who2-item[data-open="true"] .who2-pop { grid-template-rows: 1fr; }

  :root[data-who="card"] .who2-item[data-open="true"] .who2-pop__body {
    padding: 16px 0 8px 18px;
    border-left: 1px solid var(--violet);
  }

  :root[data-who="panel"] .who2-item[data-open="true"] .who2-pop__body {
    padding: 16px 0 8px 18px;
    border-left: 1px solid var(--hairline);
  }

  :root[data-who="panel"] .who2-panel { display: none; }
}

/* — мобильные темы: нижняя тёмная панель вместо inline-раскрытия — */

@media (max-width: 1100px) {
  :root[data-who="panel"] .who2-pop { display: none !important; }
}

html.who2-sheet-open { overflow: hidden; }

.who2-sheet {
  position: fixed;
  inset: auto 0 0;
  width: min(100%, 620px);
  max-height: 86svh;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cream);
  overflow: visible;
  animation: who-sheet-in .28s cubic-bezier(.22, .61, .36, 1);
}

.who2-sheet::backdrop {
  background: rgba(8, 12, 34, .62);
  animation: who-sheet-fade .22s ease;
}

.who2-sheet .who2-panel {
  position: relative !important;
  top: auto !important;
  display: block !important;
  min-height: 0 !important;
  max-height: 86svh;
  overflow-y: auto;
  padding: 28px 22px calc(24px + env(safe-area-inset-bottom));
  border: 1px solid rgba(244, 227, 198, .2);
  color: var(--cream);
  background:
    radial-gradient(120% 100% at 82% 8%, rgba(38, 154, 143, .42) 0%, rgba(38, 154, 143, 0) 58%),
    radial-gradient(90% 90% at 0% 90%, rgba(108, 90, 216, .36) 0%, rgba(108, 90, 216, 0) 62%),
    linear-gradient(112deg, #252b60 0%, #1d2c58 48%, #1d4257 100%);
}

.who2-sheet__close {
  position: absolute;
  top: 17px;
  right: 18px;
  z-index: 1;
  padding: 4px 0;
  border: 0;
  background: none;
  color: rgba(244, 227, 198, .66);
  font-family: var(--text);
  font-size: 9.5px;
  line-height: 1.2;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}

.who2-sheet__close:hover { color: var(--gold); }
.who2-sheet__close:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }

.who2-sheet .who2-pop__kicker { padding-right: 64px; }
.who2-sheet .who2-topic__link { padding: 13px 0 14px; }
.who2-sheet .who2-topic__name { font-size: 18px; }
.who2-sheet .who2-pop__all { margin-top: 18px; }

@keyframes who-sheet-in {
  from { transform: translateY(28px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes who-sheet-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .who2-sheet,
  .who2-sheet::backdrop { animation: none; }
}
