/**
 * SSRN Footer Component
 * Full footer with logo, link sections, legal links, social icons
 * Uses "Footer link" sub-component with icon + arrow
 * Desktop, tablet, and mobile responsive variants
 * Based on Figma design system
 */

/* ============================================
   FOOTER BASE
   ============================================ */
.footer {
  display: flex;
  flex-direction: column;
  padding: var(--space-1600) 120px;
  background-color: #3D3D3D;
  width: 100%;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  gap: var(--space-600);
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

/* ============================================
   LOGO AND HELP ROW
   ============================================ */
.footer__top {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  align-self: stretch;
  padding-bottom: var(--space-600);
  border-bottom: var(--border-s) solid #929494;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 40px;
}

.footer__logo img {
  height: 40px;
  width: auto;
  filter: brightness(0) invert(1);
}

/* Help Button */
.footer__help-btn {
  display: flex;
  align-items: center;
  gap: var(--space-300);
  padding: var(--space-100) var(--space-200);
  background: none;
  border: none;
  border-radius: var(--radius-xs);
  font-family: var(--font-family-body);
  font-size: var(--body-md-size);
  font-weight: var(--font-weight-semibold);
  line-height: var(--body-md-line-height);
  color: var(--white);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease;
  white-space: nowrap;
}

.footer__help-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.footer__help-btn:focus-visible {
  outline: 2px solid var(--sea-green-50);
  outline-offset: 2px;
}

.footer__help-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.footer__help-icon img {
  width: 100%;
  height: 100%;
}

/* ============================================
   LINK SECTIONS
   ============================================ */
.footer__links-wrapper {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  padding-right: 320px;
  padding-bottom: var(--space-600);
  border-bottom: var(--border-s) solid #929494;
}

.footer__link-sections {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: stretch;
  align-items: flex-start;
  align-self: stretch;
  gap: 72px;
}

/* Individual link section (Company, Explore, Top Cities) */
.footer__link-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-400);
  flex: 1;
  min-width: 140px;
}

.footer__link-heading {
  font-family: var(--font-family-heading);
  font-size: var(--body-md-size);
  font-weight: var(--font-weight-bold);
  line-height: 1.25em;
  color: var(--white);
  margin: 0;
}

.footer__link-list {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  gap: var(--space-200);
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer__link-list li {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ============================================
   FOOTER LINK - SUB-COMPONENT
   Based on Figma "Footer link" component
   States: Default, Hover, Focus, Disabled
   ============================================ */
.footer-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  align-self: stretch;
  gap: var(--space-200);
  padding: 2px;
  border-radius: var(--radius-xs);
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.footer-link__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-link__icon img {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
  transition: filter 0.15s ease;
}

.footer-link__text {
  flex: 1;
  font-family: var(--font-family-body);
  font-size: var(--body-md-size);
  font-weight: var(--font-weight-regular);
  line-height: var(--body-md-line-height);
  color: var(--white);
  transition: font-weight 0.15s ease;
}

.footer-link__arrow {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-link__arrow img {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
  transition: filter 0.15s ease;
}

/* Hide icons/arrows in footer link lists (plain text style) */
.footer__link-list .footer-link__icon,
.footer__link-list .footer-link__arrow {
  display: none;
}

/* Hover State */
.footer-link:hover .footer-link__text {
  font-weight: var(--font-weight-semibold);
}

.footer-link:hover .footer-link__icon img,
.footer-link:hover .footer-link__arrow img {
  filter: brightness(0) invert(1);
}

/* Focus State */
.footer-link:focus-visible {
  outline: var(--border-s) solid var(--white);
  outline-offset: -1px;
  border-radius: var(--radius-xs);
}

/* Disabled State */
.footer-link--disabled {
  pointer-events: none;
  opacity: 0.5;
}

.footer-link--disabled .footer-link__text {
  color: var(--grey-40);
}

.footer-link--disabled .footer-link__icon img,
.footer-link--disabled .footer-link__arrow img {
  filter: brightness(0) invert(0.6);
}

/* ============================================
   BOTTOM ROW - LEGAL LINKS + SOCIALS
   ============================================ */
.footer__bottom {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  align-self: stretch;
  gap: 72px;
}

.footer__legal-links {
  display: flex;
  flex-direction: row;
  gap: var(--space-800);
  flex: 1;
}

.footer__legal-links .footer-link {
  flex: 0 0 auto;
  align-self: auto;
}

/* Legal links don't show icons/arrows */
.footer__legal-links .footer-link__icon,
.footer__legal-links .footer-link__arrow {
  display: none;
}

.footer__socials {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-800);
}

.footer__social-link {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  padding: 2px;
  color: var(--white);
  text-decoration: none;
  transition: all 0.15s ease;
}

.footer__social-link:hover {
  opacity: 0.8;
  transform: translateY(-2px);
}

.footer__social-link:focus-visible {
  outline: 2px solid var(--sea-green-50);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.footer__social-link img {
  width: 28px;
  height: 28px;
}

/* ============================================
   RESPONSIVE - TABLET (769px - 1024px)
   ============================================ */
@media (max-width: 1024px) {
  .footer {
    padding: var(--space-1600) 60px;
  }

  .footer__links-wrapper {
    padding-right: 0;
  }

  .footer__link-sections {
    gap: 48px;
  }

  /* Stack the bottom links and socials */
  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-600);
  }

  .footer__legal-links {
    gap: var(--space-600);
    flex-wrap: wrap;
  }

  .footer__socials {
    gap: var(--space-600);
  }
}

/* ============================================
   RESPONSIVE - MOBILE (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
  .footer {
    padding: var(--space-600) var(--space-400);
  }

  .footer__top {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-400);
    padding-bottom: var(--space-400);
  }

  .footer__logo {
    height: 32px;
  }

  .footer__logo img {
    height: 32px;
  }

  .footer__links-wrapper {
    padding-right: 0;
    padding-bottom: var(--space-400);
  }

  .footer__link-sections {
    flex-direction: column;
    gap: var(--space-800);
  }

  .footer__link-group {
    min-width: 100%;
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--space-800);
    align-items: flex-start;
  }

  .footer__legal-links {
    flex-direction: column;
    gap: var(--space-200);
  }

  .footer__socials {
    gap: var(--space-800);
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.footer a:focus-visible,
.footer button:focus-visible {
  outline: 2px solid var(--sea-green-50);
  outline-offset: 2px;
}

/* Screen reader only text */
.footer .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}