/* css/footer.css
   Подвал сайта
   Вынесено из style.css без изменения содержимого правил. */

.site-footer {
  background: #13152b;
  padding: 30px 20px;
  margin-top: 50px;
  border-top: 1px solid #2a2f5a;
}
.footer-content {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 28px 36px;
  align-items: start;
}
#footerBlocks {
  display: contents;
}
.footer-section {
  min-width: 0;
}
.footer-section h3 {
  color: #f5c542;
  margin-bottom: 10px;
}
.footer-section p,
.footer-section a,
.footer-richtext {
  color: #ccc;
  font-size: 0.9em;
  line-height: 1.6;
}
/* .footer-links > a обязателен отдельно: ссылки блоков подвала лежат не прямыми
   детьми секции, а внутри контейнера .footer-links (footerSettings.js), и без
   этого селектора остаются строчными — тексты ссылок склеиваются в один абзац
   («ОфертаПользовательское соглашение...»). */
.footer-section > a,
.footer-links > a,
#footerSocials > a {
  display: block;
  text-decoration: none;
  margin-bottom: 5px;
}
.footer-section a { color: #ccc; }
.footer-section a:hover { color: #f5c542; }
.footer-richtext {
  overflow-wrap: anywhere;
}
.footer-richtext p,
.footer-richtext ul,
.footer-richtext ol {
  margin: 0 0 7px;
}
.footer-richtext p:last-child,
.footer-richtext ul:last-child,
.footer-richtext ol:last-child {
  margin-bottom: 0;
}
.footer-richtext ul,
.footer-richtext ol {
  padding-left: 20px;
}
.footer-richtext a {
  display: inline;
  color: #f5c542;
  text-decoration: none;
}
.footer-richtext a:hover { text-decoration: underline; }
/* Настройка «Сворачивать разделы подвала» (админка → Подвал):
   секция становится <details>, её заголовок — <summary>. */
.footer-collapse > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  color: #f5c542;
  font-weight: 700;
  padding: 4px 0;
}
.footer-collapse > summary::-webkit-details-marker { display: none; }
.footer-collapse > summary::after {
  content: '⌄';
  margin-left: auto;
  line-height: 1;
  transform: translateY(-3px);
  transition: transform 0.15s ease;
}
.footer-collapse[open] > summary::after {
  transform: translateY(2px) rotate(180deg);
}
.footer-collapse > summary:hover { color: #ffd76a; }
.footer-collapse > summary:focus-visible {
  outline: 2px solid #f5c542;
  outline-offset: 2px;
  border-radius: 4px;
}
.footer-collapse > *:not(summary) { padding-top: 8px; }
/* Явное скрытие, а не только штатное поведение <details>: любой авторский
   display на содержимом (например flex у .footer-links на узком экране)
   вытаскивает его из скрытого слота, и закрытая секция остаётся раскрытой. */
.footer-collapse:not([open]) > *:not(summary) { display: none; }

.footer-bottom {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #2a2f5a;
  color: #aaa;
  font-size: 0.85em;
}
/* Кнопка, выглядящая ссылкой: «Настройки cookie» открывает баннер согласия, а
   не ведёт по адресу, поэтому это <button> (см. index.html). Padding держит
   кликабельную область не ниже 24px по WCAG 2.5.8 — сам текст мельче. */
.footer-link-btn {
  appearance: none;
  background: none;
  border: none;
  padding: 6px 8px;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.15s ease;
}
.footer-link-btn:hover { color: #f5c542; }
.footer-link-btn:focus-visible {
  outline: 2px solid #f5c542;
  outline-offset: 2px;
  border-radius: 4px;
}
@media (max-width: 560px) {
  /* Подвал на узком экране: одна колонка растягивала его на целый экран.
     Ужимаем отступы и раскладываем списки ссылок в строку с переносом. */
  .site-footer { padding: 18px 16px; margin-top: 28px; }
  .footer-content { grid-template-columns: 1fr; gap: 16px; }
  .footer-section h3,
  .footer-collapse > summary {
    font-size: var(--rd-text-sm, 0.95rem);
    margin-bottom: 6px;
  }
  .footer-section p,
  .footer-section a,
  .footer-richtext {
    font-size: var(--rd-text-xs, 0.75rem);
    line-height: 1.45;
  }
  /* Соцсети и блоки ссылок (Документы и т.п.) — inline-строкой */
  #footerSocials,
  .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
  }
  .footer-section > a,
  .footer-links > a,
  #footerSocials > a {
    display: inline-block;
    margin-bottom: 0;
  }
  .footer-bottom {
    margin-top: 14px;
    padding-top: 12px;
    font-size: var(--rd-text-xs, 0.75rem);
  }
  .footer-bottom p { margin: 0 0 4px; }
  .footer-bottom p:last-child { margin-bottom: 0; }
}
