/* Главная (11.11.2026): ярко, но спокойно — первый экран «место встречи» с поиском, четыре входа, сообщество на зелёной панели.
   Гамма сайта: зелёный + оранжевый. Только для catalog/home.html; общие классы (card, btn, chip, report-teaser) — из site.css. */

/* ---------- 1. первый экран: место встречи с поиском (версия 3.2) ---------- */
/* фон: мягкое зелёное свечение справа сверху, низ плавно переходит в фон страницы — без пятен, которые обрезаются краем блока */
.hm-hero-bg { background:
    linear-gradient(180deg, rgba(242, 246, 243, 0) 55%, var(--bg) 100%),
    radial-gradient(760px 420px at 100% 0%, rgba(19, 138, 72, .12), transparent 62%),
    linear-gradient(180deg, #F7FBF8 0%, var(--bg) 100%); }
.hm-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, 1fr); gap: 44px; align-items: stretch; padding: 40px 0 56px; }
.hm-hero-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; padding-top: 8px; }
.hm-hero h1 { font-size: clamp(30px, 3.6vw, 48px); letter-spacing: -0.03em; }
.hm-hl { color: var(--green-brand); background: linear-gradient(transparent 72%, rgba(232, 131, 63, .30) 72%, rgba(232, 131, 63, .30) 92%, transparent 92%); }
.hm-lead { max-width: 640px; }
.hm-hero-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.hm-search { display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 20px; background: var(--card);
  border: 1px solid var(--line); box-shadow: 0 22px 48px rgba(15, 31, 23, .10); }
.hm-search-row { display: flex; gap: 8px; align-items: stretch; }
.hm-search-q { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 12px; background: var(--bg); color: var(--muted); }
.hm-search-q svg { flex-shrink: 0; }
.hm-search-q:focus-within { outline: 2px solid var(--green); outline-offset: -2px; background: #fff; }
.hm-search-q input { flex: 1 1 auto; min-width: 0; height: 52px; border: 0; background: transparent; font: 16px var(--body); color: var(--ink); outline: none; }
.hm-search-foot { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; justify-content: space-between; padding: 0 6px 4px; }
.hm-search-opt { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink2); cursor: pointer; }
.hm-search-opt input { width: 18px; height: 18px; accent-color: var(--green-d); margin: 0; }

/* четыре роли — кто здесь встречается: большое число, факт и строка о людях (views.home_roles).
   Колонки героя тянутся до одной высоты: слева растут карточки ролей, справа — лента, низы совпадают. */
.hm-roles { flex: 1 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.hm-role { display: flex; flex-direction: column; gap: 8px; padding: 13px 13px 11px; border-radius: 14px; background: var(--card); border: 1px solid var(--line);
  color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.hm-role:hover { border-color: var(--green); box-shadow: var(--shadow); color: var(--ink); }
.hm-role-h { display: flex; flex-direction: column; gap: 4px; }
.hm-role-h svg { color: var(--green-d); }
.hm-role-pat .hm-role-h svg { color: var(--orange-d); }
.hm-role-h b { font-size: 14.5px; line-height: 1.25; }
/* число с подписью — посередине карточки по высоте, крупно (Тим 11.11.2026: «цифры большим кеглем и отцентруй… по высоте») */
.hm-role-num { margin-top: auto; font: 800 40px/1 var(--display); letter-spacing: -0.025em; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.hm-role-num:empty { display: none; }
.hm-role-l { margin: -2px 0 auto; font-size: 13px; line-height: 1.35; color: var(--ink2); }
.hm-role-f { font-size: 12.5px; line-height: 1.35; font-weight: 600; color: var(--green-d); }
.hm-role-f:empty { display: none; }
.hm-role-p { display: flex; gap: 5px; align-items: flex-start; padding-top: 9px; border-top: 1px dashed var(--line);
  font-size: 12px; line-height: 1.35; color: var(--ink2); }
.hm-role-p:empty { display: none; }
/* одинаковые строки во всех карточках (как в «Четырёх входах»): заголовок · пусто · число · подпись · пусто · факт · люди.
   Пустые строки делят лишнюю высоту поровну — число с подписью встаёт посередине, а цифры всех карточек на одной линии. */
@supports (grid-template-rows: subgrid) {
  .hm-roles { grid-auto-rows: auto 1fr auto auto 1fr auto auto; }
  .hm-role { display: grid; grid-row: span 7; grid-template-rows: subgrid; row-gap: 0; }
  .hm-role-h { grid-row: 1; }
  .hm-role-num { grid-row: 3; margin: 14px 0 0; }
  .hm-role-num:empty { display: block; }
  .hm-role-l { grid-row: 4; margin: 6px 0 14px; align-self: start; }
  .hm-role-f { grid-row: 6; align-self: end; }   /* факт прижат к низу карточки — на одной линии с низом правой колонки */
  .hm-role-f:empty { display: block; }
  .hm-role-p { grid-row: 7; margin-top: 8px; }
  .hm-role-p:empty { display: block; border-top-color: transparent; padding-top: 0; margin-top: 0; }
}

/* лента «Сейчас на Клиномире» */
.hm-live { flex: 1 0 auto; display: flex; flex-direction: column; gap: 10px; padding: 18px 22px; }
.hm-live-h { font: 800 19px/1.2 var(--display); letter-spacing: -0.015em; }
/* лента тянется до низа левой колонки: лишняя высота делится между строками, текст — по центру строки */
.hm-live-list { flex: 1 0 auto; display: flex; flex-direction: column; }
.hm-live-it { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 9px 0 9px 20px; border-top: 1px solid var(--line); color: var(--ink); }
.hm-live-it:first-child { border-top: 0; padding-top: 2px; }
.hm-live-tag { position: relative; }
.hm-live-tag::before { content: ""; position: absolute; left: -18px; top: 50%; margin-top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.hm-live-it:first-child .hm-live-tag::before { background: var(--orange); box-shadow: 0 0 0 4px var(--orange-t); }
.hm-live-it:hover .hm-live-t { color: var(--green-d); }
.hm-live-tag { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--green-d); }
.hm-live-permit .hm-live-tag { color: var(--orange-d); }
.hm-live-t { font-size: 15px; font-weight: 600; line-height: 1.35; }
.hm-live-more { display: inline-flex; align-self: flex-start; align-items: center; gap: 4px; padding-top: 2px; font-size: 14px; font-weight: 600; color: var(--green-d); }
.hm-live-more:hover { color: var(--ink); }

/* ---------- общие для разделов ---------- */
.hm-section { margin-top: 88px; }
.hm-doors-wrap { margin-top: 24px; display: flex; flex-direction: column; gap: 28px; }
.hm-section > .section-head, .hm-doors-wrap > .section-head { max-width: 760px; }

/* ---------- 2. четыре входа ---------- */
.hm-doors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.hm-door { --acc: var(--green-d); --acc-t: var(--green-t); position: relative; display: flex; flex-direction: column; gap: 16px; padding: 24px 22px 22px;
  border-radius: 20px; background: var(--card); border: 1px solid var(--line); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.hm-door::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--acc); }
.hm-door:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.hm-door-patient { --acc: var(--orange); --acc-t: var(--orange-t); }
.hm-door-sponsor { --acc: var(--green-word); }
.hm-door-pro { --acc: var(--green-brand); }
.hm-door-top { display: flex; align-items: center; gap: 12px; }
.hm-door-top h3 { font-size: 18px; line-height: 1.25; }
.hm-door-ico { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  background: var(--acc-t); color: var(--acc); }
.hm-door-patient .hm-door-ico { color: var(--orange-d); }
.hm-door-promise { font-size: 15.5px; line-height: 1.5; color: var(--ink); font-weight: 500; }
.hm-door-num { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--acc-t); }
.hm-door-num b { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1; letter-spacing: -0.02em; color: var(--acc); font-variant-numeric: tabular-nums; }
.hm-door-patient .hm-door-num b { color: var(--orange-d); }
.hm-door-num span { font-size: 13.5px; line-height: 1.35; color: var(--ink2); }
.hm-door-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; line-height: 1.4; color: var(--ink2); }
.hm-door-list li { display: flex; gap: 8px; align-items: flex-start; }
.hm-door-list svg { color: var(--green); flex-shrink: 0; margin-top: 1px; }
.hm-door-act { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.hm-door-act .btn { flex: 1 1 auto; height: 42px; padding: 0 14px; font-size: 14.5px; }
/* общая сетка карточек: заголовок, обещание, цифра, список и кнопки стоят на одних линиях во всех четырёх (просьба Тима) */
@supports (grid-template-rows: subgrid) {
  @media (min-width: 641px) {   /* на телефоне карточки идут одна под другой — выравнивать не с чем */
    .hm-door { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 16px; align-content: start; }
    .hm-door-num { align-items: center; }
    .hm-door-act { align-self: end; }
  }
}

/* ---------- 3. проекты и анкеты feasibility ---------- */
.hm-proj { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, 1fr); gap: 48px; align-items: center; }
.hm-proj-main { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.hm-proj-side { min-width: 0; }
.hm-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; counter-reset: none; }
.hm-flow li { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.hm-flow-n { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--orange-t); color: var(--orange-d); font: 800 16px var(--display); }
.hm-flow b { display: block; font-size: 16px; font-weight: 600; line-height: 1.3; }
.hm-flow span:not(.hm-flow-n) { display: block; font-size: 14px; line-height: 1.45; color: var(--ink2); margin-top: 4px; }
.hm-proj-list { margin-top: 32px; }

/* ---------- 4. сообщество ---------- */
.hm-comm { display: flex; flex-direction: column; gap: 28px; padding: 44px; border-radius: 28px; color: #fff;
  background: radial-gradient(600px 300px at 100% 0%, rgba(79, 212, 136, .22), transparent 65%),
              radial-gradient(520px 280px at 0% 100%, rgba(232, 131, 63, .20), transparent 65%),
              linear-gradient(135deg, #0F7A44 0%, #0B4F2A 100%); }
.hm-comm h2, .hm-comm .hm-on-dark-h { color: #fff; }
.hm-comm .lead { color: #D6F0E0; }
.hm-comm .eyebrow.hm-on-dark { color: #9FE3BC; }
.hm-comm-head { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; align-items: flex-end; }
.hm-comm-stats { display: flex; flex-wrap: wrap; gap: 12px; }
.hm-comm-stats div { display: flex; flex-direction: column; gap: 4px; min-width: 130px; padding: 14px 16px; border-radius: 14px;
  background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .16); }
.hm-comm-stats b { font: 800 28px/1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hm-comm-stats span { font-size: 13px; line-height: 1.35; color: #CFEBD9; max-width: 150px; }
.hm-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hm-tile { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 12px; row-gap: 4px; padding: 18px; border-radius: 16px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.hm-tile svg { color: #9FE3BC; grid-row: 1 / 3; margin-top: 1px; }
.hm-tile b { font-size: 16px; font-weight: 600; line-height: 1.3; }
.hm-tile span { font-size: 14px; line-height: 1.45; color: #CFEBD9; }
.hm-ranks { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: space-between; padding: 18px 20px; border-radius: 16px;
  background: rgba(255, 255, 255, .95); color: var(--ink); }
.hm-ranks > div { flex: 1 1 320px; }
.hm-ranks b { font-size: 16px; }
.hm-ranks span { font-size: 14px; line-height: 1.45; color: var(--ink2); }
.hm-ranks .hm-real { font-size: 14px; color: #1E3F9A; }     /* «настоящая медаль по почте» (club/real.py) */
.hm-medals { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; }
.hm-medal { display: inline-flex; transition: transform .15s; }
.hm-medal:hover { transform: translateY(-3px); }
.hm-btn-glass { background: rgba(255, 255, 255, .10); color: #fff; border-color: rgba(255, 255, 255, .30); }
.hm-btn-glass:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.hm-comm .home-posts .net-post { color: var(--ink); }

/* ---------- 5–6. два столбца: мероприятия и база знаний; новое в каталоге и аналитика ---------- */
.hm-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.hm-two > .card:only-child { grid-column: 1 / -1; }
.hm-two-wide { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.hm-list { display: flex; flex-direction: column; }
.hm-ev, .hm-kb { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); color: var(--ink); }
.hm-ev:first-child, .hm-kb:first-child { border-top: 0; padding-top: 0; }
.hm-ev:hover .hm-item-title, .hm-kb:hover .hm-item-title { color: var(--green-d); }
.hm-ev-date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 54px; height: 56px; border-radius: 12px; flex-shrink: 0;
  background: var(--orange-t); color: var(--orange-d); }
.hm-ev-date b { font: 800 22px/1 var(--display); }
.hm-ev-date span { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.hm-kb-ico { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: var(--green-t); color: var(--green-d); }
.hm-item-title { font-size: 15.5px; font-weight: 600; line-height: 1.35; }

/* ---------- 7. доверие ---------- */
.hm-trust { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 24px; padding: 28px; border-radius: 20px;
  background: var(--card); border: 1px solid var(--line); }
.hm-trust-item { display: flex; gap: 12px; align-items: flex-start; }
.hm-trust-item b { display: block; font-size: 15.5px; font-weight: 600; line-height: 1.3; }
.hm-trust-item span:not(.ico) { display: block; font-size: 13.5px; line-height: 1.45; color: var(--ink2); margin-top: 4px; }
.hm-trust-btn { margin-top: 12px; }
.hm-early { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.45; color: #fff; padding: 10px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .18); max-width: 760px; }
.hm-early svg { color: #FFC59B; flex-shrink: 0; margin-top: 2px; }

/* ---------- ширины ---------- */
@media (max-width: 1180px) {
  .hm-roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-doors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .hm-hero { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 36px 0 48px; }
  .hm-hero-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .hm-roles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hm-proj { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .hm-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-two, .hm-two-wide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .hm-hero-side { grid-template-columns: minmax(0, 1fr); }
  .hm-roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-search-row { flex-wrap: wrap; }
  .hm-search-q { flex: 1 1 100%; }
  .hm-search-row .btn { flex: 1 1 100%; }
}
@media (max-width: 640px) {
  .hm-hero { padding: 28px 0 36px; gap: 24px; }
  .hm-hero-main { gap: 18px; }
  .hm-section { margin-top: 56px; }
  .hm-doors { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .hm-door { padding: 20px 18px 18px; gap: 14px; }
  .hm-flow { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .hm-flow li { padding: 14px; }
  .hm-comm { padding: 26px 18px; border-radius: 22px; gap: 22px; }
  .hm-comm-stats div { flex: 1 1 120px; min-width: 0; }
  .hm-tiles { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .hm-tile { padding: 14px; }
  .hm-trust { grid-template-columns: minmax(0, 1fr); padding: 20px; }
}
/* телефон: короче страница — без второстепенного (списки в карточках входов, описания плиток сообщества, лишние строки) */
@media (max-width: 640px) {
  /* на телефоне поиск — сразу под заголовком, рассказ о сайте и роли — после него */
  .hm-search { order: 1; } .hm-lead { order: 2; font-size: 16px; } .hm-roles { order: 3; }
  .hm-search-foot .tiny { display: none; }
  .hm-live { padding: 16px; }
  .hm-door-list { display: none; }
  .hm-proj-side .pick-row:nth-child(n+4) { display: none; }
  .hm-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-tile { grid-template-columns: minmax(0, 1fr); row-gap: 8px; padding: 12px; }
  .hm-tile svg { grid-row: auto; }
  .hm-tile b { font-size: 14.5px; }
  .hm-tile span { display: none; }
  .hm-comm .btn { flex: 1 1 100%; white-space: normal; height: auto; min-height: 48px; padding: 10px 16px; text-align: center; }
  .hm-comm .btn-l { font-size: 15px; }
  .hm-medals { gap: 4px; }
  .hm-medal img { width: 22px; height: auto; }
  .hm-two .legend { gap: 6px 16px; }
  .hm-list > a:nth-child(n+3) { display: none; }
  .hm-two-wide .feed-item:nth-of-type(n+4) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hm-door, .hm-medal, .hm-role { transition: none; }
  .hm-door:hover, .hm-medal:hover { transform: none; }
}
