/* ============ ФИЛЬТРЫ КЕЙСОВ ============ */
.cases-filters { gap: 0; }

.cases-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cases-select {
  height: 40px;
  padding: 0 32px 0 12px;
  border: 1px solid #d8e0eb;
  border-radius: 10px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: #243041;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
  flex: 1 1 220px;
  min-width: 0;
}
.cases-select:hover { border-color: #cfd8e3; }
.cases-select:focus { border-color: #cfd8e3; box-shadow: 0 0 0 4px rgba(36,48,65,.08); }

/* ============ SEARCHABLE SELECT (отрасль/услуга, тикет 07.07.2026) ============ */
/* JS-улучшенный select скрывается (но остаётся в форме и участвует в сабмите),
   рядом рисуется .ss-wrap той же ширины — без JS обычный select остаётся видимым. */
select.ss-native { display: none; }

.ss-wrap {
  position: relative;
  flex: 1 1 220px;
  min-width: 0;
}
.ss-toggle {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 32px 0 12px;
  border: 1px solid #d8e0eb;
  border-radius: 10px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: #243041;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.ss-toggle:hover { border-color: #cfd8e3; }
.ss-wrap.is-open .ss-toggle { border-color: #cfd8e3; box-shadow: 0 0 0 4px rgba(36,48,65,.08); }
.ss-toggle-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ss-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  background: #fff;
  border: 1px solid #d8e0eb;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(16,24,40,.12);
  overflow: hidden;
}
.ss-search-wrap { padding: 8px; border-bottom: 1px solid #eef2f7; }
.ss-search {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #e4e9f0;
  border-radius: 8px;
  font-size: 14px;
  color: #243041;
  outline: none;
  box-sizing: border-box;
}
.ss-search:focus { border-color: #cfd8e3; }

.ss-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 260px;
  overflow-y: auto;
}
.ss-option {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: #28313d;
  cursor: pointer;
}
.ss-option:hover, .ss-option:focus { background: #f0f2f5; outline: none; }
.ss-option.is-active { color: #18202b; font-weight: 700; background: #f5f7fa; }
.ss-empty { padding: 10px; font-size: 13px; color: #98a2b3; cursor: default; }

@media (max-width: 559px) {
  .ss-wrap { flex: 1 1 calc(50% - 4px); }
}

/* ============ СЕТКА КЕЙСОВ ============ */
.cases-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
  align-items: stretch;
}
@media (min-width: 560px) { .cases-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .cases-grid { grid-template-columns: repeat(3, 1fr); } }

/* ============ КАРТОЧКА КЕЙСА (витрина) ============ */
.case-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px;
  border: 1px solid #e4e9f0;
  border-radius: 14px;
  background: #fff;
  color: #18202b;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.case-card:hover {
  border-color: #cfd8e3;
  box-shadow: 0 6px 18px rgba(16,24,40,.06);
  transform: translateY(-1px);
}

/* год — приглушённый, в правом верхнем углу; клики проходят сквозь */
.case-card-year {
  position: absolute;
  top: 14px;
  right: 16px;
  color: #98a2b3;
  font-size: 12px;
  font-weight: 600;
  z-index: 1;
  pointer-events: none;
}

/* заголовок = ссылка на кейс, растянутая на всю карточку */
.case-card-title {
  margin: 0 48px 7px 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}
.case-card-title-link { color: #18202b; text-decoration: none; }
.case-card-title-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* строка агентство · заказчик: монохром, жирный кружок-разделитель, узкий отступ */
.case-card-meta {
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 8px;
}
.case-card-meta a { position: relative; z-index: 1; text-decoration: none; }
.meta-agency { color: #41506a; font-weight: 600; }   /* акцент весом — подрядчик */
.meta-agency:hover { text-decoration: underline; }
.meta-more { color: #98a2b3; font-weight: 600; margin-left: 4px; }
.meta-sep {
  display: inline-block;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: #aab2bd;
  vertical-align: middle;
  margin: 0 4px;
  font-size: 0;
}
.meta-client { color: #8a94a3; font-weight: 500; }   /* бледный — заказчик */
.meta-client:hover { color: #6b7585; text-decoration: underline; }

.case-card-summary {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: #526071;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============ НАГРАДЫ В КАРТОЧКЕ: кубок цвета высшей медали + N наград ============ */
.case-card-awards {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;            /* прижать к низу карточки (не прыгает в ряду) */
  padding-top: 10px;
  border-top: 1px solid #eef2f7;
}
.award-trophy { width: 16px; height: 16px; flex: 0 0 16px; }
.case-card-awards.tier-gold   { color: #c8951b; }
.case-card-awards.tier-silver { color: #9aa0a6; }
.case-card-awards.tier-bronze { color: #b0703a; }
.case-card-awards.tier-none   { color: #98a2b3; }
.award-total {
  font-size: 13px;
  font-weight: 600;
  color: #344054;             /* текст всегда тёмный, цветной только кубок */
}

/* ============ «ПОКАЗАТЬ ЕЩЁ» ============ */
.cases-more {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

/* Мобайл: фильтры по 2 в ряд */
@media (max-width: 559px) {
  .cases-select { flex: 1 1 calc(50% - 4px); }
}

/* ============ СТРАНИЦА АГЕНТСТВА / КОМПАНИИ (MVP-дизайн, 11.07.2026) ============ */
.entity-awards { margin: 4px 0 4px; }
.entity-title { margin:0 0 8px; font-size:1.7rem; font-weight:700; line-height:1.2; color:#18202b; }
.entity-meta { font-size:0.95rem; margin:0 0 20px; color:#7a8699; }
.entity-site { color:#41506a; font-weight:600; text-decoration:none; }
.entity-site:hover { text-decoration:underline; }
.entity-city { color:#7a8699; }
.entity-cases-head {
  display:flex; align-items:baseline; gap:8px;
  margin: 22px 0 4px; padding-top: 18px; border-top: 1px solid #eef2f7;
}
.entity-cases-title { margin:0; font-size:1.15rem; font-weight:700; color:#18202b; }
.entity-cases-count {
  font-size:0.85rem; font-weight:600; color:#98a2b3;
  background:#f0f2f5; padding:2px 9px; border-radius:20px;
}
.entity-footer-meta {
  margin-top:28px; padding-top:14px; border-top:1px solid #eef2f7;
  font-size:0.8rem; color:#98a2b3;
}

/* ============ СТРАНИЦА КЕЙСА ============ */
.case-page { max-width: 760px; }

.case-back { display:inline-block; margin-bottom:14px; font-size:13px; color:#7a8699; text-decoration:none; }
.case-back:hover { color:#4a5666; }

.case-page-title { margin:0 0 10px; font-size:1.7rem; font-weight:700; line-height:1.2; color:#18202b; }

.case-page-meta { font-size:0.95rem; margin:0 0 12px; }
.case-page-meta .meta-agency { color:#41506a; font-weight:600; text-decoration:none; }
.case-page-meta .meta-agency:hover { text-decoration:underline; }
.case-page-meta .meta-client { color:#8a94a3; font-weight:500; text-decoration:none; }
.case-page-meta .meta-client:hover { color:#6b7585; text-decoration:underline; }
.case-page-meta .meta-sep {
  display: inline-block;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: #aab2bd;
  vertical-align: middle;
  margin: 0 5px;
  font-size: 0;
}
.case-page-meta .meta-year { color:#98a2b3; }

/* теги (страница кейса): нейтральный серый чип */
.case-tags { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:18px; }
.case-tag { font-size:12px; padding:3px 11px; border-radius:8px; background:#f0f2f5; color:#3d4654; font-weight:600; text-decoration:none; }
.case-tag:hover { background:#e7ebf0; }

.case-preview { font-size:1.05rem; color:#4a5666; line-height:1.6; margin:0 0 18px; padding-left:14px; border-left:2px solid #d8e0eb; }

/* «Открыть проект»: тихая текст-ссылка, а не кнопка-CTA */
.case-project-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #3d4654;
  text-decoration: none;
  border-bottom: 1px solid #cfd6df;
  padding-bottom: 1px;
}
.case-project-link:hover { color:#18202b; border-bottom-color:#9aa0a6; }

/* ============ НАГРАДЫ НА СТРАНИЦЕ КЕЙСА ============ */
.case-awards { margin:22px 0; }

/* шапка: трофей + «Награды · N» ровно по центру */
.case-awards-head { margin-bottom: 0; }
.case-awards-titleline { display: flex; align-items: center; gap: 9px; }
.case-awards .award-trophy { width: 18px; height: 18px; flex: 0 0 18px; display: block; }
.case-awards .award-trophy.tier-gold   { color:#c8951b; }
.case-awards .award-trophy.tier-silver { color:#9aa0a6; }
.case-awards .award-trophy.tier-bronze { color:#b0703a; }
.case-awards .award-trophy.tier-none   { color:#98a2b3; }
.case-awards-title { font-size: 1.05rem; font-weight: 700; color: #18202b; line-height: 1; }

/* легенда: отделена линией снизу, значки строго по центру текста */
.case-awards-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 10px;
  padding: 10px 0 14px;
  border-bottom: 1px solid #eef2f7;
  font-size: 0.85rem;
  color: #7a8699;
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; line-height: 1; }
.legend-mark { flex: 0 0 auto; }
.legend-mark.m-gold, .legend-mark.m-silver, .legend-mark.m-bronze, .legend-mark.m-other {
  width: 8px; height: 8px; border-radius: 50%;
}
.legend-mark.m-grand_prix {
  width: 12px; height: 12px; background: #c8951b;
  -webkit-clip-path: polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
          clip-path: polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
}
.legend-mark.m-gold   { background: #c8951b; }
.legend-mark.m-silver { background: #9aa0a6; }
.legend-mark.m-bronze { background: #b0703a; }
.legend-mark.m-other  { background: transparent; border: 1.5px solid #aeb6c2; box-sizing: border-box; }

/* список наград */
.award-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.award-row { display: flex; align-items: flex-start; gap: 9px; font-size: 0.92rem; line-height: 1.45; }

/* значок в строке: единая колонка 12px для кружка И звезды (ровная левая граница) */
.award-dot {
  width: 12px; height: 12px; flex: 0 0 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: #aeb6c2;
}
.award-dot.medal-gold   { background: #c8951b; }
.award-dot.medal-silver { background: #9aa0a6; }
.award-dot.medal-bronze { background: #b0703a; }
.award-dot.medal-none,
.award-dot:not(.medal-gold):not(.medal-silver):not(.medal-bronze):not(.medal-grand_prix) {
  background: transparent; border: 1.5px solid #aeb6c2; box-sizing: border-box;
}
.award-dot.medal-grand_prix {
  background: #c8951b; border: 0; border-radius: 0;
  -webkit-clip-path: polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
          clip-path: polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
}

.award-premium { font-weight: 600; color: #28313d; }
.award-row.is-grandprix .award-premium { color: #18202b; }
.award-year { color: #98a2b3; margin-left: 4px; }
.award-detail { color: #6b7585; margin-left: 4px; }

/* раскрытие списка: extra скрыты, кнопка всегда внизу, переключает текст */
.award-extra { display: none; }
.award-list.is-expanded .award-extra { display: flex; }
.award-toggle {
  margin-top: 12px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  font-size: 0.85rem;
  color: #3d4654;
  text-decoration: underline;
}
.award-toggle:hover { color: #18202b; }

/* тело кейса */
.case-body { margin-top:22px; }
.case-h { font-size:1.05rem; font-weight:700; color:#18202b; margin:0 0 6px; }
.case-p { font-size:1rem; color:#28313d; line-height:1.65; margin:0 0 18px; }
.case-result { border-left:3px solid #1f9e75; background:#f0faf6; border-radius:0 10px 10px 0; padding:12px 16px; margin-bottom:18px; }
.case-result-label { font-size:0.8rem; font-weight:700; color:#0f6e56; text-transform:uppercase; letter-spacing:.03em; margin:0 0 4px; }
.case-result .case-p { margin:0; }

.case-empty { color:#8a94a3; font-size:0.95rem; }

/* ===== ФИКСЫ 11.07.2026 (мета-блок + выравнивание) ===== */

/* Двойная черта: у .case-awards снизу своя граница, у .entity-cases-head сверху своя.
   Когда блок наград есть — верхнюю границу заголовка «Кейсы» убираем. */
.entity-awards + .entity-cases-head {
  border-top: none;
  padding-top: 6px;
  margin-top: 14px;
}

/* Мета-блок «счётчик + дата» — ПОРТ с рейтингов (rating.css .table-meta*).
   Иконки, тултипы и поведение идентичны Grav-теме. */
.table-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.table-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #7a8699;
  white-space: nowrap;
  line-height: 1;
  position: relative;
  cursor: default;
}
.table-meta-item svg { color: #98a2b3; flex-shrink: 0; }
.table-meta-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  transform: translateY(4px);
  width: max-content;
  max-width: 220px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #1a2232;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 12px 32px rgba(16,24,40,0.2);
  font-size: 12px;
  line-height: 1.45;
  white-space: nowrap;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  pointer-events: none;
  z-index: 20;
}
.table-meta-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 10px;
  border: 5px solid transparent;
  border-top-color: #1a2232;
}
@media (hover: hover) {
  .table-meta-item:hover .table-meta-tooltip {
    opacity: 1; visibility: visible; transform: translateY(0);
  }
}
.table-meta-item.is-open .table-meta-tooltip {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.table-meta-item.tooltip-right .table-meta-tooltip {
  left: auto; right: 0; text-align: center;
}
.table-meta-item.tooltip-right .table-meta-tooltip::after { left: auto; right: 10px; }

/* Выравнивание строки под фильтром: счётчик слева, дата справа.
   padding-left выравнивает по ТЕКСТУ внутри селекта (а не по его рамке).
   ⚠️ 14px = внутренний отступ .cases-select. Если текст в селекте начинается
   с другим отступом — поправьте это одно число. */
.cases-filters .table-below-search {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0 14px;
  margin: 12px 0;
}
.cases-filters .table-meta { width: 100%; justify-content: space-between; }

/* Дата внизу карточки агентства/компании/кейса */
.entity-footer-meta {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid #eef2f7;
}

/* ===== ФИКС 11.07.2026 (2): убрать дыру фильтр → кейсы ===== */
/* Было margin:12px 0 — вместе с собственным отступом .cases-grid давало провал.
   Строка мета прижата к фильтру, а низ отдан гриду. */
.cases-filters .table-below-search {
  margin: 8px 0 0;
  min-height: 16px;
}
.cases-filters { margin-bottom: 0; }
.table-card > .cases-grid { margin-top: 10px; }

/* ===== ПЕРЕЛИНКОВКА НА СТРАНИЦЕ КЕЙСА (§23 шаг 4, 13.07.2026) ===== */
.case-nav {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin: 32px 0 8px; padding-top: 18px; border-top: 1px solid #eef2f7;
}
.case-nav-link {
  font-size: 0.9rem; font-weight: 600; color: #41506a; text-decoration: none;
  padding: 8px 14px; border: 1px solid #e3e8ef; border-radius: 10px; background: #fff;
  transition: border-color .15s ease, color .15s ease;
}
.case-nav-link:hover { border-color: #c9d2e0; color: #18202b; }

/* Похожие кейсы: страница кейса узкая (760px) — грид тут в 2 колонки, не в 3 */
.similar-cases { margin-top: 30px; padding-top: 20px; border-top: 1px solid #eef2f7; }
.similar-head { margin-bottom: 14px; }
.similar-title { margin: 0 0 8px; font-size: 1.15rem; font-weight: 700; color: #18202b; }
.similar-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.similar-tags .case-tag { text-decoration: none; transition: background .15s ease; }
.similar-tags .case-tag:hover { background: #e6ebf2; }
.similar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) {
  .similar-grid { grid-template-columns: 1fr; }
  .case-nav-link { padding: 8px 10px; font-size: 0.85rem; }
}

/* ===== ПИЛЮЛИ: отрасль ≠ услуга (13.07.2026) =====
   Раньше отрасли и услуги выглядели одинаково — «просто набор тегов», непонятно
   что есть что. Теперь отрасль идёт ПЕРВОЙ и визуально выделена (тёмная, с заливкой),
   услуги — светлые. Порядок одинаковый везде: в шапке кейса и в «Похожих». */
.case-tag--industry {
  background: #eef2f8;
  color: #2b3a52;
  border: 1px solid #d8e0ec;
  font-weight: 600;
}
.case-tag--industry:hover { background: #e2e9f3; }

/* Кнопка догрузки в блоке похожих */
.similar-more { display: flex; justify-content: center; margin-top: 14px; }

/* Пилюля-отрасль: рамка была едва различима — делаем тёмную заливку.
   Отрасль = «что за рынок» (главный ориентир), услуги = «что делали» (вторично). */
.case-tag--industry {
  background: #2b3a52;
  color: #fff;
  border: 1px solid #2b3a52;
  font-weight: 600;
}
.case-tag--industry:hover { background: #1e2a3d; border-color: #1e2a3d; color: #fff; }

/* ===== ПИЛЮЛЯ-ОТРАСЛЬ, финал (13.07.2026) =====
   История: v1 (бледная рамка) — не читалась; v2 (тёмная заливка) — кричала громче H1,
   метка выглядела как главный CTA страницы. Правильный уровень: отрасль отличается ТИПОМ,
   а не громкостью — светлая подложка, точка-маркер, чуть более тёмный текст.
   Перебивает предыдущие правила (идёт ниже в файле). */
.case-tag--industry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff3f9;
  color: #3b4a63;
  border: 1px solid #dbe3ef;
  font-weight: 600;
}
.case-tag--industry::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #7f93b5;
  flex: 0 0 5px;
}
.case-tag--industry:hover {
  background: #e5ebf4;
  border-color: #c9d4e4;
  color: #2b3a52;
}

/* ===== «Что ещё делают в отрасли X» — пилюли непустых услуг (13.07.2026) ===== */
.sibling-facets { margin: 26px 0 6px; padding-top: 20px; border-top: 1px solid #eef2f7; }
.sibling-title { margin: 0 0 12px; font-size: 1.05rem; font-weight: 700; color: #18202b; }
.sibling-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.sibling-tag {
  display: inline-flex; align-items: center; gap: 7px;
  text-decoration: none; transition: background .15s ease, border-color .15s ease;
}
.sibling-tag:hover { background: #e5ebf4; border-color: #c9d4e4; }
.sibling-count { font-size: 0.78rem; font-weight: 600; color: #98a2b3; }

/* Фикс пилюль-фасетов: цифра «взлетала» над названием (baseline-выравнивание inline-элементов
   разного кегля) и подчёркивалась на ховере (наследовала underline от a:hover). */
.sibling-tags .sibling-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  line-height: 1.2;
  text-decoration: none;
}
.sibling-tags .sibling-tag:hover,
.sibling-tags .sibling-tag:hover .sibling-count { text-decoration: none; }
.sibling-tags .sibling-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: #98a2b3;
  line-height: 1;
}
