/* Cookie consent banner. Same tokens as the rest of the theme. */

.consent {
	position: fixed;
	z-index: 1000;
	inset-block-end: clamp(12px, 3vw, 24px);
	inset-inline-start: clamp(12px, 3vw, 24px);
	width: min(430px, calc(100vw - 24px));
}

.consent[hidden] {
	display: none;
}

.consent__card {
	box-sizing: border-box;
	padding: 26px 28px 28px;
	border: 1.5px solid rgb(58 58 54 / 10%);
	border-radius: 28px;
	background: var(--sr-cream);
	box-shadow: 0 18px 48px rgb(58 58 54 / 16%);
}

.consent__title {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 900;
	letter-spacing: -0.012em;
}

.consent__text {
	margin: 0;
	font-size: 14.5px;
	line-height: 1.6;
	color: rgb(58 58 54 / 84%);
}

.consent__text a {
	color: #00857c;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.consent__text a:hover {
	text-decoration-thickness: 2px;
}

/* ------------------------------------------------------------ preferences */

.consent__panel {
	margin-top: 18px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.consent__panel[hidden] {
	display: none;
}

.consent__option {
	padding: 14px 16px;
	border: 1.5px solid rgb(58 58 54 / 10%);
	border-radius: 18px;
	background: var(--sr-white);
}

.consent__optionhead {
	display: flex;
	gap: 1rem;
	align-items: center;
	justify-content: space-between;
}

.consent__optionname {
	font-size: 15px;
	font-weight: 800;
	cursor: pointer;
}

.consent__always {
	font-size: 12.5px;
	font-weight: 800;
	color: #00857c;
}

.consent__optiontext {
	margin: 6px 0 0;
	font-size: 13.5px;
	line-height: 1.55;
	color: rgb(58 58 54 / 72%);
}

/* A checkbox drawn as the theme's switch. */
.consent__toggle {
	flex: 0 0 auto;
	appearance: none;
	position: relative;
	width: 42px;
	height: 24px;
	margin: 0;
	border: 0;
	border-radius: 999px;
	background: rgb(58 58 54 / 28%);
	cursor: pointer;
	transition: background-color 140ms ease;
}

.consent__toggle::after {
	content: "";
	position: absolute;
	inset-block-start: 3px;
	inset-inline-start: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--sr-cream);
	transition: translate 140ms ease;
}

.consent__toggle:checked {
	background: var(--sr-teal);
}

.consent__toggle:checked::after {
	translate: 18px 0;
}

.consent__toggle:focus-visible {
	outline: 3px solid var(--sr-charcoal);
	outline-offset: 3px;
}

/* ---------------------------------------------------------------- actions */

.consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 18px;
}

.consent__btn {
	flex: 1 1 auto;
	min-height: 44px;
	padding-inline: 1.25rem;
	font-size: 15px;
}

.consent__btn[hidden] {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.consent__toggle,
	.consent__toggle::after {
		transition: none;
	}
}

@media (max-width: 576px) {
	.consent {
		inset-inline: 12px;
		width: auto;
	}

	.consent__card {
		border-radius: 22px;
		padding: 22px 20px 24px;
	}
}
