/* ==========================================================================
   PRE-LIVE FINAL — overlay stacking, mobile hero, specialty hover,
   compact news, appointment media. Desktop visual kept unless scoped.
   ========================================================================== */

@media (max-width: 1099px) {
	.site-header {
		z-index: 200;
		overflow: visible !important;
	}

	.nav-drawer-overlay,
	.nav-drawer-overlay:not([hidden]) {
		position: fixed !important;
		top: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		left: 0 !important;
		z-index: 40 !important;
		width: 100vw !important;
		height: 100dvh !important;
		background: rgba(8, 28, 30, 0.46);
		opacity: 1;
	}

	.site-header .identity-row {
		position: relative;
		z-index: 60;
	}

	.header-navigation,
	.site-header .header-navigation {
		position: relative;
		z-index: 80 !important;
		height: 0;
		overflow: visible !important;
	}

	.site-header .navigation-inner .primary-nav,
	.site-header .primary-nav,
	.site-header .primary-nav.is-open {
		z-index: 90 !important;
		isolation: isolate;
		background: var(--ykhg-drawer, #0C4D50) !important;
		opacity: 1 !important;
	}

	.nav-drawer-close {
		position: relative;
		z-index: 100;
	}

	.primary-nav .header-search-box,
	.primary-nav .header-search-box.is-drawer-search,
	.nav-drawer-search-slot,
	.nav-mobile-menu,
	.nav-drawer-utility,
	.nav-drawer-actions {
		position: relative;
		z-index: 2;
		opacity: 1;
	}

	.primary-nav .header-search-box.nav-search.is-open::after,
	.primary-nav .header-search-box.is-drawer-search::after {
		content: none !important;
		display: none !important;
	}

	.primary-nav.is-open .nav-mobile-menu .menu-item-has-children > .sub-menu,
	.primary-nav.is-open .nav-mobile-menu .specialty-flyout,
	.primary-nav.is-open .nav-mobile-menu .specialty-flyout-pane {
		display: block !important;
		position: static !important;
		inset: auto !important;
		width: 100% !important;
		min-width: 0 !important;
		max-width: none !important;
		height: auto !important;
		max-height: none !important;
		overflow: visible !important;
		opacity: 1 !important;
		visibility: visible !important;
		transform: none !important;
		pointer-events: auto !important;
		box-shadow: none !important;
	}

	body.has-mobile-nav {
		overflow: hidden;
	}
}

@media (max-width: 1024px) {
	.ykhg-inner-hero,
	.specialty-directory-hero.ykhg-inner-hero,
	.specialty-detail-hero.ykhg-inner-hero,
	.doctor-directory-hero.ykhg-inner-hero,
	.doctor-directory-hero.ykhg-inner-hero.has-hero-image,
	.service-directory-hero.ykhg-inner-hero,
	.knowledge-archive-hero.ykhg-inner-hero {
		/*
		 * The default inner banner is 1920x420. `cover` scales that wide artwork
		 * by the hero height on tablets/phones, cropping both brand marks off-screen.
		 * Fit the full width instead; the matching surface color completes the
		 * vertical area without stretching the image or obscuring the copy.
		 */
		background-position: center center;
		background-size: 100% auto;
	}
}

@media (min-width: 641px) and (max-width: 768px) {
	.ykhg-inner-hero,
	.specialty-directory-hero.ykhg-inner-hero,
	.specialty-detail-hero.ykhg-inner-hero,
	.doctor-directory-hero.ykhg-inner-hero,
	.doctor-directory-hero.ykhg-inner-hero.has-hero-image,
	.service-directory-hero.ykhg-inner-hero,
	.knowledge-archive-hero.ykhg-inner-hero {
		height: auto;
		min-height: 260px;
		max-height: 320px;
		place-items: center;
		padding: 30px 0;
		background-image: var(--inner-hero-image);
		background-position: center center;
		background-size: 100% auto;
		background-repeat: no-repeat;
	}

	.ykhg-inner-hero::before,
	.specialty-directory-hero.ykhg-inner-hero::before,
	.specialty-detail-hero.ykhg-inner-hero::before,
	.doctor-directory-hero.ykhg-inner-hero::before,
	.ykhg-inner-hero::after,
	.specialty-directory-hero.ykhg-inner-hero::after,
	.specialty-detail-hero.ykhg-inner-hero::after,
	.doctor-directory-hero.ykhg-inner-hero::after {
		display: none;
	}

	.ykhg-inner-hero-copy,
	.specialty-detail-hero.ykhg-inner-hero .specialty-detail-title {
		z-index: 1;
		width: min(84%, 640px);
		padding: 16px clamp(20px, 6vw, 40px);
		background: var(--inner-hero-mobile-copy-background, transparent);
	}

	body.ykhg-site .ykhg-inner-hero h1,
	body.ykhg-site .ykhg-inner-hero .ykhg-inner-hero-heading {
		font-size: clamp(1rem, 4vw, 1.125rem) !important;
		white-space: normal;
	}

	body.ykhg-site .ykhg-inner-hero h1 span,
	body.ykhg-site .ykhg-inner-hero .ykhg-inner-hero-heading span,
	.specialty-directory-hero.ykhg-inner-hero h1 span {
		display: block;
		white-space: normal;
	}

	.ykhg-inner-hero-lead,
	.ykhg-inner-hero .hero-lead,
	.ykhg-inner-hero .doctor-directory-hero-lead {
		display: -webkit-box;
		overflow: hidden;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 4;
		line-clamp: 4;
	}
}

@media (min-width: 641px) and (max-width: 768px) {
	body.home .marketing-slides {
		background: #edf7f5;
	}

	body.home .home-marketing-slider,
	body.home .marketing-slides {
		min-height: 0 !important;
		height: auto !important;
		aspect-ratio: 2.81 / 1 !important;
	}

	body.home .marketing-slide > img,
	body.home .marketing-slide picture img,
	body.home .marketing-slide:first-child > img,
	body.home .marketing-slide:hover > img,
	body.home .marketing-slide:hover picture img {
		object-fit: contain !important;
		object-position: center center !important;
		transform: none;
		transform-origin: center center;
	}
}

@media (max-width: 640px) {
	body.home .home-marketing-slider,
	body.home .marketing-slides {
		height: auto !important;
		min-height: 0 !important;
		max-height: none !important;
		aspect-ratio: 5 / 6 !important;
		border-radius: 0;
		background: #e7f1ef;
	}

	body.home .marketing-slide > img,
	body.home .marketing-slide picture img,
	body.home .marketing-slide:first-child > img,
	body.home .marketing-slide:hover > img,
	body.home .marketing-slide:hover picture img {
		width: 100%;
		height: 100%;
		object-fit: cover !important;
		object-position: center center !important;
		transform: none !important;
	}

	.ykhg-inner-hero,
	.specialty-directory-hero.ykhg-inner-hero,
	.specialty-detail-hero.ykhg-inner-hero,
	.doctor-directory-hero.ykhg-inner-hero,
	.doctor-directory-hero.ykhg-inner-hero.has-hero-image,
	.service-directory-hero.ykhg-inner-hero,
	.knowledge-archive-hero.ykhg-inner-hero {
		height: auto;
		min-height: 0;
		max-height: none;
		aspect-ratio: 5 / 6;
		padding: clamp(32px, 8vw, 56px) 0;
		background-image: var(--inner-hero-mobile-main-image, var(--inner-hero-image-mobile, var(--inner-hero-image)));
		background-position: var(--inner-hero-mobile-position, center center);
		background-size: var(--inner-hero-mobile-size, 100% auto);
		background-repeat: no-repeat;
	}

	.ykhg-inner-hero-copy,
	.specialty-detail-hero.ykhg-inner-hero .specialty-detail-title {
		width: min(86%, 560px);
		padding: clamp(18px, 5vw, 28px);
		background: transparent;
	}

	body.ykhg-site .ykhg-inner-hero h1,
	body.ykhg-site .ykhg-inner-hero .ykhg-inner-hero-heading {
		font-size: clamp(1.05rem, 4.4vw, 1.45rem) !important;
		line-height: 1.2;
	}

	.ykhg-inner-hero-lead,
	.ykhg-inner-hero .hero-lead,
	.ykhg-inner-hero .doctor-directory-hero-lead {
		max-width: 38ch;
		font-size: clamp(.86rem, 3.45vw, 1rem);
		line-height: 1.55;
		-webkit-line-clamp: unset;
		line-clamp: unset;
	}

	body {
		padding-bottom: calc(76px + env(safe-area-inset-bottom));
	}

	.nav-drawer-utility,
	.nav-drawer-actions {
		display: none !important;
	}

	.mobile-care-bar {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 6px;
		padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
	}

	.mobile-care-bar a {
		min-width: 0;
		min-height: 56px;
		padding: 5px 4px;
		flex-direction: column;
		gap: 3px;
		font-size: clamp(.66rem, 2.65vw, .78rem);
		line-height: 1.08;
		text-align: center;
	}

	.mobile-care-bar svg {
		width: 20px;
		height: 20px;
		flex: 0 0 20px;
	}

	.mobile-care-call span,
	.mobile-care-emr span,
	.mobile-care-booking span {
		min-width: 0;
	}

	.mobile-care-call small {
		line-height: 1;
	}

	.mobile-care-call strong {
		font-size: .72rem;
		line-height: 1.05;
		white-space: nowrap;
	}

	.mobile-care-emr {
		border: 1px solid rgba(0, 112, 115, .24);
		background: #f2fbfa;
		color: var(--color-primary-dark, #075d60);
	}

	.mobile-care-booking {
		white-space: normal;
	}

	.ykhg-contact-hub {
		--ykhg-hub-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
	}
}

@media (max-width: 390px) {
	.ykhg-inner-hero-copy,
	.specialty-detail-hero.ykhg-inner-hero .specialty-detail-title {
		width: 92%;
		padding-inline: 16px;
	}

	.ykhg-inner-hero-lead,
	.ykhg-inner-hero .hero-lead,
	.ykhg-inner-hero .doctor-directory-hero-lead {
		-webkit-line-clamp: 5;
		line-clamp: 5;
	}
}

.home-specialties .specialty-showcase-card {
	display: block;
	color: inherit;
	text-decoration: none;
	cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
	.home-specialties .specialty-showcase-card:hover {
		transform: none;
		border-color: var(--gold, #b79a5b);
		box-shadow: 0 22px 48px rgba(7, 54, 60, 0.2);
	}

	.home-specialties .specialty-showcase-card:hover figure img {
		transform: scale(1.05);
	}
}

.doctor-qv-photo {
	background: transparent;
	box-shadow: none;
}

.home-specialties .specialty-card-overlay,
.home-specialties .specialty-card-overlay strong {
	color: #fff;
	text-decoration: none;
}

.home-news-section .home-news-title {
	display: block !important;
	flex: 0 0 auto;
	height: calc((1.35em * 2) + 30px);
	min-height: calc((1.35em * 2) + 30px);
	max-height: calc((1.35em * 2) + 30px);
	margin: 0;
	padding: 14px 16px 16px;
	overflow: hidden;
	line-height: 1.35;
	-webkit-line-clamp: unset !important;
	line-clamp: unset !important;
}

.home-news-section .home-news-feature .home-news-title {
	height: calc((1.35em * 2) + 34px);
	min-height: calc((1.35em * 2) + 34px);
	max-height: calc((1.35em * 2) + 34px);
	padding: 16px 18px 18px;
}

.home-news-section .home-news-title > a {
	display: -webkit-box;
	overflow: hidden;
	max-height: calc(1.35em * 2);
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2 !important;
	line-clamp: 2 !important;
}

.specialty-compact-sidebar,
.specialty-contact-panel {
	position: static !important;
	top: auto !important;
}

.ykhg-compact-news {
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid var(--line, #d7e6e3);
}

.ykhg-compact-news h2 {
	margin: 0 0 12px;
	color: var(--primary-dark, #075b5f);
	font-size: 1.05rem;
}

.ykhg-compact-news ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ykhg-compact-news li {
	display: grid;
	gap: 2px;
	margin: 0 0 12px;
	padding: 0 0 12px;
	border-bottom: 1px solid #e6efed;
}

.ykhg-compact-news li:last-child {
	margin-bottom: 8px;
}

.ykhg-compact-news a {
	color: var(--ink, #123c40);
	font-weight: 650;
	text-decoration: none;
}

.ykhg-compact-news a:hover,
.ykhg-compact-news a:focus-visible {
	color: var(--primary, #0b6f73);
}

.ykhg-compact-news time {
	color: var(--muted, #6b8488);
	font-size: 0.82rem;
}

.appointment-doctor-card {
	align-items: start;
}

.appointment-doctor-media {
	padding: 16px 16px 18px;
	background: transparent;
}

.appointment-doctor-media .appointment-doctor-photo,
.appointment-doctor-card > .appointment-doctor-photo {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	height: auto;
	min-height: 0;
	max-height: none;
	overflow: hidden;
	border-radius: 12px;
	background: #eef6f4;
}

.appointment-doctor-media .appointment-doctor-photo img,
.appointment-doctor-card > .appointment-doctor-photo img {
	width: 100%;
	height: auto;
	max-height: 280px;
	object-fit: contain;
	object-position: top center;
}

@media (max-width: 760px) {
	.appointment-doctor-media {
		padding: 14px 14px 0;
	}

	.appointment-doctor-media .appointment-doctor-photo img {
		max-height: 320px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.home-specialties .specialty-showcase-card,
	.home-specialties .specialty-showcase-card figure img {
		transition: none !important;
		transform: none !important;
	}
}

/* Polylang language switcher: immediately right of search on desktop. */
.header-language-switcher {
	position: relative;
	flex: 0 0 auto;
	z-index: 12;
}

.header-language-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 88px;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid #c9dfdc;
	border-radius: 999px;
	background: #fff;
	color: var(--ink, #123c40);
	font: inherit;
	font-size: .82rem;
	font-weight: 800;
	cursor: pointer;
}

.header-language-toggle:hover,
.header-language-toggle:focus-visible,
.header-language-toggle[aria-expanded="true"] {
	border-color: #79bdb6;
	background: #eff9f7;
}

.header-language-toggle:focus-visible,
.header-language-menu a:focus-visible {
	outline: 3px solid rgba(10, 139, 139, .22);
	outline-offset: 2px;
}

.header-language-toggle > svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	transition: transform .18s ease;
}

.header-language-toggle[aria-expanded="true"] > svg {
	transform: rotate(180deg);
}

.header-language-flag,
.header-language-flag img {
	display: block;
	width: 22px;
	height: 15px;
}

.header-language-flag img {
	object-fit: cover;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(18, 60, 64, .15);
}

.header-language-menu {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	width: 230px;
	margin: 0;
	padding: 6px;
	list-style: none;
	border: 1px solid #d7e8e5;
	border-radius: 13px;
	background: #fff;
	box-shadow: 0 16px 38px rgba(7, 62, 67, .17);
}

.header-language-menu[hidden] {
	display: none;
}

.header-language-menu li {
	margin: 0;
}

.header-language-menu a,
.header-language-unavailable {
	display: grid;
	grid-template-columns: 26px 1fr;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 8px 10px;
	border-radius: 9px;
	color: var(--ink, #123c40);
	font-size: .88rem;
	font-weight: 700;
	text-decoration: none;
}

.header-language-menu a:hover,
.header-language-menu a:focus-visible,
.header-language-menu a[aria-current="page"] {
	background: #eaf7f5;
	color: var(--primary-dark, #075c62);
}

.header-language-unavailable {
	grid-template-columns: 26px 1fr auto;
	color: #70878a;
	cursor: not-allowed;
}

.header-language-unavailable small {
	font-size: .62rem;
	font-weight: 650;
	white-space: nowrap;
}

@media (min-width: 1100px) {
	.navigation-inner .primary-nav {
		order: 1;
	}

	.navigation-inner .header-search-box.nav-search {
		order: 2;
	}

	.navigation-inner .header-language-switcher {
		order: 3;
	}
}

.ykhg-search-header {
	max-width: 780px;
	margin-bottom: 30px;
}

.ykhg-search-header h1 {
	margin: 6px 0 10px;
}

.ykhg-search-count {
	margin: 0;
	color: var(--muted, #607c80);
}

.ykhg-search-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 22px;
}

.ykhg-search-card {
	overflow: hidden;
	border: 1px solid #dbe9e7;
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 10px 28px rgba(7, 62, 67, .07);
}

.ykhg-search-card-image {
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #edf6f4;
}

.ykhg-search-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ykhg-search-card-body {
	padding: 20px;
}

.ykhg-search-type {
	margin: 0 0 7px;
	color: var(--primary, #0b7779);
	font-size: .7rem;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.ykhg-search-card h2 {
	margin: 0 0 10px;
	font-size: 1.16rem;
	line-height: 1.35;
}

.ykhg-search-card h2 a,
.ykhg-search-more {
	color: var(--ink, #123c40);
	text-decoration: none;
}

.ykhg-search-card h2 a:hover,
.ykhg-search-card h2 a:focus-visible,
.ykhg-search-more:hover,
.ykhg-search-more:focus-visible {
	color: var(--primary, #0b7779);
}

.ykhg-search-card-body > p:not(.ykhg-search-type) {
	color: var(--muted, #607c80);
	font-size: .9rem;
}

.ykhg-search-more {
	display: inline-flex;
	min-height: 44px;
	align-items: center;
	font-size: .84rem;
	font-weight: 800;
}

.ykhg-search-empty {
	padding: 34px;
	border: 1px solid #dbe9e7;
	border-radius: 18px;
	background: #f6fbfa;
}

@media (max-width: 1099px) {
	.primary-nav .header-language-switcher.is-drawer-language {
		width: 100%;
		margin: 0 0 10px;
	}

	.primary-nav .header-language-toggle {
		width: 100%;
		justify-content: flex-start;
		border-radius: 12px;
	}

	.primary-nav .header-language-toggle > svg {
		margin-left: auto;
	}

	.primary-nav .header-language-menu {
		position: static;
		width: 100%;
		margin-top: 6px;
		box-shadow: none;
	}

	.ykhg-search-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.ykhg-search-grid {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.header-language-toggle > svg {
		transition: none;
	}
}
