/* ============================================================================
   BharatClinic Sprint 01 — one shared global header + one accessible hamburger
   Scope: body.bc-s01 (the five Sprint 01 pages).
   Data source: the WordPress "Primary" menu. No second menu dataset.

   Visual language reuses the site's existing custom properties where present,
   with literal fallbacks so the header renders correctly on pages that do not
   define them.
   ========================================================================= */

.bc-s01 {
	--s01-ivory:   var(--ivory,   #fdfbf7);
	--s01-maroon:  var(--maroon,  #5c1a1b);
	--s01-green:   var(--green,   #3c6e47);
	--s01-gold:    var(--gold,    #c49a2a);
	--s01-ink:     var(--charcoal,#2d2d2d);
	--s01-muted:   var(--muted,   #6b6b6b);
	--s01-line:    var(--line,    rgba(45,45,45,.12));
	--s01-h:       68px;
}

/* ---------- Skip link ---------------------------------------------------- */

.bc-s01-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 1000;
	padding: 10px 16px;
	background: var(--s01-maroon);
	color: var(--s01-ivory);
	text-decoration: none;
	border-radius: 0 0 8px 0;
}
.bc-s01-skip:focus {
	left: 0;
}

/* ---------- Header shell ------------------------------------------------- */

.bc-s01-header {
	position: sticky;
	top: 0;
	z-index: 500;
	background: rgba(253, 251, 247, .96);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--s01-line);
}

.bc-s01-bar {
	display: flex;
	align-items: center;
	gap: 20px;
	width: min(1280px, 100% - 40px);
	margin-inline: auto;
	min-height: var(--s01-h);
}

/* ---------- Brand -------------------------------------------------------- */

.bc-s01-brand {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	text-decoration: none;
	color: var(--s01-maroon);
	flex: 0 0 auto;
	line-height: 1.1;
}
.bc-s01-brand img,
.bc-s01-brand .custom-logo,
.bc-s01-header img.custom-logo,
.bc-s01-header .custom-logo-link img {
	max-height: 44px !important;
	width: auto !important;
	height: auto !important;
	display: block;
}

/* The logo is its own link; keep it compact and on the same row. */
.bc-s01-brand--logo,
.bc-s01-header .custom-logo-link {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	line-height: 0;
}

/* Header must stay one row at desktop. */
.bc-s01-bar { flex-wrap: nowrap; }
.bc-s01-menu { flex-wrap: nowrap; }
@media (max-width: 1180px) and (min-width: 1025px) {
	.bc-s01-menu a { padding: 0 7px; font-size: 14.5px; }
}
.bc-s01-brand-name {
	font-family: var(--display, "Cormorant Garamond", Georgia, serif);
	font-size: 24px;
	font-weight: 600;
}
.bc-s01-brand small {
	font-size: 9.5px;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: var(--s01-muted);
}

/* ---------- Desktop navigation ------------------------------------------ */

.bc-s01-nav {
	flex: 1 1 auto;
	min-width: 0;
}

.bc-s01-menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bc-s01-menu li {
	position: relative;
	margin: 0;
}

.bc-s01-menu a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;          /* touch/comfort target */
	padding: 0 10px;
	font-size: 15px;
	font-weight: 500;
	color: var(--s01-ink);
	text-decoration: none;
	border-radius: 8px;
	white-space: nowrap;
}

.bc-s01-menu a:hover,
.bc-s01-menu a:focus-visible {
	color: var(--s01-maroon);
	background: rgba(196, 154, 42, .10);
}

.bc-s01-menu a:focus-visible {
	outline: 2px solid var(--s01-maroon);
	outline-offset: 2px;
}

/* Active page indication. */
.bc-s01-menu .current-menu-item > a,
.bc-s01-menu .current-menu-ancestor > a,
.bc-s01-menu .current_page_item > a {
	color: var(--s01-maroon);
	box-shadow: inset 0 -2px 0 var(--s01-gold);
}

/* ---------- Desktop submenus -------------------------------------------- */

.bc-s01-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 600;
	min-width: 260px;
	margin: 0;
	padding: 8px;
	list-style: none;
	background: var(--s01-ivory);
	border: 1px solid var(--s01-line);
	border-radius: 12px;
	box-shadow: 0 18px 40px rgba(45, 45, 45, .14);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .16s ease, transform .16s ease, visibility .16s;
}

.bc-s01-menu .sub-menu a {
	width: 100%;
	white-space: normal;
}

/* Open on hover, on keyboard focus, and on scripted toggle (touch). */
.bc-s01-menu li:hover > .sub-menu,
.bc-s01-menu li:focus-within > .sub-menu,
.bc-s01-menu li.bc-s01-open > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

/* Submenu toggle button injected by JS for touch/keyboard operability. */
.bc-s01-subtoggle {
	appearance: none;
	border: 0;
	background: transparent;
	cursor: pointer;
	padding: 6px;
	margin-left: -4px;
	min-width: 32px;
	min-height: 32px;
	color: inherit;
	line-height: 1;
}
.bc-s01-subtoggle:focus-visible {
	outline: 2px solid var(--s01-maroon);
	outline-offset: 2px;
}
.bc-s01-subtoggle svg { width: 12px; height: 12px; transition: transform .16s ease; }
[aria-expanded="true"] > .bc-s01-subtoggle svg,
.bc-s01-subtoggle[aria-expanded="true"] svg { transform: rotate(180deg); }

/* ---------- CTA + language ---------------------------------------------- */

.bc-s01-actions {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
	margin-left: auto;
}

.bc-s01-cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 18px;
	border-radius: 999px;
	background: var(--s01-green);
	color: var(--s01-ivory);
	font-weight: 600;
	font-size: 15px;
	text-decoration: none;
	white-space: nowrap;
}
.bc-s01-cta:hover { filter: brightness(.95); }
.bc-s01-cta:focus-visible {
	outline: 2px solid var(--s01-ivory);
	outline-offset: -4px;
	box-shadow: 0 0 0 4px var(--s01-maroon);
}
.bc-s01-cta--block { width: 100%; justify-content: center; }

.bc-s01-lang {
	display: inline-flex;
	gap: 8px;
	font-size: 12px;
	color: var(--s01-muted);
	white-space: nowrap;
}
.bc-s01-lang--drawer { margin-top: 12px; justify-content: center; }

/* ---------- Hamburger ---------------------------------------------------- */

.bc-s01-burger {
	display: none;               /* desktop: hidden */
	appearance: none;
	border: 1px solid var(--s01-line);
	background: transparent;
	border-radius: 10px;
	width: 44px;
	height: 44px;
	cursor: pointer;
	align-items: center;
	justify-content: center;
}
.bc-s01-burger:focus-visible {
	outline: 2px solid var(--s01-maroon);
	outline-offset: 2px;
}
.bc-s01-burger-bars { display: grid; gap: 4px; }
.bc-s01-burger-bars i {
	display: block;
	width: 20px;
	height: 2px;
	background: var(--s01-ink);
	transition: transform .18s ease, opacity .18s ease;
}
.bc-s01-burger[aria-expanded="true"] .bc-s01-burger-bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.bc-s01-burger[aria-expanded="true"] .bc-s01-burger-bars i:nth-child(2) { opacity: 0; }
.bc-s01-burger[aria-expanded="true"] .bc-s01-burger-bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Drawer ------------------------------------------------------- */

.bc-s01-scrim {
	position: fixed;
	inset: 0;
	z-index: 900;
	background: rgba(45, 45, 45, .45);
	opacity: 0;
	transition: opacity .2s ease;
}
.bc-s01-scrim.is-open { opacity: 1; }

.bc-s01-drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 950;
	width: min(86vw, 360px);
	display: flex;
	flex-direction: column;
	background: var(--s01-ivory);
	border-left: 1px solid var(--s01-line);
	transform: translateX(100%);
	transition: transform .24s ease;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}
.bc-s01-drawer.is-open { transform: none; }

.bc-s01-drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--s01-line);
}
.bc-s01-drawer-brand {
	font-family: var(--display, "Cormorant Garamond", Georgia, serif);
	font-size: 20px;
	color: var(--s01-maroon);
}
.bc-s01-drawer-close {
	appearance: none;
	border: 0;
	background: transparent;
	font-size: 30px;
	line-height: 1;
	width: 44px;
	height: 44px;
	cursor: pointer;
	color: var(--s01-ink);
	border-radius: 8px;
}
.bc-s01-drawer-close:focus-visible {
	outline: 2px solid var(--s01-maroon);
	outline-offset: 2px;
}

.bc-s01-drawer-nav { padding: 8px 8px 0; }

.bc-s01-drawer-menu,
.bc-s01-drawer-menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bc-s01-drawer-menu li { border-bottom: 1px solid var(--s01-line); }
.bc-s01-drawer-menu .sub-menu li:last-child { border-bottom: 0; }

.bc-s01-drawer-menu a {
	display: flex;
	align-items: center;
	min-height: 48px;            /* > 44px practical touch target */
	padding: 10px 12px;
	color: var(--s01-ink);
	text-decoration: none;
	font-size: 16px;
}
.bc-s01-drawer-menu a:focus-visible {
	outline: 2px solid var(--s01-maroon);
	outline-offset: -2px;
}
.bc-s01-drawer-menu .current-menu-item > a,
.bc-s01-drawer-menu .current_page_item > a {
	color: var(--s01-maroon);
	font-weight: 600;
	box-shadow: inset 3px 0 0 var(--s01-gold);
}

/* Drawer submenus: collapsed by default, expanded by the toggle button. */
.bc-s01-drawer-menu .sub-menu {
	display: none;
	padding-left: 12px;
	background: rgba(196, 154, 42, .06);
}
.bc-s01-drawer-menu li.bc-s01-open > .sub-menu { display: block; }

.bc-s01-drawer-menu .bc-s01-subtoggle {
	min-width: 44px;
	min-height: 44px;
	margin-left: auto;
}

/* Row wrapper injected by JS so link + toggle sit side by side. */
.bc-s01-row {
	display: flex;
	align-items: center;
	gap: 4px;
}
.bc-s01-row > a { flex: 1 1 auto; min-width: 0; }

.bc-s01-drawer-foot {
	margin-top: auto;
	padding: 16px;
	border-top: 1px solid var(--s01-line);
}

/* Lock background scroll while the drawer is open. */
body.bc-s01-drawer-open {
	overflow: hidden;
	touch-action: none;
}

/* ---------- Breakpoint: switch to hamburger ------------------------------ */

@media (max-width: 1024px) {
	.bc-s01-nav { display: none; }          /* JS-independent: drawer holds the same menu */
	.bc-s01-burger { display: inline-flex; }
	.bc-s01-lang:not(.bc-s01-lang--drawer) { display: none; }
	.bc-s01-cta:not(.bc-s01-cta--block) { display: none; }
	.bc-s01-bar { width: min(1280px, 100% - 24px); }
}

@media (max-width: 400px) {
	.bc-s01-brand-name { font-size: 20px; }
	.bc-s01-bar { gap: 12px; }
}

/* ---------- Prevent two hamburger systems running at once ---------------- */
/* The homepage-v4 plugin ships its own .burger/.nav-layer drawer and loads
   site-mobile-menu.css site-wide. On Sprint 01 pages the companion drawer is
   the single system, so the legacy trigger and layer are suppressed. */

.bc-s01 .burger,
.bc-s01 .nav-layer {
	display: none !important;
}

/* ---------- Demote legacy page-local headers to an "On this page" row ----- */
/* The bespoke per-page headers keep their anchor links (useful, per owner
   decision) but stop pretending to be the global header: no sticky, no
   duplicate branding, no competing CTA. */

.page-id-234 .bc-header,
.page-id-402 .bc-header,
.page-id-393 header.header {
	position: static !important;
	top: auto !important;
	z-index: 1 !important;
	background: rgba(196, 154, 42, .05);
	border-bottom: 1px solid var(--s01-line);
	backdrop-filter: none;
	box-shadow: none;
	min-height: 0;
}

/* Hide the duplicated brand/CTA/utility inside those legacy headers. */
.page-id-234 .bc-header .bc-brand,
.page-id-234 .bc-header .bc-logo,
.page-id-234 .bc-utility,
.page-id-402 .bc-header .bc-brand,
.page-id-402 .bc-header .bc-logo,
.page-id-402 .bc-utility,
.page-id-393 header.header .brand,
.page-id-393 header.header .logo,
.page-id-393 .utility {
	display: none !important;
}

/* The legacy homepage/Our Story header is fully replaced by the shared one. */
.page-id-405 header.hdr,
.home header.hdr,
.page-id-379 header.hdr {
	display: none !important;
}

/* Legacy sticky chapter mini-bar must not sit under the new header. */
.bc-s01 .ch-mini { top: var(--s01-h); }

/* ---------- Reduced motion ---------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.bc-s01-drawer,
	.bc-s01-scrim,
	.bc-s01-menu .sub-menu,
	.bc-s01-burger-bars i {
		transition: none !important;
	}
}
/* =========================================================
   LIVE HEADER HOTFIX — submenu bridge + single desktop row
   ========================================================= */

@media (min-width: 1025px) {

	/* Override the later flex-wrap: wrap declaration. */
	.bc-s01-menu {
		flex-wrap: nowrap !important;
	}

	/* Remove the physical hover gap beneath parent menu items. */
	.bc-s01-menu > li.menu-item-has-children > .sub-menu {
		top: calc(100% - 2px);
		margin-top: 0;
		transform: none !important;
		pointer-events: none;
	}

	/* Invisible bridge keeps the parent hovered while the cursor
	   travels from the parent link into the dropdown. */
	.bc-s01-menu > li.menu-item-has-children > .sub-menu::before {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		top: -12px;
		height: 12px;
	}

	.bc-s01-menu > li.menu-item-has-children:hover > .sub-menu,
	.bc-s01-menu > li.menu-item-has-children:focus-within > .sub-menu,
	.bc-s01-menu > li.menu-item-has-children.bc-s01-open > .sub-menu {
		opacity: 1;
		visibility: visible;
		transform: none !important;
		pointer-events: auto;
	}
}
/* ===== bc-s01-flyout-v1 : third-level hover flyout (R10) ===== */
.bc-s01-menu .sub-menu li { position: relative; }
.bc-s01-menu .sub-menu .sub-menu {
  top: -8px; left: 100%; z-index: 601;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateX(-6px);
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}
.bc-s01-menu .sub-menu li:hover > .sub-menu,
.bc-s01-menu .sub-menu li:focus-within > .sub-menu,
.bc-s01-menu .sub-menu li.bc-s01-open > .sub-menu {
  opacity: 1; visibility: visible; pointer-events: auto; transform: none;
}
/* hover bridge across the gap */
.bc-s01-menu .sub-menu .sub-menu::before {
  content: ""; position: absolute; top: 0; left: -12px; width: 12px; height: 100%;
}
/* caret on items that own a third level */
.bc-s01-menu .sub-menu li.menu-item-has-children > a { padding-right: 30px; }
.bc-s01-menu .sub-menu li.menu-item-has-children > a::after {
  content: "\203A"; position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%); opacity: .55; font-size: 1.15em; line-height: 1;
}
/* right-edge collision: last two top-level items flip leftward */
.bc-s01-menu > li:nth-last-child(-n+2) .sub-menu .sub-menu { left: auto; right: 100%; transform: translateX(6px); }
.bc-s01-menu > li:nth-last-child(-n+2) .sub-menu li:hover > .sub-menu,
.bc-s01-menu > li:nth-last-child(-n+2) .sub-menu li:focus-within > .sub-menu,
.bc-s01-menu > li:nth-last-child(-n+2) .sub-menu li.bc-s01-open > .sub-menu { transform: none; }
.bc-s01-menu > li:nth-last-child(-n+2) .sub-menu .sub-menu::before { left: auto; right: -12px; }
/* mobile drawer: accordion, never hover */
@media (max-width: 768px) {
  .bc-s01-drawer-menu .sub-menu .sub-menu {
    position: static; opacity: 1; visibility: visible; pointer-events: auto;
    transform: none; padding-left: 16px;
    border-left: 1px solid rgba(196,154,42,.35);
  }
  .bc-s01-drawer-menu .sub-menu .sub-menu::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bc-s01-menu .sub-menu .sub-menu { transition: none; transform: none; }
}
