/*
 * Layout support for the native Divi 4 contact, legal and registration pages.
 * Colors, backgrounds, type sizes, borders and module spacing belong to the
 * module's normal Divi settings, not to fixed theme overrides.
 */

:where(.lio-dv-contact-section, .lio-dv-legal-section,
	.lio-dv-registration-section, .lio-dv-registrations-section) *,
:where(.lio-dv-contact-section, .lio-dv-legal-section,
	.lio-dv-registration-section, .lio-dv-registrations-section) *::before,
:where(.lio-dv-contact-section, .lio-dv-legal-section,
	.lio-dv-registration-section, .lio-dv-registrations-section) *::after {
	box-sizing: border-box;
}

:where(.lio-dv-contact-layout, .lio-dv-contact-layout .et_pb_column,
	.lio-dv-contact-layout .et_pb_module, .lio-dv-legal-text,
	.lio-dv-registration-form, .lio-dv-registrations-table) {
	min-width: 0;
}

:where(.lio-dv-contact-copy, .lio-dv-contact-direct,
	.lio-dv-contact-card, .lio-dv-legal-text) .et_pb_text_inner {
	overflow-wrap: anywhere;
}

/* Keep the two familiar contact actions next to each other when space allows. */
.lio-dv-contact-button.et_pb_button_module_wrapper,
.et_pb_button_module_wrapper:has(> .lio-dv-contact-button) {
	display: inline-block;
	vertical-align: middle;
}

:where(.lio-dv-contact-details-grid) {
	display: grid;
	grid-template-columns: minmax(0, auto) minmax(0, 1fr);
	gap: 8px 16px;
	align-items: baseline;
}

:where(.lio-dv-contact-details-grid) > p {
	padding: 0;
	margin: 0;
}

:where(.lio-dv-contact-detail-label, .lio-dv-contact-detail-value a,
	.lio-dv-contact-address, .lio-dv-contact-person-address,
	.lio-dv-contact-person-role) {
	overflow-wrap: anywhere;
}

:where(.lio-dv-contact-card) h2 {
	margin-bottom: 18px;
}

:where(.lio-dv-contact-address) strong {
	display: block;
}

:where(.lio-dv-contact-card-link) a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

:where(.lio-dv-contact-card-link) a::after {
	content: "→";
}

:where(.lio-dv-contact-person-entry) {
	display: grid;
	gap: 4px;
}

:where(.lio-dv-contact-person-entry) > p {
	padding-bottom: 0;
}

:where(.lio-dv-contact-person-links) {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 12px;
}

:where(.lio-dv-contact-person-links) a {
	display: inline-flex;
	align-items: center;
	min-height: 30px;
}

:where(.lio-dv-contact-person-separator) {
	width: 100%;
	margin: 24px 0;
	border: 0;
	border-top: 1px solid currentColor;
	opacity: 0.2;
}

:where(.lio-dv-legal-text) :is(ul, ol) {
	padding-inline-start: 1.5em;
}

:where(.lio-dv-legal-text) li + li {
	margin-top: 0.65em;
}

/* The actual form remains a working shortcode inside a normal Divi module. */
:where(.lio-dv-registration-form) .lio-registration {
	width: 100%;
	max-width: 980px;
	padding: 0;
	margin: 0;
	color: inherit;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

:where(.lio-dv-registration-form) .lio-registration__field label {
	color: inherit;
}

:where(.lio-dv-registration-form) .lio-registration__field {
	min-width: 0;
}

:where(.lio-dv-registration-form) :is(input, textarea) {
	max-width: 100%;
}

:where(.lio-dv-registrations-table) .wp-block-table {
	width: 100%;
	max-width: 100%;
	margin: 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

:where(.lio-dv-registrations-table) table {
	width: 100%;
	border-collapse: collapse;
}

:where(.lio-dv-registrations-table) :is(th, td) {
	text-align: start;
	vertical-align: top;
}

@media (max-width: 980px) {
	/* Divi's own column stacking and responsive settings remain authoritative. */
	:where(.lio-dv-contact-side) {
		clear: both;
	}
}

@media (max-width: 600px) {
	:where(.lio-dv-contact-details-grid) {
		grid-template-columns: minmax(0, 1fr);
		gap: 4px;
	}

	:where(.lio-dv-contact-detail-value) + .lio-dv-contact-detail-label {
		margin-top: 14px;
	}

	:where(.lio-dv-registrations-table) table {
		min-width: 540px;
	}
}
