/**
 * Working Detail Cookies. Colours come from Settings → Cookie Consent as
 * --wdc-bg, --wdc-text, --wdc-accent and --wdc-on-accent (contrast-checked on
 * save). A theme can also set --wdc-font, --wdc-heading-font,
 * --wdc-heading-weight and --wdc-radius.
 */

.wdc,
.wdc *,
.wdc *::before,
.wdc *::after {
	box-sizing: border-box;
}

.wdc[hidden],
.wdc [hidden],
#wdc-spacer[hidden] {
	display: none !important;
}

.wdc {
	--wdc-gap: 1rem;
	--wdc-r: var(--wdc-radius, 0.5rem);
	color: var(--wdc-text, #fff);
	background: var(--wdc-bg, #1d2327);
	font-family: var(--wdc-font, inherit);
	font-size: 1rem;
	line-height: 1.5;
	letter-spacing: normal;
	text-align: left;
}

.wdc p {
	margin: 0 0 0.75rem;
	color: inherit;
	font-size: inherit;
}

.wdc a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.wdc .wdc-title {
	margin: 0 0 0.375rem;
	padding: 0;
	color: inherit;
	font-family: var(--wdc-heading-font, inherit);
	font-size: 1.125rem;
	font-weight: var(--wdc-heading-weight, 700);
	line-height: 1.3;
	text-transform: none;
	letter-spacing: normal;
}

/* Focus: 3px ring in the text colour, which is contrast-checked against the background (SC 2.4.7, 2.4.13). */
.wdc a:focus-visible,
.wdc button:focus-visible,
.wdc input:focus-visible,
.wdc summary:focus-visible,
.wdc-float:focus-visible {
	outline: 3px solid var(--wdc-text, #fff);
	outline-offset: 2px;
	box-shadow: 0 0 0 2px var(--wdc-bg, #1d2327);
}

.wdc-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Buttons: at least 44×44px (SC 2.5.8 asks 24). Accept and Reject share a style (equal prominence). */
.wdc .wdc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0.5rem 1.125rem;
	border: 2px solid var(--wdc-accent, #72aee6);
	border-radius: var(--wdc-r);
	background: var(--wdc-accent, #72aee6);
	color: var(--wdc-on-accent, #1d2327);
	font: inherit;
	font-weight: 600;
	line-height: 1.25;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	cursor: pointer;
	box-shadow: none;
}

.wdc .wdc-btn:hover {
	text-decoration: underline;
}

.wdc .wdc-btn--secondary {
	border-color: var(--wdc-text, #fff);
	background: transparent;
	color: var(--wdc-text, #fff);
}

.wdc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.625rem;
}

/* Banner ---------------------------------------------------------------- */

.wdc-banner {
	position: fixed;
	z-index: 2147483000;
	bottom: 0;
	left: 0;
	right: 0;
	max-height: 80vh;
	overflow-y: auto;
	border-top: 2px solid var(--wdc-text, #fff);
	box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
}

.wdc-banner__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 2rem;
	max-width: 76rem;
	margin: 0 auto;
	padding: 1rem;
}

.wdc-banner__text {
	flex: 1 1 28rem;
}

.wdc-banner__text p {
	margin: 0;
}

.wdc-banner--box {
	left: 1rem;
	right: auto;
	bottom: 1rem;
	width: calc(100% - 2rem);
	max-width: 28rem;
	border: 2px solid var(--wdc-text, #fff);
	border-radius: var(--wdc-r);
}

.wdc-banner--box .wdc-banner__text {
	flex-basis: 100%;
}

@media (max-width: 36rem) {
	.wdc-banner .wdc-actions .wdc-btn {
		flex: 1 1 100%;
	}
}

/* Dialog ------------------------------------------------------------------ */

.wdc-dialog {
	width: calc(100% - 2rem);
	max-width: 40rem;
	max-height: calc(100% - 2rem);
	margin: auto;
	padding: 1.25rem;
	overflow-y: auto;
	border: 2px solid var(--wdc-text, #fff);
	border-radius: var(--wdc-r);
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.wdc-dialog::backdrop {
	background: rgba(0, 0, 0, 0.6);
}

html:has(.wdc-dialog[open]) {
	overflow: hidden;
}

.wdc-dialog__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.5rem;
}

.wdc .wdc-close {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: -0.5rem -0.5rem 0 0;
	padding: 0;
	border: 2px solid transparent;
	border-radius: var(--wdc-r);
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.wdc .wdc-close:hover {
	border-color: currentColor;
}

.wdc-cats {
	margin: 1rem 0;
	padding: 0;
	list-style: none;
}

.wdc-cat {
	margin: 0;
	padding: 0.875rem 0;
	border-top: 1px solid color-mix(in srgb, var(--wdc-text, #fff) 35%, transparent);
}

.wdc-cat:last-child {
	border-bottom: 1px solid color-mix(in srgb, var(--wdc-text, #fff) 35%, transparent);
}

.wdc-cat__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
}

.wdc-cat__label {
	flex: 1 1 auto;
	font-weight: 600;
	cursor: pointer;
}

.wdc-cat__always {
	font-size: 0.875rem;
}

.wdc-cat__desc {
	margin: 0.25rem 0 0 !important;
	font-size: 0.9375rem;
}

/* Switch: a real checkbox (role="switch") so state is announced natively (SC 4.1.2). */
.wdc .wdc-switch {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	flex: none;
	width: 3.25rem;
	height: 1.875rem;
	margin: 0;
	border: 2px solid var(--wdc-text, #fff);
	border-radius: 999px;
	background: transparent;
	cursor: pointer;
}

.wdc .wdc-switch::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 1.25rem;
	height: 1.25rem;
	border-radius: 50%;
	background: var(--wdc-text, #fff);
}

.wdc .wdc-switch:checked {
	border-color: var(--wdc-accent, #72aee6);
	background: var(--wdc-accent, #72aee6);
}

.wdc .wdc-switch:checked::before {
	left: calc(100% - 1.25rem - 3px);
	background: var(--wdc-on-accent, #1d2327);
}

.wdc .wdc-switch:disabled {
	cursor: not-allowed;
	opacity: 0.75;
}

@media (prefers-reduced-motion: no-preference) {
	.wdc .wdc-switch::before {
		transition: left 0.15s ease;
	}
}

@media (forced-colors: active) {
	.wdc .wdc-switch::before {
		background: CanvasText;
	}
	.wdc .wdc-switch:checked {
		background: Highlight;
	}
	.wdc .wdc-switch:checked::before {
		background: HighlightText;
	}
}

.wdc-cat__cookies {
	margin-top: 0.5rem;
	font-size: 0.875rem;
}

.wdc-cat__cookies summary {
	display: inline-block;
	min-height: 24px;
	padding: 0.125rem 0;
	text-decoration: underline;
	cursor: pointer;
}

.wdc-cat__cookies summary::before {
	content: "▸ ";
}

.wdc-cat__cookies[open] summary::before {
	content: "▾ ";
}

.wdc-cat__cookies ul {
	margin: 0.5rem 0 0;
	padding: 0;
	list-style: none;
}

.wdc-cat__cookies li {
	margin: 0 0 0.5rem;
}

.wdc-cat__cookies code {
	padding: 0;
	background: none;
	color: inherit;
	font-size: 0.875rem;
	font-weight: 600;
}

.wdc-meta,
.wdc-purpose {
	display: block;
}

.wdc-dialog__policy {
	margin: 1rem 0 0 !important;
	font-size: 0.9375rem;
}

/* Corner button ------------------------------------------------------------ */

.wdc-float {
	position: fixed;
	z-index: 2147482999;
	bottom: 1rem;
	left: 1rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin: 0;
	padding: 0;
	border: 2px solid var(--wdc-text, #fff);
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

/* Cookie list (shortcode and block). Inherits the theme's colours. ---------- */

.wdc-cookie-list__group + .wdc-cookie-list__group {
	margin-top: 2rem;
}

.wdc-cookie-list__scroll {
	overflow-x: auto;
}

.wdc-cookie-list__scroll:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 2px;
}

.wdc-cookie-list__table {
	width: 100%;
	min-width: 34rem;
	margin: 0;
	border-collapse: collapse;
}

.wdc-cookie-list__table caption {
	margin-bottom: 0.5rem;
	text-align: left;
}

.wdc-cookie-list__label {
	display: block;
	font-weight: 700;
}

.wdc-cookie-list__table th,
.wdc-cookie-list__table td {
	padding: 0.5rem 0.75rem 0.5rem 0;
	border-bottom: 1px solid color-mix(in srgb, currentColor 30%, transparent);
	text-align: left;
	vertical-align: top;
}

.wdc-cookie-list__table thead th {
	border-bottom-width: 2px;
}

.wdc-cookie-list__table tbody th {
	font-weight: 400;
	white-space: nowrap;
}
