/* ==========================================================================
   Lightweight, dependency-free public-site animations for Siddhivinayaka.
   Pure CSS + a tiny IntersectionObserver (see site-animations.js).
   All motion is gated behind body.anim-ready so the page is fully visible
   if JS is disabled, and disabled entirely under prefers-reduced-motion.
   ========================================================================== */

/* Smooth in-page scrolling (menu anchors: #about, #contact, #faq ...) */
html { scroll-behavior: smooth; }

/* Land anchored sections below the sticky menu instead of underneath it */
#home, #services, #about, #team, #contact, #faq {
    scroll-margin-top: 110px;
}

/* ---- Fade / rise in on scroll ---- */
body.anim-ready .aos {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .7s ease, transform .7s ease;
    will-change: opacity, transform;
}
body.anim-ready .aos.in {
    opacity: 1;
    transform: none;
}

/* ---- Hover: card lift + subtle shadow ---- */
.s-single-services,
.single-counter,
.single-team,
.single-testimonial,
.department-area ul li {
    transition: transform .35s ease, box-shadow .35s ease;
}
.s-single-services:hover,
.single-counter:hover,
.single-testimonial:hover {
    transform: translateY(-8px);
}
.single-team:hover {
    transform: translateY(-6px);
}
.department-area ul li:hover {
    transform: translateX(6px);
}

/* ---- Uniform team/doctor photos ----
   The theme's original photos are 370x370 squares. Crop any admin-uploaded
   photo to the same square shape so every card matches. */
.single-team .team-thumb img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center top;
}

/* ---- Image zoom inside fixed frames ---- */
.single-team .team-thumb,
.single-team .brd,
.gallery-item,
.gallery-thumb {
    overflow: hidden;
}
.single-team .team-thumb img,
.s-single-services .services-icon img,
.gallery-item img,
.gallery-thumb img {
    transition: transform .5s ease;
}
.single-team:hover .team-thumb img,
.gallery-item:hover img,
.gallery-thumb:hover img {
    transform: scale(1.08);
}
.s-single-services:hover .services-icon img {
    transform: scale(1.12) rotate(-3deg);
}

/* Gallery tiles use background-image divs (not <img>) */
.gallery-item { overflow: hidden; border-radius: 10px; }
.gallery-item > div { transition: transform .5s ease; }
.gallery-item:hover > div { transform: scale(1.06); }

/* Show the WHOLE image inside each gallery tile (no cropping), whatever its
   shape - portrait screenshots, landscape photos, etc. The tile keeps a
   uniform size and the soft background fills any leftover space.
   (Extra ancestor in the selector so this wins over the page's inline style.) */
.counter-area .gallery-item a.gallery-lightbox-link img {
    object-fit: contain;
    background: #eef2f8;
}

/* ---- Button hover polish ---- */
.btn.ss-btn,
.top-btn {
    transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease;
}
.btn.ss-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(34, 58, 102, .25);
}

/* ---- Respect users who prefer no motion ---- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    body.anim-ready .aos { opacity: 1 !important; transform: none !important; transition: none !important; }
    .s-single-services, .single-counter, .single-team, .single-testimonial,
    .department-area ul li, .single-team .team-thumb img, .s-single-services .services-icon img,
    .gallery-item img, .gallery-thumb img, .btn.ss-btn, .top-btn { transition: none !important; }
    .s-single-services:hover, .single-counter:hover, .single-testimonial:hover,
    .single-team:hover, .department-area ul li:hover, .btn.ss-btn:hover { transform: none !important; box-shadow: none !important; }
    .single-team:hover .team-thumb img, .gallery-item:hover img, .gallery-thumb:hover img,
    .s-single-services:hover .services-icon img, .gallery-item:hover > div { transform: none !important; }
    .gallery-item > div { transition: none !important; }
}
