/* ==========================================================================
   zigmund.online — блок футера «Все направления и психологи», версия 2.0
   --------------------------------------------------------------------------
   Структура как у каталога футера SkillFactory (одна свёрнутая строка →
   разделы → подкатегории → ссылки), цвета и шрифт — футера Zigmund.
   Без JS: раскрытие — нативные <details>, «открыт один» — атрибут name.
   Все селекторы начинаются с .zg-footer-catalog, на остальной футер не влияют.
   ========================================================================== */

.zg-footer-catalog {
  /* токены: значения сняты с живого футера 14.10.2026 — при внедрении
     заменить на переменные дизайн-системы, если они есть */
  --zgc-card: #ffffff;
  --zgc-soft: #fbfaf8;
  --zgc-line: #e4dfda;
  --zgc-text: #242424;
  --zgc-title: #000000;
  --zgc-muted: #949a9e;
  --zgc-accent: #ff5a11;     /* --primary-4 */
  --zgc-accent-2: #ea8159;   /* --primary-3-rebranding */
  --zgc-accent-soft: #fff0e9;
  --zgc-radius: 12px;

  margin-top: 32px;
  color: var(--zgc-text);
  font: inherit;
}

.zg-footer-catalog *,
.zg-footer-catalog *::before,
.zg-footer-catalog *::after { box-sizing: border-box; }

.zg-footer-catalog details,
.zg-footer-catalog summary { margin: 0; }

.zg-footer-catalog summary {
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.zg-footer-catalog summary::-webkit-details-marker { display: none; }
.zg-footer-catalog summary::marker { content: ""; }

.zg-footer-catalog summary:focus-visible {
  outline: 2px solid rgba(255, 90, 17, 0.45);
  outline-offset: -2px;
}

/* «+» / «−» справа у каждого уровня */
.zg-footer-catalog__toggle::before {
  content: "+";
  display: block;
  width: 24px;
  text-align: center;
  font-size: 24px;
  line-height: 1;
  font-weight: 400;
  color: var(--zgc-title);
}
.zg-footer-catalog details[open] > summary > .zg-footer-catalog__toggle::before { content: "\2212"; }

/* --- уровень 0: одна строка «Все направления и психологи» --- */
.zg-footer-catalog__root {
  border-top: 1px solid var(--zgc-line);
  border-bottom: 1px solid var(--zgc-line);
}
.zg-footer-catalog__root-summary {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  grid-template-areas:
    "icon title toggle"
    "icon sub   toggle";
  column-gap: 16px;
  row-gap: 4px;
  align-items: center;
  min-height: 64px;
  padding: 12px 0;
}
.zg-footer-catalog__icon {
  grid-area: icon;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background:
    linear-gradient(#fff, #fff) center / 10px 2px no-repeat,
    linear-gradient(#fff, #fff) center / 2px 10px no-repeat,
    var(--zgc-accent);
}
.zg-footer-catalog__heading {
  grid-area: title;
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--zgc-title);
}
.zg-footer-catalog__sub {
  grid-area: sub;
  font-size: 12px;
  line-height: 1.3;
  color: var(--zgc-muted);
}
.zg-footer-catalog__root-summary > .zg-footer-catalog__toggle { grid-area: toggle; }

/* --- уровень 1: разделы --- */
.zg-footer-catalog__sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 16px 0 24px;
}
.zg-footer-catalog__section {
  border: 1px solid var(--zgc-line);
  border-left: 4px solid var(--zgc-accent);
  border-radius: var(--zgc-radius);
  background: var(--zgc-card);
  overflow: hidden;
}
.zg-footer-catalog__section-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 14px 16px;
}
.zg-footer-catalog__section-summary:hover,
.zg-footer-catalog__cluster-summary:hover { background: var(--zgc-soft); }
.zg-footer-catalog__section-name {
  display: block;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--zgc-title);
}
.zg-footer-catalog__section-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--zgc-muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* --- уровень 2: подкатегории --- */
.zg-footer-catalog__clusters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
  padding: 12px;
  border-top: 1px solid var(--zgc-line);
}
.zg-footer-catalog__cluster {
  border: 1px solid var(--zgc-line);
  border-top: 3px solid var(--zgc-accent-2);
  border-radius: 10px;
  background: var(--zgc-soft);
  overflow: hidden;
}
.zg-footer-catalog__cluster[open] {
  grid-column: 1 / -1;            /* открытая подкатегория — на всю ширину */
  background: var(--zgc-card);
}
.zg-footer-catalog__cluster-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 14px;
}
.zg-footer-catalog__cluster-name {
  font-size: 14px;
  line-height: 1.25;
  font-weight: 600;
  color: var(--zgc-title);
}

/* --- уровень 3: ссылки --- */
.zg-footer-catalog__links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0 16px;
  padding: 0 14px 12px;
}
.zg-footer-catalog__links--city {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.zg-footer-catalog__link {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--zgc-line);
  color: var(--zgc-text);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.25;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.zg-footer-catalog__link::before {
  content: "";
  flex: 0 0 4px;
  width: 4px;
  height: 4px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--zgc-accent);
}
.zg-footer-catalog__link:hover,
.zg-footer-catalog__link:focus-visible {
  color: var(--zgc-accent);
  background: var(--zgc-accent-soft);
  outline: none;
}

/* --- адаптив --- */
@media (max-width: 959px) {
  .zg-footer-catalog__clusters { grid-template-columns: 1fr; }
}
@media (max-width: 639px) {
  .zg-footer-catalog__root-summary { column-gap: 12px; min-height: 58px; }
  .zg-footer-catalog__heading { font-size: 16px; }
  .zg-footer-catalog__sections { gap: 10px; padding-top: 12px; }
  .zg-footer-catalog__section-summary { min-height: 58px; padding: 12px; }
  .zg-footer-catalog__section-name { font-size: 15px; }
  .zg-footer-catalog__clusters { gap: 10px; padding: 10px; }
  .zg-footer-catalog__cluster-summary { padding: 11px 12px; }
  .zg-footer-catalog__links,
  .zg-footer-catalog__links--city { grid-template-columns: 1fr; padding: 0 12px 10px; }
  .zg-footer-catalog__link { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .zg-footer-catalog__link { transition: none; }
}
