/* AWS Consent presentation belongs exclusively to the site theme. */

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

.c-aws-consent {
	background: var(--wp--preset--color--text);
	border: 1px solid var(--wp--preset--color--text-muted);
	border-radius: var(--wp--custom--radius--medium);
	bottom: clamp(1rem, 4vw, 3rem);
	box-shadow: var(--psk-shadow-soft);
	color: var(--wp--preset--color--surface);
	font-family: var(--wp--preset--font-family--sans);
	left: auto;
	margin: 0;
	max-height: calc(100vh - 2rem);
	overflow: auto;
	padding: 1rem;
	position: fixed;
	right: clamp(1rem, 4vw, 4rem);
	width: min(27rem, calc(100vw - 2rem));
	z-index: 99998;
}

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

.c-aws-consent__title {
	align-items: center;
	color: inherit;
	display: flex;
	font-size: var(--wp--preset--font-size--lead);
	font-weight: 700;
	gap: 0.625rem;
	line-height: 1.2;
	margin: 0 0 var(--wp--preset--spacing--20);
}

.c-aws-consent__title::before {
	background-color: var(--wp--preset--color--brand-secondary);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f2f2f2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5Z'/%3E%3Cpath d='M8.5 8.5v.01M12 12v.01M16 15.5v.01M11 17v.01M7 14v.01'/%3E%3C/svg%3E");
	background-position: center;
	background-repeat: no-repeat;
	background-size: 1.125rem;
	border: 1px solid var(--wp--preset--color--accent);
	border-radius: 999px;
	content: "";
	flex: 0 0 1.75rem;
	height: 1.75rem;
}

.c-aws-consent__description {
	color: var(--wp--preset--color--text-disabled);
	font-size: 0.75rem;
	line-height: 1.6;
	margin: 0 0 0 2.375rem;
}

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

.c-aws-consent__actions,
.c-aws-consent__preference-actions {
	display: grid;
	gap: 0.5rem;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin-top: 1rem;
}

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

.c-aws-consent__button {
	align-items: center;
	background: color-mix(in srgb, var(--wp--preset--color--text-muted) 62%, var(--wp--preset--color--brand-secondary));
	border: 0;
	border-radius: var(--wp--custom--radius--small);
	box-shadow: none;
	color: var(--wp--preset--color--surface);
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-size: 0.6875rem;
	font-weight: 700;
	justify-content: center;
	line-height: 1.25;
	margin: 0;
	min-height: 2.75rem;
	min-width: 0;
	padding: 0.25rem 0.4rem;
	text-align: center;
	text-decoration: none;
	transition: background-color var(--psk-transition), color var(--psk-transition);
	white-space: nowrap;
	width: 100%;
}

.c-aws-consent__button--secondary {
	background: color-mix(in srgb, var(--wp--preset--color--text-muted) 62%, var(--wp--preset--color--brand-secondary));
	color: var(--wp--preset--color--surface);
}

.c-aws-consent__button[data-aws-consent-all] {
	background: var(--wp--preset--color--action-danger);
	color: var(--wp--preset--color--surface);
}

.c-aws-consent__button:hover,
.c-aws-consent__button--secondary:hover {
	background: color-mix(in srgb, var(--wp--preset--color--text-muted) 48%, var(--wp--preset--color--brand-secondary));
	color: var(--wp--preset--color--surface);
}

.c-aws-consent__button[data-aws-consent-all]:hover {
	background: color-mix(in srgb, var(--wp--preset--color--action-danger) 84%, var(--wp--preset--color--brand-secondary));
}

.c-aws-consent :is(button, a, input):focus-visible,
.c-aws-consent-reopen:focus-visible {
	outline: 3px solid var(--wp--preset--color--surface-soft);
	outline-offset: 3px;
}

.c-aws-consent__preferences {
	display: grid;
	gap: var(--wp--preset--spacing--20);
	margin-top: var(--wp--preset--spacing--30);
}

.c-aws-consent__category {
	align-items: start;
	border: 1px solid var(--wp--preset--color--text-muted);
	border-radius: var(--wp--custom--radius--small);
	color: var(--wp--preset--color--surface);
	cursor: pointer;
	display: grid;
	gap: var(--wp--preset--spacing--20);
	grid-template-columns: 1.25rem minmax(0, 1fr);
	margin: 0;
	padding: var(--wp--preset--spacing--30);
}

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

.c-aws-consent__category input {
	accent-color: var(--wp--preset--color--surface-soft);
	height: 1.1rem;
	margin: 0.1rem 0 0;
	width: 1.1rem;
}

.c-aws-consent__category strong,
.c-aws-consent__category small {
	display: block;
}

.c-aws-consent__category strong {
	font-size: var(--wp--preset--font-size--eyebrow);
}

.c-aws-consent__category small {
	color: var(--wp--preset--color--text-disabled);
	font-size: 0.75rem;
	line-height: 1.45;
	margin-top: 0.15rem;
}

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

.c-aws-consent-reopen {
	align-items: center;
	background: var(--wp--preset--color--brand-secondary);
	border: 1px solid var(--wp--preset--color--accent);
	border-radius: 999px;
	bottom: 1rem;
	box-shadow: var(--psk-shadow-card);
	color: var(--wp--preset--color--surface-soft);
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	height: 2.75rem;
	justify-content: center;
	left: 1rem;
	margin: 0;
	min-height: 2.75rem;
	padding: 0;
	position: fixed;
	transition: background-color var(--psk-transition), border-color var(--psk-transition), color var(--psk-transition);
	width: 2.75rem;
	z-index: 99997;
}

.c-aws-consent-reopen::before {
	background: currentcolor;
	content: "";
	height: 1.375rem;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5Z'/%3E%3Cpath d='M8.5 8.5v.01M12 12v.01M16 15.5v.01M11 17v.01M7 14v.01'/%3E%3C/svg%3E") center / contain no-repeat;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5Z'/%3E%3Cpath d='M8.5 8.5v.01M12 12v.01M16 15.5v.01M11 17v.01M7 14v.01'/%3E%3C/svg%3E") center / contain no-repeat;
	width: 1.375rem;
}

.c-aws-consent-reopen span {
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.c-aws-consent-reopen:hover {
	background: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--surface-soft);
	color: var(--wp--preset--color--surface);
}

.c-aws-consent-noscript {
	background: var(--wp--preset--color--text);
	border-top: 2px solid var(--wp--preset--color--accent);
	bottom: 0;
	color: var(--wp--preset--color--surface);
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--eyebrow);
	left: 0;
	margin: 0;
	padding: var(--wp--preset--spacing--30);
	position: fixed;
	right: 0;
	z-index: 99999;
}

/* Keep privacy settings available without covering mobile forms or dialogs. */
@media (max-width: 1024px) {
	.c-aws-consent-reopen {
		border-radius: var(--wp--custom--radius--small);
		gap: 0.5rem;
		margin: 1rem;
		padding: 0.5rem 0.75rem;
		position: static;
		width: auto;
		z-index: auto;
	}

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

@media (max-width: 781px) {
	.c-aws-consent {
		bottom: 12px;
		left: 50%;
		max-height: calc(100svh - 1.5rem);
		padding: 14px;
		right: auto;
		transform: translateX(-50%);
		width: min(30rem, calc(100vw - 24px));
	}

	.c-aws-consent__title {
		font-size: 15px;
		margin-bottom: 0.25rem;
	}

	.c-aws-consent__title::before {
		background-size: 0.95rem;
		flex-basis: 1.5rem;
		height: 1.5rem;
	}

	.c-aws-consent__description {
		font-size: 13px;
		line-height: 1.45;
		margin: 8px 0 0;
	}

	.c-aws-consent__actions {
		gap: 6px;
		grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 1.2fr);
		margin-top: 0.5rem;
	}

	.c-aws-consent__preference-actions {
		gap: 0.5rem;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		margin-top: 0.75rem;
	}

	.c-aws-consent__button {
		font-size: 11px;
		line-height: 1.3;
		min-height: 2.75rem;
		padding: 6px 4px;
		white-space: normal;
		overflow-wrap: anywhere;
	}

	.c-aws-consent__preferences {
		gap: 0.5rem;
		margin-top: 0.75rem;
	}

	.c-aws-consent__category {
		gap: 0.5rem;
		padding: 0.75rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.c-aws-consent__button,
	.c-aws-consent-reopen {
		transition-duration: 0.01ms;
	}
}
