footer {
  background-color: var(--text-color);
  color: var(--dark-section-color);
  font-size: var(--body-font-size-xs);
}

footer .footer > div {
  margin: auto;
  max-width: var(--content-max-width);
  padding: 40px 24px 24px;
}

footer .footer p {
  margin: 0;
}

/* white links throughout the dark footer */
footer .footer a:any-link {
  color: var(--dark-section-color);
  font-weight: 400;
}

footer .footer a:hover {
  text-decoration: underline;
}

/* logo — its own centered row above the columns */
footer .footer .footer-grid > .footer-logo-row {
  padding: 0;
}

footer .footer .footer-logo-row p {
  margin: 0;
  text-align: center;
}

footer .footer .footer-logo-row picture img {
  width: var(--footer-logo-width);
  height: auto;
}

/* racing-stripe divider between the logo and the columns */
footer .footer .footer-grid > .footer-stripe {
  height: var(--footer-stripe-height);
  width: 100%;
  margin-top: 32px;
  padding: 0;
  background: linear-gradient(90deg, var(--brand-accent) 0, var(--brand-primary) 51.04%, var(--link-color) 100%);
}

/* mobile + tablet: everything stacks in one centered column (desktop overrides below) */
footer .footer .footer-brand,
footer .footer .footer-column {
  padding-top: 20px;
  text-align: center;
}

/* brand + social column — the list shrinks to fit its widest label (e.g. "INSTAGRAM")
   and is centered as one block, so every row's icon lines up in a column instead of
   each icon+label pair being centered independently (which shifts short labels like "X") */
footer .footer .footer-brand ul {
  display: flex;
  flex-direction: column;
  width: fit-content;
  gap: 12px;
  margin: 16px auto 0;
  padding: 0;
  list-style: none;
}

footer .footer .footer-brand li a {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: var(--body-font-size-s);
  text-transform: uppercase;
}

/* link columns — headings and lists */
footer .footer .footer-column ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

footer .footer .footer-column li {
  line-height: 26px;
}

footer .footer .footer-column a img {
  height: 14px;
  width: auto;
  vertical-align: middle;
}

/* AdChoices — label and icon sit on the same line, not stacked */
footer .footer .footer-column li:has(picture) {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

footer .footer .footer-column li:has(picture) p {
  margin: 0;
}

footer .footer .footer-column .default-content-wrapper > p:first-child {
  font-size: var(--body-font-size-s);
  line-height: 26px;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 0;
  margin-bottom: 12px;
}

/* mobile tab bar wrapper — the bar itself is fixed, so its section takes no layout space */
footer .footer .footer-tab-bar-section {
  margin: 0;
  padding: 0;
  max-width: none;
}

/* legal block — mobile: narrower centered column with extra top space */
footer .footer .footer-legal {
  color: var(--dark-section-color);
  text-align: center;
  width: 70%;
  margin-left: auto;
  margin-right: auto;
  margin-top: 100px;
  padding-bottom: 42px;
}

/* leave room so the fixed mobile tab bar doesn't cover the legal text */
footer .footer:has(.footer-tab-bar) .footer-legal {
  margin-bottom: var(--footer-tab-bar-height);
}

footer .footer .footer-legal :where(p) {
  margin-bottom: 8px;
}

/* tablet: still one centered column (mobile tab bar chrome stays visible through tablet) */
@media (width >= 768px) {
  footer .footer .footer-legal {
    width: auto;
    margin-top: 0;
    padding-bottom: 0;
  }
}

/* desktop: logo row full width, social + 5 link columns in one left-aligned row */
@media (width >= 1024px) {
  footer .footer .footer-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0 24px;
    max-width: var(--content-max-width);
    margin: auto;
  }

  footer .footer .footer-grid > div {
    padding: 32px;
    max-width: none;
  }

  footer .footer .footer-logo-row,
  footer .footer .footer-stripe,
  footer .footer .footer-legal {
    grid-column: 1 / -1;
  }

  footer .footer .footer-brand,
  footer .footer .footer-column {
    text-align: left;
  }

  footer .footer .footer-brand ul {
    width: auto;
    margin: 16px 0 0;
  }

  footer .footer .footer-column li:has(picture) {
    justify-content: flex-start;
  }

  footer .footer .footer-tab-bar-section {
    display: none;
  }

  footer .footer:has(.footer-tab-bar) .footer-legal {
    margin-bottom: 0;
  }
}
