/* Theme-owned presentation for the optional AWS Consent DOM contract. */
/* stylelint-disable selector-class-pattern -- External AWS Consent BEM selectors. */

body .c-aws-consent,
body .c-aws-consent *,
body .c-aws-consent-reopen,
body .c-aws-consent-noscript {
	box-sizing: border-box;
}

body .c-aws-consent {
	background: var(--wp--custom--aws--color--body-background, var(--wp--preset--color--canvas));
	border: 1px solid var(--wp--custom--aws--color--border, var(--wp--preset--color--line));
	border-radius: 12px;
	bottom: max(12px, env(safe-area-inset-bottom));
	box-shadow: var(--wp--custom--aws--shadow, none);
	color: var(--wp--custom--aws--color--body-text, var(--wp--preset--color--ink));
	font-family: var(--wp--preset--font-family--sans, sans-serif);
	left: auto;
	margin: 0;
	max-height: calc(100vh - 24px);
	max-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
	overflow: auto;
	padding: 12px;
	position: fixed;
	right: max(12px, env(safe-area-inset-right));
	transform: none;
	width: min(27rem, calc(100% - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)));
	z-index: 99998;
}

body .c-aws-consent[hidden],
body .c-aws-consent-reopen[hidden],
body .c-aws-consent [hidden] {
	display: none;
}

body .c-aws-consent .c-aws-consent__title {
	color: var(--wp--custom--aws--color--heading-text, var(--wp--preset--color--ink));
	display: block;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: normal;
	line-height: 1.3;
	margin: 0 0 6px;
	padding: 0;
}

body .c-aws-consent__title::before {
	content: none;
}

body .c-aws-consent .c-aws-consent__description {
	color: var(--wp--custom--aws--color--muted-text, var(--wp--preset--color--slate));
	font-size: 0.8125rem;
	line-height: 1.45;
	margin: 0;
	padding: 0;
}

body .c-aws-consent-noscript a,
body .c-aws-consent .c-aws-consent__description a {
	color: var(--wp--custom--aws--color--link-text, var(--wp--preset--color--ink));
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

body .c-aws-consent-noscript a:hover,
body .c-aws-consent .c-aws-consent__description a:hover {
	color: var(--wp--custom--aws--color--link-hover, var(--wp--preset--color--slate));
}

body .c-aws-consent__actions,
body .c-aws-consent__preference-actions {
	display: grid;
	gap: 6px;
	grid-template-columns: 1.2fr 0.8fr 1fr;
	margin-top: 10px;
}

body .c-aws-consent__preference-actions {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

body .c-aws-consent .c-aws-consent__button {
	align-items: center;
	background: var(--wp--custom--aws--color--section-background, var(--wp--preset--color--surface));
	border: 1px solid var(--wp--custom--aws--color--border, var(--wp--preset--color--line));
	border-radius: 6px;
	box-shadow: none;
	color: var(--wp--custom--aws--color--section-text, var(--wp--preset--color--ink));
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-size: 0.75rem;
	font-weight: 600;
	grid-column: auto;
	justify-content: center;
	line-height: 1.25;
	margin: 0;
	min-height: 44px;
	min-width: 0;
	overflow-wrap: anywhere;
	padding: 6px;
	text-align: center;
	text-decoration: none;
	white-space: normal;
	width: 100%;
}

body .c-aws-consent .c-aws-consent__button:hover {
	background: var(--wp--custom--aws--color--body-background, var(--wp--preset--color--canvas));
	border-color: var(--wp--custom--aws--color--body-text, var(--wp--preset--color--ink));
	color: var(--wp--custom--aws--color--body-text, var(--wp--preset--color--ink));
}

body .c-aws-consent .c-aws-consent__button[data-aws-consent-all] {
	background: var(--wp--custom--aws--color--button-background, var(--wp--preset--color--accent));
	border-color: var(--wp--custom--aws--color--button-border, var(--wp--preset--color--accent));
	color: var(--wp--custom--aws--color--button-text, var(--wp--preset--color--canvas));
	grid-column: auto;
}

body .c-aws-consent .c-aws-consent__button[data-aws-consent-all]:hover {
	background: var(--wp--custom--aws--color--button-hover-background, var(--wp--preset--color--accent-dark));
	border-color: var(--wp--custom--aws--color--button-hover-border, var(--wp--preset--color--accent-dark));
	color: var(--wp--custom--aws--color--button-hover-text, var(--wp--preset--color--canvas));
}

body .c-aws-consent__preferences {
	display: grid;
	gap: 6px;
	margin-top: 10px;
}

body .c-aws-consent__category {
	align-items: start;
	background: var(--wp--custom--aws--color--field-background, var(--wp--preset--color--canvas));
	border: 1px solid var(--wp--custom--aws--color--field-border, var(--wp--preset--color--line));
	border-radius: 6px;
	color: var(--wp--custom--aws--color--field-text, var(--wp--preset--color--ink));
	cursor: pointer;
	display: grid;
	gap: 8px;
	grid-template-columns: 20px minmax(0, 1fr);
	margin: 0;
	min-height: 44px;
	padding: 10px;
}

body .c-aws-consent__category:has(input:disabled) {
	cursor: default;
}

body .c-aws-consent__category input {
	accent-color: var(--wp--custom--aws--color--button-background, var(--wp--preset--color--accent));
	height: 20px;
	margin: 0;
	width: 20px;
}

body .c-aws-consent__category strong,
body .c-aws-consent__category small {
	display: block;
	font-size: 0.8125rem;
	line-height: 1.4;
}

body .c-aws-consent__category small {
	color: var(--wp--custom--aws--color--muted-text, var(--wp--preset--color--slate));
	margin-top: 2px;
}

body .c-aws-consent__status {
	font-size: 0.8125rem;
	margin: 6px 0 0;
}

body .c-aws-consent__status:empty {
	display: none;
}

body .c-aws-consent-reopen {
	background: var(--wp--custom--aws--color--body-background, var(--wp--preset--color--canvas));
	border: 1px solid var(--wp--custom--aws--color--border, var(--wp--preset--color--line));
	border-radius: 6px;
	bottom: max(12px, env(safe-area-inset-bottom));
	color: var(--wp--custom--aws--color--body-text, var(--wp--preset--color--ink));
	cursor: pointer;
	font: inherit;
	font-size: 0.75rem;
	height: auto;
	left: max(12px, env(safe-area-inset-left));
	margin: 0;
	min-height: 44px;
	padding: 8px 12px;
	position: fixed;
	width: auto;
	z-index: 99997;
}

body .c-aws-consent-reopen::before {
	content: none;
}

body .c-aws-consent-reopen span {
	clip-path: none;
	height: auto;
	position: static;
	white-space: normal;
	width: auto;
}

body .c-aws-consent-reopen:hover {
	background: var(--wp--custom--aws--color--section-background, var(--wp--preset--color--surface));
	border-color: var(--wp--custom--aws--color--border, var(--wp--preset--color--line));
	color: var(--wp--custom--aws--color--section-text, var(--wp--preset--color--ink));
}

body .c-aws-consent :is(button, a, input):focus-visible,
body .c-aws-consent-reopen:focus-visible {
	outline: 2px solid var(--wp--custom--aws--color--focus, var(--wp--preset--color--accent));
	outline-offset: 2px;
}

body .c-aws-consent-noscript {
	border-color: var(--wp--custom--aws--color--border, var(--wp--preset--color--line));
	background: var(--wp--custom--aws--color--body-background, var(--wp--preset--color--canvas));
	color: var(--wp--custom--aws--color--body-text, var(--wp--preset--color--ink));
	font-size: 0.8125rem;
	line-height: 1.45;
	margin: 0;
	padding: 12px;
}

@media (min-width: 48rem) {

	body .c-aws-consent {
		padding: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {

	body .c-aws-consent *,
	body .c-aws-consent-reopen {
		transition: none;
	}
}
