/**
 * ConsentKit frontend styles.
 * Scoped under #ck-root so themes cannot leak in and we cannot leak out.
 */

#ck-root {
	--ck-bg: #ffffff;
	--ck-text: #1f2328;
	--ck-accent: #1a56db;
	--ck-accent-text: #ffffff;
	--ck-radius: 10px;
	--ck-muted: color-mix(in srgb, var(--ck-text) 62%, transparent);
	--ck-border: color-mix(in srgb, var(--ck-text) 14%, transparent);
	--ck-surface: color-mix(in srgb, var(--ck-text) 4%, var(--ck-bg));
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.55;
	color: var(--ck-text);
}

#ck-root *,
#ck-root *::before,
#ck-root *::after {
	box-sizing: border-box;
}

/*
 * The banner, the preference modal and the floating button all set an explicit
 * display value, and an author-level display declaration beats the browser's
 * own [hidden] { display: none } rule. Without this, setting el.hidden does
 * nothing and the preference center renders over the page on first load.
 *
 * Scoped to this plugin's own elements wherever they appear, not just inside
 * #ck-root, so adding a display rule to any ck- component later cannot
 * reintroduce the same bug.
 */
#ck-root [hidden],
[class^="ck-"][hidden],
[class*=" ck-"][hidden] {
	display: none !important;
}

#ck-root.ck-theme--dark {
	--ck-bg: #16181d;
	--ck-text: #e8eaed;
}

@media (prefers-color-scheme: dark) {
	#ck-root.ck-theme--auto {
		--ck-bg: #16181d;
		--ck-text: #e8eaed;
	}
}

.ck-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

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

.ck-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 18, 22, 0.55);
	z-index: 999997;
}

.ck-banner {
	position: fixed;
	z-index: 999998;
	background: var(--ck-bg);
	color: var(--ck-text);
	border: 1px solid var(--ck-border);
	border-radius: var(--ck-radius);
	box-shadow: 0 12px 40px rgba(10, 14, 20, 0.18);
	padding: 20px 22px;
	display: flex;
	gap: 20px;
	align-items: center;
	flex-wrap: wrap;
	animation: ck-rise 0.28s ease-out;
}

@keyframes ck-rise {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	.ck-banner { animation: none; }
}

.ck-banner--bar {
	left: 16px;
	right: 16px;
	max-width: none;
}

.ck-banner--box {
	max-width: 420px;
	flex-direction: column;
	align-items: stretch;
}

.ck-banner--modal {
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	max-width: 560px;
	width: calc(100% - 32px);
	flex-direction: column;
	align-items: stretch;
	z-index: 999999;
}

.ck-banner--bottom { bottom: 16px; }
.ck-banner--top { top: 16px; }
.ck-banner--bottom-left { bottom: 16px; left: 16px; right: auto; }
.ck-banner--bottom-right { bottom: 16px; right: 16px; left: auto; }

.ck-banner--modal.ck-banner--bottom,
.ck-banner--modal.ck-banner--top {
	bottom: auto;
	top: 50%;
}

.ck-banner__content {
	flex: 1 1 340px;
	min-width: 0;
}

.ck-banner__title {
	margin: 0 0 6px;
	font-size: 1.05rem;
	font-weight: 650;
	line-height: 1.3;
	color: var(--ck-text);
}

.ck-banner__message {
	margin: 0;
	font-size: 0.9rem;
	color: var(--ck-muted);
}

.ck-banner__policy {
	color: var(--ck-accent);
	text-decoration: underline;
	white-space: nowrap;
}

.ck-banner__actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
}

.ck-banner--box .ck-banner__actions,
.ck-banner--modal .ck-banner__actions {
	margin-top: 4px;
}

.ck-banner__close {
	position: absolute;
	top: 8px;
	right: 10px;
	background: none;
	border: 0;
	font-size: 22px;
	line-height: 1;
	color: var(--ck-muted);
	cursor: pointer;
	padding: 4px 8px;
}

.ck-banner__credit {
	flex-basis: 100%;
	margin: 4px 0 0;
	font-size: 0.7rem;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: color-mix(in srgb, var(--ck-text) 38%, transparent);
}

/* --------------------------------------------------------------------------
 * Buttons
 * ----------------------------------------------------------------------- */

.ck-btn {
	appearance: none;
	font: inherit;
	font-size: 0.875rem;
	font-weight: 560;
	line-height: 1.2;
	padding: 11px 18px;
	border-radius: calc(var(--ck-radius) - 3px);
	border: 1px solid transparent;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.ck-btn:focus-visible {
	outline: 2px solid var(--ck-accent);
	outline-offset: 2px;
}

.ck-btn--primary {
	background: var(--ck-accent);
	color: var(--ck-accent-text);
}

.ck-btn--primary:hover {
	background: color-mix(in srgb, var(--ck-accent) 86%, black);
}

.ck-btn--secondary {
	background: var(--ck-surface);
	color: var(--ck-text);
	border-color: var(--ck-border);
}

.ck-btn--secondary:hover {
	background: color-mix(in srgb, var(--ck-text) 9%, var(--ck-bg));
}

.ck-btn--ghost {
	background: transparent;
	color: var(--ck-muted);
	border-color: transparent;
	text-decoration: underline;
	padding-left: 8px;
	padding-right: 8px;
}

.ck-btn--ghost:hover {
	color: var(--ck-text);
}

/* --------------------------------------------------------------------------
 * Preference center
 * ----------------------------------------------------------------------- */

.ck-modal {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.ck-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 18, 22, 0.6);
}

.ck-modal__dialog {
	position: relative;
	background: var(--ck-bg);
	color: var(--ck-text);
	border-radius: var(--ck-radius);
	box-shadow: 0 24px 64px rgba(10, 14, 20, 0.3);
	width: 100%;
	max-width: 620px;
	max-height: min(84vh, 780px);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.ck-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 20px 24px 14px;
	border-bottom: 1px solid var(--ck-border);
}

.ck-modal__title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 650;
}

.ck-modal__close {
	background: none;
	border: 0;
	font-size: 26px;
	line-height: 1;
	color: var(--ck-muted);
	cursor: pointer;
	padding: 0 4px;
}

.ck-modal__body {
	padding: 18px 24px;
	overflow-y: auto;
	flex: 1 1 auto;
}

.ck-modal__intro {
	margin: 0 0 18px;
	font-size: 0.875rem;
	color: var(--ck-muted);
}

.ck-modal__footer {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	flex-wrap: wrap;
	padding: 14px 24px 18px;
	border-top: 1px solid var(--ck-border);
	background: var(--ck-surface);
}

.ck-modal__policy-link {
	margin: 14px 0 0;
	font-size: 0.85rem;
}

.ck-modal__policy-link a {
	color: var(--ck-accent);
}

body.ck-modal-open {
	overflow: hidden;
}

/* --------------------------------------------------------------------------
 * Categories
 * ----------------------------------------------------------------------- */

.ck-category {
	padding: 14px 0;
	border-bottom: 1px solid var(--ck-border);
}

.ck-category:last-of-type {
	border-bottom: 0;
}

.ck-category__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
}

.ck-category__label {
	font-weight: 620;
	font-size: 0.95rem;
	cursor: pointer;
}

.ck-category__always {
	font-size: 0.78rem;
	font-weight: 560;
	color: var(--ck-accent);
	white-space: nowrap;
}

.ck-category__desc {
	margin: 6px 0 0;
	font-size: 0.85rem;
	color: var(--ck-muted);
	max-width: 62ch;
}

.ck-category__details {
	margin-top: 10px;
	font-size: 0.82rem;
}

.ck-category__details summary {
	cursor: pointer;
	color: var(--ck-accent);
	font-weight: 540;
}

.ck-cookie-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 10px;
	font-size: 0.78rem;
	display: block;
	overflow-x: auto;
}

.ck-cookie-table th,
.ck-cookie-table td {
	text-align: left;
	padding: 7px 10px;
	border-bottom: 1px solid var(--ck-border);
	vertical-align: top;
}

.ck-cookie-table th {
	font-weight: 620;
	color: var(--ck-muted);
	white-space: nowrap;
}

.ck-cookie-table code {
	font-size: 0.95em;
	word-break: break-all;
}

/* --------------------------------------------------------------------------
 * Switch
 * ----------------------------------------------------------------------- */

.ck-switch {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
}

.ck-switch__input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	margin: 0;
	cursor: pointer;
	z-index: 1;
}

.ck-switch__track {
	display: block;
	width: 44px;
	height: 25px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--ck-text) 22%, transparent);
	transition: background-color 0.18s ease;
}

.ck-switch__thumb {
	display: block;
	width: 19px;
	height: 19px;
	margin: 3px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
	transition: transform 0.18s ease;
}

.ck-switch__input:checked ~ .ck-switch__track {
	background: var(--ck-accent);
}

.ck-switch__input:checked ~ .ck-switch__track .ck-switch__thumb {
	transform: translateX(19px);
}

.ck-switch__input:focus-visible ~ .ck-switch__track {
	outline: 2px solid var(--ck-accent);
	outline-offset: 2px;
}

/* --------------------------------------------------------------------------
 * Blocked embed placeholder
 * ----------------------------------------------------------------------- */

.ck-placeholder {
	position: relative;
	display: block;
	min-height: 200px;
	border: 1px dashed rgba(120, 130, 145, 0.5);
	border-radius: 10px;
	background: rgba(126, 136, 150, 0.07);
	overflow: hidden;
}

.ck-placeholder__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-align: center;
	padding: 28px 22px;
	min-height: 200px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.ck-placeholder__label {
	margin: 0;
	font-weight: 650;
	font-size: 0.95rem;
}

.ck-placeholder__text {
	margin: 0;
	font-size: 0.85rem;
	opacity: 0.75;
	max-width: 46ch;
}

.ck-placeholder__btn {
	margin-top: 6px;
	font: inherit;
	font-size: 0.85rem;
	font-weight: 560;
	padding: 9px 16px;
	border: 0;
	border-radius: 7px;
	background: #1a56db;
	color: #fff;
	cursor: pointer;
}

.ck-placeholder__link {
	background: none;
	border: 0;
	font: inherit;
	font-size: 0.8rem;
	text-decoration: underline;
	opacity: 0.7;
	cursor: pointer;
	padding: 2px;
}

.ck-placeholder iframe {
	display: none;
}

.ck-placeholder--released {
	min-height: 0;
	border: 0;
	background: none;
}

.ck-placeholder--released .ck-placeholder__inner {
	display: none;
}

.ck-placeholder--released iframe {
	display: block;
	width: 100%;
}

/* --------------------------------------------------------------------------
 * Floating button and toast
 * ----------------------------------------------------------------------- */

.ck-fab {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 999996;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 9px 13px;
	font: inherit;
	font-size: 0.8rem;
	font-weight: 540;
	color: var(--ck-text);
	background: var(--ck-bg);
	border: 1px solid var(--ck-border);
	border-radius: 999px;
	box-shadow: 0 4px 16px rgba(10, 14, 20, 0.14);
	cursor: pointer;
	opacity: 0.72;
	transition: opacity 0.15s ease;
}

.ck-fab:hover {
	opacity: 1;
}

.ck-fab__label {
	display: none;
}

.ck-fab:hover .ck-fab__label,
.ck-fab:focus-visible .ck-fab__label {
	display: inline;
}

.ck-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%) translateY(8px);
	z-index: 1000001;
	padding: 11px 18px;
	border-radius: 8px;
	background: #1f2328;
	color: #fff;
	font-size: 0.85rem;
	opacity: 0;
	transition: opacity 0.25s ease, transform 0.25s ease;
	pointer-events: none;
}

.ck-toast--visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* --------------------------------------------------------------------------
 * Cookie policy shortcode table
 * ----------------------------------------------------------------------- */

.ck-policy-table {
	width: 100%;
	border-collapse: collapse;
	margin: 16px 0 28px;
	font-size: 0.9rem;
}

.ck-policy-table caption {
	text-align: left;
	font-weight: 650;
	padding-bottom: 8px;
}

.ck-policy-table th,
.ck-policy-table td {
	text-align: left;
	padding: 9px 12px;
	border-bottom: 1px solid rgba(125, 135, 150, 0.28);
	vertical-align: top;
}

.ck-policy-table thead th {
	border-bottom-width: 2px;
	white-space: nowrap;
}

/* --------------------------------------------------------------------------
 * DSAR form
 * ----------------------------------------------------------------------- */

.ck-dsar-form {
	max-width: 560px;
}

.ck-dsar-form .ck-field {
	margin-bottom: 16px;
}

.ck-dsar-form label {
	display: block;
	font-weight: 560;
	font-size: 0.9rem;
	margin-bottom: 5px;
}

.ck-dsar-form input[type="text"],
.ck-dsar-form input[type="email"],
.ck-dsar-form select,
.ck-dsar-form textarea {
	width: 100%;
	padding: 10px 12px;
	font: inherit;
	font-size: 0.9rem;
	border: 1px solid rgba(125, 135, 150, 0.45);
	border-radius: 7px;
	background: #fff;
	color: #1f2328;
}

.ck-dsar-form textarea {
	min-height: 110px;
	resize: vertical;
}

.ck-dsar-form .ck-field--consent {
	display: flex;
	gap: 9px;
	align-items: flex-start;
	font-size: 0.85rem;
}

.ck-dsar-form .ck-hp {
	position: absolute !important;
	left: -9999px;
}

.ck-dsar-message {
	padding: 13px 16px;
	border-radius: 8px;
	margin-bottom: 18px;
	font-size: 0.9rem;
}

.ck-dsar-message--success {
	background: rgba(22, 145, 88, 0.12);
	border: 1px solid rgba(22, 145, 88, 0.35);
}

.ck-dsar-message--error {
	background: rgba(200, 45, 45, 0.1);
	border: 1px solid rgba(200, 45, 45, 0.35);
}

@media (max-width: 640px) {
	.ck-banner {
		left: 10px;
		right: 10px;
		bottom: 10px;
		padding: 16px;
		gap: 14px;
		flex-direction: column;
		align-items: stretch;
	}

	.ck-banner--bottom-left,
	.ck-banner--bottom-right {
		left: 10px;
		right: 10px;
	}

	.ck-banner__actions {
		flex-direction: column-reverse;
	}

	.ck-banner__actions .ck-btn {
		width: 100%;
	}

	.ck-modal__footer {
		flex-direction: column-reverse;
	}

	.ck-modal__footer .ck-btn {
		width: 100%;
	}
}

/* --------------------------------------------------------------------------
 * IAB TCF layer
 * ----------------------------------------------------------------------- */

.ck-banner__vendors {
	margin: 8px 0 0;
	font-size: 0.82rem;
	color: var(--ck-muted);
}

.ck-tcf {
	margin-top: 22px;
	padding-top: 18px;
	border-top: 2px solid var(--ck-border);
}

.ck-tcf__title {
	margin: 0 0 4px;
	font-size: 1rem;
	font-weight: 650;
}

.ck-tcf__intro,
.ck-tcf__note {
	margin: 0 0 14px;
	font-size: 0.83rem;
	color: var(--ck-muted);
	max-width: 68ch;
}

.ck-tcf__loading {
	font-size: 0.85rem;
	color: var(--ck-muted);
	padding: 14px 0;
}

.ck-tcf__tabs {
	display: flex;
	gap: 4px;
	border-bottom: 1px solid var(--ck-border);
	margin-bottom: 14px;
	overflow-x: auto;
}

.ck-tcf__tab {
	appearance: none;
	background: none;
	border: 0;
	border-bottom: 2px solid transparent;
	font: inherit;
	font-size: 0.85rem;
	font-weight: 560;
	color: var(--ck-muted);
	padding: 8px 12px;
	cursor: pointer;
	white-space: nowrap;
}

.ck-tcf__tab.is-active {
	color: var(--ck-accent);
	border-bottom-color: var(--ck-accent);
}

.ck-tcf__tab:focus-visible {
	outline: 2px solid var(--ck-accent);
	outline-offset: -2px;
}

.ck-tcf__heading {
	margin: 22px 0 6px;
	font-size: 0.9rem;
	font-weight: 650;
}

.ck-tcf__item {
	padding: 12px 0;
	border-bottom: 1px solid var(--ck-border);
}

.ck-tcf__item:last-child {
	border-bottom: 0;
}

.ck-tcf__item--locked {
	opacity: 0.82;
}

.ck-tcf__item-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

.ck-tcf__name {
	font-size: 0.9rem;
	font-weight: 620;
	flex: 1 1 auto;
	min-width: 0;
}

.ck-tcf__desc {
	margin: 6px 0 0;
	font-size: 0.82rem;
	color: var(--ck-muted);
	max-width: 68ch;
}

.ck-tcf__toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.78rem;
	font-weight: 540;
	color: var(--ck-muted);
	white-space: nowrap;
	cursor: pointer;
	flex: 0 0 auto;
}

.ck-tcf__toggle input {
	width: 16px;
	height: 16px;
	accent-color: var(--ck-accent);
	cursor: pointer;
	margin: 0;
}

.ck-tcf__examples {
	margin-top: 8px;
	font-size: 0.8rem;
}

.ck-tcf__examples summary {
	cursor: pointer;
	color: var(--ck-accent);
	font-weight: 540;
}

.ck-tcf__examples .ck-tcf__desc {
	margin-top: 6px;
}

.ck-tcf__bulk {
	display: flex;
	gap: 8px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}

.ck-btn--small {
	font-size: 0.78rem;
	padding: 7px 12px;
}

.ck-tcf__search {
	width: 100%;
	padding: 9px 12px;
	font: inherit;
	font-size: 0.85rem;
	border: 1px solid var(--ck-border);
	border-radius: 7px;
	background: var(--ck-bg);
	color: var(--ck-text);
	margin-bottom: 6px;
}

.ck-tcf__vendors {
	max-height: 340px;
	overflow-y: auto;
	border: 1px solid var(--ck-border);
	border-radius: 7px;
	padding: 0 14px;
}

.ck-tcf__vendor-meta {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
	margin-top: 6px;
	font-size: 0.75rem;
}

.ck-tcf__vendor-meta a {
	color: var(--ck-accent);
}

.ck-tcf__small {
	color: var(--ck-muted);
}

.ck-tcf__actions {
	margin-top: 16px;
}
