/* Hand-written fixes on top of the generated site.css (which mirrors WordPress). Keep this small. */

/* Post titles became <h1> (were <h2> on WP): keep the h2 visual size from the theme. */
.wp-block-post-title:is(h1) { font-size: var(--wp--preset--font-size--xx-large); line-height: 1.25; }

/* Gravity Forms markup is submitted to HubSpot by /assets/js/hubspot-forms.js */
.gform_submitting [type=submit] { opacity: .6; cursor: progress; }
.gform_submission_error { color: #c02b0a; font-size: 1rem; margin: 0 0 1rem; }

/* Heading-level fixes (one <h1> per page) that must not change the original look */
h1.is-h2-style { font-size: var(--wp--preset--font-size--xx-large); line-height: 1.25; }
h2.is-h1-style { font-size: clamp(1.875rem, 2.679vw + 1.205rem, 2.813rem); line-height: 1.1; }

/* ------------------------------------------------------------------
   Scroll reveal (core pages). Classes are added by /assets/js/reveal.js,
   so without JS (or with reduced motion) nothing is ever hidden.
   Uses the individual `translate`/`scale` properties so existing
   theme transforms are left untouched.
   ------------------------------------------------------------------ */
html.reveal-ready .reveal { opacity: 0; translate: 0 28px; }
html.reveal-ready .reveal--media { scale: 0.97; }
html.reveal-ready .reveal.is-visible {
  opacity: 1; translate: none; scale: none;
  transition: opacity 0.9s cubic-bezier(0.22, 0.61, 0.36, 1), translate 0.9s cubic-bezier(0.22, 0.61, 0.36, 1), scale 1.1s cubic-bezier(0.22, 0.61, 0.36, 1),
    /* keep the hover transitions of revealed cards/buttons (this shorthand would otherwise drop them) */
    transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.45s cubic-bezier(0.22, 0.61, 0.36, 1),
    background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
/* Rocket launch: hero rocket travels up along its ~11deg tilt (dx = 0.2 * dy), CTA rocket straight up.
   Long ease-out so it decelerates like a launch; clipped by its cover so it rises out of the clouds. */
html.reveal-ready .reveal.reveal--launch-hero { translate: -44px 220px; scale: none; }
html.reveal-ready .reveal.reveal--launch { translate: 0 160px; scale: none; }
html.reveal-ready .reveal.reveal--launch-hero.is-visible,
html.reveal-ready .reveal.reveal--launch.is-visible {
  translate: none;
  transition: opacity 1.1s ease-out, translate 1.9s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-reduced-motion: reduce) {
  html.reveal-ready .reveal { opacity: 1 !important; translate: none !important; scale: none !important; }
}

/* ------------------------------------------------------------------
   Hover motion: buttons and cards. Builds on the theme's own hovers
   (buttons lift 3px and swap colour, link cards lift 5px); adds smooth
   easing, depth and a sheen. Movement only on real hover devices and
   never with reduced motion; colour changes stay as on WordPress.
   ------------------------------------------------------------------ */
:root {
  --hover-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --hover-shadow-btn: 0 14px 28px -12px rgba(21, 73, 121, 0.55);
  --hover-shadow-card: 0 22px 48px -18px rgba(21, 73, 121, 0.35), 0 6px 16px -8px rgba(0, 0, 0, 0.12);
}

/* Buttons (content buttons only: the header keeps its own) */
.wp-site-blocks > :not(header) .wp-block-button__link,
.wp-site-blocks .gform_button,
main.l365 .btn {
  transition: background-color 0.3s ease, color 0.3s ease, outline-color 0.3s ease, border-color 0.3s ease,
    opacity 0.3s ease, transform 0.35s var(--hover-ease), box-shadow 0.35s var(--hover-ease);
}
.wp-site-blocks > :not(header) .wp-block-button__link,
main.l365 .btn { position: relative; overflow: hidden; isolation: isolate; }
/* light sweep across the button on hover */
.wp-site-blocks > :not(header) .wp-block-button__link::after,
main.l365 .btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  translate: -120% 0; transition: translate 0.7s var(--hover-ease);
}
.wp-site-blocks > :not(header) .wp-block-button__link:focus-visible,
.wp-site-blocks .gform_button:focus-visible,
main.l365 .btn:focus-visible {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--wp--preset--color--bright-blue, #2f80ed);
}

/* Cards */
.wp-block-query li.wp-block-post,
.wp-block-query li.wp-block-post .is-style-column-box-shadow,
.wp-block-acf-link-block .link-block__container,
.wp-block-acf-case-study-link-block .case-study-link-block__container,
main .is-style-box-shadow,
main.l365 .card {
  transition: transform 0.45s var(--hover-ease), box-shadow 0.45s var(--hover-ease),
    background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.wp-block-acf-link-block .link-block__link { transition: transform 0.45s var(--hover-ease); }
.wp-block-acf-case-study-link-block .case-study-link-block__link { transition: none; }
.wp-block-query .wp-block-post-featured-image img,
.wp-block-acf-link-block .link-block__image-container svg { transition: transform 0.7s var(--hover-ease); }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .wp-site-blocks > :not(header) .wp-block-button__link:hover,
  .wp-site-blocks .gform_button:hover,
  main.l365 .btn:hover { transform: translateY(-3px); box-shadow: var(--hover-shadow-btn); }
  .wp-site-blocks > :not(header) .wp-block-button__link:hover::after,
  main.l365 .btn:hover::after { translate: 120% 0; }
  .wp-site-blocks > :not(header) .wp-block-button__link:active,
  .wp-site-blocks .gform_button:active,
  main.l365 .btn:active { transform: translateY(-1px) scale(0.98); transition-duration: 0.1s; }

  /* blog / archive cards: lift (theme), deeper shadow, slow image zoom */
  .wp-block-query li.wp-block-post:hover { transform: translateY(-6px); }
  .wp-block-query li.wp-block-post:hover .is-style-column-box-shadow { box-shadow: var(--hover-shadow-card) !important; }
  .wp-block-query li.wp-block-post:hover .wp-block-post-featured-image img { transform: scale(1.05); }

  /* service link cards: lift (theme), deeper shadow, icon nudge */
  .wp-block-acf-link-block .link-block__link:hover .link-block__container { box-shadow: var(--hover-shadow-card); }
  .wp-block-acf-link-block .link-block__link:hover .link-block__image-container svg { transform: translateY(-3px) scale(1.06); }

  /* case-study cards: lift + colour flip (theme), deeper shadow */
  .wp-block-acf-case-study-link-block .case-study-link-block__link:hover .case-study-link-block__container { box-shadow: var(--hover-shadow-card); }

  /* content boxes and Local365 cards */
  main .is-style-box-shadow:hover { transform: translateY(-4px); box-shadow: var(--hover-shadow-card); }
  main.l365 .card:hover { transform: translateY(-4px); box-shadow: var(--hover-shadow-card); }
}
