/* footer — two-tier IES footer. Lifted from base.css */
footer { background: #fff; }
footer .footer { background: #fff; }
footer .footer .container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-2xl); }

.footer .ies-footer { color: var(--text); font-size: 14px; background: var(--light-gray); }
.footer .ftr-main { padding: 56px 0 0; }
.footer .footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-xl); }
.footer .footer-cols h2 { font-size: 16px; font-weight: var(--font-weight-bold); color: var(--text); margin: 0 0 18px; }
.footer .footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer .footer-cols li { margin-bottom: var(--space-s); }
.footer .footer-cols a { color: var(--text-muted); font-size: 16px; line-height: var(--line-height-l); }
.footer .footer-cols a:hover { color: var(--primary); text-decoration: underline; }

/* accordion toggle — on desktop it just renders as the plain column heading;
   the caret and the interactivity only surface at the mobile breakpoint */
.footer .footer-col .col-toggle { display: inline-flex; align-items: center; gap: var(--space-2xs); padding: 0; margin: 0; background: none; border: 0; font: inherit; font-size: 16px; font-weight: var(--font-weight-bold); color: var(--text); text-align: left; cursor: default; }
.footer .footer-col .caret { display: none; }

/* shared chevron for the country selector (all breakpoints) and the mobile
   accordion toggles */
.footer .caret { display: inline-block; width: 8px; height: 8px; border-right: 2px solid currentcolor; border-bottom: 2px solid currentcolor; transform: rotate(45deg); margin-top: -3px; transition: transform 0.15s ease; }

.footer .footer-col.open .caret,
.footer .country.open .caret { transform: rotate(-135deg); margin-top: 2px; }

.footer .footer-search { margin-top: var(--space-2xl); }
.footer .footer-search input { width: 300px; max-width: 100%; height: 40px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 14px; font-size: 14px; font-family: inherit; color: var(--text); }

/* grid mirrors the legal tier's 1fr 2fr 1fr so the country chip lands in the
   same center column as the brand logos below it */
.footer .footer-sitemap { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: var(--space-2xl); align-items: center; padding: 22px 0; margin-top: 34px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.footer .footer-sitemap a { color: var(--text-muted); }
.footer .footer-sitemap .social { display: flex; align-items: center; gap: var(--space-m); justify-self: end; }
.footer .footer-sitemap .social a { color: var(--text-muted); display: inline-flex; }
.footer .footer-sitemap .social a:hover { color: var(--primary); }
.footer .footer-sitemap .social svg { width: 24px; height: 24px; }

/* country selector — a desktop chip inside the sitemap row, plus a mobile
   accordion-style row rendered under the columns (hidden here, shown < 900px) */
.footer .country-mobile { display: none; }
.footer .footer-sitemap .country { position: relative; }
.footer .country-toggle { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 14px; font-size: 14px; color: var(--text); background: #fff; font-family: inherit; cursor: pointer; }
.footer .country-toggle .caret { color: var(--text-muted); }
.footer .country-menu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 20; min-width: 220px; margin: 0; padding: var(--space-2xs) 0; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 20px rgb(0 0 0 / 12%); }
.footer .country-menu[hidden] { display: none; }
.footer .country-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 18px; font-size: 14px; color: var(--text); white-space: nowrap; }
.footer .country-menu a:hover { background: #f5f6f7; }
.footer .country-menu .flag { font-size: 16px; line-height: var(--line-height-none); }

.footer .ftr-legal { padding: var(--space-2xl) 0 var(--space-3xl); }
.footer .legal-grid { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: var(--space-2xl); align-items: start; }
.footer .legal-left ul { list-style: none; margin: 0; padding: 0; }
.footer .legal-left li { margin-bottom: 0; }
.footer .legal-left a { display: block; color: var(--text-muted); line-height: 1.8; }

/* logo sizing matches erp.intuit.com's real gwp-footer assets (Intuit
   164x37, TurboTax 90x19, Credit Karma 115x19, QuickBooks 107x20); Mailchimp
   is the current icon+wordmark pair from the nav strip, sized to the same
   ~20px row height since its own footer asset predates a brand refresh */
.footer .ftr-logo { display: block; margin-bottom: 22px; }
.footer .ftr-logo svg { height: 37px; width: auto; display: block; }
.footer .legal-center .brand-logos { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-bottom: var(--space-m); }
.footer .ftr-brand { display: inline-flex; align-items: center; }
.footer .ftr-brand svg { height: 19px; width: auto; }
.footer .ftr-brand-mailchimp svg:first-child { height: 20px; width: auto; margin-right: 4.5px; }
.footer .ftr-brand-mailchimp svg:last-child { height: 12.5px; width: auto; }
.footer .footer-copy { color: var(--text); font-size: 14px; line-height: 1.43; margin: 0 0 14px; max-width: none; }

/* underlined, not just color, so links inline in this small/low-contrast body
   copy stay distinguishable for low-vision/color-blind readers (WCAG 1.4.1) */
.footer .footer-copy a { color: inherit; text-decoration: underline; }
.footer .footer-copy-btn { background: none; border: none; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

/* CCPA "Your Privacy Choices" opt-out icon (California geo label) — scaled to the text */
.footer .footer-copy-btn .privacy-choices-icon { height: 0.85em; width: auto; vertical-align: middle; margin-left: 6px; }
.footer .legal-right .legal-links { font-size: 14px; color: var(--text-muted); margin-bottom: var(--space-m); white-space: nowrap; }
.footer .legal-right .legal-links a { color: var(--text-muted); }
.footer .legal-right .legal-links .legal-sep { margin: 0 var(--space-3xs); }
.footer .truste { display: inline-block; line-height: 0; }
.footer .truste img { width: 142px; height: 45px; }

/* ── mobile (< 1024px): mirror erp.intuit.com — link columns collapse into
   accordions, the country selector and search stack beneath them, sitemap +
   social share a row, and the legal tier regroups (logos on one line, About
   links beside the copyright). Uniform light-gray background throughout. ── */
@media (width < 1024px) {
  footer .footer .container { padding: 0 var(--space-m); }

  /* stack the top tier so DOM order (cols → country → search → sitemap) shows */
  .footer .ftr-main { border-top: 0; padding: var(--space-3xs) 0 0; }
  .footer .ftr-main .container { display: flex; flex-direction: column; }

  /* link columns → accordions */
  .footer .footer-cols { display: block; grid-template-columns: none; gap: 0; border-top: 1px solid var(--line); }
  .footer .footer-col { border-bottom: 1px solid var(--line); }
  .footer .footer-col h2 { margin: 0; }
  .footer .footer-col .col-toggle { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 60px; cursor: pointer; }
  .footer .footer-col .caret { display: inline-block; color: var(--text-muted); }

  /* collapsed rows stay on the ambient gray band; the revealed list switches
     to white, matching source's FooterMenuSection_menuList treatment. Each
     link is its own 60px row (same rhythm as the .col-toggle header above it) */
  .footer .footer-col ul { display: none; background: #fff; margin: 0 -20px; padding: 0; }
  .footer .footer-col.open ul { display: block; }
  .footer .footer-col li { display: flex; align-items: center; min-height: 60px; margin-bottom: 0; padding: 0 34px; }
  .footer .footer-col li a { font-size: 16px; }

  /* country selector row (mobile copy) */
  .footer .country-desktop { display: none; }
  .footer .country-mobile { display: block; border-bottom: 1px solid var(--line); position: relative; }
  .footer .country-mobile .country-toggle { display: flex; align-items: center; gap: var(--space-2xs); width: 100%; min-height: 60px; padding: 0; border: 0; border-radius: 0; background: none; font-size: 16px; font-weight: var(--font-weight-bold); color: var(--text); }
  .footer .country-mobile .country-toggle .caret { margin-left: auto; }
  .footer .country-mobile .country-menu { position: static; min-width: 0; margin: 0; padding: 0 0 14px; border: 0; border-radius: 0; box-shadow: none; }
  .footer .country-mobile .country-menu a { padding: 11px 0 11px 26px; }

  /* search */
  .footer .footer-search { margin: 0; padding: 22px 0; }
  .footer .footer-search input { width: 100%; max-width: 320px; }

  /* sitemap + social on one line */
  .footer .footer-sitemap { display: flex; margin: 0; padding: var(--space-m) 0; justify-content: space-between; gap: var(--space-s); border-bottom: 1px solid var(--line); }
  .footer .footer-sitemap .social { margin-left: 0; }

  /* legal tier: flatten the three columns and regroup via grid areas */
  .footer .ftr-legal { padding: var(--space-xl) 0 var(--space-2xl); }
  .footer .legal-left, .footer .legal-center, .footer .legal-right { display: contents; }

  .footer .legal-grid {
    grid-template-columns: max-content 1fr;
    grid-template-areas:
      "logo brand"
      "nav  copy"
      "nav  truste"
      "nav  links";
    gap: 24px 28px;
  }
  .footer .legal-grid .ftr-logo { grid-area: logo; margin: 0; align-self: center; }
  .footer .legal-grid .brand-logos { grid-area: brand; margin: 0; align-self: center; }
  .footer .legal-grid .legal-nav { grid-area: nav; margin: 0; padding: 0; align-self: start; }
  .footer .legal-grid .legal-copy { grid-area: copy; }
  .footer .legal-grid .truste { grid-area: truste; align-self: start; }
  .footer .legal-grid .legal-links { grid-area: links; margin: 0; }
}

@media (width < 768px) {
  .footer .legal-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "logo"
      "brand"
      "nav"
      "copy"
      "truste"
      "links";
    row-gap: var(--space-m);
  }
}

/* footer "Search this site" — submits to /blog/search on Enter (issue #60) */
.footer .footer-search input:focus { outline: 0; border-color: var(--primary); }
