/* ============================================
   Scroll Fade-In Animations
   Subtle, professional reveal on scroll.
   Works alongside AOS library.
   ============================================ */

/* Custom fade-in-up for sections — used via AOS data attributes */
[data-aos="fade-up"] {
    transition-property: opacity, transform;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Gentle fade-in for page load */
@keyframes fadeInPage {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main {
    animation: fadeInPage 0.6s ease-out;
}

/* Navbar subtle shadow on scroll — enhanced via JS */
nav.scrolled {
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

/* Smooth image hover zoom (service/blog cards) */
.hover-zoom:hover img {
    transform: scale(1.05);
}
.hover-zoom img {
    transition: transform 0.4s ease;
}

/* Collapse empty paragraphs from rich text editors */
.prose p:empty,
.includes-list p:empty {
    display: none;
}

/* ── Wagtail rich-text image alignment ─────────────────
   Wagtail outputs bare <img class="richtext-image left|right|full-width">
   inside .prose containers.

   Left/right images float to their side.  Each following block element
   (p, ul, ol …) gets overflow:hidden which creates a block formatting
   context — the whole paragraph sits beside the image as a unit, never
   splitting across.  Once the float is cleared (text taller than the
   image), subsequent paragraphs return to full page width automatically.
   ─────────────────────────────────────────────────────── */

.prose img.richtext-image {
    border-radius: 0.75rem;
    height: auto;
}

.prose img.richtext-image.full-width {
    display: block;
    width: 100%;
    margin: 2rem 0;
}

.prose img.richtext-image.left {
    float: left;
    max-width: 45%;
    margin: 0.25rem 2rem 1.25rem 0;
}

.prose img.richtext-image.right {
    float: right;
    max-width: 45%;
    margin: 0.25rem 0 1.25rem 2rem;
}

/* Each block after a floated image stays together as a unit */
.prose img.richtext-image.left ~ p,
.prose img.richtext-image.left ~ ul,
.prose img.richtext-image.left ~ ol,
.prose img.richtext-image.left ~ blockquote,
.prose img.richtext-image.left ~ h2,
.prose img.richtext-image.left ~ h3,
.prose img.richtext-image.left ~ h4,
.prose img.richtext-image.right ~ p,
.prose img.richtext-image.right ~ ul,
.prose img.richtext-image.right ~ ol,
.prose img.richtext-image.right ~ blockquote,
.prose img.richtext-image.right ~ h2,
.prose img.richtext-image.right ~ h3,
.prose img.richtext-image.right ~ h4 {
    overflow: hidden;
}

/* Clear the float after the prose block */
.prose::after {
    content: "";
    display: table;
    clear: both;
}

/* On small screens, stack images full-width */
@media (max-width: 640px) {
    .prose img.richtext-image.left,
    .prose img.richtext-image.right {
        float: none;
        max-width: 100%;
        margin: 1.5rem 0;
    }
}

/* Teal accent underline for active nav links */
.nav-link-active {
    border-bottom: 2px solid #3b7a84;
    padding-bottom: 2px;
}