/* xGrowth mobile footer refinement (2026-11-20, rev 2: checked against the 17 actual family stylesheets).
   Additive override. Link immediately AFTER /navigation-footer-assets/footer-directory.css on every route.
   Every rule sits inside @media (max-width:640px), so desktop and tablet above 640px are unchanged.

   Family base it builds on (claude.css, core.css, editorial.css, services.css share it):
     footer{font-size:13px;padding:34px 0 40px}  (Home: 34px 0 110px, which clears its phone sticky CTA; kept)
     .wrap{max-width:var(--max);padding:0 var(--gut)}  --gut:clamp(16px,4vw,48px)
     footer .wrap{display:flex;justify-content:space-between;flex-wrap:wrap;gap:20px}
     footer nav{display:flex;gap:10px 22px;flex-wrap:wrap}   footer-social.css: footer nav .xg-social{display:contents}
     footer .logo{width:96px}   footer .xg-social a:focus-visible{outline:2px solid #BEFF74}
   The footer element's own padding already frames the component, so this file adds no outer padding of its own.

   Composition at 640px and below:
     1. Site directory (nav.xgfd): Services as one column; Explore and Legal as two-column lists on a
        shared column line, so no half-empty block sits beside a longer one.
     2. One hairline (the directory's existing bottom border).
     3. Legacy footer row (div.wrap) as a short sign-off: any remaining unique footer link and the social
        links on the same two-column line, then the logo and copyright on one row.

   Duplicate handling: in the legacy nav[aria-label="Footer"], only links whose href exactly equals a
   directory href are hidden, and only when the directory precedes the row in the same footer
   (footer > .xgfd ~ .wrap). Each destination therefore stays visible once. Any other href (Home's in-page
   #services) stays visible. On every matching route the directory carries aria-current="page", so
   current-page semantics remain. No markup changes. */

@media (max-width:640px){

  /* ---------- 1. Site directory ---------- */
  footer > .xgfd{padding-top:0;padding-bottom:12px}
  footer > .xgfd .xgfd-grid{grid-template-columns:minmax(0,1fr);gap:24px}
  footer > .xgfd .xgfd-group--services{grid-column:auto}
  footer > .xgfd .xgfd-h{margin-bottom:4px}
  footer > .xgfd .xgfd-list{gap:0}
  footer > .xgfd .xgfd-list a{min-height:44px;font-size:16px;line-height:1.35}

  /* Explore and Legal: two columns sharing one column line (also used by the sign-off row below). */
  footer > .xgfd .xgfd-group:not(.xgfd-group--services) .xgfd-list{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:20px
  }

  /* ---------- 2. Legacy footer row as a compact sign-off ---------- */
  footer > .xgfd ~ .wrap{
    --xgmf-fg:#F0F0ED;
    display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"links links" "logo copy";
    align-items:center;gap:8px 16px;
    padding-top:12px;padding-bottom:0;text-align:left
  }

  /* Remaining legacy links (social links and any unique site link) on the directory's two-column line.
     .xg-social is already display:contents inside footer nav (footer-social.css), so its links join this grid. */
  footer > .xgfd ~ .wrap > nav[aria-label="Footer"]{
    grid-area:links;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0 20px;
    margin:0;padding:0;align-items:center
  }
  footer > .xgfd ~ .wrap > nav[aria-label="Footer"] > .xg-social{display:contents}

  footer > .xgfd ~ .wrap > nav[aria-label="Footer"] > a,
  footer > .xgfd ~ .wrap > nav[aria-label="Footer"] > .xg-social > a{
    display:inline-flex;align-items:center;gap:8px;justify-self:start;
    min-height:44px;margin:0;padding:0;
    color:var(--xgmf-fg);opacity:.82;font-size:16px;line-height:1.35;font-weight:500;text-decoration:none;
    text-underline-offset:5px;text-decoration-thickness:1px
  }
  footer > .xgfd ~ .wrap > nav[aria-label="Footer"] > a:hover,
  footer > .xgfd ~ .wrap > nav[aria-label="Footer"] > .xg-social > a:hover{
    color:var(--xgmf-fg);opacity:1;text-decoration:underline
  }
  /* Same green focus ring the footer's social links already use (footer-social.css), applied to the whole row. */
  footer > .xgfd ~ .wrap > nav[aria-label="Footer"] > a:focus-visible,
  footer > .xgfd ~ .wrap > nav[aria-label="Footer"] > .xg-social > a:focus-visible,
  footer > .xgfd ~ .wrap > .logo:focus-visible{
    opacity:1;outline:2px solid #BEFF74;outline-offset:3px;border-radius:6px
  }

  /* Hide only exact duplicates of directory destinations (each remains visible in the directory). */
  footer > .xgfd ~ .wrap > nav[aria-label="Footer"] > a:is(
    [href="/"],
    [href="/what-we-do/"],
    [href="/what-we-do/monetization/"],
    [href="/what-we-do/user-acquisition/"],
    [href="/what-we-do/app-store-optimization/"],
    [href="/what-we-do/product/"],
    [href="/about/"],
    [href="/blog/"],
    [href="/contact/"],
    [href="/privacy-policy/"],
    [href="/publisher-terms-and-conditions/"]
  ){display:none}

  /* Logo and copyright share one row. Logo artwork, 96px width and URL are unchanged. */
  footer > .xgfd ~ .wrap > .logo{
    grid-area:logo;justify-self:start;display:inline-flex;align-items:center;min-height:44px;margin:0
  }
  footer > .xgfd ~ .wrap > span{
    grid-area:copy;justify-self:end;margin:0;
    color:var(--xgmf-fg);opacity:.62;font-size:15px;line-height:1.35;font-weight:500;white-space:nowrap
  }
}

@media (max-width:640px) and (forced-colors:active){
  footer > .xgfd ~ .wrap > nav[aria-label="Footer"] > a,
  footer > .xgfd ~ .wrap > nav[aria-label="Footer"] > .xg-social > a,
  footer > .xgfd ~ .wrap > span{opacity:1}
}
