/* ============================================================================
   BharatClinic Sprint 01 — Contact reveal resilience + preview-residue backstop
   Scope: body.bc-s01 pages only.
   ========================================================================= */

/* ---------------------------------------------------------------------------
   B. CONTACT (and OC / Our Story) REVEAL RESILIENCE
   Root cause: .bc-reveal starts at opacity:0 and depends on JS adding .is-in.
   Above-fold content therefore stays invisible until a scroll event fires —
   measured 0.000 opacity 2s after load on /contact-us/.
   Principle applied: CONTENT VISIBLE BY DEFAULT; motion is an enhancement.
   The burgundy/cream colour pair is NOT touched — this was never a colour bug.
--------------------------------------------------------------------------- */

/* 1. Baseline: every reveal element is visible. This is the default state even
      if no JavaScript ever runs, and it is what search engines/AT receive. */
/* v1.0.1 (P1-B): the child theme declares `html.bc-js .bc-reveal{opacity:0}`
   at specificity (0,2,1). The v1.0.0 override `.bc-s01 .bc-reveal` was (0,2,0)
   and lost the cascade. Every rule below is now authored against html.bc-js. */
html.bc-js .bc-s01 .bc-reveal,
html.bc-js body.bc-s01 .bc-reveal {
	opacity: 1;
	transform: none;
	visibility: visible;
}

/* 2. Only when JS has confirmed it is running AND the browser supports the
      observer do we allow below-fold elements to start hidden and animate in.
      html.bc-s01-anim is set by sprint-01-reveal.js. */
html.bc-js.bc-s01-anim .bc-s01 .bc-reveal:not(.is-in):not(.bc-s01-abovefold) {
	opacity: 0;
	transform: translateY(12px);
	transition: opacity .5s ease, transform .5s ease;
}

html.bc-js.bc-s01-anim .bc-s01 .bc-reveal.is-in {
	opacity: 1;
	transform: none;
}

/* 3. Above-fold elements never animate — they are readable immediately.
      The class is applied by the script before first paint of the animation
      layer; the selector below is the belt-and-braces CSS guarantee. */
html.bc-js .bc-s01 .bc-s01-abovefold,
html.bc-js .bc-s01 .bc-s01-abovefold .bc-reveal,
html.bc-js .bc-reveal.bc-s01-abovefold,
html.bc-js .bc-reveal.is-in {
	opacity: 1 !important;
	transform: none !important;
	visibility: visible !important;
}

/* 4. Reduced motion: force the FINAL state, not a fast animation.
      A 0.01ms transition would still leave a stuck element stuck. */
@media (prefers-reduced-motion: reduce) {
	html.bc-js.bc-s01-anim .bc-s01 .bc-reveal,
	html.bc-js .bc-s01 .bc-reveal,
	html.bc-js .bc-reveal,
	html.bc-js .bc-s01 .bc-reveal:not(.is-in) {
		opacity: 1 !important;
		transform: none !important;
		visibility: visible !important;
		transition: none !important;
		animation: none !important;
	}
}

/* 5. Safety net: if the script fails after arming the animation layer, this
      timed fallback returns everything to visible. .bc-s01-reveal-failsafe is
      added by the script on a timer and also on window load. */
html.bc-js.bc-s01-reveal-failsafe .bc-reveal,
html.bc-s01-reveal-failsafe .bc-reveal {
	opacity: 1 !important;
	transform: none !important;
	visibility: visible !important;
}

/* 6. Our Story end-bar was observed stuck at opacity:0 even after entering the
      viewport. Same principle: visible by default. */
.page-id-379 .bc-endbar {
	opacity: 1;
	visibility: visible;
}

/* ---------------------------------------------------------------------------
   C. ONLINE CONSULTATION — preview stamp (CSS BACKSTOP ONLY)
   Primary neutralisation is the server-side output filter in the companion PHP,
   which removes the node from the delivered DOM. This rule is the fallback if
   the markup changes and the filter no longer matches.
   INTERIM: if this rule is what is doing the work, the string still exists in
   the source DOM. See OPEN_LIMITATIONS.md.
--------------------------------------------------------------------------- */

.page-id-234 .bc-preview {
	display: none !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

/* ---------------------------------------------------------------------------
   D. NRI — preview chip (CSS BACKSTOP ONLY)
   Primary neutralisation is the server-side output filter. Narrow selector:
   page 393 + the page's own body class + the exact chip class.
   Nothing else about NRI is touched: not the slug, not robots, not navigation
   presence, not Element 399, not page content.
--------------------------------------------------------------------------- */

.page-id-393 .preview-chip,
.bc-nri-page .preview-chip {
	display: none !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

/* No-JS: html.bc-js is never added, so the theme's opacity:0 never applies and
   content is visible. Explicit guard kept for clarity/safety. */
html:not(.bc-js) .bc-reveal {
	opacity: 1 !important;
	transform: none !important;
	visibility: visible !important;
}

/* ---------------------------------------------------------------------------
   E. NRI — shared-header CTA label legibility (R2, 2026-07-29)

   Root cause: generatepress-child/assets/css/nri-sol-fable-v1.css
   `.bc-nri-page a{color:var(--green)}` outranks the Sprint shared-header CTA
   colour, producing green text on a green CTA background.
--------------------------------------------------------------------------- */

.page-id-393 .bc-s01-header a.bc-s01-cta,
.bc-nri-page .bc-s01-header a.bc-s01-cta,
.page-id-393 .bc-s01-drawer a.bc-s01-cta,
.bc-nri-page .bc-s01-drawer a.bc-s01-cta,
.page-id-393 a.bc-s01-skip,
.bc-nri-page a.bc-s01-skip {
    color: var(--s01-ivory);
}
