/**
 * Cookie consent controls.
 *
 * The banner sits at the bottom and does not cover the page. A consent
 * request that blocks reading until it is answered pressures the answer, and
 * an answer given to get rid of something is not a decision.
 *
 * Accept and Reject share one class and differ in nothing. If a future change
 * makes one of them louder than the other, that is the bug.
 */

.jt-cookies {
	--jt-cookies-gap: 0.75rem;

	color: var(--wp--preset--color--jt-text, #f0e9df);
	background: var(--wp--preset--color--jt-surface, #211c17);
	border: 1px solid var(--wp--preset--color--jt-line, #453b31);
	border-radius: 0.5rem;
	padding: 1rem 1.25rem;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.jt-cookies--banner {
	position: fixed;
	inset-inline: 0.75rem;
	inset-block-end: 0.75rem;
	z-index: 9998;
	max-width: 44rem;
	margin-inline: auto;
	box-shadow: 0 0.5rem 2rem rgb(0 0 0 / 45%);
}

/* Below the quick-exit control, which must never be obscured. */
@media (max-width: 30rem) {
	.jt-cookies--banner {
		max-height: 70vh;
		overflow-y: auto;
	}
}

.jt-cookies__title {
	margin: 0 0 0.35rem;
	font-size: 1rem;
	line-height: 1.3;
}

.jt-cookies__intro {
	margin: 0 0 var(--jt-cookies-gap);
}

.jt-cookies__detail {
	margin-block-end: var(--jt-cookies-gap);
	border-block-start: 1px solid var(--wp--preset--color--jt-line, #453b31);
	padding-block-start: var(--jt-cookies-gap);
}

.jt-cookies__detail summary {
	cursor: pointer;
	padding-block: 0.25rem;
}

.jt-cookies__list {
	margin: var(--jt-cookies-gap) 0 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: var(--jt-cookies-gap);
}

.jt-cookies__label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 600;
}

.jt-cookies__description {
	margin: 0.15rem 0 0 1.6rem;
	color: var(--wp--preset--color--jt-muted, #b0a494);
	font-size: 0.875rem;
}

.jt-cookies__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--jt-cookies-gap);
}

.jt-cookies__button {
	flex: 1 1 10rem;
	padding: 0.55rem 1rem;
	font: inherit;
	font-weight: 600;
	color: var(--wp--preset--color--jt-text, #f0e9df);
	background: var(--wp--preset--color--jt-raised, #2c251e);
	border: 1px solid var(--wp--preset--color--jt-line, #453b31);
	border-radius: 0.35rem;
	cursor: pointer;
}

.jt-cookies__button:hover {
	border-color: var(--wp--preset--color--jt-copper, #d08a55);
}

.jt-cookies__button:focus-visible {
	outline: 2px solid var(--wp--preset--color--jt-copper, #d08a55);
	outline-offset: 2px;
}

.jt-cookies__button--quiet {
	flex: 0 0 auto;
	margin-block-start: var(--jt-cookies-gap);
	font-weight: 400;
}

/* A checkbox that cannot be changed still has to read as "on, and fixed". */
.jt-cookies__label input:disabled {
	opacity: 1;
	cursor: not-allowed;
}

@media (prefers-reduced-motion: no-preference) {
	.jt-cookies--banner {
		animation: jt-cookies-in 160ms ease-out;
	}
}

@keyframes jt-cookies-in {
	from {
		transform: translateY(0.5rem);
		opacity: 0;
	}
}
