/*
Theme Name:  IH Divi Child
Description: Inventive Horizons child theme for Divi (DEC-027 / ORDERS 083). Page fixes that used to live in mu-plugins move here.
Author:      Inventive Horizons
Template:    Divi
Version:     1.0.0
Text Domain: ih-divi-child
*/

/* Mobile menu toggle button (functions.php): look exactly like Divi's span. line-height:0 after font:inherit keeps the header at 80px on phones. */
button.mobile_menu_bar {
	-webkit-appearance: none;
	appearance: none;
	background: none;
	border: 0;
	border-radius: 0;
	margin: 0;
	padding: 0;
	color: inherit;
	font: inherit;
	line-height: 0;
	text-align: left;
	cursor: pointer;
}

/* Visible keyboard focus (crew-tsprod01's ts-divi-child). body.ih-a11y is set in functions.php on pilot blogs. */
body.ih-a11y a:focus-visible,
body.ih-a11y .et_pb_button:focus-visible,
body.ih-a11y .mobile_menu_bar:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Sub-menu toggle (DEC-042). The button carries Divi's down arrow in place of the link's own, and opens the sub-menu while aria-expanded is true. */
body.ih-a11y #top-menu .menu-item-has-children > a:first-child {
	display: inline-block;
	padding-right: 0;
}
body.ih-a11y #top-menu .sub-toggle {
	vertical-align: top;
}
body.ih-a11y #top-menu .menu-item-has-children > a:first-child:after {
	display: none;
}
body.ih-a11y .sub-toggle {
	-webkit-appearance: none;
	appearance: none;
	background: none;
	border: 0;
	margin: 0 0 0 2px;
	padding: 0;
	width: 20px;
	height: 20px;
	color: inherit;
	font: inherit;
	line-height: 1;
	vertical-align: middle;
	cursor: pointer;
}
body.ih-a11y .sub-toggle:before {
	content: "3";
	font-family: ETmodules;
	font-size: 16px;
}
body.ih-a11y .sub-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}
body.ih-a11y #top-menu .sub-toggle[aria-expanded="true"] + .sub-menu {
	visibility: visible;
	opacity: 1;
}
/* Divi shows nested items open in the mobile menu, so the toggle is not needed there. */
body.ih-a11y .et_mobile_menu .sub-toggle {
	display: none;
}

/* Link contrast (crew-coord unm59j1o, 8z1pz5h1): Divi's default #2ea3f2 is 2.9:1 on white. Same selectors as Divi's
 * default rules with :where() so specificity is unchanged and only the default is replaced; set colours still win. */
:where(body.ih-a11y) a,
:where(body.ih-a11y) .nav-single a,
:where(body.ih-a11y) .posted_in a,
:where(body.ih-a11y) .comment-reply-link,
:where(body.ih-a11y) #top-menu li.current-menu-item > a,
:where(body.ih-a11y) #top-menu li.current-menu-ancestor > a,
:where(body.ih-a11y) .et_pb_bg_layout_light.et_pb_module.et_pb_button,
:where(body.ih-a11y) .et_pb_bg_layout_light .et_pb_more_button,
:where(body.ih-a11y) .tagged_as a,
:where(body.ih-a11y) .et_pb_contact_submit,
:where(body.ih-a11y) .et_pb_bg_layout_light .et_pb_newsletter_button,
:where(body.ih-a11y) .et_pb_bg_layout_light_tablet .et_pb_newsletter_button,
:where(body.ih-a11y) .et_pb_bg_layout_light_phone .et_pb_newsletter_button,
:where(body.ih-a11y) .et_password_protected_form .et_submit_button,
:where(body.ih-a11y) .form-submit .et_pb_button,
:where(body.ih-a11y) .et_pb_contact p input[type=checkbox]:checked + label i:before {
	color: #237cb8;
}
/* WCAG 1.4.1: underline links in body text (paragraphs and list items); not menus, titles, post meta, buttons or image links. */
body.ih-a11y :is(.et_pb_text, .entry-content, .et_pb_post_content) :is(p, li):not(.post-meta) a:not(.et_pb_button):not(.wp-block-button__link):not(.more-link):not(:has(img)) {
	text-decoration: underline !important;
}
/* Divi's search widget button is #666 on #ddd, 4.23:1 (crew-coord s1u56f6p). Divi's selector has an element and an ID, so this one is not :where()-wrapped. */
body.ih-a11y .widget_search input#searchsubmit,
body.ih-a11y .et_pb_widget .wp-block-search__button {
	color: #616161;
}
