/* ---------------------------------------------------------------------------
 * Cookie consent banner.
 *
 * Bottom-left card on desktop, full-width sheet on phones. Accept and reject
 * are the same size and weight - a reject button that is harder to find than
 * accept is not valid consent.
 * ------------------------------------------------------------------------- */

.cookie-consent {
	position: fixed;
	z-index: 9000;
	left: 1rem;
	right: auto;
	bottom: 1rem;
	width: min(30rem, calc(100vw - 2rem));
}

.cookie-consent__card {
	padding: var(--space-5);
	color: var(--color-dark);
	background-color: var(--color-white);
	border-radius: 0.625rem;
	box-shadow: 0 1rem 2.5rem rgb(2 4 38 / 0.18);

	opacity: 0;
	transform: translateY(0.75rem);
	transition: opacity 0.4s ease-out, transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.cookie-consent.is-open .cookie-consent__card {
	opacity: 1;
	transform: none;
}

.cookie-consent__title {
	margin: 0 0 var(--space-2);
	font-family: "Gotham", sans-serif;
	font-weight: 450;
	font-size: var(--text-md);
	line-height: 1.2;
	color: var(--color-secondary);
}

.cookie-consent__text {
	margin: 0;
	font-size: var(--text-sm);
	line-height: 1.5;
}

.cookie-consent__link {
	color: var(--color-secondary);
	text-decoration: underline;
	text-decoration-color: var(--color-primary);
	text-underline-offset: 0.2em;
}

.cookie-consent__options {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
	margin-top: var(--space-4);
	padding-top: var(--space-4);
	border-top: 1px solid rgb(2 4 38 / 0.12);
}

.cookie-consent__option {
	display: flex;
	align-items: flex-start;
	gap: var(--space-2);
	font-size: var(--text-sm);
	line-height: 1.4;
	cursor: pointer;
}

.cookie-consent__option input {
	flex: 0 0 auto;
	width: 1.1rem;
	height: 1.1rem;
	margin-top: 0.15em;
	accent-color: var(--color-primary);
}

.cookie-consent__option input:disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

.cookie-consent__option strong {
	display: block;
	font-weight: 450;
	color: var(--color-secondary);
}

.cookie-consent__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2);
	margin-top: var(--space-4);
}

.cookie-consent .cookie-consent__btn {
	flex: 1 1 auto;
	padding: 0.6875rem 1.25rem;
	font-family: "Gotham", sans-serif;
	font-weight: 450;
	font-size: var(--text-sm);
	line-height: 1.2;
	text-align: center;
	border: 2px solid transparent;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.2s ease-out, color 0.2s ease-out;
}

.cookie-consent .cookie-consent__btn--accept {
	color: var(--color-white);
	background-color: var(--color-primary);
}

.cookie-consent .cookie-consent__btn--reject,
.cookie-consent .cookie-consent__btn--save {
	color: var(--color-secondary);
	background-color: transparent;
	border-color: var(--color-secondary);
}

@media (hover: hover) {
	.cookie-consent .cookie-consent__btn--accept:hover { background-color: var(--color-secondary); }
	.cookie-consent .cookie-consent__btn--reject:hover,
	.cookie-consent .cookie-consent__btn--save:hover {
		color: var(--color-white);
		background-color: var(--color-secondary);
	}
}

.cookie-consent .cookie-consent__settings {
	flex: 0 0 auto;
	padding: 0.6875rem 0.5rem;
	font-size: var(--text-sm);
	color: var(--color-dark);
	background: none;
	border: 0;
	text-decoration: underline;
	text-underline-offset: 0.2em;
	cursor: pointer;
}

.cookie-consent button:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: 2px;
}

@media screen and (max-width: 560px) {
	.cookie-consent {
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
	}

	.cookie-consent__card {
		padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom, 0px));
		border-radius: 0.625rem 0.625rem 0 0;
	}

	.cookie-consent .cookie-consent__btn { flex: 1 1 100%; }
	.cookie-consent .cookie-consent__settings { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.cookie-consent__card { transition: none; }
}
