/*
 * Adapt old manuals.css / repo.css to Zbyszek /main/ chrome.
 * Does not replace manuals.css — only counters layout rules that assume the
 * old 50px #top_menu_bar and that would stretch or collapse the new nav/footer.
 */

/* manuals.css sets body,html { margin:0 auto } and repo.css sets height:100% */
body:has(.cc-legacy-manuals) {
	height: auto !important;
	min-height: 100vh;
	margin: 0 !important;
	display: flex;
	flex-direction: column;
}
html:has(.cc-legacy-manuals) {
	height: auto !important;
	margin: 0 !important;
}

/* Restore the 1200px column. Sticky nav is in-flow so drop the old 60px offset. */
#content.cc-legacy-manuals {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto !important;
	padding: 0 24px 48px;
	box-sizing: border-box;
	text-align: left;
	flex: 1 0 auto;
	align-self: center;
}

/* repo.css sticky-footer hack must not pull the new <footer> */
body:has(.cc-legacy-manuals) .wrapper {
	margin-bottom: 0;
	min-height: 0;
}
body:has(.cc-legacy-manuals) .push {
	height: 0;
	display: none;
}

/* Multipage bar sat under the old 50px header; new nav is 72px / 64px */
.cc-legacy-manuals #multipage_bar,
body:has(.cc-legacy-manuals) #multipage_bar {
	top: 72px;
}
@media (max-width: 900px) {
	.cc-legacy-manuals #multipage_bar,
	body:has(.cc-legacy-manuals) #multipage_bar {
		top: 64px;
	}
}
body:has(#multipage_bar) .cc-legacy-manuals #manual_section {
	padding-top: 70px;
}

/* Universal * reset in _styles_base zeroes img margins; keep screenshots in flow */
.cc-legacy-manuals #text_div img {
	max-width: 100%;
	height: auto;
}

/* manuals.css #main_manual_title must win over scoped TinyMCE h1 */
.cc-legacy-manuals #main_manual_title {
	font-size: 32px;
	margin-bottom: 30px;
	font-weight: 400;
	padding-top: 0;
	width: auto;
}
.cc-legacy-manuals .manual_path a,
.cc-legacy-manuals .manual_path a:visited {
	color: #000;
}

/*
 * Support / “Was it helpful?” — manuals.css sizes assume content-box.
 * New layout’s * { box-sizing: border-box } shrinks #helpful (height 50px +
 * 20px padding) so Yes/No overflow and the next paragraph wraps into them.
 */
.cc-legacy-manuals #helpful,
.cc-legacy-manuals #helpful .container,
.cc-legacy-manuals #helpful .checkmark {
	box-sizing: content-box;
}
.cc-legacy-manuals #helpful {
	overflow: hidden;
}
.cc-legacy-manuals #support_form > p {
	clear: both;
	width: auto;
	max-width: 800px;
	margin: 12px 0 10px;
}
.cc-legacy-manuals #support_form h1 {
	width: auto;
	font-weight: normal;
}
.cc-legacy-manuals #support_form textarea {
	box-sizing: border-box;
	max-width: 100%;
	display: block;
	clear: both;
}
.cc-legacy-manuals #support_form input[type=submit] {
	box-sizing: content-box;
}

/* Related / PDF lists: manuals.css already hides ::before; keep that */
.cc-legacy-manuals .related_topics,
.cc-legacy-manuals .pdf_list,
.cc-legacy-manuals .video_list {
	width: 100%;
}
.cc-legacy-manuals .related_topics li::before,
.cc-legacy-manuals .pdf_list li::before,
.cc-legacy-manuals .video_list li::before {
	content: '';
	display: none;
	margin: 0;
	width: auto;
}

@media (max-width: 800px) {
	.cc-legacy-manuals p,
	.cc-legacy-manuals h2,
	.cc-legacy-manuals h3,
	.cc-legacy-manuals h4,
	.cc-legacy-manuals h5,
	.cc-legacy-manuals h6,
	.cc-legacy-manuals ul,
	.cc-legacy-manuals ol {
		width: auto;
	}
}
