/* ============================================================
   Averon Insurance — подвал сайта (core/partials/footer.html).

   Макет Figma node 529:2447: Desktop 529:2446 · Tablet 529:2445 · Mobile 529:2444.
     Телефон   ≤ 767px   (макет 320)
     Планшет   768–1023  (макет 768)
     Компьютер ≥ 1024px  (макет 1440, контейнер до 1920)

   Для ссылок в слоте footer_links: класс site-footer__legal-link,
   для кнопки — site-footer__legal-link site-footer__legal-link--button.
   ============================================================ */

/* --- Токены (Desktop) --------------------------------------- */
.site-footer {
  /* палитра */
  --f-bg: var(--c-footer-bg);
  --f-title: var(--c-white);
  --f-text: var(--c-footer-text);
  --f-muted: var(--c-footer-muted);
  --f-line: var(--c-footer-text);
  --f-hover: var(--c-primary);

  /* геометрия */
  --pad-x: 120px;
  --pad-y: 96px;
  --gap-root: 64px;
  --gap-nav: 32px;
  --gap-col: 32px;
  --gap-item: 16px;
  --gap-bottom: 16px;
  --gap-meta: 16px;

  /* типографика */
  --fs-title: 22px;
  --lh-title: 30px;
  --fs-link: 16px;
  --lh-link: 24px;
  --fs-contact: 15px;
  --lh-contact: 22px;
  --fs-notice: 16px;
  --lh-notice: 24px;
  --fs-legal: 14px;
  --lh-legal: 20px;
  --fs-disclaimer: 13px;
  --lh-disclaimer: 18px;

  background-color: var(--f-bg);
  color: var(--f-text);
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (max-width: 1023px) {
  /* Tablet 768 */
  .site-footer {
    --pad-x: 40px;
    --pad-y: 72px;
    --gap-root: 48px;
    --gap-col: 24px;
    --gap-item: 12px;
    --gap-meta: 12px;

    --fs-title: 18px;
    --lh-title: 26px;
    --fs-link: 15px;
    --lh-link: 22px;
    --fs-notice: 15px;
    --lh-notice: 22px;
    --fs-legal: 13px;
    --lh-legal: 18px;
    --fs-disclaimer: 13px;
    --lh-disclaimer: 18px;
  }
}

@media (max-width: 767px) {
  /* Mobile 320 — блок продуктовой навигации в макете отсутствует (см. .site-footer__nav ниже). */
  .site-footer {
    --pad-x: 20px;
    --pad-y: 56px;
    --gap-root: 64px;
    --gap-nav: 64px;
    --gap-col: 16px;
    --gap-meta: 16px;
    --gap-bottom: 32px;

    --fs-notice: 14px;
    --lh-notice: 20px;
    --fs-legal: 12px;
    --lh-legal: 16px;
    --fs-disclaimer: 12px;
    --lh-disclaimer: 16px;
  }
}

/* --- Каркас ------------------------------------------------- */
.site-footer__inner {
  max-width: 1920px;
  margin-inline: auto;
  padding: var(--pad-y) var(--pad-x);
  display: flex;
  flex-direction: column;
  gap: var(--gap-root);
}

/* --- Продуктовая навигация ---------------------------------- */
.site-footer__nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap-nav);
  word-break: break-word;
}

.site-footer__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--gap-col);
}

.site-footer__col-title {
  font-size: var(--fs-title);
  line-height: var(--lh-title);
  font-weight: 500;
  color: var(--f-title);
  text-transform: uppercase;
  width: 100%;
}

a.site-footer__col-title:hover {
  color: var(--f-hover);
}

.site-footer__list {
  display: flex;
  flex-direction: column;
  gap: var(--gap-item);
  width: 100%;
  list-style: none;
}

.site-footer__link {
  display: block;
  font-size: var(--fs-link);
  line-height: var(--lh-link);
  color: var(--f-text);
}

a.site-footer__link:hover {
  color: var(--f-hover);
}

/* Пункты без активного маршрута — выглядят как остальные, но не кликаются. */
.site-footer__link--static {
  cursor: default;
}

/* Группа без единой живой страницы — весь столбец приглушён. */
.site-footer__col--muted .site-footer__col-title,
.site-footer__col--muted .site-footer__link {
  color: var(--c-muted);
}

/* --- Нижний блок -------------------------------------------- */
.site-footer__bottom {
  display: flex;
  flex-direction: column;
  gap: var(--gap-bottom);
}

.site-footer__meta {
  display: flex;
  flex-direction: column;
  gap: var(--gap-meta);
}

/* Соцсети и контакты */
.site-footer__contacts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-meta);
}

.site-footer__socials {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-footer__social {
  display: block;
  width: 24px;
  height: 24px;
  color: var(--f-text);
}

.site-footer__social svg {
  display: block;
  width: 24px;
  height: 24px;
}

.site-footer__social:hover {
  color: var(--f-hover);
}

.site-footer__contact-links {
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}

.site-footer__contact {
  font-size: var(--fs-contact);
  line-height: var(--lh-contact);
  color: var(--f-title);
}

.site-footer__contact:hover {
  color: var(--f-hover);
}

/* Разделитель */
.site-footer__divider {
  height: 1px;
  border-radius: 1px;
  background-color: var(--f-line);
}

/* Адрес и юридические ссылки */
.site-footer__legal {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  font-size: var(--fs-legal);
  line-height: var(--lh-legal);
  word-break: break-word;
}

.site-footer__address {
  max-width: 300px;
  font-size: var(--fs-legal);
  line-height: var(--lh-legal);
  color: var(--f-text);
}

.site-footer__legal-links {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  align-items: center;
  gap: 16px;
  white-space: normal;
}

.site-footer__legal-link {
  font-size: var(--fs-legal);
  line-height: var(--lh-legal);
  color: var(--f-text);
}

.site-footer__legal-link:hover {
  color: var(--f-hover);
}

/* Кнопка в ряду ссылок (например «Cookie Settings» модуля analytics)
   выглядит как соседние ссылки. */
.site-footer__legal-link--button {
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  font-weight: inherit;
  text-align: inherit;
  cursor: pointer;
  transition: color 0.3s ease;
}

.site-footer__legal-link--button:focus-visible {
  outline: 2px solid var(--f-hover);
  outline-offset: 2px;
}

/* --- Уведомление и дисклеймеры ------------------------------ */
.site-footer__notice {
  font-size: var(--fs-notice);
  line-height: var(--lh-notice);
  color: var(--f-text);
}

.site-footer__disclaimer {
  font-size: var(--fs-disclaimer);
  line-height: var(--lh-disclaimer);
  color: var(--f-muted);
}

/* ===== Tablet: 768–1023 ===================================== */
@media (max-width: 1023px) {
  /* Адрес и ссылки встают в колонку и тянутся на всю ширину. */
  .site-footer__legal {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .site-footer__address {
    max-width: none;
  }

  .site-footer__legal-links {
    justify-content: flex-start;
  }
}

/* ===== Mobile: ≤767 ========================================= */
@media (max-width: 767px) {
  /* В мобильном фрейме макета продуктовой навигации нет вовсе — не только
     четырёх колонок, блок HEALTH/LIFE/PROPERTY/SUPPLEMENTAL отсутствует. */
  .site-footer__nav {
    display: none;
  }

  .site-footer__contacts {
    flex-direction: column;
    justify-content: center;
    gap: 16px;
  }

  .site-footer__contact-links {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .site-footer__legal {
    align-items: center;
    gap: 16px;
    text-align: center;
  }

  .site-footer__address {
    max-width: 250px;
  }

  /* Четыре ссылки равной ширины, переносятся внутри своей колонки. */
  .site-footer__legal-links {
    align-items: flex-start;
    justify-content: center;
    max-width: 350px;
    width: 100%;
    white-space: normal;
  }

  .site-footer__legal-link {
    flex: 1 0 0;
    min-width: 0;
  }

  /* Четыре документа остаются в ряд, «Cookie Settings» — строкой ниже. */
  .site-footer__legal-links {
    flex-wrap: wrap;
    row-gap: 12px;
  }

  .site-footer__legal-link.site-footer__legal-link--button {
    flex: 0 0 100%;
    text-align: center;
  }

  .site-footer__notice,
  .site-footer__disclaimer {
    text-align: center;
  }
}
