/*
 * ESYD cookie notice.
 *
 * Follows the design system the rest of the site follows — navy #213264,
 * hairline #d9dde8, 44px targets — with the values restated here rather than
 * read from the theme, so the plugin keeps its appearance under any theme.
 *
 * The one rule worth explaining is at the foot: the notice knows about the
 * accessibility launcher and moves it out of its way. The dependency runs one
 * way only, like the theme's on the content model — the launcher knows nothing
 * about this file and works the same whether or not it is loaded.
 */

.esyd-consent {
	--consent-navy: #213264;
	--consent-deep: #111a35;
	--consent-line: #d9dde8;
	--consent-muted: #5a6478;
	--consent-tint: #f3f4f8;
	--consent-amber: #f7b817;

	font-family: inherit;
}

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

/* Our own, so the plugin does not lean on the theme for it. */
.esyd-consent .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* The button ----------------------------------------------------------------- */

/*
 * Matched to the accessibility launcher opposite it: 56px, a white ring, the
 * same navy and the same shadow. They are the same kind of thing — a standing
 * offer in a corner — and two different circles would read as two different
 * kinds of control.
 */
.esyd-consent__launch {
	position: fixed;
	inset-block-end: 20px;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background-color: var(--consent-navy);
	color: #fff;
	box-shadow: 0 1px 3px rgb(33 50 100 / 20%), 0 4px 12px rgb(33 50 100 / 20%);
	cursor: pointer;
}

/* The drawing carries no width of its own, so that one svg serves every size. */
.esyd-consent__launch svg { width: 28px; height: 28px; }

.esyd-consent__launch:hover { background-color: #2c4383; }

/*
 * Away on the way down.
 *
 * Only where there is little room: a width, not a hover query, because this is
 * about a phone's screen and not about touch. Out through the bottom rather
 * than faded in place, so it reads as having stepped aside and not as having
 * broken. pointer-events off while it is gone, or a thumb finds a button that
 * is not there.
 */
.esyd-consent__launch {
	transition: transform 260ms cubic-bezier(0.2, 0, 0, 1), opacity 200ms ease-out;
}

.esyd-consent__launch.is-away {
	transform: translateY(calc(100% + 28px));
	opacity: 0;
	pointer-events: none;
}

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


.esyd-consent--right .esyd-consent__launch { inset-inline-end: 20px; }
.esyd-consent--left .esyd-consent__launch { inset-inline-start: 20px; }

/*
 * Both buttons are placed by a setting of their own, so both can be asked to
 * sit in the same corner. When that happens this one steps aside by its own
 * width rather than landing on top of the other.
 *
 * The dependency runs one way: the accessibility plugin knows nothing about
 * this file and is unaffected by it, which is what keeps it working on a site
 * that has no cookie panel at all.
 */
:root:has(.esyd-a11y--right) .esyd-consent--right .esyd-consent__launch { inset-inline-end: 88px; }
:root:has(.esyd-a11y--left) .esyd-consent--left .esyd-consent__launch { inset-inline-start: 88px; }

/* The buttons in it ---------------------------------------------------------- */

/*
 * Allowing and refusing are the same button. Withdrawing has to be as easy as
 * giving, and the usual grey "reject" beside a coloured "accept" is that
 * requirement answered in the wrong direction — so neither of them is the
 * quiet one.
 */
.esyd-consent__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 20px;
	border: 2px solid var(--consent-navy);
	border-radius: 4px;
	background-color: var(--consent-navy);
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
	cursor: pointer;
	transition: background-color 160ms ease-out, color 160ms ease-out;
}

.esyd-consent__button:hover {
	background-color: var(--consent-deep);
	border-color: var(--consent-deep);
}

.esyd-consent__button--no {
	background-color: transparent;
	color: var(--consent-navy);
}

.esyd-consent__button--no:hover {
	background-color: var(--consent-tint);
	border-color: var(--consent-navy);
	color: var(--consent-navy);
}

.esyd-consent__policy {
	color: var(--consent-navy);
	text-underline-offset: 3px;
}

.esyd-consent__launch:focus-visible,
.esyd-consent__button:focus-visible,
.esyd-consent__close:focus-visible,
.esyd-consent__switch-input:focus-visible + .esyd-consent__switch {
	outline: 3px solid var(--consent-amber);
	outline-offset: 2px;
}

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

/* The dialog --------------------------------------------------------------- */

.esyd-consent__backdrop {
	position: fixed;
	inset: 0;
	z-index: 10060;
	background-color: rgb(17 26 53 / 45%);
}

.esyd-consent__dialog {
	position: fixed;
	inset-block-start: 50%;
	inset-inline-start: 50%;
	transform: translate(-50%, -50%);
	z-index: 10070;
	display: flex;
	flex-direction: column;
	width: min(620px, calc(100vw - 32px));
	max-height: min(640px, calc(100vh - 32px));
	background-color: #fff;
	border-radius: 6px;
	box-shadow: 0 24px 64px rgb(17 26 53 / 35%);
}

.esyd-consent__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 24px;
	border-block-end: 1px solid var(--consent-line);
}

.esyd-consent__title {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	color: var(--consent-navy);
}

.esyd-consent__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--consent-line);
	border-radius: 4px;
	background-color: #fff;
	color: var(--consent-navy);
	cursor: pointer;
}

.esyd-consent__close:hover { background-color: var(--consent-tint); }

.esyd-consent__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px 24px;
}

.esyd-consent__intro {
	margin: 0;
	font-size: 15px;
	line-height: 1.6;
	color: var(--consent-deep);
	text-wrap: pretty;
}

/* One category ------------------------------------------------------------- */

.esyd-consent__cat {
	padding-block: 20px;
	border-block-end: 1px solid var(--consent-line);
}

.esyd-consent__cat:last-child { border-block-end: 0; }

.esyd-consent__cathead {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.esyd-consent__catlabel {
	font-size: 16px;
	font-weight: 700;
	color: var(--consent-navy);
}

/* The whole row, so the drawn track is clickable as well as the words. */
.esyd-consent__cathead--switch { cursor: pointer; }

.esyd-consent__always {
	flex-shrink: 0;
	padding: 4px 12px;
	border-radius: 999px;
	background-color: var(--consent-tint);
	font-size: 13px;
	font-weight: 600;
	color: var(--consent-muted);
}

.esyd-consent__catdesc {
	margin: 6px 0 0;
	font-size: 14px;
	line-height: 1.6;
	color: var(--consent-muted);
	text-wrap: pretty;
}

/*
 * The switch: a checkbox that is still a checkbox, off-screen but focusable,
 * with a drawing beside it. A drawing is not something a keyboard or a screen
 * reader can operate.
 */
.esyd-consent__toggle {
	position: relative;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
}

.esyd-consent__switch-input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.esyd-consent__switch {
	position: relative;
	width: 44px;
	height: 26px;
	border-radius: 999px;
	background-color: #c6cbd9;
	transition: background-color 160ms ease-out;
}

.esyd-consent__switch::after {
	content: "";
	position: absolute;
	inset-block-start: 3px;
	inset-inline-start: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background-color: #fff;
	box-shadow: 0 1px 3px rgb(17 26 53 / 35%);
	transition: transform 160ms ease-out;
}

.esyd-consent__switch-input:checked + .esyd-consent__switch { background-color: var(--consent-navy); }
.esyd-consent__switch-input:checked + .esyd-consent__switch::after { transform: translateX(18px); }

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

/* What is in a category ---------------------------------------------------- */

.esyd-consent__details { margin-block-start: 10px; }

.esyd-consent__details > summary {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-size: 14px;
	font-weight: 600;
	color: var(--consent-navy);
	cursor: pointer;
}

.esyd-consent__details > summary:focus-visible {
	outline: 3px solid var(--consent-amber);
	outline-offset: 2px;
}

.esyd-consent__services {
	margin: 0;
	padding: 0;
	list-style: none;
}

.esyd-consent__service {
	padding: 12px 14px;
	border-radius: 4px;
	background-color: var(--consent-tint);
}

.esyd-consent__service + .esyd-consent__service { margin-block-start: 8px; }

.esyd-consent__servicehead {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	color: var(--consent-deep);
}

.esyd-consent__provider {
	font-weight: 400;
	color: var(--consent-muted);
}

.esyd-consent__provider::before { content: "· "; }

.esyd-consent__purpose {
	margin: 4px 0 0;
	font-size: 13px;
	line-height: 1.6;
	color: var(--consent-muted);
	text-wrap: pretty;
}

.esyd-consent__storage {
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
	font-size: 13px;
	color: var(--consent-muted);
}

.esyd-consent__name {
	font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
	font-size: 12px;
	color: var(--consent-deep);
}

/* The dialog's foot -------------------------------------------------------- */

.esyd-consent__foot {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	padding: 16px 24px;
	border-block-start: 1px solid var(--consent-line);
}

.esyd-consent__foot .esyd-consent__policy { margin-inline-start: auto; font-size: 14px; }

/* A held-back embed -------------------------------------------------------- */

.esyd-consent-embed {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 220px;
	padding: 24px;
	border: 1px dashed var(--consent-line, #d9dde8);
	border-radius: 6px;
	background-color: #f3f4f8;
}

.esyd-consent-embed__notice { max-width: 420px; text-align: center; }

.esyd-consent-embed__text {
	margin: 0 0 16px;
	font-size: 14px;
	line-height: 1.6;
	color: #5a6478;
	text-wrap: pretty;
}

.esyd-consent-embed__load,
.esyd-consent-embed__always {
	min-height: 44px;
	margin: 0 4px;
	padding: 0 18px;
	border: 2px solid #213264;
	border-radius: 4px;
	background-color: #213264;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	cursor: pointer;
}

.esyd-consent-embed__always { background-color: transparent; color: #213264; }

/* Narrow ------------------------------------------------------------------- */

@media (width <= 600px) {
	.esyd-consent__foot { flex-direction: column; align-items: stretch; }
	.esyd-consent__foot .esyd-consent__policy { margin-inline-start: 0; text-align: center; }
	.esyd-consent__dialog { max-height: calc(100vh - 16px); }
}
