/* ==========================================================================
   KIYIZGROUP — культурный код: библиотека мотивов и статьи.
   Опирается на site/base.css: переменные, .wrap, .section, .h1/.h2/.h3,
   .eyebrow, .btn. Здесь только то, чего в общей теме нет.

   Мотивы рисуются одним <path> из базы в viewBox 1000×1000. Заливка —
   currentColor, поэтому мотив меняет цвет вместе с состоянием карточки
   и не требует второго файла на каждое состояние.
   ========================================================================== */

/*
   Атрибут hidden против классов раскладки.

   `[hidden]` прячет элемент правилом `display: none` из таблицы браузера,
   а у неё специфичность нулевая. Любое наше `display: grid` или
   `display: inline-flex` на классе её перебивает, и скрытый блок остаётся
   на экране — пустым. Поэтому каждый блок, который скрипт показывает
   и прячет, глушится здесь явно.
*/
.ccstats[hidden],
.ccpass[hidden],
.ccbadge[hidden],
.ccher[hidden],
.ccterms[hidden],
.ccrel[hidden],
[data-view][hidden] {
  display: none;
}

/* ---------- первый экран ---------- */
.chero {
  padding: calc(var(--nav-h) + clamp(56px, 9vh, 110px)) 0 clamp(48px, 7vh, 88px);
}
.chero__lead {
  max-width: 62ch;
  margin-top: 20px;
}

.ccstats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin: clamp(36px, 5vh, 64px) 0 0;
  background: var(--line);
  border: 1px solid var(--line);
}
.ccstat {
  background: var(--bg);
  padding: 20px 22px;
}
.ccstat dd {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.ccstat dt {
  order: 2;
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.ccstat {
  display: flex;
  flex-direction: column;
}

/* ---------- фильтр подборок ---------- */
.ccfilters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 clamp(28px, 4vh, 44px);
}
.ccchip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 9px 16px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}
.ccchip:hover {
  border-color: var(--ink);
}
.ccchip[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ink-d);
}
.ccchip__n {
  opacity: 0.5;
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}

/* ---------- сетка мотивов ---------- */
.ccgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.ccgrid--small {
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  margin-top: 16px;
}
.ccmotif {
  appearance: none;
  border: 0;
  background: var(--bg);
  color: var(--ink);
  padding: 16px 10px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font: inherit;
  text-align: center;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.ccmotif:hover {
  background: var(--bg-sand);
}
.ccmotif[aria-pressed='true'] {
  background: var(--ink);
  color: var(--ink-d);
}
.ccmotif svg {
  width: 100%;
  max-width: 78px;
  aspect-ratio: 1;
  fill: currentColor;
}
.ccmotif__ky {
  font-size: 12px;
  line-height: 1.25;
  font-weight: 500;
}
.ccmotif__ru {
  font-size: 11px;
  line-height: 1.25;
  color: var(--ink-mute);
}
.ccmotif[aria-pressed='true'] .ccmotif__ru {
  color: rgba(255, 255, 255, 0.62);
}
.ccempty {
  grid-column: 1 / -1;
  background: var(--bg);
  padding: 44px 20px;
  text-align: center;
  color: var(--ink-mute);
  margin: 0;
}

/* ---------- паспорт мотива ---------- */
.ccpass {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: start;
  margin-top: 1px;
  padding: clamp(24px, 4vw, 40px);
  background: var(--bg);
  border: 1px solid var(--line);
  border-top: 0;
}
.ccpass__close {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 26px;
  line-height: 1;
}
.ccpass__art {
  background: var(--bg-sand);
  padding: clamp(18px, 3vw, 34px);
}
.ccpass__art svg {
  width: 100%;
  aspect-ratio: 1;
  fill: var(--ink);
  display: block;
}
.ccpass__ky {
  margin: 0;
  font-size: clamp(19px, 2.4vw, 25px);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.ccpass__ru {
  margin: 2px 0 0;
  color: var(--ink-mute);
  font-weight: 400;
}
.ccpass__meaning {
  margin: 18px 0 0;
  max-width: 60ch;
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.6;
}
.ccpass__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 14px 24px;
  margin: 24px 0 0;
}
.ccpass__facts div {
  min-width: 0;
}
.ccpass__facts dt {
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.ccpass__facts dd {
  margin: 4px 0 0;
  font-size: 14px;
}
.ccpass__src {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-mute);
}
.ccpass__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 14px;
}
.ccpass__links a {
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 720px) {
  .ccpass {
    grid-template-columns: 1fr;
  }
}

/* ---------- статьи ---------- */
.ccarts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.ccart {
  background: var(--bg);
  padding: clamp(22px, 3vw, 30px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: inherit;
  transition: background 0.15s ease;
}
.ccart:hover {
  background: var(--bg-sand);
}
.ccart__kind {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.ccart__title {
  margin: 0;
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.ccart__native {
  margin: 0;
  font-size: 13px;
  color: var(--ink-mute);
}
.ccart__sum {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* Метка охранного статуса. Единственный факт на странице, который читатель
   проверяет за минуту в чужом реестре, — и потому выделен. */
.ccbadge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  align-self: flex-start;
}
.ccbadge--urgent {
  border-color: rgba(224, 138, 123, 0.5);
  color: #a2503f;
}
/* Охранный статус в статье: метка и официальное название элемента рядом.
   Контейнер — не метка: вложенная в себя таблетка рисует рамку дважды. */
.ccher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 22px 0 0;
}
.ccher__title {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-mute);
}
.ccentry .ccbadge {
  margin: 0;
}

/* ---------- раздел «чего не знаем» ---------- */
.ccgap {
  max-width: 74ch;
}
.ccgap .h2 {
  margin-top: 14px;
}
.ccgap .lead {
  margin-top: 18px;
}
.ccgap__ask {
  color: rgba(255, 255, 255, 0.86) !important;
}
.ccgap .btn {
  margin-top: 26px;
}

/* ---------- отдельная статья ---------- */
.ccentry {
  padding: calc(var(--nav-h) + clamp(40px, 6vh, 72px)) 0 var(--sec);
}
.ccentry .wrap {
  max-width: 76ch;
}
.ccback {
  display: inline-block;
  margin-bottom: 26px;
  font-size: 13px;
  color: var(--ink-mute);
}
.ccentry__kind {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.ccentry__title {
  margin: 10px 0 0;
}
.ccentry__native {
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--ink-mute);
}
.ccentry__summary {
  margin-top: 20px;
}
.ccentry__body h2 {
  margin: clamp(34px, 5vh, 52px) 0 0;
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.ccentry__body p {
  margin: 14px 0 0;
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.68;
  color: var(--ink-soft);
}
.ccterms,
.ccrel {
  margin-top: clamp(40px, 6vh, 64px);
  padding-top: clamp(24px, 4vh, 34px);
  border-top: 1px solid var(--line);
}
.ccterms dl {
  margin: 16px 0 0;
  display: grid;
  gap: 14px;
}
.ccterms dt {
  font-weight: 500;
}
.ccterms dd {
  margin: 3px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.ccterms .ccterm__note {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--ink-mute);
}
.ccentry__src {
  margin: clamp(36px, 5vh, 52px) 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-mute);
}
.ccrel__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 18px;
}
.ccrel__links a {
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
