/**
 * Cookie Consent Plugin — front-end styles.
 *
 * Everything is scoped under .ccp-* and resets the properties themes most
 * often override (button padding, list bullets, link colour).
 */

/*
 * Defaults live on :root so the inline block the plugin prints from the
 * settings (also on :root, but later in the cascade) wins.
 */
:root {
	--ccp-accent: #2cb34a;
	--ccp-accent-text: #ffffff;
	--ccp-radius: 24px;
}

.ccp-root,
.ccp-reopen,
.ccp-placeholder {
	--ccp-bg: #1b2230;
	--ccp-surface: #232c3d;
	--ccp-fg: #f7f8fa;
	--ccp-muted: #c3cddd;
	--ccp-border: rgba(255, 255, 255, 0.16);
	--ccp-shadow: 0 24px 60px rgba(2, 6, 23, 0.42);
	--ccp-reject: #6b7280;
	--ccp-reject-text: #ffffff;
	--ccp-track: rgba(255, 255, 255, 0.28);
	--ccp-btn-radius: 8px;
	--ccp-btn-height: 50px;

	box-sizing: border-box;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
}

.ccp-root *,
.ccp-root *::before,
.ccp-root *::after,
.ccp-reopen *,
.ccp-placeholder * {
	box-sizing: inherit;
}

.ccp-root[hidden],
.ccp-root [hidden],
.ccp-reopen[hidden],
[data-ccp-src][hidden] {
	display: none !important;
}

.ccp-theme-light {
	--ccp-bg: #f5f5f5;
	--ccp-surface: #ffffff;
	--ccp-fg: #0a0e13;
	--ccp-muted: #4f4f4f;
	--ccp-border: #dcdcdc;
	--ccp-shadow: 0 24px 60px rgba(10, 14, 19, 0.22);
	--ccp-reject: #606060;
	--ccp-reject-text: #ffffff;
	--ccp-track: #d9d9d9;
}

/* ------------------------------------------------------------------ overlay */

.ccp-overlay {
	position: fixed;
	inset: 0;
	z-index: 999998;
	background: rgba(0, 0, 0, 0.5);
	animation: ccp-fade 0.18s ease-out;
}

/* ------------------------------------------------------------------- banner */

.ccp-banner {
	position: fixed;
	z-index: 999999;
	display: flex;
	gap: 20px 32px;
	align-items: center;
	justify-content: space-between;
	padding: 30px;
	color: var(--ccp-fg);
	background: var(--ccp-bg);
	border: 1px solid var(--ccp-border);
	box-shadow: var(--ccp-shadow);
	animation: ccp-rise 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Layout: full-width bar. */
.ccp-layout-bar .ccp-banner {
	left: 0;
	right: 0;
	border-radius: 0;
	border-left: 0;
	border-right: 0;
}

.ccp-layout-bar.ccp-pos-top .ccp-banner {
	top: 0;
	border-top: 0;
}

.ccp-layout-bar.ccp-pos-bottom .ccp-banner,
.ccp-layout-bar.ccp-pos-bottom-left .ccp-banner,
.ccp-layout-bar.ccp-pos-bottom-right .ccp-banner {
	bottom: 0;
	border-bottom: 0;
}

/* Layout: floating card — the default. */
.ccp-layout-box .ccp-banner {
	flex-direction: column;
	align-items: stretch;
	max-width: 440px;
	border: 0;
	border-radius: var(--ccp-radius);
}

/*
 * Top/bottom keep the full card width, so the notice reads the same as the
 * centred dialog without taking the page over. Centring uses inset + auto
 * margins rather than translate(-50%), because the entry animation owns
 * `transform` — sharing it makes the card jump on load.
 */
.ccp-layout-box.ccp-pos-bottom .ccp-banner,
.ccp-layout-box.ccp-pos-top .ccp-banner {
	left: 16px;
	right: 16px;
	max-width: 830px;
	max-height: calc(100vh - 32px);
	margin-left: auto;
	margin-right: auto;
	overflow-y: auto;
}

.ccp-layout-box.ccp-pos-bottom .ccp-banner {
	bottom: 16px;
}

.ccp-layout-box.ccp-pos-top .ccp-banner {
	top: 16px;
}

/* Corner variants stay compact. */
.ccp-layout-box.ccp-pos-bottom-left .ccp-banner {
	bottom: 24px;
	left: 24px;
}

.ccp-layout-box.ccp-pos-bottom-right .ccp-banner {
	bottom: 24px;
	right: 24px;
}

/* Layout: centred card — the default. */
.ccp-layout-modal .ccp-banner {
	inset: 0;
	flex-direction: column;
	align-items: stretch;
	width: calc(100% - 32px);
	max-width: 830px;
	height: fit-content;
	max-height: calc(100vh - 32px);
	margin: auto;
	overflow-y: auto;
	border: 0;
	border-radius: var(--ccp-radius);
}

/* Programmatic focus on the dialog container should not draw a ring. */
.ccp-banner:focus,
.ccp-modal__panel:focus {
	outline: none;
}

.ccp-banner__body {
	min-width: 0;
}

.ccp-title {
	margin: 0 0 10px;
	padding: 0;
	color: var(--ccp-fg);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

.ccp-text {
	color: var(--ccp-fg);
	font-size: 15px;
	line-height: 1.6;
}

.ccp-text p {
	margin: 0 0 8px;
	color: inherit;
	font-size: inherit;
	line-height: inherit;
}

.ccp-text p:last-child {
	margin-bottom: 0;
}

.ccp-text__meta {
	margin: 10px 0 0;
	font-size: 15px;
}

.ccp-root .ccp-link {
	color: var(--ccp-accent);
	font-weight: 400;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ccp-root .ccp-link:hover,
.ccp-root .ccp-link:focus-visible {
	text-decoration-thickness: 2px;
}

/* ------------------------------------------------------------------ buttons */

.ccp-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
	justify-content: space-between;
}

.ccp-layout-box .ccp-actions,
.ccp-layout-modal .ccp-actions {
	margin-top: 26px;
}

.ccp-actions__start,
.ccp-actions__end {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
}

.ccp-actions__end {
	margin-left: auto;
}

.ccp-root .ccp-btn,
.ccp-placeholder .ccp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 160px;
	min-height: var(--ccp-btn-height);
	margin: 0;
	padding: 12px 26px;
	color: var(--ccp-fg);
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	background: transparent;
	border: 2px solid transparent;
	border-radius: var(--ccp-btn-radius);
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, filter 0.15s ease;
}

.ccp-root .ccp-btn:active {
	transform: translateY(1px);
}

.ccp-root .ccp-btn:focus-visible,
.ccp-root .ccp-switch input:focus-visible + .ccp-switch__track,
.ccp-root .ccp-close:focus-visible,
.ccp-reopen:focus-visible {
	outline: 2px solid var(--ccp-accent);
	outline-offset: 3px;
}

/* Solid accent — accept / save. */
.ccp-root .ccp-btn--primary,
.ccp-placeholder .ccp-btn--primary {
	color: var(--ccp-accent-text);
	background: var(--ccp-accent);
	border-color: var(--ccp-accent);
}

.ccp-root .ccp-btn--primary:hover,
.ccp-placeholder .ccp-btn--primary:hover {
	filter: brightness(1.08);
}

/* Outlined accent — manage cookies. */
.ccp-root .ccp-btn--outline {
	color: var(--ccp-accent);
	background: transparent;
	border-color: var(--ccp-accent);
}

.ccp-root .ccp-btn--outline:hover {
	color: var(--ccp-accent-text);
	background: var(--ccp-accent);
}

/* Solid neutral — reject. */
.ccp-root .ccp-btn--muted {
	color: var(--ccp-reject-text);
	background: var(--ccp-reject);
	border-color: var(--ccp-reject);
}

.ccp-root .ccp-btn--muted:hover {
	filter: brightness(1.12);
}

/* -------------------------------------------------------------------- modal */

.ccp-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.ccp-modal__panel {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 830px;
	max-height: min(790px, calc(100vh - 32px));
	color: var(--ccp-fg);
	background: var(--ccp-bg);
	border-radius: var(--ccp-radius);
	box-shadow: var(--ccp-shadow);
	animation: ccp-rise 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.ccp-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-shrink: 0;
	padding: 26px 30px 18px;
	border-bottom: 1px solid var(--ccp-border);
}

.ccp-modal__body {
	flex: 1 1 auto;
	padding: 0 20px 8px 30px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.ccp-modal__body .ccp-text__meta {
	margin-top: 22px;
}

.ccp-modal__foot {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	flex-shrink: 0;
	justify-content: flex-end;
	padding: 24px 30px 30px;
}

.ccp-root .ccp-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	padding: 0;
	color: var(--ccp-muted);
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: color 0.15s ease;
}

.ccp-root .ccp-close:hover {
	color: var(--ccp-fg);
}

.ccp-close__icon {
	display: block;
	width: 22px;
	height: 22px;
}

/* Scrollbar, matching the reference: thin grey thumb on a near-white track. */
.ccp-modal__body {
	scrollbar-width: thin;
	scrollbar-color: #8b8b8b #fcfcfc;
}

.ccp-modal__body::-webkit-scrollbar {
	width: 15px;
}

.ccp-modal__body::-webkit-scrollbar-track {
	background: #fcfcfc;
}

.ccp-modal__body::-webkit-scrollbar-thumb {
	background: #8b8b8b;
	border: 3px solid #fcfcfc;
	border-radius: 999px;
}

/* --------------------------------------------------------------- categories */

.ccp-root .ccp-categories {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ccp-root .ccp-category {
	margin: 0;
	padding: 26px 0;
	list-style: none;
	background: none;
	border: 0;
	border-bottom: 1px solid var(--ccp-border);
}

.ccp-root .ccp-category:last-child {
	border-bottom: 0;
}

.ccp-category__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 24px;
}

.ccp-root .ccp-category__title {
	margin: 0;
	padding: 0;
	color: var(--ccp-fg);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

.ccp-category__desc {
	margin-top: 14px;
	color: var(--ccp-muted);
	font-size: 15px;
	line-height: 1.6;
}

.ccp-category__desc p {
	margin: 0 0 8px;
	color: inherit;
	font-size: inherit;
	line-height: inherit;
}

.ccp-category__desc p:last-child {
	margin-bottom: 0;
}

.ccp-always {
	flex-shrink: 0;
	color: var(--ccp-accent);
	font-size: 15px;
	font-weight: 700;
	white-space: nowrap;
}

/* Switch */
.ccp-root .ccp-switch {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	margin: 0;
	padding: 0;
	cursor: pointer;
}

.ccp-root .ccp-switch input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.ccp-switch__track {
	position: relative;
	display: block;
	width: 44px;
	height: 24px;
	flex-shrink: 0;
	background: var(--ccp-track);
	border-radius: 999px;
	transition: background-color 0.18s ease;
}

.ccp-switch__thumb {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 20px;
	height: 20px;
	background: #ffffff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(10, 14, 19, 0.22);
	transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.ccp-switch input:checked + .ccp-switch__track {
	background: var(--ccp-accent);
}

.ccp-switch input:checked + .ccp-switch__track .ccp-switch__thumb {
	transform: translateX(20px);
}

/* ------------------------------------------------------------ reopen button */

.ccp-reopen {
	position: fixed;
	bottom: 18px;
	left: 18px;
	z-index: 999997;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	color: var(--ccp-accent-text);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	background: var(--ccp-accent);
	border: 0;
	border-radius: 999px;
	box-shadow: 0 8px 22px rgba(10, 14, 19, 0.24);
	cursor: pointer;
	opacity: 0.9;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.ccp-reopen:hover {
	opacity: 1;
	transform: translateY(-1px);
}

.ccp-reopen__icon {
	flex-shrink: 0;
}

/* ------------------------------------------------- blocked embed placeholder */

.ccp-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	min-height: 180px;
	padding: 24px;
	text-align: center;
	color: #0a0e13;
	font-size: 15px;
	background: #f5f5f5;
	border: 1px dashed #dcdcdc;
	border-radius: 8px;
}

.ccp-placeholder__text {
	margin: 0;
	max-width: 42ch;
}

/* ------------------------------------------------------------------ motion */

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

@keyframes ccp-fade {
	from {
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ccp-banner,
	.ccp-modal__panel,
	.ccp-overlay,
	.ccp-switch__thumb,
	.ccp-switch__track,
	.ccp-reopen {
		animation: none !important;
		transition: none !important;
	}
}

/* ------------------------------------------------------------- small screens */

@media (max-width: 782px) {
	.ccp-banner {
		flex-direction: column;
		align-items: stretch;
		gap: 20px;
		padding: 24px 20px;
	}

	.ccp-layout-box .ccp-banner,
	.ccp-layout-bar .ccp-banner {
		left: 12px;
		right: 12px;
		bottom: 12px;
		max-width: none;
		border-radius: var(--ccp-radius);
		border-width: 1px;
	}

	.ccp-layout-modal .ccp-banner {
		width: calc(100% - 24px);
		max-height: calc(100vh - 24px);
	}

	/* Match the specificity of the wide top/bottom card rules above. */
	.ccp-layout-box.ccp-pos-bottom .ccp-banner,
	.ccp-layout-box.ccp-pos-top .ccp-banner {
		left: 12px;
		right: 12px;
		max-height: calc(100vh - 24px);
	}

	.ccp-layout-box.ccp-pos-bottom .ccp-banner {
		bottom: 12px;
	}

	.ccp-layout-bar.ccp-pos-top .ccp-banner,
	.ccp-layout-box.ccp-pos-top .ccp-banner {
		top: 12px;
		bottom: auto;
	}

	.ccp-actions,
	.ccp-actions__start,
	.ccp-actions__end {
		flex-direction: column-reverse;
		align-items: stretch;
		gap: 12px;
	}

	.ccp-actions__end {
		margin-left: 0;
	}

	.ccp-root .ccp-btn {
		width: 100%;
	}

	.ccp-modal {
		padding: 12px;
	}

	.ccp-modal__head {
		padding: 20px 20px 14px;
	}

	.ccp-modal__body {
		padding: 0 12px 0 20px;
	}

	.ccp-modal__foot {
		flex-direction: column-reverse;
		padding: 20px;
	}

	.ccp-category__head {
		align-items: flex-start;
	}

	.ccp-reopen__label {
		display: none;
	}

	.ccp-reopen {
		padding: 12px;
	}
}
