/* ===========================================================================
   FF Footer section styles (shortened footer without form)
   =========================================================================== */

.ff-footer {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 1920px;
  margin-inline: auto;
  background: var(--bg-dark-primary);
  border: 1px solid var(--border-main-quarteary);
  padding: clamp(80px, 6.25vw, 120px) clamp(60px, 5.2vw, 100px);
  border-radius: 32px 32px 0 0;
  color: var(--text-constant-light);
  overflow: hidden;
  box-shadow: var(--shadow-main);
}

/* --- Background image ------------------------------------------ */

.ff-footer__bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.ff-footer__bg-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  pointer-events: none;
}

/* --- Main content wrapper ------------------------------------ */

.ff-footer__wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.ff-footer__content {
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 3.5vw, 48px);
  width: 100%;
}

/* --- Contacts (email & phone) --------------------------------- */

.ff-footer__contacts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  width: 100%;
  align-items: flex-start;
}


.ff-footer__contact-link {
  display: inline-block;
  font-size: clamp(32px, 5.208vw, 82px);
  font-weight: var(--weight-500);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text-constant-light);
  text-decoration: underline;
  text-decoration-skip-ink: none;
  /* Линия должна идти ПОД выносными элементами (@, скобки), а не сквозь них. */
  text-underline-offset: 0.17em;
  text-decoration-thickness: 7px;
  transition: opacity 0.2s ease;
  width: fit-content;
}

.ff-footer__contact-link:hover {
  opacity: 0.8;
}

/* --- Links section: socials and nav ------------------------- */

.ff-footer__links-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  width: 100%;
  align-items: flex-start;
}

/* --- Social icons & Nav links --------------------------------- */

.ff-footer__socials {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-self: start;
}

.ff-footer__social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: white;
  color: var(--text-constant-dark);
  transition: transform 0.2s ease, opacity 0.2s ease;
  flex-shrink: 0;
}

.ff-footer__social-icon:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.ff-footer__social-icon-img {
  width: 17.23px;
  height: 17.23px;
  display: block;
  object-fit: contain;
}

.ff-footer__nav {
  display: flex;
  gap: 32px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  justify-self: start;
}

.ff-footer__nav-link {
  font-size: var(--scale-03);
  font-weight: var(--weight-500);
  line-height: 1.2;
  color: var(--text-constant-light);
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.ff-footer__nav-link:hover {
  opacity: 0.8;
}

/* --- Legal section --------------------------------------------- */

.ff-footer__legal {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  width: 100%;
  flex-wrap: wrap;
}

.ff-footer__legal-text {
  font-size: var(--scale-01);
  font-weight: var(--weight-400);
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--text-constant-light);
  white-space: nowrap;
}

.ff-footer__legal-link {
  font-size: var(--scale-01);
  font-weight: var(--weight-400);
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--text-constant-light);
  text-decoration: underline;
  text-decoration-skip-ink: none;
  text-underline-offset: 0.17em;
  text-decoration-thickness: 1px;
  transition: opacity 0.2s ease;
}

.ff-footer__legal-link:hover {
  opacity: 0.8;
}

/* ===========================================================================
   Responsive: 1440px
   =========================================================================== */

@media (max-width: 1440px) {
  .ff-footer__contact-link {
    font-size: clamp(28px, 4.5vw, 82px);
  }
}

/* ===========================================================================
   Responsive: 1024px
   =========================================================================== */



/* ===========================================================================
   Responsive: 768px
   =========================================================================== */



/* ===========================================================================
   Responsive: 480px
   =========================================================================== */



/* ============================================================================
   Планшет (≤1024) — узел 534:4835 (768x356): контакты 40, меню 2x3,
   юридическая строка 14.
   ============================================================================ */

@media (max-width: 1199px) {
  /* Меню футера в макете прижато к правому краю (x326 при 688) */
  .ff-footer__links-section {
    justify-content: space-between;
  }

  /* Подчёркивание контактов: десктопные 7px на 40px кегле слишком жирные */
  .ff-footer__contact-link {
    text-decoration-thickness: 3px;
  }

  .ff-footer {
    padding: 39px; /* 39 + 1px рамки = 40 макетных */
    border-radius: 32px 32px 0 0;
  }

  .ff-footer__content { gap: 48px; }

  .ff-footer__contact-link {
    font-size: 40px;
    line-height: 1.2;
  }

  .ff-footer__links-section {
    display: flex;
    align-items: flex-start; /* соцсети и меню в макете начинаются на одном y */
    justify-content: space-between;
    gap: 48px;
  }

  .ff-footer__nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
    width: 362px;
    max-width: 100%;
    flex-shrink: 0;
  }

  .ff-footer__nav-link { font-size: 14px; }

  .ff-footer__legal { gap: 24px; }

  .ff-footer__legal-text,
  .ff-footer__legal-link { font-size: 14px; }

  .ff-footer__bg-img {
    width: 1920px;
    height: auto;
    max-width: none;
    position: absolute;
    left: -976px;
    top: 0;
  }
}

/* Мобильная версия (max-width: 767px, 375px вьюпорт) */
@media (max-width: 767px) {
  /* Мобильный кроп текстуры подставляет <picture>; сбрасываем планшетный сдвиг */
  .ff-footer__bg-img {
    width: 100%;
    height: auto;
    max-width: 100%;
    position: absolute;
    left: 0;
    top: 2px;
  }

  .ff-footer {
    padding: 40px 24px;
    border-radius: 0;
  }

  .ff-footer__content {
    gap: 48px;
    width: 100%;
    display: flex;
    flex-direction: column;
  }

  .ff-footer__contacts {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    align-items: flex-start;
    min-height: 92px;
  }

  .ff-footer__contact-link {
    font-size: 32px;
    line-height: 1.2;
    width: fit-content;
    margin: 0;
    text-align: left;
    justify-self: start;
    text-decoration-thickness: 2px;
  }

  .ff-footer__links-section {
    display: flex;
    flex-direction: column;
    gap: 48px;
    width: 100%;
    align-items: flex-start;
    min-height: 207px;
  }

  .ff-footer__socials {
    gap: 10px;
    min-height: 44px;
  }

  .ff-footer__nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
    width: 328px;
    max-width: 100%;
    min-height: 115px;
  }

  .ff-footer__nav-link {
    font-size: 14px;
    line-height: 1.2;
    margin: 0;
  }

  .ff-footer__legal {
    gap: 12px;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    min-height: 90px;
  }

  .ff-footer__legal-text,
  .ff-footer__legal-link {
    font-size: 12px;
    line-height: 1.2;
    margin: 0;
  }

}

/* Внутреннее поле полноширинной секции не меньше бокового поля страницы */
@media (min-width: 1200px) and (max-width: 1919px) {
  .ff-footer {
    padding-inline: max(var(--page-gutter), 40px);
  }
}
