/**
 * WordPress / bridge overrides so prototype geometry stays intact.
 * Loaded last on the prototype shell.
 */

/*
 * WP style.css sets overflow-x:hidden on html/body. Any non-visible overflow on
 * those roots creates a scroll containment and breaks position:sticky — the
 * header scrolls away instead of sticking/sliding like the prototype.
 */
html,
body {
	overflow-x: visible !important;
}

/*
 * Underscores styles `.page { margin: 0 0 1.5em }`. Body also gets the `page`
 * class on static front pages, so the whole document picked up a 27px bottom
 * gap the prototype does not have.
 */
body.page,
body.home,
body.blog {
	margin: 0;
}

/*
 * Sticky top + hide travel share --site-header-sticky-top so is-hidden
 * clears the full sticky offset (incl. WP admin-bar), not just ~32px.
 */
.site-shell > .site-header {
	--site-header-sticky-top: 24px;
	position: sticky;
	top: var(--site-header-sticky-top);
	z-index: 50;
	transform: none;
	transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
	will-change: transform;
}

.site-shell > .site-header.is-hidden,
.site-header.is-hidden {
	transform: translate3d(0, calc(-100% - var(--site-header-sticky-top, 24px) - 8px), 0);
	pointer-events: none;
	box-shadow: none;
}

.site-shell > .site-header.is-visible:not(.is-hidden) {
	transform: none;
	box-shadow: 0 10px 28px rgba(67, 72, 85, 0.12);
}

@media (max-width: 1024px) {
	.site-shell > .site-header {
		--site-header-sticky-top: 20px;
	}
}

/* Prototype sticky uses top:16px only at ≤325px; 326–600 keeps top:20px from @1024. */
@media (max-width: 325px) {
	.site-shell > .site-header {
		--site-header-sticky-top: 16px;
	}
}

.admin-bar .site-shell > .site-header {
	--site-header-sticky-top: calc(24px + 32px);
}

@media screen and (max-width: 782px) {
	.admin-bar .site-shell > .site-header {
		--site-header-sticky-top: calc(16px + 46px);
	}
}

/* WP theme sets img { height: auto; max-width: 100% } — that breaks fixed/absolute fills. */
.site-shell .logo .logo-image,
.site-footer .logo .logo-image {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: contain;
	object-position: left center;
}

/* Hero slides: full-bleed banners like the prototype (image + CTA hotzone). */
.site-shell .hero > .hero-slide {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
}

.site-shell .hero.has-track .hero-track .hero-slide {
	position: relative;
	inset: auto;
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
}

.site-shell .hero-slide .hero-picture {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
}

.site-shell .hero-slide .hero-picture img,
.site-shell .hero-slide .hero-main {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center center;
}

/*
 * Slide 2 art is a wide transparent cutout (cat + 24/7). cover crops the "7";
 * contain keeps the full mark and lets --page show through the letterbox.
 */
@media (max-width: 1100px) {
	.site-shell .hero-slide[data-slide-index="1"] .hero-picture img,
	.site-shell .hero-slide[data-slide-index="1"] .hero-main {
		object-fit: contain;
		object-position: center center;
	}
}

.site-shell .hero-slide .hero-action {
	z-index: 2;
}

.site-shell .hero.is-dragging .hero-action,
.site-shell .hero.is-settling .hero-action {
	pointer-events: none;
}

.site-shell .intro-banner .intro-graphic {
	flex: none;
	max-width: none;
	object-fit: cover;
}

/*
 * Desktop values-feature: do not override prototype grid (styles.css 1fr 1fr / 342px).
 * Neutralize Underscores img { max-width:100%; height:auto } so cells/icons size like proto.
 */
.site-shell .values-feature img {
	max-width: none;
}

.site-shell .value-grid article > img {
	width: 62px;
	height: 62px;
	max-width: none;
	object-fit: contain;
}

.site-shell .header-socials {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 28px;
	margin-left: auto;
}

.site-shell .header-socials .max-link,
.site-shell .header-socials .header-social {
	gap: 8px;
}

.site-shell .footer-contact .header-socials {
	margin-left: 0;
	gap: 24px;
}

.site-shell .max-link img,
.site-shell .header-icon img,
.site-shell .menu-toggle img,
.site-shell .field-leading,
.site-shell .field-clear img,
.site-shell .chat-launcher img {
	max-width: none;
}

.site-shell .doctor-photo img {
	max-width: none;
}

.site-shell .doctor-story-ring img,
.site-shell .doctor-story-ring video {
	max-width: none;
	max-height: none;
	height: 100%;
	width: 100%;
	object-fit: cover;
}

.site-shell .rating-image {
	min-width: 0;
	overflow: hidden;
}

/* Bridge `.button.button-primary` is more specific than `.header-appointment { display:none }`. */
@media (max-width: 600px) {
	.site-shell a.button.button-primary.header-appointment,
	.site-shell .button.button-primary.header-appointment {
		display: none;
	}

	/*
	 * Prototype responsive.css @600: 1fr + three 44px icon tracks (later 40px @≤400).
	 * WP must not fall back to desktop grid / dual phone icons.
	 */
	.site-shell .header-main {
		display: grid;
		grid-template-columns: minmax(0, 1fr) repeat(3, 44px);
		align-items: center;
		gap: 4px;
		height: 45px;
	}

	.site-shell .header-main .logo {
		min-width: 0;
		max-width: 100%;
		margin-right: 0;
		overflow: hidden;
	}

	.site-shell .header-icon.search-toggle,
	.site-shell .header-icon.header-chat-phone,
	.site-shell .menu-toggle {
		display: flex;
		width: 44px;
		height: 44px;
	}

	/* Prototype hides tel icon; chat.js / vetus bridge inject .header-chat-phone. */
	.site-shell .header-icon.phone-action {
		display: none;
	}

	.site-shell .values-feature {
		display: flex;
		flex-direction: column;
		height: auto;
		grid-template-rows: none;
	}

	/* Kill styles.css ≤450 overlay leftovers (width 77%/58%) once we stack. */
	.site-shell .values-feature-copy {
		width: 100%;
		height: auto;
		min-height: 0;
		padding: 16px 16px 8px;
	}

	.site-shell .values-feature img {
		position: static;
		width: 100%;
		height: 256px;
		flex: none;
		max-width: none;
		object-fit: cover;
		mask-image: linear-gradient(to bottom, transparent 0%, #000 18%);
	}

	.site-shell .value-grid article img {
		width: 62px;
		height: 62px;
		object-fit: contain;
	}
}

@media (min-width: 361px) and (max-width: 400px) {
	.site-shell .header-main {
		grid-template-columns: minmax(0, 1fr) repeat(3, 40px);
	}

	.site-shell .header-main .logo {
		width: 136px;
		height: 38px;
	}

	.site-shell .header-icon.search-toggle,
	.site-shell .header-icon.header-chat-phone,
	.site-shell .menu-toggle {
		width: 40px;
		height: 40px;
	}
}

@media (max-width: 360px) {
	.site-shell .header-main {
		grid-template-columns: minmax(0, 1fr) repeat(3, 40px);
	}

	.site-shell .header-icon.search-toggle,
	.site-shell .header-icon.header-chat-phone,
	.site-shell .menu-toggle {
		width: 40px;
		height: 40px;
	}
}

/* Keep CTA visible between search-icon and burger on tablet widths. */
@media (min-width: 601px) and (max-width: 800px) {
	.site-shell a.button.button-primary.header-appointment,
	.site-shell .button.button-primary.header-appointment {
		display: inline-flex;
	}
}

/* Footer: addresses and contact stack like the prototype. */
.site-footer .footer-contact {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
}

.site-footer .footer-contact > a,
.site-footer .footer-contact > small,
.site-footer .footer-contact > .address-map-link {
	display: block;
}

.site-footer .footer-contact small,
.site-footer .footer-contact .address-map-link small {
	color: var(--ink, #434855);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
}

.site-footer .footer-contact .address-map-link {
	color: inherit;
	text-decoration: none;
}

@media (max-width: 800px) {
	.site-footer .footer-about {
		display: contents;
	}

	.site-footer .footer-about .logo {
		order: 0;
		margin-bottom: 16px;
	}

	.site-footer .footer-about p {
		order: 1;
		margin: 0 0 32px;
	}

	.site-footer .footer-links {
		order: 2;
	}

	.site-footer .footer-contact {
		order: 3;
		margin: 0;
		gap: 12px;
	}
}
