/* Cookie consent popup
   Markup: functions/cookie-consent.php   Behaviour: js/cookie-consent.js */

.skyciv-consent {
	--cc-ink: #01071f;
	--cc-muted: #4a5260;
	--cc-line: #d4d8de;
	--cc-soft: #f6f7f8;
	--cc-blue: #002fff;
	--cc-blue-hover: #0026cc;
	--cc-switch-off: #c5cee6;

	position: fixed;
	left: 20px;
	bottom: 20px;
	z-index: 100000;
	box-sizing: border-box;
	width: 360px;
	max-width: calc(100vw - 40px);
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	padding: 24px;
	background: #ffffff;
	color: var(--cc-ink);
	border: 1px solid var(--cc-line);
	border-radius: 8px;
	box-shadow: 0 12px 40px rgba(1, 7, 31, 0.18);
	font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	font-size: 12px;
	line-height: 1.5;
	text-align: left;
	animation: skyciv-consent-in 0.25s ease-out;
}

.skyciv-consent *,
.skyciv-consent *::before,
.skyciv-consent *::after {
	box-sizing: border-box;
}

/* Our display rules would otherwise override the hidden attribute */
.skyciv-consent[hidden],
.skyciv-consent [hidden] {
	display: none !important;
}

.skyciv-consent:focus {
	outline: none;
}

/* ---------- Text ---------- */

.skyciv-consent .skyciv-consent__title {
	margin: 0 0 8px;
	padding: 0;
	color: var(--cc-ink);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
}

.skyciv-consent .skyciv-consent__text {
	margin: 0 0 20px;
	padding: 0;
	color: var(--cc-muted);
	font-size: 12px;
	line-height: 1.55;
}

.skyciv-consent .skyciv-consent__text a {
	color: var(--cc-blue);
	text-decoration: underline;
}

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

.skyciv-consent__prefs {
	margin: 0 0 20px;
	border-top: 1px solid var(--cc-line);
}

.skyciv-consent__cat {
	padding: 14px 0;
	border-bottom: 1px solid var(--cc-line);
}

.skyciv-consent .skyciv-consent__cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0;
	padding: 0;
	color: var(--cc-ink);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
}

.skyciv-consent label.skyciv-consent__cat-head {
	cursor: pointer;
}

.skyciv-consent .skyciv-consent__cat-desc {
	margin: 4px 0 0;
	padding: 0;
	color: var(--cc-muted);
	font-size: 12px;
	line-height: 1.5;
}

.skyciv-consent__always {
	color: var(--cc-blue);
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}

/* ---------- Toggle switch ---------- */

.skyciv-consent__switch {
	position: relative;
	flex: 0 0 auto;
	width: 40px;
	height: 22px;
}

.skyciv-consent .skyciv-consent__switch input {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.skyciv-consent__slider {
	position: absolute;
	inset: 0;
	background: var(--cc-switch-off);
	border-radius: 999px;
	transition: background-color 0.2s;
}

.skyciv-consent__slider::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	background: #ffffff;
	border-radius: 50%;
	box-shadow: 0 1px 2px rgba(1, 7, 31, 0.25);
	transition: transform 0.2s;
}

.skyciv-consent__switch input:checked + .skyciv-consent__slider {
	background: var(--cc-blue);
}

.skyciv-consent__switch input:checked + .skyciv-consent__slider::after {
	transform: translateX(18px);
}

.skyciv-consent__switch input:focus-visible + .skyciv-consent__slider {
	outline: 2px solid var(--cc-ink);
	outline-offset: 2px;
}

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

.skyciv-consent__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

/* Accept and Reject are deliberately identical: rejecting must be as easy as accepting */
.skyciv-consent .skyciv-consent__btn {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	margin: 0;
	padding: 10px 16px;
	background: var(--cc-blue);
	color: #ffffff;
	border: 1px solid var(--cc-blue);
	border-radius: 4px;
	box-shadow: none;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.skyciv-consent .skyciv-consent__btn:hover {
	background: var(--cc-blue-hover);
	border-color: var(--cc-blue-hover);
	color: #ffffff;
}

.skyciv-consent .skyciv-consent__btn:focus-visible {
	outline: 2px solid var(--cc-ink);
	outline-offset: 2px;
}

.skyciv-consent .skyciv-consent__btn--secondary {
	grid-column: 1 / -1;
	background: transparent;
	color: var(--cc-blue);
}

.skyciv-consent .skyciv-consent__btn--secondary:hover {
	background: var(--cc-soft);
	color: var(--cc-blue-hover);
}

/* ---------- Mobile: full-width bar along the bottom ---------- */

@media (max-width: 600px) {
	.skyciv-consent {
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		max-width: none;
		max-height: 85vh;
		padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
		border-width: 1px 0 0;
		border-radius: 12px 12px 0 0;
	}
}

/* ---------- Footer "Cookie settings" link (beside the language selector) ---------- */

.footer-bottom-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 8px 24px;
}

/* !important to beat Avada's footer link colour, same as .footer-list a in style.css */
.footer-bottom-links .cookie-settings-link {
	color: inherit !important;
	font-size: 14px;
	text-decoration: none;
	white-space: nowrap;
}

.footer-bottom-links .cookie-settings-link:hover,
.footer-bottom-links .cookie-settings-link:focus-visible {
	color: #ffffff !important;
	text-decoration: underline;
}

/* Language selector goes full width here (style.css), so the link sits on its own line above it */
@media all and (max-width: 1024px) {
	.footer-bottom-links {
		justify-content: flex-start;
	}
}

@keyframes skyciv-consent-in {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: none; }
}

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

@media print {
	.skyciv-consent { display: none !important; }
}
