/**
 * HL Cookie Consent
 * Colours come from CSS custom properties set by the plugin settings.
 */

:root {
	--hlcc-bg: #ffffff;
	--hlcc-text: #1f2933;
	--hlcc-accent: #1d6fa5;
	--hlcc-accent-text: #ffffff;
	--hlcc-secondary-text: #1f2933;
	--hlcc-radius: 8px;
	--hlcc-shadow: 0 2px 24px rgba( 15, 23, 32, 0.18 );
	--hlcc-border: rgba( 31, 41, 51, 0.16 );
}

.hlcc-root[hidden] {
	display: none;
}

.hlcc-root *,
.hlcc-root *::before,
.hlcc-root *::after {
	box-sizing: border-box;
}

/* ---------- Banner ---------- */

.hlcc-banner {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 2147483000;
	display: flex;
	flex-wrap: wrap;
	gap: 16px 24px;
	align-items: center;
	justify-content: space-between;
	padding: 20px clamp( 16px, 4vw, 40px );
	background: var( --hlcc-bg );
	color: var( --hlcc-text );
	box-shadow: var( --hlcc-shadow );
	font-size: 15px;
	line-height: 1.5;
}

.hlcc-banner[hidden] {
	display: none;
}

.hlcc-root[data-hlcc-position='bottom'] .hlcc-banner {
	bottom: 0;
}

.hlcc-root[data-hlcc-position='top'] .hlcc-banner {
	top: 0;
}

.hlcc-root[data-hlcc-layout='box'] .hlcc-banner {
	left: auto;
	right: 24px;
	bottom: 24px;
	max-width: 420px;
	flex-direction: column;
	align-items: flex-start;
	border-radius: var( --hlcc-radius );
}

.hlcc-root[data-hlcc-layout='modal'] .hlcc-banner {
	top: 50%;
	left: 50%;
	right: auto;
	bottom: auto;
	transform: translate( -50%, -50% );
	max-width: 520px;
	flex-direction: column;
	align-items: flex-start;
	border-radius: var( --hlcc-radius );
}

.hlcc-banner__content {
	flex: 1 1 420px;
	min-width: 0;
}

.hlcc-banner__title {
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	color: inherit;
}

.hlcc-banner__text p {
	margin: 0 0 8px;
	color: inherit;
}

.hlcc-banner__text p:last-child {
	margin-bottom: 0;
}

.hlcc-banner__links {
	font-size: 13px;
}

.hlcc-banner a,
.hlcc-modal a {
	color: var( --hlcc-accent );
	text-decoration: underline;
}

.hlcc-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	flex-shrink: 0;
}

/* ---------- Buttons ---------- */

.hlcc-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 20px;
	border: 1px solid transparent;
	border-radius: var( --hlcc-radius );
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: opacity 0.15s ease, background-color 0.15s ease;
}

.hlcc-btn:focus-visible {
	outline: 2px solid var( --hlcc-accent );
	outline-offset: 2px;
}

.hlcc-btn:hover {
	opacity: 0.88;
}

.hlcc-btn--primary {
	background: var( --hlcc-accent );
	color: var( --hlcc-accent-text );
}

.hlcc-btn--secondary {
	background: transparent;
	border-color: var( --hlcc-border );
	color: var( --hlcc-secondary-text );
}

.hlcc-btn--link {
	background: none;
	border: none;
	padding: 10px 4px;
	color: var( --hlcc-secondary-text );
	text-decoration: underline;
	font-weight: 500;
}

.hlcc-prefs-link {
	appearance: none;
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
}

/* ---------- Preferences modal ---------- */

.hlcc-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.hlcc-modal[hidden] {
	display: none;
}

.hlcc-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 15, 23, 32, 0.55 );
}

.hlcc-modal__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 560px;
	max-height: calc( 100vh - 40px );
	background: var( --hlcc-bg );
	color: var( --hlcc-text );
	border-radius: var( --hlcc-radius );
	box-shadow: var( --hlcc-shadow );
	font-size: 15px;
	line-height: 1.5;
}

.hlcc-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 24px;
	border-bottom: 1px solid var( --hlcc-border );
}

.hlcc-modal__title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: inherit;
}

.hlcc-modal__close {
	appearance: none;
	background: none;
	border: 0;
	width: 36px;
	height: 36px;
	font-size: 26px;
	line-height: 1;
	color: inherit;
	cursor: pointer;
	border-radius: var( --hlcc-radius );
}

.hlcc-modal__close:focus-visible {
	outline: 2px solid var( --hlcc-accent );
	outline-offset: 2px;
}

.hlcc-modal__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 8px 24px 16px;
}

.hlcc-modal__links {
	font-size: 13px;
	margin: 16px 0 0;
}

.hlcc-modal__footer {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-end;
	padding: 16px 24px;
	border-top: 1px solid var( --hlcc-border );
}

/* ---------- Categories ---------- */

.hlcc-cat {
	padding: 16px 0;
	border-bottom: 1px solid var( --hlcc-border );
}

.hlcc-cat:last-of-type {
	border-bottom: 0;
}

.hlcc-cat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.hlcc-cat__label {
	font-weight: 600;
	cursor: pointer;
}

.hlcc-cat__locked {
	font-size: 13px;
	opacity: 0.65;
}

.hlcc-cat__desc {
	margin: 6px 0 0;
	font-size: 14px;
	opacity: 0.8;
}

/* ---------- Switch ---------- */

.hlcc-switch {
	position: relative;
	flex-shrink: 0;
	width: 46px;
	height: 26px;
}

.hlcc-switch input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 1;
}

.hlcc-switch__track {
	position: absolute;
	inset: 0;
	background: rgba( 31, 41, 51, 0.25 );
	border-radius: 999px;
	transition: background-color 0.15s ease;
	pointer-events: none;
}

.hlcc-switch__track::after {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.15s ease;
}

.hlcc-switch input:checked + .hlcc-switch__track {
	background: var( --hlcc-accent );
}

.hlcc-switch input:checked + .hlcc-switch__track::after {
	transform: translateX( 20px );
}

.hlcc-switch input:focus-visible + .hlcc-switch__track {
	outline: 2px solid var( --hlcc-accent );
	outline-offset: 2px;
}

/* ---------- Blocked embed placeholder ---------- */

.hlcc-embed-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 32px 20px;
	text-align: center;
	background: rgba( 31, 41, 51, 0.05 );
	border: 1px dashed var( --hlcc-border );
	border-radius: var( --hlcc-radius );
	font-size: 14px;
}

/* ---------- Small screens ---------- */

@media ( max-width: 640px ) {
	.hlcc-banner {
		flex-direction: column;
		align-items: stretch;
		padding: 16px;
		max-height: 85vh;
		overflow-y: auto;
	}

	.hlcc-root[data-hlcc-layout='box'] .hlcc-banner,
	.hlcc-root[data-hlcc-layout='modal'] .hlcc-banner {
		left: 0;
		right: 0;
		bottom: 0;
		top: auto;
		transform: none;
		max-width: none;
		border-radius: var( --hlcc-radius ) var( --hlcc-radius ) 0 0;
	}

	/* In a column, the desktop 420px flex-basis becomes a height. Reset it. */
	.hlcc-banner__content {
		flex: 0 1 auto;
	}

	.hlcc-banner__actions {
		flex-direction: column-reverse;
		align-items: stretch;
	}

	.hlcc-btn {
		width: 100%;
	}

	.hlcc-modal__footer {
		flex-direction: column-reverse;
	}

	.hlcc-modal__footer .hlcc-btn {
		width: 100%;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.hlcc-btn,
	.hlcc-switch__track,
	.hlcc-switch__track::after {
		transition: none;
	}
}

/* ---------- Do Not Sell / Your Privacy Choices ---------- */

.hlcc-do-not-sell {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.hlcc-optout-icon {
	flex-shrink: 0;
	vertical-align: middle;
}
