/* v3 buttons: one hover/focus animation for every button-style link on the site.
   Loaded after screen.css, v3-themes.css, v3-pages.css (and after directory.css on the directory).

   Covered (one shared list, keep the three :is() lists below in sync):
     .dg-btn (.dg-btn--primary, .dg-btn--secondary)  CTAs everywhere: Home, themes, product, docs, support, thanks, 404, footer "Email support"
     .dir-button                                     directory CTAs (Stretch promo, listing "visit" button)
     .dir-categories a                               directory category filter pills
     .dir-pagination a                               directory pagination pills (the current page is a <span>, not animated)
     .dir-tags a                                     category label pills on directory cards and listings
     .site-header__support                           header Support pill
     .site-footer__social a                          footer social circles
     .footer-social a                                social circles on support/contact pages
     .footer-google                                  footer "Make us preferred on Google" pill
     .docs-download                                  docs download pill (its ::before is the arrow, so its layer is ::after)
     .archive-topics a                               topic pills
   Not buttons (keep normal link styles): inline text links, "Live demo", breadcrumbs, .dg-text-link.

   Effect: an orange layer (--color-accent) rises from the bottom with a rounded top that flattens
   as it fills the button. Text and icons turn #111 on every variant. The current/active pill
   ([aria-current="page"]) stays filled #111 and does not animate. */

:is(.dg-btn, .dir-button, .dir-categories a, .dir-pagination a, .dir-tags a, .site-header__support, .site-footer__social a, .footer-social a, .footer-google, .docs-download, .archive-topics a) {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  text-decoration: none;
  transition: color .2s ease, background-color .2s ease, border-color .65s cubic-bezier(.45, .05, .2, 1);
}

/* The fill: a circle that grows from the bottom centre of the button until it covers all of it. It is a clip-path
   circle, so the edge stays round the whole way (a translated layer flattens as it rises). 115% of the reference
   box is enough to reach the farthest corner of any button, wide pill or round icon. */
:is(.dg-btn, .dir-button, .dir-categories a, .dir-pagination a, .dir-tags a, .site-header__support, .site-footer__social a, .footer-social a, .footer-google, .archive-topics a)::before,
.docs-download::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--color-accent);
  clip-path: circle(0% at 50% 100%);
  transition: clip-path .65s cubic-bezier(.45, .05, .2, 1);
  pointer-events: none;
}

:is(.dg-btn, .dir-button, .dir-categories a, .dir-pagination a, .dir-tags a, .site-header__support, .site-footer__social a, .footer-social a, .footer-google, .docs-download, .archive-topics a):not([aria-current="page"]):is(:hover, :focus-visible) {
  color: var(--color-text-primary);
  /* The border takes the fill colour, so no dark outline is left around the orange. */
  border-color: var(--color-accent);
  text-decoration: none;
}

:is(.dg-btn, .dir-button, .dir-categories a, .dir-pagination a, .dir-tags a, .site-header__support, .site-footer__social a, .footer-social a, .footer-google, .archive-topics a):not([aria-current="page"]):is(:hover, :focus-visible)::before,
.docs-download:is(:hover, :focus-visible)::after {
  clip-path: circle(115% at 50% 100%);
}

/* Pressed: the orange darkens slightly. */
:is(.dg-btn, .dir-button, .dir-categories a, .dir-pagination a, .dir-tags a, .site-header__support, .site-footer__social a, .footer-social a, .footer-google, .archive-topics a):not([aria-current="page"]):active::before,
.docs-download:active::after {
  filter: brightness(.9);
}

/* YouTube play triangle is a cutout in the background colour, so it follows the orange. */
.footer-social a:is(:hover, :focus-visible) .footer-social__cutout { fill: var(--color-accent); stroke: var(--color-accent); }

/* Current page: filled #111, no animation (directory category pills, header Support pill). */
:is(.dir-categories a, .site-header__support)[aria-current="page"] { color: #fff; background: #111; border-color: #111; }
:is(.dir-categories a, .site-header__support)[aria-current="page"]::before { content: none; }

@media (prefers-reduced-motion: reduce) {
  :is(.dg-btn, .dir-button, .dir-categories a, .dir-pagination a, .dir-tags a, .site-header__support, .site-footer__social a, .footer-social a, .footer-google, .docs-download, .archive-topics a),
  :is(.dg-btn, .dir-button, .dir-categories a, .dir-pagination a, .dir-tags a, .site-header__support, .site-footer__social a, .footer-social a, .footer-google, .archive-topics a)::before,
  .docs-download::after { transition: none; }
}
