/* ==========================================================================
   Cedrus Wealth - Accessibility remediation stylesheet
   Target: WCAG 2.2 Level AA  (+ SEBI / GIGW / IS 17802)

   This file is loaded LAST so it wins the cascade. Nothing in main.css or any
   vendor stylesheet is edited, so the whole remediation can be rolled back by
   removing the single <link> in includes/header-file.php.

   Every rule below is annotated with the Success Criterion it satisfies.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. SC 2.4.7 Focus Visible (AA) + SC 1.4.11 Non-text Contrast (AA)

   WHY: the global reset in css/main.css (line ~130) applies `outline: none` to
   a, input, select, textarea and button, and nothing anywhere replaces it.
   Only two `:focus` rules exist in 198 KB of CSS, neither of which draws a
   focus ring. Keyboard focus was therefore completely invisible site-wide.

   The indicator is #0d47a1, which measures 8.63:1 on white, 7.71:1 on the
   #f2f2f2 panels and 4.11:1 on the #a8bc5a brand green - so it clears the 3:1
   non-text contrast requirement against every background used on the site.

   `:focus-visible` is used so that mouse and touch users see no change at all;
   only keyboard users get the ring. The `:focus` block is the fallback for
   engines without :focus-visible, and is immediately withdrawn for pointer
   input by the `:focus:not(:focus-visible)` rule.
   -------------------------------------------------------------------------- */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
summary:focus,
[tabindex]:focus,
[role="button"]:focus {
	outline: 3px solid #0d47a1;
	outline-offset: 2px;
	/* main.css puts `transition: all 0.3s` on links, which animates the ring
	   in over 300ms - a fast tabber would only ever see a faint 1px outline.
	   The indicator must be immediate. */
	transition: none;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
summary:focus:not(:focus-visible),
[tabindex]:focus:not(:focus-visible),
[role="button"]:focus:not(:focus-visible) {
	outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible {
	outline: 3px solid #0d47a1;
	outline-offset: 2px;
	/* main.css puts `transition: all 0.3s` on links, which animates the ring
	   in over 300ms - a fast tabber would only ever see a faint 1px outline.
	   The indicator must be immediate. */
	transition: none;
}

/* The sticky header clips its children; without this the ring on the logo and
   the top-level nav links would be cut off. */
.sticky-menu,
.sticky-wrapper,
.main-nav > ul > li {
	overflow: visible;
}


/* --------------------------------------------------------------------------
   2. SC 2.4.1 Bypass Blocks (A)

   WHY: every page repeats the same header and 7-item navigation before the
   content. There was no way to jump past it. This is the "Skip to main
   content" link, injected as the first focusable element in the <body>.

   It is positioned off-screen (not display:none, which would remove it from
   the tab order) and slides into view only when focused, so the visual design
   is untouched for sighted mouse users.
   -------------------------------------------------------------------------- */
.skip-link {
	position: absolute;
	top: -100px;
	left: 8px;
	z-index: 100000;
	display: inline-block;
	padding: 12px 22px;
	background: #ffffff;
	color: #0d47a1;
	border: 3px solid #0d47a1;
	border-radius: 0 0 4px 4px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: underline;
	transition: top 0.15s ease-in-out;
}

.skip-link:focus,
.skip-link:focus-visible {
	top: 0;
	outline: 3px solid #0d47a1;
	outline-offset: 2px;
	transition: none;
}

/* The skip-link target must not be given a focus ring of its own - it is a
   container, not a control. It only needs to be programmatically focusable. */
#main-content:focus {
	outline: none;
}


/* --------------------------------------------------------------------------
   3. SC 2.1.1 Keyboard (A)

   WHY: the three dropdown menus (About Us, Our Solutions, Media & Insights)
   are revealed purely by `.main-nav > ul > li:hover > ul`. The submenu is
   parked at `left: -999999px; opacity: 0` but its links remain in the tab
   order - so a keyboard user tabbed into links that were 999999px off-screen
   and completely invisible.

   Adding :focus-within mirrors the existing :hover rule exactly, so the menu
   now opens on keyboard focus with identical appearance and timing. Mouse
   behaviour is unchanged.
   -------------------------------------------------------------------------- */
.main-nav ul li:focus-within ul {
	z-index: 2;
	-webkit-transition: opacity 0.3s ease, left 0.0s step-start;
	-moz-transition: opacity 0.3s ease, left 0.0s step-start;
	-ms-transition: opacity 0.3s ease, left 0.0s step-start;
	transition: opacity 0.3s ease, left 0.0s step-start;
}

.main-nav > ul > li:focus-within > ul {
	left: 0;
	opacity: 1;
}


/* --------------------------------------------------------------------------
   4. SC 4.1.2 Name, Role, Value (A) / SC 2.4.3 Focus Order (A)

   WHY: `<a class="menu-bar">` (the hamburger) is only wired up on pages whose
   nav carries `.switch-menu` - that is index.php and eq.php. On the other 28
   pages it renders as an empty, invisible anchor that still receives keyboard
   focus and announces nothing. Hiding it where it has no function removes a
   dead stop from the tab order. It has no visible box on those pages, so this
   produces no visual change.
   -------------------------------------------------------------------------- */
.main-nav:not(.switch-menu) .menu-bar {
	display: none;
}


/* --------------------------------------------------------------------------
   5. Screen-reader-only utility

   Used for text that must be announced but not shown - e.g. clarifying the
   destination of "Read More" links (SC 2.4.4) without altering the visual
   design. Uses the clip-rect technique so the text stays in the a11y tree.
   -------------------------------------------------------------------------- */
.sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}


/* --------------------------------------------------------------------------
   6. SC 1.4.3 Contrast (Minimum) (AA)

   The brand green #a8bc5a measures only 2.10:1 on white and 1.87:1 on the
   #f2f2f2 panels - far below the 4.5:1 required for body text. It is kept
   unchanged as a background, border and decorative colour; it is replaced by
   #687437 ONLY where it is used for reading text. #687437 is the same hue,
   simply darkened: 5.07:1 on white and 4.53:1 on #f2f2f2.
   -------------------------------------------------------------------------- */

/* Body copy links - this is the global `p a` rule from main.css line ~391. */
p a {
	color: #687437;
}

/* Ordered-list text (main.css ~line 416). */
ol li {
	color: #687437;
}

/* Pull-quotes and their decorative quote marks. */
q b,
q:before,
q:after {
	color: #687437;
}

/* Active / hovered navigation item. */
nav a:hover,
nav a.active,
.mobile_nav .active {
	color: #687437;
}

/* NOTE - deliberately NOT overridden: `.tags-post` / `.widget-tag`.
   On disclosures.php the `.category-button` cards render with a BLACK
   background, where the original #a8bc5a measures ~9:1 and already passes.
   Darkening it there would have taken it DOWN to 4.14:1 and broken the card
   design. Verified with a computed-style probe, not assumed. */

/* Card headings on investor-grievances.php and similar. */
.category-item .category-info h4,
.widget-course-details .category-info h4 {
	color: #687437;
}

/* Testimonial attribution. */
.quote-avatar-author .author-info span {
	color: #687437;
}

/* Community blocks. */
.community.color-1 h3 {
	color: #687437;
}

/* index.php tab buttons. */
.tabs-box a.active {
	color: #687437;
}

/* White text on the brand green badge ("by ..." on the knowledge-series
   cards) measured 2.09:1. Darkening the badge background to #5c6730 gives
   6.11:1 while keeping the same hue. */
.author-post,
.post-info .author-post {
	background-color: #5c6730;
}

/* 404 page: #b0b0b0 on white is 2.16:1. */
.container-404 p,
.container-404 p span {
	color: #767676;
}

/* The huge "404" numeral is 250px, which qualifies as large text and so only
   needs 3:1 - #939393 gives 3.07:1 and stays visually light as designed. */
.container-404 .number {
	color: #939393;
}


/* --------------------------------------------------------------------------
   7. SC 1.4.1 Use of Colour (A)

   WHY: includes/footer.php sets `footer p a { color:#000; text-decoration:none }`.
   That makes footer links - including the SEBI SCORES and ODR Portal links,
   which are legally required disclosures - visually identical to the plain
   body text around them. They were distinguishable by nothing at all.

   This is the one deliberate visual change in this remediation: footer links
   are underlined. There is no conformant alternative that leaves them looking
   the same as static text.
   -------------------------------------------------------------------------- */
footer p a {
	text-decoration: underline;
}


/* --------------------------------------------------------------------------
   8. SC 2.2.2 Pause, Stop, Hide (A)

   Styling for the pause/play control that js/accessibility.js adds to the
   auto-playing background video on the home page. Sits bottom-right of the
   hero, above the overlay, and is fully keyboard operable.
   -------------------------------------------------------------------------- */
.a11y-video-toggle {
	position: absolute;
	right: 28px;
	bottom: 28px;
	z-index: 30;

	/* SC 2.5.8 Target Size (Minimum) requires 24x24; 48 is comfortably above it
	   and matches a normal media-control hit area. */
	width: 48px;
	height: 48px;
	padding: 0;

	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
	-webkit-box-pack: center;
	-ms-flex-pack: center;
	justify-content: center;

	/* A dark translucent disc with a white glyph and a white ring stays legible
	   over ANY frame of the video - light sky or dark forest - which a solid
	   brand-colour button would not. The ring guarantees the control is
	   distinguishable from the footage behind it (SC 1.4.11). */
	background-color: rgba(17, 21, 27, 0.68);
	border: 2px solid #ffffff;
	border-radius: 50%;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
	color: #ffffff;
	cursor: pointer;
	-webkit-transition: background-color 0.2s ease, -webkit-transform 0.2s ease;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.a11y-video-toggle__icon {
	display: block;
	width: 20px;
	height: 20px;
	pointer-events: none;
}

.a11y-video-toggle__icon svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.a11y-video-toggle:hover {
	background-color: rgba(17, 21, 27, 0.9);
	-webkit-transform: scale(1.06);
	-ms-transform: scale(1.06);
	transform: scale(1.06);
}

/* The generic focus rule already supplies the 3px #0d47a1 ring; on a dark
   translucent disc over video a white outer ring keeps it visible against a
   dark frame too. */
.a11y-video-toggle:focus-visible {
	box-shadow: 0 0 0 3px #ffffff;
}

@media (max-width: 767px) {
	.a11y-video-toggle {
		right: 16px;
		bottom: 16px;
		width: 44px;
		height: 44px;
	}
}

/* If the visitor has asked the OS to reduce motion, the video starts paused -
   make the control read as the primary affordance rather than an overlay. */
@media (prefers-reduced-motion: reduce) {
	.a11y-video-toggle {
		background-color: rgba(17, 21, 27, 0.85);
	}
}


/* --------------------------------------------------------------------------
   9. SC 4.1.2 Name, Role, Value (A) - carousel controls

   js/accessibility.js promotes the Owl Carousel prev/next <div>s to real
   buttons. Browsers give <div role="button"> no default sizing, so this keeps
   them exactly where the theme put them while guaranteeing a usable hit area.
   -------------------------------------------------------------------------- */
.owl-controls .owl-buttons .owl-prev,
.owl-controls .owl-buttons .owl-next {
	min-width: 24px;
	min-height: 24px;
}


/* --------------------------------------------------------------------------
   10. SC 1.4.12 Text Spacing (AA) safety net

   Several theme rules pin text containers to a fixed pixel height, which
   clips content when a user increases line-height or letter-spacing via a
   user stylesheet. Allowing these to grow prevents loss of content.
   -------------------------------------------------------------------------- */
.counter-block,
.category-button,
.info-box,
.instructor-profession {
	height: auto;
	min-height: 0;
	overflow: visible;
}


/* --------------------------------------------------------------------------
   11. SC 1.3.1 Info and Relationships (A) - page heading level

   Several pages used <h2> as the page title with no <h1> at all, so assistive
   technology had no top-level heading to anchor the page. The tag was promoted
   to <h1>; this class re-applies the exact <h2> metrics (28px / 1.4) so the
   promotion is invisible on screen. h1 is 32px by default in main.css.
   -------------------------------------------------------------------------- */
h1.as-h2 {
	font-size: 28px;
	line-height: 1.4;
}

/* main.css sets .main-heeding{font-size:32px !important}, which already matches
   an <h1>, so pages using that class need no compensation. */


/* --------------------------------------------------------------------------
   12. SC 1.4.3 Contrast (Minimum) (AA) - preloader percentage

   Royal Preloader writes its percentage readout colour inline, landing at
   #90929f on white (3.08:1) in the BrowserStack capture. !important is required to
   beat the inline style. #2b2f3a is deliberately DARKER than any value the
   plugin writes, so this override can never reduce an already-passing ratio.
   -------------------------------------------------------------------------- */
#royal_preloader .royal_preloader_percentage {
	color: #2b2f3a !important;
}


/* --------------------------------------------------------------------------
   SC 2.4.7 Focus Visible (AA) - guaranteed-winning fallback

   Several vendor stylesheets kill the focus ring at a specificity the element
   selectors above cannot beat:
     * flickity.min.css  `.flickity-button:focus  { outline: 0 }`      (0,2,0)
     * style1.css        `input.form-control:focus{ outline: 0 }`      (0,2,1)
     * style1.css        `.styled-select select:focus{outline:none}`   (0,2,1)
     * main.css          `.woocommerce ... select:focus{outline:none}` (0,3,2)
   A universal :focus-visible rule with !important is the only way to guarantee
   a visible indicator on EVERY control without editing vendor files.

   It is scoped to :focus-visible, so pointer users still see nothing.
   -------------------------------------------------------------------------- */
*:focus-visible {
	outline: 3px solid #0d47a1 !important;
	outline-offset: 2px !important;
	transition: none !important;
}

/* Programmatic focus targets (skip-link landing point) are containers, not
   controls - they must be focusable but must not draw a ring. */
#main-content:focus,
#main-content:focus-visible,
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible {
	outline: none !important;
}


/* --------------------------------------------------------------------------
   SC 1.3.1 Info and Relationships (A) - home page hero

   The hero originally used TWO <h1> elements ("Your Wealth" / "Our Expertise")
   for what is one title, which gave the page two top-level headings. They are
   now one <h1> with two block-level spans.

   The two original <h1> blocks collapsed to a 17px gap between the lines
   (margin-bottom 12px vs margin-top 17px). This reproduces that gap exactly,
   so the hero renders pixel-identically to before.
   -------------------------------------------------------------------------- */
.text h1 .hero-line {
	display: block;
}

.text h1 .hero-line + .hero-line {
	margin-top: 17px;
}


/* --------------------------------------------------------------------------
   13. SC 1.4.3 Contrast (Minimum) (AA) - team card text below 980px

   main.css contains this pair inside `@media screen and (max-width: 980px)`:

       .item-instructor { background-color: transparent !important; }
       .item-instructor .info-box h3,
       .item-instructor .info-box .instructor-profession { color: #ffffff; }

   The card background is dropped to transparent but the text is left white,
   so on the light page background the person's name and role render at
   1.09:1 - effectively invisible to every mobile and tablet visitor. The
   white is a leftover from the desktop hover state, where the card does have
   a dark fill.

   Restoring the desktop colour below 980px fixes it. On desktop (>980px)
   nothing changes, so the hover treatment is untouched.
   -------------------------------------------------------------------------- */
@media screen and (max-width: 980px) {
	.item-instructor .info-box h3,
	.item-instructor .info-box h4,
	.item-instructor .info-box .instructor-profession {
		color: #000000;
	}
}


/* --------------------------------------------------------------------------
   14. SC 2.5.8 Target Size (Minimum) (AA, new in WCAG 2.2)

   The footer disclosure links (Disclosures, Privacy Policy, AMFI Regulation
   KYC, Registration) drop to a 20px-tall target on narrow screens, below the
   24x24 minimum. They are stacked list items, not links inside a sentence, so
   the "inline" exception does not apply.

   Raising the line box to 26px clears the minimum with room to spare and adds
   a little breathing room between the stacked links.
   -------------------------------------------------------------------------- */
@media screen and (max-width: 980px) {
	.footer-nav > ul > li {
		line-height: 26px;
	}

	.footer-nav > ul > li > a {
		display: inline-block;
		min-height: 26px;
		line-height: 26px;
	}
}
