/* Every selector stays within a service block, including Gutenberg previews. */
.wv-service-block {
    --wv-service-primary: #1677f8;
    --wv-service-white: #fff;
    --wv-service-h1-size: clamp(3rem, 4.2vw, 4rem);
    --wv-service-h2-size: clamp(2.35rem, 3.2vw, 3rem);
    --wv-service-h3-size: clamp(1.5rem, 2.2vw, 2rem);
    --wv-service-h4-size: clamp(1.125rem, 1.4vw, 1.25rem);
    --wv-service-body-size: 1.125rem;
    --wv-service-h1-line-height: 1.1;
    --wv-service-h2-line-height: 1.2;
    --wv-service-h3-line-height: 1.25;
    --wv-service-h4-line-height: 1.3;
    --wv-service-body-line-height: 1.5;
}

.wv-service-block .wv-service-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Match the theme's primary button dimensions without its legacy classes. */
.wv-service-block .wv-service-button {
    display: inline-block;
    padding: 14px 25px;
    border: 1px solid var(--wv-service-primary);
    border-radius: 8px;
    background: var(--wv-service-primary);
    color: var(--wv-service-white);
    font-size: 14px;
    line-height: 18px;
    font-weight: 500;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.wv-service-block .wv-service-button--secondary,
.wv-service-block .wv-service-button:hover {
    background: transparent;
    color: var(--wv-service-primary);
}

.wv-service-block .wv-service-button--secondary:hover {
    background: var(--wv-service-primary);
    color: var(--wv-service-white);
}

.wv-service-block .wv-service-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    .wv-service-block .wv-service-button {
        transition: none;
    }
}

/* Keep every semantic heading in the display face, including rich text and
   existing card rules. Size controls and paragraph treatments stay independent. */
.wv-service-block :is(h1, h2, h3, h4, h5, h6) {
    font-family: "DM Serif Display", serif !important;
}

/* Rich-text headings use the scale; explicit Size controls take precedence. */
.wv-service-block h2 {
    font-size: var(--wv-service-h2-size);
    line-height: var(--wv-service-h2-line-height);
}
.wv-service-block h3 {
    font-size: var(--wv-service-h3-size);
    line-height: var(--wv-service-h3-line-height);
}
.wv-service-block :is(h4, h5, h6) {
    font-size: var(--wv-service-h4-size);
    line-height: var(--wv-service-h4-line-height);
}
.wv-service-block p {
    font-size: var(--wv-service-body-size);
    line-height: var(--wv-service-body-line-height);
}

/* Visual size is independent of the renderer's H2/H3/H4 semantic tag. */
.wv-service-block .wv-service-heading.wv-service-heading--large {
    font-size: var(--wv-service-h2-size);
    line-height: var(--wv-service-h2-line-height);
}
.wv-service-block .wv-service-heading.wv-service-heading--medium {
    font-size: var(--wv-service-h3-size);
    line-height: var(--wv-service-h3-line-height);
}
.wv-service-block .wv-service-heading.wv-service-heading--small {
    font-size: var(--wv-service-h4-size);
    line-height: var(--wv-service-h4-line-height);
}

/* Preserve the unconfigured Feature Cards paragraph treatment. */
.wv-service-block .wv-service-heading.wv-service-heading--body {
    font-size: var(--wv-service-body-size);
    line-height: var(--wv-service-body-line-height);
}

/* Native fragment navigation: existing sticky header plus 16px clearance.
 * Desktop scrolled header: 48px navigation + 80px padding = 128px.
 * Responsive header rules live in css/responsive.css; closed mobile header is 65.58px.
 * Keep these variables local to service wrappers so legacy sections are unaffected.
 */
.wv-service-block {
    --wv-service-scroll-offset: 144px;
}
.wv-service-block[id] {
    scroll-margin-top: var(--wv-service-scroll-offset);
}
@media (max-width: 1400px) {
    .wv-service-block { --wv-service-scroll-offset: 104px; }
}
@media (max-width: 1281px) {
    .wv-service-block { --wv-service-scroll-offset: 100px; }
}
@media (max-width: 991px) {
    .wv-service-block { --wv-service-scroll-offset: 82px; }
}

/* AOS defaults hide content even without JS. Service content opts in only after
   the existing footer instance has successfully prepared every animation node. */
.wv-service-block [data-aos] {
    opacity: 1;
    transform: none;
    transition: none;
}
@media (prefers-reduced-motion: no-preference) {
    .wv-service-block [data-aos].wv-service-motion-ready {
        transition-property: opacity, transform;
        transition-timing-function: ease-out;
        transition-duration: 600ms;
        transition-delay: 0ms;
    }
    .wv-service-block [data-aos="zoom-in-up"].wv-service-motion-ready {
        transition-duration: 500ms;
    }
    .wv-service-block [data-aos="fade-up"].wv-service-motion-ready:not(.aos-animate) {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }
    .wv-service-block [data-aos="zoom-in-up"].wv-service-motion-ready:not(.aos-animate) {
        opacity: 0;
        transform: translate3d(0, 12px, 0) scale(.96);
    }
    .wv-service-block [data-aos].wv-service-motion-ready.aos-animate {
        opacity: 1;
        transform: none;
        transition-delay: 0ms;
    }
    /* Delays are capped at 400ms by the shared PHP renderer. */
    .wv-service-block [data-aos-delay="100"].wv-service-motion-ready.aos-animate { transition-delay: 100ms; }
    .wv-service-block [data-aos-delay="200"].wv-service-motion-ready.aos-animate { transition-delay: 200ms; }
    .wv-service-block [data-aos-delay="300"].wv-service-motion-ready.aos-animate { transition-delay: 300ms; }
    .wv-service-block [data-aos-delay="400"].wv-service-motion-ready.aos-animate { transition-delay: 400ms; }
}
/* Keep focus and fragment destinations immediately usable. No custom scrolling. */
.wv-service-block [data-aos].wv-service-motion-revealed,
.wv-service-block [data-aos]:focus-within {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    transition-delay: 0ms !important;
}
@media (prefers-reduced-motion: reduce) {
    .wv-service-block [data-aos] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        transition-delay: 0ms !important;
    }
}
