/*
 * The Default consent banner.
 *
 * THE BAR: light, across the whole foot of the page, over it, never pushing
 * it — its words in a column of their own, the buttons to their right on a
 * wide screen, under them on a narrow one.
 *
 * THE WINDOW (`<dialog>`, opened modal by Analytics' script): tabs Consent,
 * Details, About, the body scrolling between its head and its buttons.
 *
 * Its font is the theme's; its colours are its own, so it reads the same on
 * any page behind it.
 */

/*
 * Over everything a page floats — a chat button included (2147483000) — while
 * it waits for an answer; under the Templates preview's own bar. The window
 * is in the browser's top layer, over everything anyway.
 */
.ax-consent {
	position: fixed;
	z-index: 2147483100;
	inset-inline: 0;
	bottom: 0;
}

.ax-consent[hidden] {
	display: none;
}

/* Edge to edge; what it says kept to a 1200px column in the middle. */
.ax-consent__panel {
	box-sizing: border-box;
	width: 100%;
	max-height: 85vh;
	max-height: 85dvh;
	overflow: auto;
	padding: 20px max(24px, calc((100% - 1200px) / 2));
	padding-bottom: max(20px, env(safe-area-inset-bottom));
	border-top: 1px solid rgb(22 24 29 / 0.12);
	background: #fff;
	color: #1d2026;
	box-shadow: 0 -8px 24px rgb(16 24 40 / 0.12);
	font-size: 15px;
	line-height: 1.5;
}

.ax-consent__panel:focus {
	outline: none;
}

.ax-consent__title {
	margin: 0 0 6px;
	color: inherit;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
}

.ax-consent__text p {
	margin: 0 0 8px;
}

.ax-consent__text p:last-child {
	margin-bottom: 0;
}

.ax-consent__text a,
.ax-consent__policy a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ax-consent__policy:empty {
	display: none;
}

.ax-consent__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 12px 16px;
	margin-top: 14px;
}

.ax-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* Customize and Allow all look the same: one is not easier to press than the other. */
.ax-consent__button {
	min-height: 44px;
	padding: 0 22px;
	border: 1px solid #1d2026;
	border-radius: 6px;
	background: #1d2026;
	color: #fff;
	font: inherit;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
}

.ax-consent__button:hover {
	background: #000;
}

/* Show details: a quiet way into the window. */
.ax-consent__more {
	min-height: 44px;
	padding: 0 4px;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.ax-consent__button:focus-visible,
.ax-consent__more:focus-visible,
.ax-consent-dialog__tab:focus-visible,
.ax-consent-dialog__close:focus-visible,
.ax-consent__switch input:focus-visible + .ax-consent__slider {
	outline: 2px solid #1d2026;
	outline-offset: 2px;
}

/* -- The window ------------------------------------------------------------------- */

.ax-consent-dialog {
	box-sizing: border-box;
	width: min(720px, calc(100% - 32px));
	max-width: none;
	height: fit-content;
	max-height: min(720px, calc(100vh - 32px));
	max-height: min(720px, calc(100dvh - 32px));
	padding: 0;
	border: 1px solid rgb(22 24 29 / 0.12);
	border-radius: 12px;
	background: #fff;
	color: #1d2026;
	box-shadow: 0 24px 48px rgb(16 24 40 / 0.24);
	font-size: 15px;
	line-height: 1.5;
}

.ax-consent-dialog[open] {
	display: flex;
	flex-direction: column;
}

.ax-consent-dialog::backdrop {
	background: rgb(16 24 40 / 0.45);
}

.ax-consent-dialog:focus {
	outline: none;
}

.ax-consent-dialog__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 16px 0 24px;
}

.ax-consent-dialog__title {
	margin: 0;
	color: inherit;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
}

.ax-consent-dialog__close {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: none;
	color: inherit;
	cursor: pointer;
}

.ax-consent-dialog__close:hover {
	background: rgb(22 24 29 / 0.06);
}

.ax-consent-dialog__tabs {
	display: flex;
	gap: 4px;
	margin-top: 8px;
	padding: 0 24px;
	border-bottom: 1px solid rgb(22 24 29 / 0.12);
}

.ax-consent-dialog__tab {
	flex: 1 1 0;
	min-height: 44px;
	margin-bottom: -1px;
	padding: 0 12px;
	border: 0;
	border-bottom: 2px solid transparent;
	background: none;
	color: rgb(29 32 38 / 0.7);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.ax-consent-dialog__tab[aria-selected="true"] {
	border-bottom-color: #1d2026;
	color: #1d2026;
}

.ax-consent-dialog__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	padding: 20px 24px;
}

.ax-consent-dialog__panel[hidden] {
	display: none;
}

.ax-consent-dialog__panel .ax-consent__policy {
	margin: 12px 0 0;
}

.ax-consent-dialog__foot {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
	padding: 16px 24px;
	border-top: 1px solid rgb(22 24 29 / 0.12);
}

/* -- Details: the groups ----------------------------------------------------------- */

.ax-consent__groups {
	display: grid;
}

.ax-consent__group {
	padding: 14px 0;
	border-bottom: 1px solid rgb(22 24 29 / 0.1);
}

.ax-consent__group:first-child {
	padding-top: 0;
}

.ax-consent__group:last-child {
	border-bottom: 0;
}

.ax-consent__group-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.ax-consent__group-title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	color: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}

.ax-consent__count {
	display: inline-grid;
	place-items: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	box-sizing: border-box;
	border-radius: 11px;
	background: rgb(22 24 29 / 0.08);
	font-size: 12px;
	font-weight: 600;
}

.ax-consent__group-text {
	margin: 6px 0 0;
	color: rgb(29 32 38 / 0.8);
	font-size: 14px;
}

/* The toggle: a switch, on in the ink colour, Necessary's fixed on. */
.ax-consent__switch {
	position: relative;
	flex: 0 0 auto;
	width: 44px;
	height: 24px;
	cursor: pointer;
}

.ax-consent__switch input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: inherit;
}

.ax-consent__slider {
	position: absolute;
	inset: 0;
	border-radius: 12px;
	background: rgb(22 24 29 / 0.25);
	transition: background-color 0.15s;
	pointer-events: none;
}

.ax-consent__slider::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 2px rgb(16 24 40 / 0.3);
	transition: transform 0.15s;
}

.ax-consent__switch input:checked + .ax-consent__slider {
	background: #1d2026;
}

.ax-consent__switch input:checked + .ax-consent__slider::before {
	transform: translateX(20px);
}

.ax-consent__switch input:disabled {
	cursor: not-allowed;
}

.ax-consent__switch input:disabled + .ax-consent__slider {
	opacity: 0.55;
}

@media (prefers-reduced-motion: reduce) {
	.ax-consent__slider,
	.ax-consent__slider::before {
		transition: none;
	}
}

/* A group's cookies, folded: "See the cookies" with a plus that turns into a minus. */
.ax-consent__group-cookies {
	margin-top: 8px;
}

.ax-consent__group-cookies summary {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 32px;
	font-size: 14px;
	font-weight: 600;
	list-style: none;
	cursor: pointer;
}

.ax-consent__group-cookies summary::-webkit-details-marker {
	display: none;
}

.ax-consent__group-cookies summary::after {
	content: "+";
	display: inline-grid;
	place-items: center;
	width: 18px;
	height: 18px;
	box-sizing: border-box;
	border: 1px solid currentcolor;
	border-radius: 50%;
	font-size: 13px;
	line-height: 1;
}

.ax-consent__group-cookies[open] summary::after {
	content: "\2212";
}

.ax-consent__group-cookies summary:focus-visible {
	outline: 2px solid #1d2026;
	outline-offset: 2px;
}

/* A group's cookies. */
.ax-consent__cookies {
	width: 100%;
	margin-top: 6px;
	border-collapse: collapse;
	font-size: 13px;
	line-height: 1.4;
}

.ax-consent__cookies th,
.ax-consent__cookies td {
	padding: 6px 8px;
	border-bottom: 1px solid rgb(22 24 29 / 0.1);
	text-align: start;
	vertical-align: top;
}

.ax-consent__cookies th {
	background: rgb(22 24 29 / 0.04);
	font-weight: 600;
}

.ax-consent__cookies code {
	font-size: 12px;
	white-space: nowrap;
}

/* A wide screen: the bar's words on the left, its buttons on the right. */
@media (min-width: 900px) {
	.ax-consent__panel {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		column-gap: 40px;
		align-items: center;
	}

	.ax-consent__panel > :not(.ax-consent__foot) {
		grid-column: 1;
	}

	.ax-consent__foot {
		grid-column: 2;
		grid-row: 1 / span 2;
		flex-wrap: nowrap;
		margin-top: 0;
	}

	.ax-consent__actions {
		flex-wrap: nowrap;
	}
}

@media (max-width: 600px) {
	.ax-consent__panel {
		padding: 16px;
		padding-bottom: max(16px, env(safe-area-inset-bottom));
	}

	/* Customize and Allow all side by side; Show details under them. */
	.ax-consent__foot {
		flex-direction: column-reverse;
		align-items: stretch;
		gap: 4px;
	}

	.ax-consent__actions {
		flex-wrap: nowrap;
	}

	.ax-consent__actions .ax-consent__button {
		flex: 1 1 0;
	}

	.ax-consent-dialog {
		width: calc(100% - 16px);
		max-height: calc(100vh - 16px);
		max-height: calc(100dvh - 16px);
	}

	.ax-consent-dialog__head {
		padding: 12px 8px 0 16px;
	}

	.ax-consent-dialog__tabs,
	.ax-consent-dialog__body {
		padding-inline: 16px;
	}

	.ax-consent-dialog__foot {
		padding: 12px 16px;
		padding-bottom: max(12px, env(safe-area-inset-bottom));
	}

	/* Deny and Allow selection side by side, Allow all under them. */
	.ax-consent-dialog__foot {
		display: grid;
		grid-template-columns: 1fr 1fr;
	}

	.ax-consent-dialog__foot [data-ax-consent="accept"] {
		grid-column: 1 / -1;
	}

	/* A group's cookies, a card a cookie: its name, then what it is for and how long. */
	.ax-consent__cookies thead {
		display: none;
	}

	.ax-consent__cookies,
	.ax-consent__cookies tbody {
		display: block;
	}

	.ax-consent__cookies tr {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 2px 12px;
		padding: 8px 0;
		border-bottom: 1px solid rgb(22 24 29 / 0.1);
	}

	.ax-consent__cookies td {
		padding: 0;
		border: 0;
	}

	.ax-consent__cookies .ax-consent__cookie-kind {
		grid-row: 1;
		grid-column: 2;
		color: rgb(29 32 38 / 0.7);
		text-align: end;
	}

	.ax-consent__cookies .ax-consent__cookie-purpose,
	.ax-consent__cookies .ax-consent__cookie-kept {
		grid-column: 1 / -1;
	}

	.ax-consent__cookies .ax-consent__cookie-kept {
		color: rgb(29 32 38 / 0.7);
	}
}

@media print {
	.ax-consent,
	.ax-consent-dialog {
		display: none;
	}
}
