/* ==========================================================================
   (#290) NivaasMart motion — small, smooth interactions on every public page
   (website + app). Theme colours are not touched; only movement & feedback.
     • cards slide up softly as they scroll into view (listings, projects,
       developers, agents, professionals, news, blog) — nm-motion.js
     • cards lift a little and their photo zooms gently on hover (mouse only)
     • every button / card gives a press-in feedback on tap or click
     • a thin blue bar at the top while the next page is opening
     • keyboard focus ring in NivaasMart blue
   Uses the separate `translate` / `scale` properties so it never fights the
   `transform` that sliders, galleries or existing hover rules already use.
   Nothing is hidden unless nm-motion.js runs (html.nm-mo), and everything is
   off for people who ask their device for less motion.
   ========================================================================== */

/* ---- scroll-in ---- */
html.nm-mo .nm-rv { opacity: 0; translate: 0 26px; }
html.nm-mo .nm-rv.nm-rv-in {
    opacity: 1; translate: 0 0;
    transition: opacity .65s cubic-bezier(.2, .7, .2, 1), translate .7s cubic-bezier(.2, .7, .2, 1);
    transition-delay: var(--nm-rv-d, 0s);
}

/* ---- press-in feedback (tap / click) ---- */
.btn, .hv2-btn, .nm-btn, .lst-card-cta, .prj-card-cta, .dvr-card-cta, .hv2-search-btn, button[type="submit"],
.lst-card, .prj-card, .dvr-card, .nm-news-card, .blog-card, .hv2-pick-card, .hv2-nl-card, .hv2-rp-card, .hv2-fp-card, .hv2-prop2-card, .hv2-handpick-card, .hv2-devshow2-card {
    transition-property: scale, translate, opacity, box-shadow, border-color, background-color, color, transform, filter;
    -webkit-tap-highlight-color: transparent;
}
.btn:active, .hv2-btn:active, .nm-btn:active, .lst-card-cta:active, .prj-card-cta:active, .dvr-card-cta:active, .hv2-search-btn:active, button[type="submit"]:active { scale: .96; transition-duration: .1s; }
.lst-card:active, .prj-card:active, .dvr-card:active, .nm-news-card:active, .blog-card:active { scale: .985; transition-duration: .12s; }

/* ---- hover (mouse only): photo zoom inside cards + smoother lift ---- */
@media (hover: hover) and (pointer: fine) {
    .lst-card-media, .prj-card-media, .developers-page .dvr-card-media, .dvr-card-media:has(> img) { overflow: hidden; }
    .lst-card-media img, .prj-card-media > img, .dvr-card-media > img { transition: scale .8s cubic-bezier(.2, .7, .2, 1); }
    .lst-card:hover .lst-card-media img, .prj-card:hover .prj-card-media > img, .dvr-card:hover .dvr-card-media > img { scale: 1.06; }
    .lst-card, .prj-card, .dvr-card { transition-duration: .3s; transition-timing-function: cubic-bezier(.2, .8, .2, 1); }
    .lst-card:hover, .dvr-card:hover { box-shadow: 0 16px 34px -14px rgba(37, 99, 235, .28), 0 2px 6px rgba(15, 23, 42, .05); }
    .prj-card:hover { box-shadow: 0 18px 36px -14px rgba(37, 99, 235, .3), 0 2px 6px rgba(15, 23, 42, .05); }
    .lst-card-cta, .prj-card-cta, .dvr-card-cta { transition-duration: .25s; }
    .btn:hover, .hv2-btn:hover, .nm-btn:hover { filter: brightness(1.05); }
}

/* ---- keyboard focus ring ---- */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 2px; border-radius: 6px;
}

/* ---- top loading bar while the next page opens ---- */
#nmTopBar {
    position: fixed; left: 0; top: 0; height: 3px; width: 0; z-index: 2147483000; pointer-events: none; opacity: 0;
    background: linear-gradient(90deg, #2563EB, #60A5FA, #2563EB); background-size: 200% 100%;
    box-shadow: 0 0 10px rgba(37, 99, 235, .55); border-radius: 0 3px 3px 0;
    transition: width .35s ease, opacity .3s ease;
}
#nmTopBar.on { opacity: 1; animation: nmBarFlow 1.1s linear infinite; }
body.capacitor-app #nmTopBar { top: var(--nm-sat, 0px); }
@keyframes nmBarFlow { to { background-position: -200% 0; } }

/* ---- smooth jump to #sections ---- */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ---- less motion if the device asks for it ---- */
@media (prefers-reduced-motion: reduce) {
    html.nm-mo .nm-rv { opacity: 1 !important; translate: none !important; transition: none !important; }
    .lst-card-media img, .prj-card-media > img, .dvr-card-media > img { transition: none !important; scale: none !important; }
    #nmTopBar { display: none !important; }
}
