/**
 * IDCWF Accessibility - front-end styles.
 *
 * Every rule is scoped by a body class that the plugin adds only while the
 * matching fixer is enabled (idcwf-a11y--{fixer}).
 */

/* Screen reader text (icon labels, PDF hints). */
.idcwf-a11y--icons .screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

/* ---- Contrast ---------------------------------------------------------- */

/* The "online form" fallback link shown before Wufoo loads sits on a light gray background. */
.idcwf-a11y--colors [id^="wufoo-"] a {
	color: #00688d;
	text-decoration: underline;
}

/* ---- Headings ---------------------------------------------------------- */

/*
 * A heading re-levelled by the plugin keeps the size it had. Low specificity
 * on purpose: a module's own per-level settings (copied to the new level) win.
 */
:where(.idcwf-a11y--headings) .idcwf-a11y-from-h3 {
	font-size: 25px;
}

:where(.idcwf-a11y--headings) .idcwf-a11y-from-h4 {
	font-size: 21px;
}

/* Address, phone and fax lines that were headings are now paragraphs; keep the heading's spacing. */
.idcwf-a11y--headings .et_pb_text_inner .idcwf-a11y-line {
	margin: 0;
	padding-bottom: 10px;
}

/* ---- Keyboard ---------------------------------------------------------- */

.idcwf-a11y-skip {
	background: #1a1a1a;
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	left: -9999px;
	line-height: 1.4;
	padding: 12px 20px;
	position: absolute;
	text-decoration: none;
	top: 0;
	z-index: 1000000;
}

.idcwf-a11y-skip:focus {
	left: 8px;
	top: 8px;
}

/* Divi removes every focus outline; restore a two-tone ring that is visible on light and dark backgrounds. */
.idcwf-a11y--keyboard :focus-visible {
	box-shadow: 0 0 0 2px #fff;
	outline: 3px solid #1a1a1a !important;
	outline-offset: 2px;
}

.idcwf-a11y--keyboard .idcwf-a11y-skip:focus-visible {
	outline-color: #fff !important;
	box-shadow: none;
}

/* Open dropdowns while any link inside the item has focus, as hover already does. */
.idcwf-a11y--keyboard .nav li:focus-within > ul {
	opacity: 1;
	visibility: visible;
}

/* Escape closes the dropdown even though focus is still inside it. */
.idcwf-a11y--keyboard .nav li.idcwf-menu-closed > ul {
	opacity: 0 !important;
	visibility: hidden !important;
}

/* Clickable Divi modules (phone numbers) are now focusable. */
.idcwf-a11y--keyboard .et_clickable {
	cursor: pointer;
}
