/*
  Mobile-only fixes for the static export.
  Existing stylesheets are not modified.

  The desktop nav is replaced by the hamburger below 64rem (lg).
  Phone layout fixes are further limited to the widths where each
  section is actually in its mobile arrangement, all of which sit
  below that hamburger breakpoint. Nothing here applies at 1024px
  or wider, so the desktop layout is unchanged.
*/

/* Header: swap the logo and the menu cluster whenever the hamburger is showing.
   Smooth scrolling on the document is what lets Safari stop a "back to top"
   halfway down the page, so phones scroll instantly. */
@media (max-width: 63.999rem) {
  html {
    scroll-behavior: auto;
  }

  header.fixed > .container-x {
    flex-direction: row-reverse;
  }
}

@media (max-width: 767px) {
  /* Hero deliverable row: even 2-column grid, icon + label at the start. */
  ul.enter.flex-wrap.justify-center {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    justify-items: start;
    align-items: start;
    column-gap: 1rem;
    row-gap: 0.85rem;
    letter-spacing: 0.01em;
  }

  ul.enter.flex-wrap.justify-center > li {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 0.45rem;
    text-align: start;
  }

  ul.enter.flex-wrap.justify-center > li svg {
    margin-top: 0.12em;
  }

  /* Process steps: the 2-column grid (below md) leaves the 5th step alone.
     Center it on its own row at the same column width. */
  section[aria-labelledby="steps-title"] > ol > li:last-child {
    grid-column: 1 / -1;
    justify-self: center;
    width: 50%;
  }

  /* Audience / sector cards that stack as tall image-on-top cards. */
  section[aria-labelledby="clients-title"] ul.grid,
  section[aria-labelledby="other-clients"] ul.grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  section[aria-labelledby="clients-title"] ul.grid {
    margin-top: 1.5rem;
  }

  section[aria-labelledby="clients-title"] ul.grid > li > a.group,
  section[aria-labelledby="other-clients"] ul.grid > li > a.group {
    display: flex;
    flex-direction: row;
    align-items: stretch;
  }

  section[aria-labelledby="clients-title"] ul.grid > li > a.group > div[class*="aspect-"],
  section[aria-labelledby="other-clients"] ul.grid > li > a.group > div[class*="aspect-"] {
    flex: 0 0 132px;
    width: 132px;
    height: auto;
    min-height: 148px;
    aspect-ratio: auto;
  }

  section[aria-labelledby="clients-title"] ul.grid > li > a.group > div.flex {
    padding: 0.7rem 0.8rem;
    gap: 0.45rem;
  }

  section[aria-labelledby="clients-title"] ul.grid h3 {
    font-size: 1.05rem;
    line-height: 1.25;
  }

  section[aria-labelledby="clients-title"] ul.grid h3 + p {
    margin-top: 0.3rem;
    font-size: 0.82rem;
    line-height: 1.4;
  }

  section[aria-labelledby="other-clients"] ul.grid > li > a.group > p {
    display: flex;
    flex: 1;
    align-items: center;
    margin: 0;
    padding: 0.7rem 0.85rem;
  }

  /* Blog index cards use the same tall image-over-text stack on phones. */
  ul.mt-10.grid.gap-6 > li > a.group {
    flex-direction: row;
    align-items: stretch;
  }

  ul.mt-10.grid.gap-6 > li > a.group > div[class*="aspect-"] {
    flex: 0 0 124px;
    width: 124px;
    height: auto;
    min-height: 124px;
    aspect-ratio: auto;
  }

  ul.mt-10.grid.gap-6 > li > a.group > div.p-6 {
    padding: 0.7rem 0.8rem;
  }

  ul.mt-10.grid.gap-6 > li > a.group h3,
  ul.mt-10.grid.gap-6 > li > a.group .text-xl {
    font-size: 1rem;
    line-height: 1.3;
  }

  /* Services index category images are full-width 16/11 blocks on phones. */
  main section.grid > div.reveal > div[class*="aspect-[16/11]"] {
    height: 156px;
    aspect-ratio: auto;
  }

  /* Deliverables fan: pull the side cards in so they stay inside the viewport. */
  section[aria-labelledby="sheets-title"] .relative.mx-auto.h-\[21rem\] {
    height: 18.5rem;
    max-width: 100%;
  }

  section[aria-labelledby="sheets-title"] figure.w-\[12\.5rem\] {
    width: min(9.6rem, 44%);
  }

  section[aria-labelledby="sheets-title"] figure.-translate-x-\[58\%\] {
    --tw-translate-x: -54%;
    rotate: -5deg;
  }

  section[aria-labelledby="sheets-title"] figure.translate-x-\[58\%\] {
    --tw-translate-x: 54%;
    rotate: 5deg;
  }

  /* The English FAQ call-to-action is nowrap and wider than a phone. */
  #faq .btn {
    max-width: 100%;
    height: auto;
    min-height: 3.25rem;
    white-space: normal;
    padding-block: 0.75rem;
    text-align: center;
  }
}

/* Social row. Visible on desktop and mobile; only the new links are styled. */
.social-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.75rem;
  padding: 0;
  list-style: none;
}

.social-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid color-mix(in srgb, currentColor 32%, transparent);
  border-radius: 999px;
  color: inherit;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.social-row a:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
}

.social-row svg {
  width: 20px;
  height: 20px;
  display: block;
}
