/**
 * ZB Flagship Nav — стили фильтрации разделов исследования.
 */

.zb-seg-off { display: none !important; }

body.zb-seg-filtered .zb-flagship-cover .zb-card-link {
  display: none !important;
}

body.zb-seg-filtered .entry-content .table-of-contents {
  display: none !important;
}

body.zb-seg-filtered .zb-flagship-cover,
body.zb-seg-filtered .entry-content .zb-flagship-cover,
body.zb-seg-filtered .entry-content > *:has(.zb-flagship-cover),
body.zb-seg-filtered .entry-content > .zb-seg-off:has(.zb-flagship-cover) {
  display: block !important;
}

body.zb-seg-filtered [data-zb-nav-mount],
body.zb-seg-filtered .entry-content > .zb-seg-off:has([data-zb-nav-mount]) {
  display: block !important;
}

body.zb-seg-filtered .zb-seg-bar {
  display: flex !important;
}

body.zb-seg-filtered .zb-seg-footer,
body.zb-seg-filtered .zb-seg-related {
  display: block !important;
}

/* ============================================================
   Счётчик разделов на узле хаба
   ============================================================ */

.zb-seg-count-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  vertical-align: middle;
  min-width: 28px;
}

.zb-seg-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #EFEFEF;
  color: #656565;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1;
  font-weight: 500;
}

.zb-seg-count-label {
  margin-top: 2px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 9px;
  line-height: 1.1;
  font-weight: 400;
  color: #909090;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.zb-node.zb-seg-picked .zb-seg-count,
.zb-node.active .zb-seg-count {
  background: #00A152;
  color: #FFFFFF;
}

.zb-node.zb-seg-picked .zb-seg-count-label,
.zb-node.active .zb-seg-count-label {
  color: #00A152;
}

.zb-node.zb-seg-picked {
  border-color: #00A152 !important;
  box-shadow: 0 0 0 1px #00A152 inset;
}

/* ============================================================
   Хвост среза: интервью + исследования
   ============================================================ */

.zb-seg-related {
  --zb-content: 1200px;
  --zb-paper: #FEFAEE;
  --zb-card: #FFFAEA;
  --zb-border: #DEDEDE;
  --zb-black: #041A19;
  --zb-body: rgba(0, 0, 0, 0.70);
  --zb-green: #00A152;
  --zb-font-display: 'Geologica', system-ui, sans-serif;
  --zb-font-body: 'Inter', system-ui, sans-serif;
  --zb-font-mono: 'JetBrains Mono', ui-monospace, monospace;

  max-width: var(--zb-content);
  margin: 36px auto 0;
  padding: 0 0 8px;
}

.zb-seg-related[hidden] { display: none; }

.zb-seg-related__title {
  margin: 0 0 20px;
  font-family: var(--zb-font-display);
  font-weight: 500;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--zb-black);
}

.zb-seg-related__interviews {
  margin-bottom: 40px;
  padding: 28px 24px;
  background: #051C1B;
  border-radius: 20px;
}

.zb-seg-related__interviews .zb-seg-related__title {
  color: #FEFAEE;
}

.zb-seg-related__interview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.zb-seg-iv {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #18302F;
  border-radius: 20px;
  overflow: hidden;
}

.zb-seg-iv__media {
  display: block;
  aspect-ratio: 500 / 321;
  background: #041616;
  overflow: hidden;
}

.zb-seg-iv__cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.zb-seg-iv__ep,
.zb-seg-iv__cat,
.zb-seg-iv__title,
.zb-seg-iv__excerpt,
.zb-seg-iv__cta {
  margin: 0;
  padding-left: 14px;
  padding-right: 14px;
}

.zb-seg-iv__ep {
  margin-top: 12px;
  font-family: var(--zb-font-mono);
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: rgba(254, 250, 238, 0.50);
}

.zb-seg-iv__cat {
  font-family: var(--zb-font-mono);
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: #8BBAFF;
}

.zb-seg-iv--food .zb-seg-iv__cat { color: #EA9312; }
.zb-seg-iv--grooming .zb-seg-iv__cat { color: #FFC3C9; }
.zb-seg-iv--hotels .zb-seg-iv__cat { color: #FFDCB2; }
.zb-seg-iv--training .zb-seg-iv__cat { color: #FFCCA3; }
.zb-seg-iv--veterinary .zb-seg-iv__cat { color: #8BBAFF; }

.zb-seg-iv__title {
  font-family: var(--zb-font-display);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.15;
  color: #FEFAEE;
}

.zb-seg-iv__title a {
  color: inherit;
  text-decoration: none;
}

.zb-seg-iv__title a:hover {
  color: #B9F078;
}

.zb-seg-iv__excerpt {
  font-family: var(--zb-font-body);
  font-size: 14px;
  line-height: 1.35;
  color: rgba(254, 250, 238, 0.70);
  flex: 1 1 auto;
}

.zb-seg-iv__cta {
  display: inline-block;
  margin-bottom: 16px;
  font-family: var(--zb-font-body);
  font-size: 14px;
  line-height: 1.2;
  color: #B9F078;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.zb-seg-related__research {
  margin-bottom: 8px;
}

.zb-seg-related__empty {
  margin: 0;
  padding: 20px 18px;
  background: var(--zb-card);
  border: 1px solid var(--zb-border);
  border-radius: 8px;
  font-family: var(--zb-font-body);
  font-size: 16px;
  line-height: 1.3;
  color: #656565;
}

.zb-seg-related__research-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.zb-seg-rs {
  --zb-seg: #01503D;
  display: flex;
  flex-direction: column;
  background: var(--zb-card);
  border: 1px solid var(--zb-border);
  border-radius: 8px;
  overflow: hidden;
}

.zb-seg-rs--veterinary { --zb-seg: #0078D9; }
.zb-seg-rs--grooming   { --zb-seg: #FF7E8D; }
.zb-seg-rs--hotels     { --zb-seg: #FFB500; }
.zb-seg-rs--training   { --zb-seg: #FF9700; }
.zb-seg-rs--food       { --zb-seg: #7A4A05; }
.zb-seg-rs--pet-tech   { --zb-seg: #6544FD; }
.zb-seg-rs--shops      { --zb-seg: #00BABC; }
.zb-seg-rs--toys       { --zb-seg: #041A19; }
.zb-seg-rs--insurance  { --zb-seg: #01503D; }

.zb-seg-rs__media {
  display: block;
  aspect-ratio: 335 / 220;
  background: #FAF4E3;
  overflow: hidden;
}

.zb-seg-rs__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.zb-seg-rs__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  padding: 16px 16px 14px;
}

.zb-seg-rs__title {
  margin: 0;
  font-family: var(--zb-font-display);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.04em;
  color: var(--zb-black);
}

.zb-seg-rs__title a {
  color: inherit;
  text-decoration: none;
}

.zb-seg-rs__title a:hover {
  color: var(--zb-green);
}

.zb-seg-rs__cta {
  margin-top: auto;
  font-family: var(--zb-font-body);
  font-size: 14px;
  line-height: 1.2;
  color: var(--zb-green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.zb-seg-rs__line {
  height: 8px;
  background: linear-gradient(90deg, transparent 0%, var(--zb-seg) 100%);
  opacity: 0.9;
}

/* ============================================================
   Панель «Показать весь материал» + полоса 10px ПОСЛЕ неё
   ============================================================ */

.zb-seg-footer {
  --zb-seg-from: #00A152;
  --zb-seg-to: #B9F078;

  max-width: 1200px;
  margin: 0 auto 36px;
}

.zb-seg-footer[hidden] { display: none; }

.zb-seg-footer--active {
  margin-top: 28px;
}

.zb-seg-bar {
  position: relative;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 10px 16px;
  background: #FFFDF6;
  border: 1px solid #DEDEDE;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

.zb-seg-bar--footer {
  position: static;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .08);
}

.zb-seg-bar__label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.3;
  color: #072322;
}

.zb-seg-bar__reset {
  flex: 0 0 auto;
  background: none;
  border: 1px solid #00A152;
  border-radius: 6px;
  padding: 6px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #00A152;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}

.zb-seg-bar__reset:hover {
  background: #00A152;
  color: #FFFFFF;
}

.zb-seg-bar__reset:focus-visible {
  outline: 2px solid #00A152;
  outline-offset: 2px;
}

/* Полоса сразу под панелью, не внутри неё */
.zb-seg-bar__line {
  display: block;
  width: 100%;
  height: 10px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(
    90deg,
    var(--zb-seg-from) 0%,
    var(--zb-seg-to) 40%,
    var(--zb-seg-from) 70%,
    var(--zb-seg-to) 100%
  );
  background-size: 300% 100%;
  animation: zb-seg-line-flow 18s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .zb-seg-bar__line {
    animation: none;
    background-size: 100% 100%;
  }
}

@keyframes zb-seg-line-flow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============================================================
   Мобильная версия
   ============================================================ */

@media (max-width: 900px) {
  .zb-seg-related__interview-grid,
  .zb-seg-related__research-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .zb-seg-bar {
    padding: 8px 12px;
    gap: 8px;
  }

  .zb-seg-bar__label { font-size: 12px; }

  .zb-seg-bar__reset {
    padding: 5px 10px;
    font-size: 12px;
  }

  .zb-seg-related__interviews {
    padding: 20px 14px;
  }

  .zb-seg-related__interview-grid,
  .zb-seg-related__research-grid {
    grid-template-columns: 1fr;
  }
}
