/* ===== СТРАНИЦА СЛОВАРЯ ===== */
.dictionary-page .page-entry-title {
  margin-bottom: 24px;
}

.dictionary-intro {
  margin-bottom: 24px;
  color: #555f77;
  font-size: 16px;
  line-height: 1.65;
}

.dictionary-intro > *:last-child {
  margin-bottom: 0;
}

/* Поиск */
.dictionary-search {
  position: relative;
  margin-bottom: 48px;
}

.dictionary-search__input {
  width: 100%;
  min-height: 56px;
  padding: 16px 24px !important;
  color: #424753 !important;
  font-size: 15px;
  line-height: 1.4;
  background: #ffffff !important;
  border: none !important;
  border-radius: 28px !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dictionary-search__input::placeholder {
  color: #424753;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0.5px;
}

.dictionary-search__input:focus {
  border-color: #9ea8ca;
  box-shadow: 0 0 0 4px rgba(102, 118, 168, 0.14) !important;
}

/* Кнопка поиска (на случай если раскомментируют) */
.dictionary-search__button {
  position: absolute;
  top: 50%;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: #5d6581;
  background: transparent;
  border: 0;
  border-radius: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  opacity: 1;
  visibility: visible;
}

.dictionary-search__button:hover {
  color: #2e3c66;
  background: rgba(93, 101, 129, 0.08);
}

.dictionary-search__input:focus + .dictionary-search__button,
.dictionary-search__input:not(:placeholder-shown) + .dictionary-search__button {
  opacity: 0;
  visibility: hidden;
}

.dictionary-search__input:not(:focus):placeholder-shown + .dictionary-search__button {
  opacity: 1;
  visibility: visible;
}

/* Группы терминов */
.dictionary-groups {
  columns: 4 220px;
  column-gap: 48px;
}

.dictionary-group {
  break-inside: avoid;
  margin: 0 0 28px;
}

.dictionary-group__title {
  margin: 0 0 10px;
  color: #596685;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.dictionary-group__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dictionary-group__item {
  line-height: 24px;
  margin-bottom: 6px;
}

.dictionary-group__item:last-child {
  margin-bottom: 0;
}

.dictionary-group__link {
  color: #424753;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0.5px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.dictionary-group__link:hover {
  color: #c62828;
  border-color: currentColor;
}

.dictionary-empty {
  margin: 12px 0 0;
  color: #5d6581;
  font-size: 15px;
  line-height: 1.5;
}

.dictionary-empty[hidden] {
  display: none !important;
}

.dictionary-helper {
  margin-bottom: 0;
}

/* ===== СТРАНИЦА ТЕРМИНА ===== */
.glossary-term-header__lead {
  margin: 0 0 32px;
  padding: 16px;
  background: #D8E2FF;
  border-radius: 12px;
}

.glossary-term-header__lead p {
  margin: 0;
  color: #31466F;
  font-size: 22px;
  font-weight: 500;
  line-height: 28px;
}

.term-content .c-infobox,
.term-content .c-table-scroll,
.term-content .c-faq__wrapper {
  margin-bottom: 32px;
}

.term-content h3 {
  margin-bottom: 16px;
}

.related-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.related-tags .related-tag {
  padding: 4px 8px;
  color: #415680;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0.1px;
  text-decoration: none;
  background: rgba(79, 55, 139, 0.08);
  border: 1px solid #C2C6D5;
  border-radius: 8px;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 991.98px) {
  .dictionary-groups {
    columns: 2 220px;
    column-gap: 32px;
  }
}

@media (max-width: 767.98px) {
  .dictionary-page .page-entry-title {
    margin-bottom: 16px;
  }

  .dictionary-search {
    margin-bottom: 24px;
  }

  .dictionary-search__input {
    min-height: 52px;
    padding-left: 16px;
    padding-right: 56px;
    font-size: 14px;
  }

  .dictionary-groups {
    columns: 1;
    column-gap: 0;
  }

  .dictionary-group {
    margin-bottom: 24px;
  }

  .glossary-term-header__lead p {
    font-size: 16px;
  }

  .dictionary-search__button {
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  .dictionary-search__input:focus + .dictionary-search__button,
  .dictionary-search__input:not(:placeholder-shown) + .dictionary-search__button {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}
