/* Site footer, shared by every page.
   Full footer (home, what-we-build): .grid of brand + four link groups.
   Compact footer (legal, case studies): footer.ft.ft-compact, brand + one nav row.
   Phones < 600px · tablets 600–1199px · desktop >= 1200px. */

footer.ft {
  background: #eceef5;
  color: var(--ink-soft);
  padding: 40px 0 24px;
  border-top: 1px solid var(--line);
}

footer.ft a {
  color: var(--ink-soft);
  text-decoration: none;
}

footer.ft a:hover {
  color: var(--blue);
}

footer.ft a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Brand: logo beside the about line, DPIIT badge underneath */
footer.ft .ft-brand {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 18px;
  align-items: start;
}

.ft-logo {
  grid-row: 1 / 3;
  width: 72px;
  height: auto;
  display: block;
}

footer.ft .about {
  font-size: 14.5px;
  line-height: 1.5;
  max-width: 34ch;
  margin: 0;
  color: var(--ink-soft);
}

footer.ft .ft-mail {
  justify-self: start;
  margin-top: 6px;
  padding: 3px 0;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--blue);
}

footer.ft a.ft-dpiit {
  grid-column: 1 / -1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-soft);
  text-align: left;
}

footer.ft a.ft-dpiit:hover {
  border-color: var(--blue);
}

.ft-dpiit img {
  width: 72px;
  height: auto;
  border-radius: 4px;
  display: block;
  flex: none;
}

.ft-dpiit strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

/* Full footer: link groups */
footer.ft .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

footer.ft .grid > .ft-brand {
  grid-column: 1 / -1;
}

footer.ft h3 {
  line-height: 1.5;
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  font-size: 13.5px;
  letter-spacing: 0.005em;
  color: var(--ink);
  font-weight: 600;
  margin: 0 0 8px;
}

html[lang="ja"] footer.ft h3 {
  font-family: "Noto Sans JP", sans-serif;
}

footer.ft .grid > div:not(.ft-brand) > a {
  display: block;
  padding: 3px 0;
  font-size: 14.5px;
  line-height: 1.4;
}

.ft-addr {
  font-style: normal;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 240px;
  text-wrap: pretty;
}

.ft-addr span {
  display: block;
}

footer.ft .grid > div > a.ft-directions {
  display: inline-block;
  margin-top: 4px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--blue);
}

/* The map is a tablet/desktop affordance; phones get the directions link.
   display:none keeps the lazy iframe from loading at all. */
.foot-map {
  display: none;
  margin-top: 12px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  max-width: 240px;
}

.foot-map iframe {
  width: 100%;
  height: 120px;
  border: 0;
  display: block;
}

/* Legal row (full footer .legal, compact footer .cr) */
footer.ft .legal,
footer.ft .cr {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 20px;
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  font-size: 13.5px;
  letter-spacing: 0.005em;
  color: var(--ink-soft);
}

html[lang="ja"] footer.ft .legal,
html[lang="ja"] footer.ft .cr {
  font-family: "Noto Sans JP", sans-serif;
}

footer.ft .legal > span:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
}

footer.ft .legal a {
  display: inline-block;
  padding: 4px 0;
}

/* Compact footer */
footer.ft.ft-compact {
  margin-top: 50px;
}

footer.ft.ft-compact .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px 40px;
}

footer.ft.ft-compact nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
}

footer.ft.ft-compact nav a {
  display: inline-block;
  padding: 4px 0;
  font-size: 14px;
}

footer.ft.ft-compact .cr {
  width: 100%;
  margin-top: 6px;
}

@media (min-width: 600px) {
  footer.ft {
    padding: 56px 0 36px;
  }

  .ft-logo {
    width: 80px;
  }

  .ft-dpiit img {
    width: 88px;
  }

  footer.ft .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 36px 28px;
  }

  /* Brand spans the top as one row: logo · about · badge */
  footer.ft .grid > .ft-brand {
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 24px;
  }

  footer.ft .grid > .ft-brand a.ft-dpiit {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
    margin-top: 0;
  }

  footer.ft h3 {
    margin-bottom: 10px;
  }

  footer.ft .grid > div:not(.ft-brand) > a {
    padding: 4px 0;
  }

  .foot-map {
    display: block;
  }

  footer.ft .grid > div > a.ft-directions {
    display: none;
  }

  footer.ft .legal {
    margin-top: 40px;
    padding-top: 22px;
  }
}

@media (min-width: 1200px) {
  footer.ft {
    padding: 70px 0 46px;
  }

  .ft-logo {
    width: 96px;
  }

  footer.ft .grid {
    grid-template-columns: 1.6fr 1fr 1fr 1fr 1.2fr;
    gap: 40px;
  }

  footer.ft .grid > .ft-brand {
    display: block;
    grid-column: auto;
  }

  footer.ft .grid > .ft-brand .ft-logo {
    margin-bottom: 14px;
  }

  footer.ft .grid > .ft-brand .about {
    margin-bottom: 10px;
  }

  footer.ft .grid > .ft-brand a.ft-dpiit {
    margin-top: 18px;
  }

  footer.ft .ft-mail {
    display: inline-block;
  }

  footer.ft h3 {
    margin-bottom: 14px;
  }

  footer.ft .grid > div:not(.ft-brand) > a {
    padding: 5px 0;
  }
}
