/**
 * Cookie banner, settings dialog and held embeds.
 *
 * Works with any theme: HostRider tokens when the theme has them, the same
 * values written out when it does not. Logical properties only, so Arabic
 * mirrors on its own.
 */

.hr-consent,
.hr-consent-dialog,
.hr-consent-reopen,
.hr-consent-overlay,
.hr-consent-embed,
.hr-cookie-table {
	--hrc-ink: var(--hr-ink, #191341);
	--hrc-body: var(--hr-body, #4b4a5e);
	--hrc-muted: var(--hr-muted, #666b7a);
	--hrc-plum: var(--hr-plum-700, #3f2c97);
	--hrc-plum-dark: var(--hr-plum-800, #241a5e);
	--hrc-tint: var(--hr-tint, #f6f3ff);
	--hrc-border: var(--hr-border, #e8e4f4);
	--hrc-focus: var(--hr-orange-500, #eb5207);
	--hrc-font: var(--hr-font-text, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
	--hrc-label: var(--hr-font-label, var(--hrc-font));
	--hrc-radius: var(--hr-radius, 18px);
	--hrc-shadow: var(--hr-shadow-lg, 0 30px 70px -30px rgba(26, 19, 69, 0.45));
	/* The roles a design or the owner's colours change. */
	--hrc-bg: #fff;
	--hrc-fg: var(--hrc-body);
	--hrc-heading: var(--hrc-ink);
	--hrc-btn: var(--hrc-plum);
	--hrc-btn-fg: #fff;
	--hrc-link: var(--hrc-plum);
	--hrc-line: var(--hrc-border);
	--hrc-r: var(--hrc-radius);
	--hrc-w: 420px;
	font-family: var(--hrc-font);
	font-size: 15px;
	line-height: 1.55;
	color: var(--hrc-fg);
	box-sizing: border-box;
}

.hr-consent *,
.hr-consent-dialog *,
.hr-consent-embed * {
	box-sizing: border-box;
}

.hr-consent[hidden],
.hr-consent-reopen[hidden],
.hr-consent-overlay[hidden],
.hr-consent-dialog__id[hidden] {
	display: none !important;
}

/* Banner */
.hr-consent {
	position: fixed;
	z-index: 99990;
	inset-block-end: 16px;
	inset-inline: 16px;
	background: var(--hrc-bg);
	border: 1px solid var(--hrc-line);
	border-radius: var(--hrc-r);
	box-shadow: var(--hrc-shadow);
}

.hr-consent--top {
	inset-block-start: 16px;
	inset-block-end: auto;
}

.hr-consent--bottom-start,
.hr-consent--bottom-end {
	inline-size: min(var(--hrc-w), calc(100% - 32px));
}

.hr-consent--bottom-start {
	inset-inline-end: auto;
}

.hr-consent--bottom-end {
	inset-inline-start: auto;
}

.hr-consent--center {
	inset: 0;
	inline-size: min(var(--hrc-w), calc(100% - 32px));
	block-size: fit-content;
	max-block-size: calc(100% - 32px);
	margin: auto;
	overflow: auto;
}

.hr-consent-overlay {
	position: fixed;
	z-index: 99989;
	inset: 0;
	background: rgba(26, 19, 69, 0.45);
}

.hr-consent__inner {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	gap: 16px 32px;
	align-items: center;
	justify-content: space-between;
	max-inline-size: 1180px;
	margin-inline: auto;
	padding: 20px 24px;
}

.hr-consent__text {
	flex: 1 1 420px;
	min-inline-size: 0;
}

.hr-consent__text p {
	margin: 0;
}

.hr-consent .hr-consent__title,
.hr-consent-dialog .hr-consent__title {
	margin: 0 0 4px;
	font-family: var(--hrc-label);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--hrc-heading);
}

/* Shown by the designs that want it. */
.hr-consent__icon {
	display: none;
	flex: 0 0 auto;
	color: var(--hrc-link);
}

.hr-consent__icon svg {
	display: block;
}

.hr-consent a,
.hr-consent-dialog a,
.hr-consent-embed a,
.hr-cookie-table a {
	color: var(--hrc-link);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.hr-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 10px;
	align-items: center;
}

/* Accept and refuse look the same: neither choice is pushed. */
.hr-consent__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-block-size: 44px;
	padding: 10px 20px;
	margin: 0;
	border: 1px solid var(--hrc-btn);
	border-radius: 999px;
	background: var(--hrc-btn);
	color: var(--hrc-btn-fg);
	font-family: var(--hrc-label);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.hr-consent__btn:hover {
	background: color-mix(in srgb, var(--hrc-btn) 82%, #000);
	border-color: color-mix(in srgb, var(--hrc-btn) 82%, #000);
	color: var(--hrc-btn-fg);
}

.hr-consent__btn--quiet {
	background: transparent;
	color: var(--hrc-link);
}

.hr-consent__btn--quiet:hover {
	background: color-mix(in srgb, var(--hrc-btn) 10%, transparent);
	color: var(--hrc-link);
}

.hr-consent__link {
	display: inline-flex;
	align-items: center;
	min-block-size: 44px;
	padding: 10px 8px;
	margin: 0;
	border: 0;
	background: none;
	color: var(--hrc-link);
	font-family: var(--hrc-label);
	font-size: 15px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.hr-consent__btn:focus-visible,
.hr-consent__link:focus-visible,
.hr-consent__x:focus-visible,
.hr-consent-reopen:focus-visible,
.hr-consent-dialog__close:focus-visible,
.hr-consent a:focus-visible,
.hr-consent-dialog a:focus-visible,
.hr-consent-embed a:focus-visible {
	outline: 3px solid var(--hrc-focus);
	outline-offset: 2px;
}

/* Closing counts as Only necessary. */
.hr-consent__x {
	position: absolute;
	inset-block-start: 6px;
	inset-inline-end: 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: 40px;
	block-size: 40px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--hrc-heading);
	cursor: pointer;
}

.hr-consent__x:hover {
	background: color-mix(in srgb, var(--hrc-heading) 8%, transparent);
}

.hr-consent:has(.hr-consent__x) .hr-consent__text {
	padding-inline-end: 32px;
}

.hr-consent--box .hr-consent__inner {
	padding: 20px;
}

.hr-consent--box .hr-consent__text {
	flex-basis: 100%;
}

/* Settings dialog */
.hr-consent-dialog {
	inline-size: min(560px, calc(100% - 32px));
	max-block-size: calc(100% - 32px);
	padding: 0;
	margin: auto;
	border: 0;
	border-radius: var(--hrc-r);
	background: var(--hrc-bg);
	box-shadow: var(--hrc-shadow);
	overflow: auto;
}

.hr-consent-dialog::backdrop {
	background: rgba(26, 19, 69, 0.55);
}

.hr-consent-dialog__form {
	position: relative;
	padding: 28px;
}

.hr-consent-dialog .hr-consent__title {
	padding-inline-end: 40px;
	font-size: 20px;
}

.hr-consent-dialog__lead {
	margin: 0 0 16px;
}

.hr-consent-dialog__list {
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
	border-block-start: 1px solid var(--hrc-line);
}

.hr-consent-dialog__item {
	margin: 0;
	padding: 14px 0;
	border-block-end: 1px solid var(--hrc-line);
}

.hr-consent-dialog__text {
	margin: 4px 0 0;
	padding-inline-start: 56px;
	font-size: 14px;
	color: var(--hrc-fg);
	opacity: 0.85;
}

.hr-consent-dialog__id {
	margin: 16px 0 0;
	font-size: 13px;
	opacity: 0.85;
}

.hr-consent-dialog__id code {
	font-size: 12px;
	word-break: break-all;
}

.hr-consent-dialog__close {
	position: absolute;
	inset-block-start: 18px;
	inset-inline-end: 18px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: 44px;
	block-size: 44px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--hrc-heading);
	cursor: pointer;
}

.hr-consent-dialog__close:hover {
	background: color-mix(in srgb, var(--hrc-heading) 8%, transparent);
}

/* Switch */
.hr-consent-switch {
	position: relative;
	display: flex;
	gap: 12px;
	align-items: center;
	min-block-size: 32px;
	cursor: pointer;
}

.hr-consent-switch input {
	position: absolute;
	inset-block-start: 4px;
	inset-inline-start: 0;
	inline-size: 44px;
	block-size: 24px;
	margin: 0;
	opacity: 0;
	cursor: inherit;
}

.hr-consent-switch__track {
	position: relative;
	flex: 0 0 44px;
	block-size: 24px;
	border-radius: 999px;
	background: #c9c4da;
	transition: background-color 0.15s ease;
}

.hr-consent-switch__track::after {
	content: "";
	position: absolute;
	inset-block-start: 3px;
	inset-inline-start: 3px;
	inline-size: 18px;
	block-size: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 2px rgba(26, 19, 69, 0.3);
	transition: transform 0.15s ease;
}

.hr-consent-switch input:checked + .hr-consent-switch__track {
	background: var(--hrc-btn);
}

.hr-consent-switch input:checked + .hr-consent-switch__track::after {
	background: var(--hrc-btn-fg);
	transform: translateX(20px);
}

[dir="rtl"] .hr-consent-switch input:checked + .hr-consent-switch__track::after {
	transform: translateX(-20px);
}

.hr-consent-switch input:disabled + .hr-consent-switch__track {
	opacity: 0.6;
}

.hr-consent-switch input:disabled ~ .hr-consent-switch__name {
	cursor: default;
}

.hr-consent-switch input:focus-visible + .hr-consent-switch__track {
	outline: 3px solid var(--hrc-focus);
	outline-offset: 2px;
}

.hr-consent-switch__name {
	font-family: var(--hrc-label);
	font-weight: 600;
	color: var(--hrc-heading);
}

/* Small button to change the choice later */
.hr-consent-reopen {
	position: fixed;
	z-index: 99980;
	inset-block-end: 16px;
	inset-inline-start: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: 44px;
	block-size: 44px;
	padding: 0;
	border: 1px solid var(--hrc-line);
	border-radius: 999px;
	background: var(--hrc-bg);
	color: var(--hrc-link);
	box-shadow: var(--hr-shadow-sm, 0 1px 2px rgba(26, 19, 69, 0.05), 0 10px 24px -18px rgba(26, 19, 69, 0.25));
	cursor: pointer;
}

.hr-consent-reopen--bottom-end {
	inset-inline-start: auto;
	inset-inline-end: 16px;
}

.hr-consent-reopen:hover {
	background: color-mix(in srgb, var(--hrc-btn) 10%, var(--hrc-bg));
}

/* Held embeds */
.hr-consent-embed {
	display: flex;
	align-items: center;
	justify-content: center;
	min-block-size: 220px;
	padding: 24px;
	border: 1px solid var(--hrc-border);
	border-radius: var(--hr-radius-sm, 12px);
	background: var(--hrc-tint);
	text-align: center;
}

/* In a ratio box the placeholder keeps the video shape, and grows when its
   text needs more room (narrow screens). */
.wp-has-aspect-ratio .hr-consent-embed {
	aspect-ratio: 16 / 9;
	min-block-size: auto;
}

.wp-has-aspect-ratio .wp-block-embed__wrapper:has(> .hr-consent-embed)::before {
	display: none;
}

.hr-consent-embed__note {
	max-inline-size: 460px;
}

.hr-consent-embed__note p {
	margin: 0 0 12px;
}

.hr-consent-embed__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
	align-items: center;
	justify-content: center;
	margin: 0;
}

.hr-consent-embed .hr-consent-embed__actions {
	margin: 0;
}

/* Cookie table: [hostrider_cookie_table] */
.hr-cookie-table {
	--hrc-bg: transparent;
	color: inherit;
	font-family: inherit;
	font-size: inherit;
}

.hr-cookie-table__group {
	margin-block: 0 28px;
}

.hr-cookie-table .hr-cookie-table__title {
	margin: 0 0 4px;
}

.hr-cookie-table .hr-cookie-table__text {
	margin: 0 0 12px;
}

.hr-cookie-table__scroll {
	overflow-x: auto;
}

.hr-cookie-table table {
	inline-size: 100%;
	margin: 0;
	border-collapse: collapse;
	font-size: 0.95em;
}

.hr-cookie-table th,
.hr-cookie-table td {
	padding: 10px 12px;
	border-block-end: 1px solid var(--hrc-line);
	text-align: start;
	vertical-align: top;
}

.hr-cookie-table th {
	font-family: var(--hrc-label);
	font-weight: 600;
	color: var(--hrc-heading);
	background: var(--hrc-tint);
}

.hr-cookie-table code {
	font-size: 0.9em;
	word-break: break-all;
}

@media (max-width: 600px) {
	.hr-consent {
		inset-block-end: 8px;
		inset-inline: 8px;
	}

	.hr-consent--top {
		inset-block-start: 8px;
		inset-block-end: auto;
	}

	.hr-consent--bottom-start,
	.hr-consent--bottom-end {
		inline-size: auto;
	}

	.hr-consent--center {
		inset: 0;
		inline-size: calc(100% - 16px);
	}

	.hr-consent-reopen--bottom-end {
		inset-inline-end: 12px;
	}

	.hr-consent__inner {
		padding: 16px;
	}

	.hr-consent__actions {
		inline-size: 100%;
	}

	.hr-consent__actions .hr-consent__btn {
		flex: 1 1 auto;
	}

	.hr-consent__actions .hr-consent__link {
		flex: 1 1 100%;
		justify-content: center;
		min-block-size: 40px;
		padding-block: 6px;
	}


	.hr-consent-dialog__form {
		padding: 22px 18px;
	}

	.hr-consent-dialog__text {
		padding-inline-start: 0;
	}

	.hr-consent-embed {
		padding: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hr-consent__btn,
	.hr-consent-switch__track,
	.hr-consent-switch__track::after {
		transition: none;
	}
}

/*
 * Designs (Kit 1.8.0). Drafted with muse-spark, reviewed. Each one sets the
 * colour roles on .hr-consent-d-<slug>, so the owner's colours (an inline
 * style on the same element) still win. Accept all and Only necessary look
 * the same in every design.
 */
.hr-consent-d-minimal {
	--hrc-btn: var(--hr-ink, #191341);
	--hrc-shadow: none;
}

.hr-consent.hr-consent-d-minimal .hr-consent__title {
	font-size: 15px;
}

.hr-consent.hr-consent-d-minimal .hr-consent__btn {
	background: transparent;
	color: var(--hrc-btn);
}

/* The deepest Faris shade, so it follows "Shades follow your colours". */
.hr-consent-d-dark {
	--hrc-bg: var(--hr-deep, #14112b);
	--hrc-fg: #e9e7f4;
	--hrc-heading: #fff;
	--hrc-btn: #fff;
	--hrc-btn-fg: var(--hr-deep, #14112b);
	--hrc-link: #fff;
	--hrc-line: rgba(255, 255, 255, 0.16);
	--hrc-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.hr-consent-overlay.hr-consent-d-dark {
	background: rgba(6, 4, 16, 0.68);
}

.hr-consent-d-tint {
	--hrc-bg: var(--hr-tint, #f6f3ff);
	--hrc-line: transparent;
	--hrc-shadow: 0 12px 32px rgba(25, 19, 65, 0.14);
}

.hr-consent-d-outline {
	--hrc-line: var(--hrc-btn);
	--hrc-shadow: none;
}

.hr-consent.hr-consent-d-outline {
	border-width: 2px;
}

.hr-consent.hr-consent-d-outline .hr-consent__btn {
	background: transparent;
	color: var(--hrc-btn);
}

.hr-consent-d-glass {
	--hrc-bg: color-mix(in srgb, #fff 78%, transparent);
	--hrc-line: rgba(25, 19, 65, 0.12);
	--hrc-shadow: 0 12px 32px rgba(25, 19, 65, 0.16);
}

.hr-consent-dialog.hr-consent-d-glass {
	--hrc-bg: color-mix(in srgb, #fff 92%, transparent);
}

.hr-consent.hr-consent-d-glass,
.hr-consent-dialog.hr-consent-d-glass {
	-webkit-backdrop-filter: blur(14px) saturate(1.4);
	backdrop-filter: blur(14px) saturate(1.4);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.hr-consent-d-glass,
	.hr-consent-dialog.hr-consent-d-glass {
		--hrc-bg: #fff;
	}
}

.hr-consent-d-brand {
	--hrc-bg: var(--hr-plum-700, #3f2c97);
	--hrc-fg: #fff;
	--hrc-heading: #fff;
	--hrc-btn: #fff;
	--hrc-btn-fg: var(--hr-plum-700, #3f2c97);
	--hrc-link: #fff;
	--hrc-line: rgba(255, 255, 255, 0.32);
	--hrc-shadow: 0 12px 32px rgba(36, 26, 94, 0.45);
}

.hr-consent.hr-consent-d-compact .hr-consent__inner {
	padding-block: 12px;
	padding-inline: 18px;
}

.hr-consent.hr-consent-d-compact .hr-consent__text {
	font-size: 14px;
}

.hr-consent.hr-consent-d-compact .hr-consent__title {
	font-size: 15px;
}

.hr-consent.hr-consent-d-compact .hr-consent__btn {
	min-block-size: 40px;
	padding-block: 8px;
	padding-inline: 14px;
}

.hr-consent.hr-consent-d-icon .hr-consent__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	align-self: start;
	inline-size: 48px;
	block-size: 48px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--hrc-btn) 12%, var(--hrc-bg));
	color: var(--hrc-link);
}

.hr-consent-d-pill {
	--hrc-r: 999px;
}

.hr-consent.hr-consent-d-pill.hr-consent--box,
.hr-consent-dialog.hr-consent-d-pill {
	--hrc-r: 28px;
}

.hr-consent.hr-consent-d-pill .hr-consent__inner {
	padding-inline: 32px;
}

.hr-consent-d-sharp {
	--hrc-r: 0px;
}

.hr-consent.hr-consent-d-sharp .hr-consent__btn,
.hr-consent-dialog.hr-consent-d-sharp .hr-consent__btn {
	border-radius: 0;
}

.hr-consent.hr-consent-d-sharp .hr-consent__title {
	font-size: 13px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* Spaced letters break joined scripts. */
.hr-consent.hr-consent-d-sharp .hr-consent__title:is(:lang(ar), :lang(fa), :lang(ur), :lang(he)) {
	font-size: 15px;
	letter-spacing: normal;
}

.hr-consent-d-stripe {
	--hrc-shadow: 0 4px 16px rgba(25, 19, 65, 0.08);
}

.hr-consent.hr-consent-d-stripe {
	border-inline-start: 6px solid var(--hrc-btn);
}

.hr-consent-d-night {
	--hrc-bg: #1e1b4b;
	--hrc-fg: #e7e5f7;
	--hrc-heading: #fff;
	--hrc-btn: #c2410c;
	--hrc-btn-fg: #fff;
	--hrc-link: #fdba74;
	--hrc-line: rgba(255, 255, 255, 0.16);
	--hrc-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.hr-consent-overlay.hr-consent-d-night {
	background: rgba(8, 8, 24, 0.7);
}

.hr-consent-d-paper {
	--hrc-bg: #fbf7ef;
	--hrc-fg: #4a443a;
	--hrc-heading: #2b2620;
	--hrc-btn: #2b2620;
	--hrc-btn-fg: #fbf7ef;
	--hrc-link: #2b2620;
	--hrc-line: #e7ddc8;
	--hrc-shadow: 0 12px 28px rgba(70, 55, 30, 0.14);
}

.hr-consent.hr-consent-d-paper .hr-consent__title,
.hr-consent-dialog.hr-consent-d-paper .hr-consent__title {
	font-family: ui-serif, Georgia, "Times New Roman", serif;
}

@media (max-width: 600px) {
	.hr-consent.hr-consent-d-pill {
		--hrc-r: 28px;
	}

	.hr-consent.hr-consent-d-pill .hr-consent__inner {
		padding-inline: 18px;
	}
}
