/*
 * footer.css — AMP global footer (blue banner + content + legal + social).
 * Visual parity with the AEM amp-2024 footer, rebuilt as a single responsive
 * component on AMP brand tokens (see styles/styles.css). Mobile-first: base =
 * stacked; @media >=600px / >=900px progressively widen to the desktop grid.
 */

footer {
  background-color: var(--amp-bg);
  font-size: var(--body-font-size-xs);
}

.amp-footer {
  overflow: hidden;
  padding: var(--space-m);
  color: var(--amp-ink-blue);
  font-family: var(--body-font-family);
  background: var(--amp-ultramarine);
}

.amp-footer *,
.amp-footer *::before,
.amp-footer *::after {
  box-sizing: border-box;
}

.amp-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.amp-footer a {
  text-decoration: none;
  color: inherit;
}

.amp-footer p {
  margin: 0;
}

/* shared mask icon (arrow + social glyphs are tinted via currentcolor) */
.amp-footer-icon,
.amp-footer-social-icon {
  display: inline-block;
  flex: none;
  background-color: currentcolor;
}

.amp-footer-icon-arrow {
  width: var(--spacing-20);
  height: var(--spacing-12);
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 16"><path d="M15.5 0 14 1.5 19.5 7H0v2h19.5L14 14.5 15.5 16 24 8z"/></svg>') center / contain no-repeat;
}

/* =================================================================
   BLUE BANNER (optional — only rendered when headline + CTA authored)
   ================================================================= */

.amp-footer-banner {
  display: flex;
  justify-content: center;
  padding: var(--space-3xl) var(--space-l);
  background: var(--amp-ultramarine) url('./spark-footer-mobile.png') center / cover no-repeat;
}

.amp-footer-banner-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-l);
  max-width: 640px;
  text-align: center;
}

.amp-footer-banner-title {
  font-family: var(--heading-font-family);
  font-weight: var(--font-weight-600);
  font-size: var(--font-size-36);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--amp-bg);
}

.amp-footer-banner-title .amp-footer-emphasis {
  color: var(--amp-cyan);
}

.amp-footer-banner-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-m);
  width: 100%;
}

.amp-footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--spacing-12) var(--spacing-24);
  font-family: var(--heading-font-family);
  font-weight: var(--font-weight-600);
  font-size: var(--body-font-size-s);
  line-height: 1.3;
  letter-spacing: 0.005em;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.amp-footer-btn-primary {
  background: var(--amp-teal);
  border-color: var(--amp-teal-dark);
  color: var(--amp-ink-blue);
}

.amp-footer-btn-primary:hover {
  background: var(--amp-teal-hover);
  color: var(--amp-ink-blue);
}

.amp-footer-btn-secondary {
  background: transparent;
  border-color: rgb(255 255 255 / 60%);
  color: var(--amp-bg);
}

.amp-footer-btn-secondary:hover {
  border-color: var(--amp-bg);
  background: rgb(255 255 255 / 8%);
}

.amp-footer-btn:focus-visible {
  outline: 2px solid var(--amp-bg);
  outline-offset: 2px;
}

/* =================================================================
   MAIN CONTENT (white)
   ================================================================= */

.amp-footer-main {
  background: var(--amp-bg);
  padding: var(--space-l) 0 var(--space-xl);
}

.amp-footer-main-inner {
  --footer-gutter: var(--space-l);

  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--footer-gutter);
}

/* ---- top: brand + nav ---- */

.amp-footer-top {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
}

.amp-footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}

.amp-footer-logo {
  display: inline-flex;
  align-self: flex-start;
}

.amp-footer-logo img {
  width: var(--spacing-112);
  height: auto;
}

.amp-footer-tagline {
  font-family: var(--heading-font-family);
  font-weight: var(--font-weight-600);
  font-size: var(--font-size-28);
  line-height: 1.2;
  color: var(--amp-ink-blue);
  max-width: 12em;
}

.amp-footer-tagline .amp-footer-emphasis {
  color: var(--amp-ultramarine);
}

/* nav: mobile = primary list full width, then the two titled columns 50/50 */
.amp-footer-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-l);
  padding-top: var(--space-l);
  border-top: 1px solid var(--amp-border-light);
}

.amp-footer-nav-col-primary {
  grid-column: 1 / -1;
  padding-bottom: var(--space-l);
  border-bottom: 1px solid var(--amp-border-light);
}

.amp-footer-nav-heading {
  margin-bottom: var(--space-m);
  font-size: var(--font-size-11);
  font-weight: var(--font-weight-600);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--amp-slate);
}

.amp-footer-nav-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  line-height: 1.25;
}

.amp-footer-nav-col-primary .amp-footer-nav-list {
  gap: var(--space-m);
  line-height: 1.45;
}

.amp-footer-nav-link {
  color: var(--amp-ink-blue);
}

.amp-footer-nav-link:hover {
  color: var(--amp-ultramarine);
}

.amp-footer-nav-col-primary .amp-footer-nav-link {
  font-family: var(--heading-font-family);
  font-weight: var(--font-weight-600);
  font-size: var(--body-font-size-s);
}

.amp-footer-nav-col:not(.amp-footer-nav-col-primary) .amp-footer-nav-link {
  font-size: var(--body-font-size-xs);
}

/* ---- legal + social ---- */

.amp-footer-legal {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
  margin: var(--space-xl) calc(-1 * var(--footer-gutter)) 0;
  padding: var(--space-l) var(--footer-gutter);
  border-top: 1px solid var(--amp-border-light);
  border-bottom: 1px solid var(--amp-border-light);
}

.amp-footer-legal-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-m);
}

.amp-footer-legal-link {
  font-size: var(--body-font-size-xs);
  font-weight: var(--font-weight-600);
  color: var(--amp-ink-blue);
}

.amp-footer-legal-link:hover {
  color: var(--amp-ultramarine);
}

.amp-footer-social {
  display: flex;
  align-items: center;
  gap: var(--space-l);
}

.amp-footer-social-link {
  display: inline-flex;
  color: var(--amp-ink-blue);
}

.amp-footer-social-link:hover {
  color: var(--amp-ultramarine);
}

.amp-footer-social-icon {
  width: var(--spacing-24);
  height: var(--spacing-24);
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.amp-footer-social-icon-linkedin { mask-image: url('/icons/social-linkedin.svg'); }
.amp-footer-social-icon-x { mask-image: url('/icons/social-x.svg'); }
.amp-footer-social-icon-facebook { mask-image: url('/icons/social-facebook.svg'); }
.amp-footer-social-icon-youtube { mask-image: url('/icons/social-youtube.svg'); }
.amp-footer-social-icon-tiktok { mask-image: url('/icons/social-tiktok.svg'); }
.amp-footer-social-icon-instagram { mask-image: url('/icons/social-instagram.svg'); }

/* ---- acknowledgement of country ---- */

.amp-footer .amp-footer-ack {
  margin-top: var(--space-xl);
  font-size: var(--body-font-size-xs);
  line-height: 1.45;
  color: var(--amp-slate);
}

/* =================================================================
   TABLET (>= 600px)
   ================================================================= */

@media (width >= 600px) {
  .amp-footer-nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .amp-footer-nav-col-primary {
    grid-column: auto;
    padding-bottom: 0;
    border-bottom: 0;
  }

  .amp-footer-legal {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .amp-footer-legal-list {
    gap: var(--space-l);
  }

  .amp-footer-banner-actions {
    flex-direction: row;
    justify-content: center;
    width: auto;
  }
}

/* =================================================================
   DESKTOP (>= 900px)
   ================================================================= */

@media (width >= 900px) {
  /* permanent ultramarine + spark backdrop; the white .amp-footer-main floats
     as a centered card, blue showing top/bottom and (on wide viewports) sides */
  .amp-footer {
    padding: var(--spacing-56) 0 var(--spacing-48);
    background: var(--amp-ultramarine) url('./spark-footer.svg') center / cover no-repeat;
  }

  .amp-footer-main {
    /* White card: caps at the shared line + 32px each side (content lands on the
       1248 edge), but always leaves at least --space-m of the ultramarine/spark
       backdrop showing on each side — matching the mobile frame — so the card
       never bleeds to the viewport edge below the cap. */
    width: min(calc(var(--content-max-width) + 64px), 100% - 2 * var(--space-m));
    margin: 0 auto;
    padding: var(--space-2xl) 0;
  }

  .amp-footer-main-inner {
    /* gutter = distance from the 1248 content line to the white card edge, so
       the .amp-footer-legal divider bleeds to the card edge (1248 + 32*2). */
    --footer-gutter: var(--space-xl);

    width: min(var(--content-max-width), 100% - 64px);
    max-width: none;
    margin: 0 auto;
    padding: 0;
  }

  .amp-footer-banner {
    padding: var(--spacing-96) var(--space-xl);
    background-image: url('./spark-footer.svg');
  }

  .amp-footer-banner-inner {
    gap: var(--space-2xl);
    max-width: 720px;
  }

  .amp-footer-banner-title {
    font-size: 64px;
  }

  .amp-footer-top {
    flex-direction: row;
    gap: var(--space-3xl);
  }

  .amp-footer-brand {
    flex: 0 0 40%;
    gap: var(--space-l);
    justify-content: space-between;
  }

  .amp-footer-tagline {
    font-size: var(--font-size-36);
  }

  .amp-footer-logo img {
    width: 149px;
  }

  .amp-footer-nav {
    flex: 1;
    padding-top: 0;
    border-top: 0;
  }
}

/* honour reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .amp-footer-btn {
    transition: none;
  }
}
