/*
 * GFS accessibility corrections that are pure CSS (WCAG 2.2 AA).
 * Loaded by mu-plugins/gfs-accessibility.php.
 */

/*
 * Pager links (Calendar and other FacetWP lists): FacetWP draws each page number
 * as a 13-16px wide, 18px tall link, below the 24x24 CSS px minimum target size
 * (WCAG 2.5.8). Each link gets a 24x24 minimum hit area with its text centred.
 * FacetWP's 6px gap between links is folded into the larger box, so the space
 * between the numbers stays about the same.
 */
.facetwp-type-pager .facetwp-page {
  box-sizing: border-box;
  min-width: 24px;
  min-height: 24px;
  margin-right: 0;
  line-height: 24px;
  text-align: center;
}

/*
 * Cookie banner: while the CookieYes banner is open it is fixed over the bottom of
 * the viewport (the full width on phones). cookie-banner.js publishes its height in
 * --gfs-cookie-banner-reserve. Keyboard focus then scrolls clear of the banner
 * (WCAG 2.4.11), and the page gains the same space at its end, so the last links
 * on the page can also scroll above it. Both are removed once the banner closes.
 */
html.gfs-cookie-banner-open {
  scroll-padding-bottom: calc(var(--gfs-cookie-banner-reserve, 0px) + 8px);
}

/* The site footer is the last block on every template and has no bottom
 * padding of its own, so the space takes the footer's colour. */
html.gfs-cookie-banner-open footer.footer {
  padding-bottom: var(--gfs-cookie-banner-reserve, 0px);
}

html.gfs-cookie-banner-open body:not(:has(footer.footer)) {
  padding-bottom: var(--gfs-cookie-banner-reserve, 0px);
}
