/**
 * Site header — 1:1 port of the gynonc.com.sg (health-center "logo-menu") header.
 *
 * Fonts:   menu  → Helvetica, 16px/16px, #666666
 *          dropdown → Helvetica, 12px, #666666
 *          top bar  → 12px, #ffffff
 * Colors:  top bar bg #257574 · accent #50c4c3 / #50c2c2 · dropdown bg #efefef
 * Breakpoint: 959px (desktop ⇄ mobile)
 */

/* ============================================================ *
 * Shared utilities
 * ============================================================ */
.visuallyhidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}
.skip-link:focus {
	position: fixed;
	top: 10px;
	left: 10px;
	z-index: 100000;
	width: auto;
	height: auto;
	padding: 12px 20px;
	clip: auto;
	background: #ffffff;
	color: #257574;
	font: 700 14px/1 Arial, Helvetica, sans-serif;
}

/* ============================================================ *
 * Header shell
 * ============================================================ */
.fixed-header-box {
	position: sticky;                        /* live: fixed header pinned to top on desktop */
	top: 0;
	z-index: 100;                            /* above page content (e.g. the overlap-hero
	                                            "About Dr Cindy Pang" card at z-index 10),
	                                            below the mobile offcanvas menu (9998/9999) */
	width: 100%;
	background-color: #ffffff;
	box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.09);
	transition: box-shadow .3s ease;
}

/* Inner content rail — full-bleed bars, content capped + centered. */
.limit-wrapper {
	box-sizing: border-box;
	display: block;
	margin: 0 auto;
	max-width: 1260px;
	width: 100%;
	padding: 0 60px;
}

header.main-header {
	box-sizing: border-box;
	width: 100%;
	padding: 0;
	background-color: #ffffff;
	border-bottom: 1px solid #f0f0f1;
}

.header-content-wrapper {
	position: relative;
	background-color: #ffffff;
}

/* ============================================================ *
 * Top bar — emergency contact
 * ============================================================ */
#top-nav-wrapper {
	position: relative;
	z-index: 6666;
	width: 100%;
	background: #257574;
}
.top-nav {
	box-sizing: border-box;
	display: block;
	width: 100%;
	background-color: #257574;
	color: #ffffff;
	white-space: nowrap;
}
.top-nav,
.top-nav p,
.top-nav div {
	font-size: 12px;
	line-height: 20px;
}
.top-nav a {
	color: #ffffff;
}
.top-nav a:hover {
	color: #aaeaea;
}
.top-nav .top-nav-inner {
	position: relative;
	z-index: 555;
	min-height: 100%;
}
.top-nav .top-nav-inner > .row {
	display: block;
	padding: 5px 0;
}
.top-nav .top-nav-inner > .row > .row {
	display: table;
	width: 100%;
	table-layout: fixed;
}
.top-nav .grid-1-2 {
	display: table-cell;
	width: 50%;
	min-height: 1px;
	padding: 0 15px;
	vertical-align: middle;
}
#top-nav-text {
	position: relative;
	text-align: right;
}
.top-nav__icon {
	display: inline-block;
	margin: 0 2px 0 6px;
	vertical-align: -2px;
	color: #efefef;
}
.top-nav__phone,
.top-nav__phone:hover {
	color: #ffffff;
}

/* ============================================================ *
 * Header contents — logo + menu (table-cell rows, 1:1 with live)
 * ============================================================ */
header.main-header .header-contents {
	display: table;
	width: 100%;
	margin: 0;
	table-layout: auto;
}

/* --- Logo --- */
header.main-header .first-row {
	display: table-cell;
	vertical-align: middle;
	white-space: nowrap;
}
.logo-wrapper {
	position: relative;
	display: block;
	padding: 7px 0;
	min-height: 100px;
	text-align: left;
}
.logo-wrapper .logo {
	display: inline-block;
	line-height: 1;
	text-decoration: none;
}
.logo-wrapper .logo img,
.logo-wrapper .logo .normal-logo {
	display: block;
	width: auto;
	height: 92px;
	max-width: 100%;
	border: 0;
	vertical-align: bottom;
}
.logo-wrapper .logo--text {
	font: 300 30px/40px Helvetica, Arial, sans-serif;
	color: #000000;
}

/* --- Menu — fills the remaining width, right-aligned --- */
header.main-header .second-row {
	display: table-cell;
	width: auto;
	min-height: 49px;
	vertical-align: middle;
	text-align: right;
}
#menus {
	position: relative;
	z-index: 210;
	min-height: 41px;
	padding: 9.5px 0;
}

#main-menu .menu {
	position: relative;
	margin: 0;
	padding: 0;
	min-height: 41px;
	font-size: 0;
	list-style: none;
}
#main-menu .menu .menu-item {
	position: relative;
	padding: 0;
	list-style: none;
	cursor: pointer;
}
#main-menu .menu > .menu-item {
	display: inline-block;
	padding: 9px 8px 5px 0;
}
#main-menu .menu .menu-item a {
	display: block;
	padding: .3em .6em;
	text-decoration: none;
	transition: color .3s;
}
#main-menu .menu > .menu-item > a,
#main-menu .menu > .menu-item > a:visited {
	color: #666666;
	font: normal 16px/16px Helvetica, Arial, sans-serif;
	border-bottom: 2px double transparent;
}
#main-menu .menu > .menu-item.current-menu-parent,
#main-menu .menu > .menu-item.current-menu-item,
#main-menu .menu > .menu-item.current-menu-ancestor,
#main-menu .menu > .menu-item:hover {
	border-bottom-color: #50c2c2;
}
#main-menu .menu > .menu-item.current-menu-parent > a,
#main-menu .menu > .menu-item.current-menu-item > a,
#main-menu .menu > .menu-item.current-menu-ancestor > a,
#main-menu .menu > .menu-item:hover > a {
	color: #50c2c2;
	text-decoration: none;
}

/* --- Desktop dropdown --- */
#main-menu .menu .sub-menu-wrapper {
	display: none;
}
#main-menu .menu > .menu-item:hover > .sub-menu-wrapper {
	display: block;
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 200;
	width: 100%;
	padding-top: 25px;
}
#main-menu .menu .sub-menu {
	box-sizing: border-box;
	position: absolute;
	left: 50%;
	width: 170px;
	margin: 0 0 0 -85px;
	padding: 10px;
	text-align: left;
	background: #efefef;
	border-radius: 5px;
	box-shadow: 0 2px 4px 2px rgba(0, 0, 0, .09);
	list-style: none;
}
#main-menu .menu .sub-menu::before {
	position: absolute;
	top: -7px;
	left: 77px;
	width: 0;
	height: 0;
	content: "";
	border: 8px solid transparent;
	border-top: 0;
	border-bottom: 7px solid #efefef;
}
#main-menu .menu .sub-menu .menu-item {
	display: block;
}
#main-menu .menu .sub-menu .menu-item > a {
	padding: .6em 10px;
	color: #666666;
	font: normal 12px/1.4 Helvetica, Arial, sans-serif;
}
#main-menu .menu .sub-menu .menu-item.current-menu-item,
#main-menu .menu .sub-menu .menu-item:hover {
	background: #50c2c2;
	border-radius: 4px;
	transition: all .3s;
}
#main-menu .menu .sub-menu .menu-item.current-menu-item > a,
#main-menu .menu .sub-menu .menu-item:hover > a {
	color: #ffffff;
	text-decoration: none;
}

/* --- Group-website notice — dark-teal box pinned top-right --- */
header.main-header #phone-num {
	display: table-cell;
	width: 0;
	padding: 10px 0 10px 20px;
	vertical-align: top;
	white-space: nowrap;
}
#phone-num .sog-main {
	position: absolute;
	top: -10px;
	right: 0;
	box-sizing: content-box;
	height: 30px;
	padding: 10px 50px;
	background: #155352;
	color: #ffffff;
	font: normal 13px/30px "Droid Sans", Arial, Helvetica, sans-serif;
}
.sog-main a {
	color: #50c2c2;
	text-decoration: none;
}
.sog-main a:hover {
	color: #aaeaea;
}

/* ============================================================ *
 * Hamburger trigger + mobile top bar — hidden on desktop
 * ============================================================ */
.mp-menu-trigger,
.mobile-top-bar {
	display: none;
}

/* ============================================================ *
 * Mid-tablet / small desktop — ≤ 1280px
 * Live drops #phone-num out of the table layout here, freeing the
 * absolutely-positioned .sog-main to sit at the right of header-contents.
 * ============================================================ */
@media (max-width: 1280px) {
	header.main-header #phone-num {
		display: block;
		width: auto;
		padding: 10px 0 10px 20px;
	}
}

/* ============================================================ *
 * Mobile / responsive — ≤ 959px
 * ============================================================ */
@media (max-width: 959px) {

	.fixed-header-box {
		position: relative;
	}
	header.main-header {
		position: relative;
	}

	/* Emergency top bar stays; only the desktop menu row + sog box go */
	header.main-header .second-row,
	header.main-header #phone-num {
		display: none !important;
	}

	/* Emergency bar — taller on mobile (40px) and centered */
	.limit-wrapper {
		padding: 0 15px;
	}
	#top-nav-wrapper {
		min-height: 40px;
	}
	.top-nav {
		min-height: 40px;
	}
	.top-nav .top-nav-inner > .row > .row {
		display: block;
	}
	.top-nav .grid-1-2 {
		display: block;
		width: auto;
		padding: 10px 15px;
		text-align: center;
	}
	.top-nav .menu-wrapper {
		display: none;
	}
	#top-nav-text {
		display: block;
		text-align: center;
		padding: 10px 15px;
	}

	/* Group-website notice — full-width dark-green bar under the top bar.
	 * Break out of the .limit-wrapper's 15px side padding so the bar reaches
	 * both viewport edges (matches the full-width emergency bar above it). */
	header.main-header .mobile-top-bar {
		display: block;
		padding: 8px 20px;
		background: #133122;
		color: #ffffff;
		text-align: center;
		margin-left: -15px;
		margin-right: -15px;
	}
	header.main-header .mobile-top-bar .sog-main {
		position: static;
		padding: 0;
		background: none;
		color: #ffffff;
		font-size: 12px;
		line-height: 1.5;
	}

	header.main-header .header-contents {
		display: block;
		margin: 0;
		padding: 0;
	}
	header.main-header .first-row {
		display: block;
		width: auto;
		white-space: normal;
	}

	/* Logo row — leaves space on the left for the hamburger */
	.logo-wrapper {
		display: block;
		min-height: 0;
		padding-left: 70px;
		padding-right: 20px;
	}
	.logo-wrapper .logo {
		display: block;
		padding: 10px 0;
	}
	.logo-wrapper .logo img,
	.logo-wrapper .logo .normal-logo {
		height: auto;
		max-height: 65px;
	}

	/* Hamburger */
	.mp-menu-trigger {
		display: block;
		position: absolute;
		top: 50%;
		left: 0;
		z-index: 600;
		width: 35px;
		height: 35px;
		margin-top: -17.5px;
		padding: 0 20px;
		box-sizing: content-box;
		background: none;
		border: 0;
		cursor: pointer;
	}
	.mp-menu-trigger__bars,
	.mp-menu-trigger__bars::before,
	.mp-menu-trigger__bars::after {
		position: absolute;
		width: 32px;
		height: 4px;
		background: #50c4c3;
		border-radius: 2px;
		transition: transform .3s ease, opacity .3s ease;
	}
	/* Middle bar sits 20px in from the button edge; the two pseudo bars are
	 * positioned relative to it, so they use left:0 to stay aligned (previously
	 * they inherited left:20px and rendered staggered). */
	.mp-menu-trigger__bars {
		left: 20px;
		top: 50%;
		margin-top: -2px;
	}
	.mp-menu-trigger__bars::before,
	.mp-menu-trigger__bars::after {
		content: "";
		left: 0;
	}
	.mp-menu-trigger__bars::before { top: -10px; }
	.mp-menu-trigger__bars::after  { top: 10px; }

	/* Hamburger → X while the panel is open */
	body.offcanvas-open .mp-menu-trigger__bars {
		background: transparent;
	}
	body.offcanvas-open .mp-menu-trigger__bars::before {
		top: 0;
		transform: rotate(45deg);
	}
	body.offcanvas-open .mp-menu-trigger__bars::after {
		top: 0;
		transform: rotate(-45deg);
	}
}

/* Desktop — never show the off-canvas panel */
@media (min-width: 960px) {
	.site-offcanvas,
	.site-offcanvas-overlay {
		display: none !important;
	}
}

/* ============================================================ *
 * Off-canvas mobile menu (multi-level slide)
 * ============================================================ */
.site-offcanvas-overlay {
	position: fixed;
	inset: 0;
	z-index: 9998;
	background: rgba(0, 0, 0, .5);
	opacity: 0;
	transition: opacity .3s ease;
}
body.offcanvas-open .site-offcanvas-overlay {
	opacity: 1;
}

.site-offcanvas {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 9999;
	width: 280px;
	max-width: 85vw;
	height: 100%;
	background: #ffffff;
	box-shadow: 2px 0 12px rgba(0, 0, 0, .2);
	transform: translateX(-100%);
	transition: transform .3s ease;
	overflow: hidden;
	-webkit-overflow-scrolling: touch;
}
body.offcanvas-open .site-offcanvas {
	transform: translateX(0);
}

.site-offcanvas__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: #257574;
}
.site-offcanvas__logo img {
	display: block;
	max-height: 44px;
	width: auto;
}
.site-offcanvas__logo {
	color: #ffffff;
	font: 700 16px/1.2 Arial, Helvetica, sans-serif;
	text-decoration: none;
}
.site-offcanvas__close {
	flex: none;
	width: 36px;
	height: 36px;
	padding: 0;
	background: none;
	border: 0;
	color: #ffffff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

/* Scroll viewport holding the sliding levels */
.site-offcanvas__nav {
	position: relative;
	height: calc(100% - 72px);
	overflow: hidden;
}
.site-offcanvas__nav .menu,
.site-offcanvas__nav .sub-menu {
	margin: 0;
	padding: 0;
	list-style: none;
}
.site-offcanvas__nav .menu {
	height: 100%;
	overflow-y: auto;
}
.site-offcanvas__nav .menu-item-has-children > a {
	/* Positioning context for the chevron pseudo-element. The plain
	 * .menu-item is intentionally NOT positioned, so each .sub-menu anchors
	 * to the full .site-offcanvas__nav panel and slides in as a whole level. */
	position: relative;
}
.site-offcanvas__nav .menu-item > a {
	display: block;
	padding: 12px 44px 12px 20px;
	color: #666666;
	font: normal 16px/30px Helvetica, Arial, sans-serif;
	text-decoration: none;
	box-shadow: inset 0 -1px rgba(0, 0, 0, .08);
	transition: background .3s ease, color .3s ease;
}
.site-offcanvas__nav .menu-item > a:hover,
.site-offcanvas__nav .menu-item.current-menu-item > a {
	color: #50c2c2;
}

/* Parent-row chevron → the whole row opens the child level (see header.js).
 * The chevron is a pure visual affordance on the right of the row. */
.site-offcanvas__nav .menu-item-has-children > a {
	padding-right: 44px;
}
.site-offcanvas__nav .menu-item-has-children > a::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 20px;
	width: 9px;
	height: 9px;
	margin-top: -6px;
	border-right: 2px solid #666666;
	border-bottom: 2px solid #666666;
	transform: rotate(-45deg);
}

/* Each sub-menu is a full-panel level slid off to the right */
.site-offcanvas__nav .sub-menu {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1; /* paint above the parent-level rows (their links are positioned) */
	width: 100%;
	height: 100%;
	background: #ffffff;
	overflow-y: auto;
	transform: translateX(100%);
	transition: transform .3s ease;
}
.site-offcanvas__nav .sub-menu.is-open {
	z-index: 2;
	transform: translateX(0);
}

/* "Back" row prepended to every sub-level by header.js */
.site-offcanvas__nav .offcanvas-back {
	display: block;
	width: 100%;
	padding: 12px 20px;
	background: #f3f3f3;
	border: 0;
	box-shadow: inset 0 -1px rgba(0, 0, 0, .08);
	color: #257574;
	font: 700 14px/30px Helvetica, Arial, sans-serif;
	text-align: left;
	cursor: pointer;
}
.site-offcanvas__nav .offcanvas-back::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-right: 10px;
	vertical-align: 1px;
	border-left: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
}
