/* GBAF interaction layer. Geometry, copy and brand tokens come from the theme. */
:root {
  --gbaf-fx-ease: cubic-bezier(.2, 0, 0, 1);
}

.site-header.gbaf-fx-scrolled {
  background-color: var(--gbaf-white);
  box-shadow: 0 8px 24px rgba(24, 32, 39, .12);
}

.site-header :is(a, button):focus-visible,
.site-main :is(a, button, input, textarea, select):focus-visible,
.site-footer :is(a, button):focus-visible,
.contact-hub :is(a, button):focus-visible,
.gbaf-back-top:focus-visible,
.skip-link:focus-visible {
  outline: 2px solid var(--gbaf-red-dark);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--gbaf-white);
}

.site-main .home-hero :is(a, button):focus-visible,
.site-main .page-hero :is(a, button):focus-visible,
.site-main .cta-band :is(a, button):focus-visible {
  outline-color: var(--gbaf-white);
  box-shadow: 0 0 0 3px var(--gbaf-red-dark);
}

.site-main :is(.facebook-card, .post-card) > a:focus-visible {
  outline-offset: -4px;
  box-shadow: inset 0 0 0 4px var(--gbaf-white);
}

.gbaf-form :is(input:not([type="hidden"]), textarea, select):is(:focus, :user-invalid) {
  border-color: var(--gbaf-red-dark);
}

.contact-hub .contact-hub__toggle,
.contact-hub .contact-hub__toggle::after {
  animation: none;
}

.contact-hub__toggle::after {
  border-color: var(--gbaf-gold);
  opacity: 0;
  pointer-events: none;
}

.contact-hub__toggle[aria-expanded="true"]::after {
  opacity: 1;
}

.gbaf-back-top:not([hidden], :focus-visible) {
  box-shadow: 0 8px 24px rgba(24, 32, 39, .14);
}

@media (max-width: 760px) {
  .contact-hub {
    bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px));
  }

  body.nav-open .contact-hub {
    visibility: hidden;
  }

  body:has(.gbaf-form :is(input, textarea, select):focus) :is(.contact-hub, .gbaf-back-top) {
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .site-header {
    transition: background-color 150ms var(--gbaf-fx-ease), box-shadow 150ms var(--gbaf-fx-ease);
  }

  :is(.site-main .button, .gbaf-hero-contact, .gbaf-carousel-pause, .contact-hub__toggle, .gbaf-back-top) {
    transition: scale 150ms var(--gbaf-fx-ease), background-color 150ms var(--gbaf-fx-ease);
  }

  :is(.site-main .button, .gbaf-hero-contact, .gbaf-carousel-pause, .contact-hub__toggle, .gbaf-back-top):active {
    transform: none;
    scale: .98;
    transition-duration: 100ms;
  }

  .site-main .gbaf-fx-reveal {
    animation: gbaf-fx-reveal 240ms var(--gbaf-fx-ease);
  }

  .site-main .gbaf-fx-reveal:focus-within {
    animation: none;
  }

  @keyframes gbaf-fx-reveal {
    from { translate: 0 6px; }
    to { translate: 0 0; }
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .site-main :is(.feature-card, .facebook-card, .post-card, .contact-channel-card) {
    transition: translate 150ms var(--gbaf-fx-ease), box-shadow 150ms var(--gbaf-fx-ease);
  }

  .site-main :is(.feature-card, .facebook-card, .post-card, .contact-channel-card):hover {
    translate: 0 -2px;
    box-shadow: 0 12px 30px rgba(24, 32, 39, .14);
  }

  .site-main .contact-channel-card:hover {
    transform: none;
  }

  .site-main :is(.facebook-card__media, .post-card__media) img {
    transition: transform 220ms var(--gbaf-fx-ease);
  }

  .site-main :is(.facebook-card:not(.facebook-card--poster), .post-card:not(.post-card--poster)) a:hover
    :is(.facebook-card__media, .post-card__media) img {
    transform: scale(1.035);
  }
}

/* Keep the text and logos on existing posters in frame. */
.site-main .facebook-card--poster a:is(:hover, :focus-visible) .facebook-card__media img {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html, *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .site-main :is(.button, .contact-channel-card, .gbaf-hero-contact, .gbaf-carousel-pause):active,
  .gbaf-back-top:active,
  .site-main .contact-channel-card:hover,
  .facebook-card a:is(:hover, :focus-visible) .facebook-card__media img {
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  :is(.site-main .button, .gbaf-hero-contact).gbaf-fx-glint {
    position: relative;
  }

  :is(.site-main .button, .gbaf-hero-contact).gbaf-fx-glint::after {
    content: "";
    position: absolute;
    inset: 2px;
    border: 1px solid var(--gbaf-gold);
    border-radius: inherit;
    pointer-events: none;
    animation: gbaf-fx-glint 360ms var(--gbaf-fx-ease) both;
  }

  [data-gbaf-fx="full"] .home-hero__dot.is-active::after {
    animation: gbaf-fx-hero-dot 240ms var(--gbaf-fx-ease);
  }

  .site-header.gbaf-fx-page-entry::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gbaf-gold), transparent);
    pointer-events: none;
    animation: gbaf-fx-page-accent 280ms var(--gbaf-fx-ease) both;
  }

  .stat-row .gbaf-fx-stat {
    animation: gbaf-fx-stat 400ms var(--gbaf-fx-ease);
  }

  .gbaf-fx-loading {
    position: relative;
    background-color: var(--gbaf-line);
  }

  .gbaf-fx-loading::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(105deg, transparent 25%, var(--gbaf-white) 50%, transparent 75%);
    animation: gbaf-fx-shimmer 820ms var(--gbaf-fx-ease) both;
  }

  @keyframes gbaf-fx-glint {
    from { opacity: .85; scale: .96; }
    to { opacity: 0; scale: 1; }
  }

  @keyframes gbaf-fx-hero-dot {
    from { scale: .8; }
    to { scale: 1; }
  }

  @keyframes gbaf-fx-page-accent {
    0%, 100% { opacity: 0; }
    45% { opacity: .78; }
  }

  @keyframes gbaf-fx-stat {
    0% { translate: 0 7px; }
    72% { translate: 0 -1px; }
    100% { translate: 0; }
  }

  @keyframes gbaf-fx-shimmer {
    from { translate: -100% 0; opacity: .55; }
    to { translate: 100% 0; opacity: 0; }
  }
}
