/*
 * Responsive layer for the legacy implamed.net pages.
 * Loaded after styles.css. Replaces the old fixed 775px table shell.
 * Breakpoint: 767px (phones / small tablets get the stacked layout).
 */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	/* We style dark mode ourselves (bar + menu); stop Chrome's auto-darkening
	   from recolouring the legacy content and images. */
	color-scheme: only light;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

/* The old <body leftmargin/topmargin=0> attributes now live here */
body {
	margin: 0;
}

.page {
	max-width: 775px;
	margin: 0 auto;
}

/* ---------- Header ---------- */
.hdr {
	display: flex;
	align-items: stretch;
}
.hdr-logo {
	flex: 0 0 213px;
}
.hdr-logo img {
	display: block;
	width: 213px;
	height: auto;
}
.hdr-main {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
}
.hdr-top {
	background: #345181;
	display: flex;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: 4px 16px;
	padding: 4px 12px;
	font: bold 12px/1.4 tahoma, Verdana, sans-serif;
}
.hdr-top a,
.page .hdr-top a:link,
.page .hdr-top a:visited {
	color: #fff;
	text-decoration: none;
}
.hdr-banner {
	display: block;
	width: 100%;
	height: auto;
}

/* ---------- Mobile bar + hamburger menu (hidden on desktop) ---------- */
.m-bar,
.m-nav {
	display: none;
}

/* ---------- Body columns ---------- */
.layout {
	display: flex;
	align-items: stretch;
}
.sidebar {
	flex: 0 0 213px;
	width: 213px;
	min-height: 100%;
}
.content {
	flex: 1 1 auto;
	min-width: 0;
	background: #fff;
	padding: 10px 12px;
	overflow-wrap: break-word;
}
.side-right {
	flex: 0 0 104px;
}
.side-right img {
	display: block;
	width: 104px;
	height: auto;
}

/* ---------- Footer ---------- */
.footer {
	background: #345181;
	color: #fff;
	text-align: center;
	padding: 10px 12px 14px;
	font: 12px/1.9 tahoma, Verdana, sans-serif;
}
.page .footer a:link,
.page .footer a:visited {
	color: #fff;
	font-weight: bold;
	text-decoration: underline;
}
.page .footer font {
	color: #9fb3d6 !important;
}
/* Editor + last-update line (legally expected on health sites) */
.side-editor {
	padding: 4px 8px 18px;
	color: #525252;
	font: bold 10px/1.5 tahoma, Verdana, sans-serif;
}
.side-editor span {
	font-weight: normal;
}
.footer-editor {
	margin-top: 10px;
	color: #fff;
	font-size: 13px;
}
.footer-editor .sep {
	color: #9fb3d6;
}
.footer-note {
	margin-top: 4px;
	color: #d6e0f0;
	font-size: 12px;
}

/* ---------- Content partials: keep fixed-size media inside the column ---------- */
.content img {
	max-width: 100%;
	height: auto;
}
.content table {
	max-width: 100%;
}
.content input,
.content select,
.content textarea {
	max-width: 100%;
}

/* ---------- Home page photo slider (all screen sizes) ---------- */
.slider {
	position: relative;
	max-width: 420px;
	margin: 6px auto 18px;
	overflow: hidden;
	border-radius: 6px;
	background: #f4f8e6;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
.slider .slide {
	margin: 0;
}
.slider .slide img {
	display: block;
	margin: 0 auto;
}
/* Without JavaScript the photos simply stack, as before */
.slider:not(.js) .slide + .slide {
	margin-top: 8px;
}
.slider:not(.js) .slider-prev,
.slider:not(.js) .slider-next,
.slider:not(.js) .slider-dots {
	display: none;
}
.slider.js .slider-track {
	display: flex;
	transition: transform 0.5s ease;
}
/* Every slide is the same 16:9 frame; photos fill it completely and are
   centred, so taller photos are trimmed equally at the top and bottom. */
.slider.js .slide {
	flex: 0 0 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
}
.slider.js .slide img {
	width: 100% !important;
	max-width: none !important;
	height: 100% !important;
	max-height: none !important;
	object-fit: cover;
	object-position: center center;
}
.slider-prev,
.slider-next {
	position: absolute;
	top: 50%;
	width: 40px;
	height: 40px;
	margin-top: -20px;
	padding: 0 0 4px;
	border: 2px solid rgba(255, 255, 255, 0.85);
	border-radius: 50%;
	background: rgba(52, 81, 129, 0.8);
	color: #fff;
	font: bold 28px/1 Arial, sans-serif;
	cursor: pointer;
}
.slider-prev {
	left: 8px;
}
.slider-next {
	right: 8px;
}
.slider-dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 8px;
	text-align: center;
	line-height: 0;
}
.slider-dot {
	width: 12px;
	height: 12px;
	margin: 0 5px;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.35);
	cursor: pointer;
}
.slider-dot.on {
	background: #7aa619;
}
@media (prefers-reduced-motion: reduce) {
	.slider.js .slider-track {
		transition: none;
	}
}

/* ---------- Location page: Google Maps directions button ---------- */
.directions {
	margin: 18px 0 8px;
	text-align: center;
}
.page .btn-directions:link,
.page .btn-directions:visited {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	min-width: 240px;
	padding: 12px 22px;
	border-radius: 8px;
	background: #345181;
	color: #fff;
	font: bold 16px/1.3 tahoma, Verdana, sans-serif;
	text-decoration: none;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.page .btn-directions:hover {
	background: #2a4268;
	color: #fff;
}
.btn-directions small {
	margin-top: 2px;
	color: #d6e0f0;
	font-size: 12px;
	font-weight: normal;
}
/* simple CSS map pin */
.btn-directions .pin {
	width: 14px;
	height: 14px;
	margin-bottom: 6px;
	border-radius: 50% 50% 50% 0;
	background: #7aa619;
	transform: rotate(-45deg);
	box-shadow: inset 0 0 0 4px #7aa619, inset 0 0 0 7px #fff;
}

/* ---------- Contact form (location page) ---------- */
.cf {
	max-width: 440px;
	margin: 26px auto 10px;
	padding: 18px 16px 20px;
	border: 1px solid #d9e6b8;
	border-radius: 8px;
	background: #f7fbec;
	text-align: left;
	font-family: tahoma, Verdana, sans-serif;
	scroll-margin-top: 110px;
}
.cf-title {
	margin: 0 0 6px;
	color: #345181;
	font-size: 20px;
}
.cf-intro {
	margin: 0 0 14px;
	color: #525252;
	font-size: 14px;
	line-height: 1.5;
}
.cf-row {
	margin-bottom: 12px;
}
.cf-row label {
	display: block;
	margin-bottom: 4px;
	color: #333;
	font-size: 14px;
	font-weight: bold;
}
.cf-req {
	color: #888;
	font-weight: normal;
}
.cf-row input[type="text"],
.cf-row input[type="tel"],
.cf-row input[type="email"],
.cf-row textarea {
	display: block;
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #b9c99a;
	border-radius: 6px;
	background: #fff;
	color: #222;
	font: 16px/1.4 tahoma, Verdana, sans-serif;
}
.cf-row input:focus,
.cf-row textarea:focus {
	outline: 2px solid #7aa619;
	outline-offset: 0;
	border-color: #7aa619;
}
.cf-check label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-weight: normal;
	line-height: 1.45;
}
.page .cf-check a:link,
.page .cf-check a:visited {
	color: #345181;
	font: inherit;
	font-weight: bold;
	text-decoration: underline;
}
.cf-check input {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 1px 0 0;
}
.cf-has-err input,
.cf-has-err textarea {
	border-color: #c0392b;
}
.cf-err {
	display: block;
	margin-top: 4px;
	color: #c0392b;
	font-size: 13px;
	font-weight: bold;
}
.cf-err-top {
	margin: 0 0 12px;
}
.cf-send {
	min-width: 140px;
	min-height: 48px;
	padding: 0 24px;
	border: 0;
	border-radius: 6px;
	background: #7aa619;
	color: #fff;
	font: bold 17px tahoma, Verdana, sans-serif;
	cursor: pointer;
}
.cf-send:active {
	background: #6a9214;
}
.cf-ok {
	margin: 0;
	padding: 12px 14px;
	border-radius: 6px;
	background: #e3f2c4;
	color: #2f5a00;
	font-size: 15px;
	font-weight: bold;
}
/* honeypot: hidden from people, visible to naive bots */
.cf-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- Job application form wizard ---------- */
.wiz-hidden {
	display: none !important;
}
.wiz-head {
	margin: 4px 0 14px;
	font-family: tahoma, Verdana, sans-serif;
}
.wiz-count {
	color: #7aa619;
	font-size: 13px;
	font-weight: bold;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}
.wiz-title {
	margin: 2px 0 8px;
	color: #003399;
	font-size: 17px;
	font-weight: bold;
}
.wiz-bar {
	height: 8px;
	border-radius: 4px;
	background: #e6eed3;
	overflow: hidden;
}
.wiz-bar span {
	display: block;
	height: 100%;
	width: 0;
	background: #7aa619;
	transition: width 0.3s ease;
}
.wiz-msg {
	min-height: 1em;
	margin: 10px 0 0;
	color: #c0392b;
	font-weight: bold;
}
.wiz-nav {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin: 16px 0 8px;
}
.wiz-nav button {
	min-width: 120px;
	min-height: 46px;
	padding: 0 18px;
	border: 0;
	border-radius: 6px;
	font: bold 16px tahoma, Verdana, sans-serif;
	cursor: pointer;
}
.wiz-back {
	background: #e6eed3;
	color: #345181;
}
.wiz-next {
	margin-left: auto;
	background: #7aa619;
	color: #fff;
}
.wiz-next:active {
	background: #6a9214;
}
/* The form's own Send button on the last step */
form.wiz input[type="submit"] {
	min-height: 46px;
	padding: 0 22px;
	border: 0;
	border-radius: 6px;
	background: #345181;
	color: #fff;
	font-weight: bold;
	cursor: pointer;
}

/* ---------- Phones ---------- */
@media (max-width: 767px) {
	body {
		font-size: 14px;
	}

	/* Desktop header is replaced by a compact sticky bar */
	.hdr {
		display: none;
	}

	.sidebar,
	.side-right {
		display: none;
	}

	.m-bar {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		position: sticky;
		top: 0;
		z-index: 50;
		height: 76px;
		padding: 0 10px 0 10px;
		background: #345181;
		border-bottom: 4px solid #c5e27a;
	}
	.m-brand,
	.page .m-brand:link,
	.page .m-brand:visited {
		display: flex;
		align-items: flex-start;
		height: 76px;
		gap: 10px;
		min-width: 0;
		text-decoration: none;
	}
	/* Logo is a badge that hangs below the bar (bar height stays 76px) */
	.m-brand {
		align-self: flex-start;
	}
	.m-brand img {
		position: relative;
		z-index: 2;
		display: block;
		width: auto;
		height: 96px;
		margin-top: 6px;
		padding: 3px;
		background: #fff;
		border: 1px solid #f2c94c;
		border-radius: 6px;
		box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
		transition: height 0.2s ease;
	}
	.m-title {
		align-self: center;
		margin-top: 0;
	}
	/* Keep the hanging logo from covering the first item of the open menu */
	html.m-lock .m-brand img {
		height: 60px;
	}
	.m-title {
		color: #fff;
		font: bold 24px/1.05 tahoma, Verdana, sans-serif;
		letter-spacing: 2px;
		white-space: nowrap;
	}
	.m-title {
		min-width: 0;
	}
	.m-title small {
		display: block;
		margin-top: 4px;
		color: #e4ebf6;
		font-size: 15px;
		line-height: 1.2;
		font-weight: normal;
		letter-spacing: 0;
		/* long practice name may wrap to two lines on narrow phones */
		white-space: normal;
	}

	.m-burger {
		flex: 0 0 60px;
		width: 60px;
		height: 58px;
		padding: 0;
		border: 2px solid #c5e27a;
		border-radius: 8px;
		background: #7aa619;
		box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
		cursor: pointer;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 5px;
		-webkit-tap-highlight-color: transparent;
	}
	.m-burger:focus-visible {
		outline: 2px solid #c5e27a;
		outline-offset: 2px;
	}
	/* Icon is text (not background-painted bars) so browser dark modes
	   that darken backgrounds can't make it disappear. */
	.m-ico {
		display: block;
		color: #fff;
		font: bold 26px/1 Arial, "Segoe UI Symbol", "Noto Sans Symbols 2", sans-serif;
		text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
	}
	.m-ico-close {
		display: none;
		font-size: 38px;
		line-height: 26px;
	}
	.m-burger[aria-expanded="true"] .m-ico-open {
		display: none;
	}
	.m-burger[aria-expanded="true"] .m-ico-close {
		display: block;
	}
	.m-burger-txt {
		display: block;
		margin-top: 1px;
		color: #fff;
		font: bold 10px/1 tahoma, Verdana, sans-serif;
		letter-spacing: 1px;
	}
	.m-burger:active {
		background: #6a9214;
	}

	/* Full-screen menu panel under the bar */
	.m-nav.open {
		display: block;
		position: fixed;
		top: 76px;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 49;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		background: #7aa619;
		padding: 4px 0 24px;
		font-family: tahoma, Verdana, sans-serif;
	}
	html.m-lock,
	html.m-lock body {
		overflow: hidden;
	}
	.m-nav ul {
		list-style: none;
		margin: 0;
		padding: 0;
	}
	.m-nav li a:link,
	.m-nav li a:visited {
		display: block;
		padding: 14px 20px;
		color: #fff;
		font-size: 18px;
		font-weight: bold;
		text-decoration: none;
		border-bottom: 1px solid rgba(255, 255, 255, 0.25);
		border-left: 4px solid transparent;
	}
	.m-nav li a.on {
		background: rgba(0, 0, 0, 0.14);
		border-left-color: #fff;
	}
	.m-nav .m-extra,
	.m-nav .m-contact {
		margin: 16px 20px 0;
		color: #fff;
		font-size: 15px;
		line-height: 1.7;
	}
	.m-nav .m-extra a:link,
	.m-nav .m-extra a:visited {
		display: inline-block;
		padding: 6px 14px;
		border: 1px solid rgba(255, 255, 255, 0.7);
		border-radius: 4px;
		color: #fff;
		font-size: 14px;
		font-weight: bold;
		text-decoration: none;
	}
	.m-nav .m-contact a:link,
	.m-nav .m-contact a:visited {
		color: #fff;
		font-size: 15px;
		font-weight: bold;
	}

	.layout {
		display: block;
	}
	.content {
		padding: 16px;
		padding-top: 34px; /* room for the logo hanging below the bar */
	}
	/* Readable body text on phones: one size for everything inside the
	   content column (legacy styles.css pins text and links to 10-11px). */
	.content {
		font-size: 19px;
		line-height: 1.65;
	}
	.content *:not(sub):not(sup):not(input):not(select):not(textarea):not(button) {
		font-size: inherit !important;
		line-height: inherit;
	}
	.content input,
	.content select,
	.content textarea,
	.content button {
		font-size: 16px !important; /* 16px+ also stops iOS zooming into fields */
	}
	/* Contact form keeps its own sizes */
	.page .content .cf-title {
		font-size: 21px !important;
	}
	.page .content .cf-intro,
	.page .content .cf-row label,
	.page .content .cf-check label {
		font-size: 15px !important;
	}
	.page .content .cf-err {
		font-size: 14px !important;
	}
	.page .content .cf-ok {
		font-size: 16px !important;
	}
	.page .content .cf-send {
		font-size: 17px !important;
	}
	/* Directions button keeps its own sizes */
	.page .content .btn-directions {
		font-size: 18px !important;
	}
	.page .content .btn-directions small {
		font-size: 13px !important;
	}
	/* Multi-column legacy forms (job application, Q&A) stay a bit tighter
	   so their tables need less sideways scrolling. */
	.page .content form {
		font-size: 16px !important;
		line-height: 1.45;
	}
	/* Text fields follow their cell width instead of their size="" attribute */
	.content form input:not([type="radio"]):not([type="checkbox"]):not([type="submit"]):not([type="reset"]):not([type="button"]),
	.content form textarea,
	.content form select {
		width: 100%;
		min-width: 3em;
	}
	.content td[width],
	.content th[width] {
		width: auto !important;
	}
	.content table,
	.content table[width] {
		width: auto !important;
	}
	/* A few legacy tables (e.g. the job form) can't shrink below ~440px:
	   they scroll sideways inside the content box instead of widening the page. */
	.content {
		overflow-x: auto;
	}
	.content img {
		max-width: 100% !important;
		height: auto !important;
	}
	.content img[align] {
		float: none !important;
		display: block;
		margin: 8px auto !important;
	}
	/* Team page: team photos use the full screen width */
	.page-ekibimiz img[src*="ekip-2026"] {
		float: none !important;
		display: block;
		width: 100% !important;
		max-width: 100% !important;
		height: auto !important;
		margin: 12px 0 !important;
		border-radius: 4px;
	}
	.content img[hspace] {
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	.footer {
		font-size: 16px;
		line-height: 2;
	}
	.page .footer a:link,
	.page .footer a:visited {
		font-size: 16px;
	}
	.footer-editor {
		margin-top: 14px;
		font-size: 15px;
		line-height: 1.5;
	}
	.footer-editor .sep {
		display: none;
	}
	.footer-editor .upd {
		display: block;
	}
	.footer-note {
		margin-top: 8px;
		font-size: 14px;
		line-height: 1.5;
	}
}

/* ---------- Phones in dark mode: bar + menu only, content stays as designed ---------- */
@media (max-width: 767px) and (prefers-color-scheme: dark) {
	.m-bar {
		background: #16233a;
		border-bottom-color: #7aa619;
	}
	.m-title {
		color: #ffffff;
	}
	.m-title small {
		color: #b9c7de;
	}
	.m-burger {
		background: #8cc21f;
		border-color: #e3f5b0;
		box-shadow: 0 0 0 2px rgba(140, 194, 31, 0.35), 0 2px 8px rgba(0, 0, 0, 0.6);
	}
	.m-burger:active {
		background: #7aa619;
	}
	.m-ico {
		color: #ffffff;
		text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
	}
	.m-nav.open {
		background: #111b2c;
	}
	.m-nav li a:link,
	.m-nav li a:visited {
		color: #e8eef7;
		border-bottom-color: rgba(255, 255, 255, 0.12);
	}
	.m-nav li a.on {
		background: rgba(140, 194, 31, 0.18);
		border-left-color: #8cc21f;
		color: #ffffff;
	}
	.m-nav .m-extra,
	.m-nav .m-contact {
		color: #c9d4e6;
	}
	.m-nav .m-extra a:link,
	.m-nav .m-extra a:visited {
		color: #ffffff;
		border-color: #8cc21f;
	}
	.m-nav .m-contact a:link,
	.m-nav .m-contact a:visited {
		color: #b8e35a;
	}
}
