/**
 * Canonical cross-site Footer recipe.
 *
 * My Website is the accepted Bits & Bolts visual reference. Consumers own
 * footer content and routes; this recipe owns presentation and responsive layout.
 */

@import url("./brand-mark.css");

.bb-footer,
.bb-footer *,
.bb-footer *::before,
.bb-footer *::after {
  box-sizing: border-box;
}

.bb-footer {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--bb-v2-identity-primary-foreground);
  background: var(--bb-v2-identity-primary);
  font-family: var(--bb-font-family-body);
  font-size: 0.9rem;
  line-height: normal;
}

.bb-footer__inner {
  display: flex;
  width: 100%;
  min-height: 0;
  padding: var(--bb-spacing-4) 0;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0;
}

.bb-footer__inner:has(> .bb-footer__links) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  column-gap: clamp(1rem, 3vw, 2.5rem);
}

.bb-footer__brand {
  display: flex;
  align-items: center;
  margin-left: 1rem;
  color: var(--bb-v2-identity-primary-foreground);
  text-decoration: none;
}

.bb-footer__brand img,
.bb-footer__brand-mark {
  width: 40px;
  height: auto;
  padding: 0.5rem 0;
}

.bb-footer__brand img {
  object-fit: contain;
}

.bb-footer__brand-mark--monochrome {
  --bb-brand-mark-image: var(--bb-footer-brand-mark-image);
  height: 40px;
}

.bb-footer__brand[data-bb-brand-layout="wordmark"] :is(img, .bb-footer__brand-mark) {
  width: 11.5rem;
  height: 2.2rem;
  padding: 0;
}

.bb-footer__brand > span {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--bb-v2-identity-primary-foreground);
  font-family: var(--bb-font-family-display);
  font-weight: var(--bb-font-weight-semibold);
  line-height: 1.1;
}

.bb-footer__brand strong {
  font-size: 1rem;
  font-weight: var(--bb-font-weight-semibold);
  letter-spacing: 0;
}

.bb-footer__brand small {
  font-size: 0.7rem;
  font-weight: var(--bb-font-weight-regular);
  letter-spacing: 0;
}

.bb-footer__links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  font-size: 0.85rem;
}

.bb-footer__link {
  color: var(--bb-v2-identity-primary-foreground);
  text-decoration: none;
  white-space: nowrap;
}

.bb-footer__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  margin-right: 1rem;
  color: var(--bb-v2-identity-primary-foreground);
  font-size: 0.85rem;
  line-height: normal;
  text-align: center;
  text-decoration: none;
}

.bb-footer__inner:has(> .bb-footer__brand[data-bb-brand-layout="wordmark"]) :is(.bb-footer__links, .bb-footer__meta) {
  font-weight: var(--bb-font-weight-bold);
}

.bb-footer__inner:has(> .bb-footer__links) .bb-footer__brand {
  justify-self: start;
}

.bb-footer__inner:has(> .bb-footer__links) .bb-footer__links {
  justify-self: end;
}

.bb-footer__inner:has(> .bb-footer__links) .bb-footer__meta {
  justify-self: end;
}

@media (max-width: 1025px) {
  .bb-footer__brand {
    justify-content: center;
  }

  .bb-footer__brand img,
  .bb-footer__brand-mark {
    width: 3.5rem;
    height: 3.5rem;
  }

  .bb-footer__brand strong {
    font-size: clamp(1rem, 2.4vw, 1.2rem);
  }

  .bb-footer__brand small {
    font-size: clamp(0.6rem, 1.8vw, 0.9rem);
  }
}

@media (max-width: 700px) {
  .bb-footer__inner:has(> .bb-footer__links) {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    row-gap: 0.5rem;
  }

  .bb-footer__inner:has(> .bb-footer__links) .bb-footer__brand {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: center;
  }

  .bb-footer__inner:has(> .bb-footer__links) .bb-footer__links {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    flex-wrap: wrap;
    align-self: start;
    justify-content: flex-end;
    margin-right: 1rem;
  }

  .bb-footer__inner:has(> .bb-footer__links) .bb-footer__meta {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
  }

  .bb-footer__inner:has(> .bb-footer__brand[data-bb-brand-layout="wordmark"]) {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-rows: auto;
    column-gap: clamp(0.2rem, 3vw, 1.5rem);
    row-gap: 0;
    align-items: center;
  }

  .bb-footer__brand[data-bb-brand-layout="wordmark"] :is(img, .bb-footer__brand-mark) {
    width: clamp(4.5rem, 26vw, 11.5rem);
    height: clamp(1rem, 5vw, 2.2rem);
  }

  .bb-footer__inner:has(> .bb-footer__brand[data-bb-brand-layout="wordmark"]) .bb-footer__brand {
    grid-column: 1;
    grid-row: 1;
    margin-left: clamp(0.25rem, 1vw, 1rem);
  }

  .bb-footer__inner:has(> .bb-footer__brand[data-bb-brand-layout="wordmark"]) .bb-footer__links {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    flex-wrap: nowrap;
    gap: clamp(0.5rem, 3vw, 1.5rem);
    margin-right: 0;
    font-size: clamp(0.6rem, 1.85vw, 0.85rem);
  }

  .bb-footer__inner:has(> .bb-footer__brand[data-bb-brand-layout="wordmark"]) .bb-footer__meta {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    margin-right: clamp(0.25rem, 1vw, 1rem);
    font-size: clamp(0.6rem, 1.85vw, 0.85rem);
  }

  .bb-footer__inner:has(> .bb-footer__brand[data-bb-brand-layout="wordmark"]) .bb-footer__meta > span {
    white-space: nowrap;
  }

}

@media (max-width: 560px) {
  .bb-footer__inner {
    align-items: flex-start;
  }
}
