/*
 * Cookie Consent (GDPR) for Joomla - RB Studio, Renato Bonica
 * Everything lives under #fcc-root and is reset first, so the site template
 * cannot restyle the banner and the banner cannot restyle the site.
 */

#fcc-root,
#fcc-root * {
	all: revert;
	box-sizing: border-box;
}

#fcc-root {
	--fcc-accent: #4f7a0f;
	--fcc-ink: #1d2419;
	--fcc-muted: #55604d;
	--fcc-line: #dfe5d8;
	--fcc-surface: #ffffff;
	--fcc-soft: #f4f7ef;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--fcc-ink);
	text-align: left;
}

#fcc-root .fcc-hidden {
	display: none !important;
}

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

#fcc-root .fcc-banner {
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: 16px;
	z-index: 2147483000;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 28px;
	max-width: 1080px;
	max-height: calc(100vh - 32px);
	margin: 0 auto;
	padding: 22px 60px 22px 26px;
	overflow-y: auto;
	background: var(--fcc-surface);
	border-top: 4px solid var(--fcc-accent);
	border-radius: 10px;
	box-shadow: 0 10px 44px rgba(20, 30, 10, 0.3);
}

#fcc-root .fcc-banner-body {
	flex: 1 1 420px;
	min-width: 0;
}

#fcc-root .fcc-title {
	margin: 0 0 6px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--fcc-ink);
}

#fcc-root .fcc-text {
	margin: 0;
	font-size: 14px;
	line-height: 1.55;
	color: var(--fcc-muted);
}

#fcc-root .fcc-link {
	color: var(--fcc-accent);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
	white-space: nowrap;
}

#fcc-root .fcc-link:hover {
	text-decoration-thickness: 2px;
}

#fcc-root .fcc-actions {
	display: flex;
	flex: 0 1 auto;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
}

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

#fcc-root .fcc-btn {
	display: inline-block;
	min-width: 132px;
	min-height: 44px;
	margin: 0;
	padding: 10px 20px;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	white-space: nowrap;
	cursor: pointer;
	border: 2px solid transparent;
	border-radius: 6px;
	transition: filter 0.15s ease, background-color 0.15s ease;
}

/* Accept and Reject have the same size and weight: neither is hidden behind the other */
#fcc-root .fcc-btn-accept {
	color: #fff;
	background: var(--fcc-accent);
	border-color: var(--fcc-accent);
}

#fcc-root .fcc-btn-reject {
	color: #fff;
	background: #2c3329;
	border-color: #2c3329;
}

#fcc-root .fcc-btn-accept:hover,
#fcc-root .fcc-btn-reject:hover {
	filter: brightness(1.12);
}

#fcc-root .fcc-btn-plain {
	min-width: 0;
	color: var(--fcc-ink);
	background: transparent;
	text-decoration: underline;
	text-underline-offset: 3px;
}

#fcc-root .fcc-btn-plain:hover {
	background: var(--fcc-soft);
}

#fcc-root .fcc-btn-outline {
	min-width: 132px;
	text-decoration: none;
	border-color: #2c3329;
}

#fcc-root .fcc-close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	font: inherit;
	font-size: 28px;
	line-height: 1;
	color: var(--fcc-muted);
	cursor: pointer;
	background: transparent;
	border: 0;
	border-radius: 50%;
}

#fcc-root .fcc-close:hover {
	color: var(--fcc-ink);
	background: var(--fcc-soft);
}

#fcc-root button:focus-visible,
#fcc-root a:focus-visible,
#fcc-root .fcc-switch-input:focus-visible + .fcc-switch-track {
	outline: 3px solid var(--fcc-ink);
	outline-offset: 2px;
}

#fcc-root .fcc-banner:focus,
#fcc-root .fcc-modal:focus {
	outline: none;
}

/* ------------------------------------------------------------ preferences window */

#fcc-root .fcc-overlay {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 2147483001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(20, 26, 16, 0.6);
}

#fcc-root .fcc-modal {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 640px;
	max-height: 100%;
	background: var(--fcc-surface);
	border-radius: 10px;
	box-shadow: 0 16px 60px rgba(0, 0, 0, 0.4);
}

#fcc-root .fcc-modal-head {
	padding: 22px 60px 14px 26px;
	border-bottom: 1px solid var(--fcc-line);
}

#fcc-root .fcc-modal-head .fcc-title {
	margin: 0;
	font-size: 20px;
}

#fcc-root .fcc-modal-body {
	flex: 1 1 auto;
	padding: 18px 26px 6px;
	overflow-y: auto;
}

#fcc-root .fcc-cat {
	margin: 14px 0 0;
	padding: 14px 16px;
	background: var(--fcc-soft);
	border: 1px solid var(--fcc-line);
	border-radius: 8px;
}

#fcc-root .fcc-cat-head {
	display: flex;
	align-items: center;
	gap: 12px;
}

#fcc-root .fcc-cat-name {
	flex: 1 1 auto;
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--fcc-ink);
	cursor: pointer;
}

#fcc-root .fcc-always {
	font-size: 12px;
	font-weight: 600;
	color: var(--fcc-muted);
	white-space: nowrap;
}

#fcc-root .fcc-cat-desc {
	margin: 6px 0 0;
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--fcc-muted);
}

#fcc-root .fcc-modal-actions {
	padding: 16px 26px 20px;
	border-top: 1px solid var(--fcc-line);
}

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

#fcc-root .fcc-switch {
	position: relative;
	display: inline-block;
	flex: 0 0 auto;
	width: 46px;
	height: 26px;
}

#fcc-root .fcc-switch-input {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
	opacity: 0;
}

#fcc-root .fcc-switch-track {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: #8a9383;
	border-radius: 13px;
	transition: background-color 0.15s ease;
}

#fcc-root .fcc-switch-track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
	transition: transform 0.15s ease;
}

#fcc-root .fcc-switch-input:checked + .fcc-switch-track {
	background: var(--fcc-accent);
}

#fcc-root .fcc-switch-input:checked + .fcc-switch-track::after {
	transform: translateX(20px);
}

#fcc-root .fcc-switch-locked .fcc-switch-input {
	cursor: not-allowed;
}

#fcc-root .fcc-switch-locked .fcc-switch-track {
	opacity: 0.55;
}

/* ------------------------------------------------------------ "cookie preferences" button */

#fcc-root .fcc-fab {
	position: fixed;
	left: 14px;
	bottom: 14px;
	z-index: 2147482999;
	display: flex;
	align-items: center;
	gap: 0;
	height: 40px;
	margin: 0;
	padding: 0 10px;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	color: var(--fcc-ink);
	cursor: pointer;
	background: var(--fcc-surface);
	border: 1px solid var(--fcc-line);
	border-radius: 20px;
	box-shadow: 0 3px 14px rgba(20, 30, 10, 0.22);
}

#fcc-root .fcc-fab-icon {
	position: relative;
	display: block;
	width: 20px;
	height: 20px;
	background: var(--fcc-accent);
	border-radius: 50%;
}

/* three "bites" make the dot read as a cookie */
#fcc-root .fcc-fab-icon::before {
	content: "";
	position: absolute;
	top: 5px;
	left: 5px;
	width: 3px;
	height: 3px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 7px 2px 0 #fff, 2px 8px 0 #fff;
}

#fcc-root .fcc-fab-label {
	max-width: 0;
	overflow: hidden;
	white-space: nowrap;
	transition: max-width 0.2s ease, margin 0.2s ease;
}

#fcc-root .fcc-fab:hover .fcc-fab-label,
#fcc-root .fcc-fab:focus-visible .fcc-fab-label {
	max-width: 220px;
	margin-left: 8px;
}

/* ------------------------------------------------------------ blocked content (lives in the page, outside #fcc-root) */

.fcc-placeholder {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	width: 100%;
	min-height: 180px;
	margin: 0 0 12px;
	padding: 24px 20px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	text-align: center;
	background: #f4f7ef;
	border: 1px dashed #b9c4ac;
	border-radius: 8px;
}

.fcc-placeholder .fcc-placeholder-text {
	max-width: 520px;
	margin: 0;
	padding: 0;
	font-size: 14px;
	line-height: 1.5;
	color: #3f4939;
}

.fcc-placeholder .fcc-placeholder-btn {
	min-height: 44px;
	margin: 0;
	padding: 10px 20px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	color: #fff;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	background: #4f7a0f;
	border: 0;
	border-radius: 6px;
	box-shadow: none;
}

.fcc-placeholder .fcc-placeholder-btn:hover {
	filter: brightness(1.12);
}

.fcc-placeholder .fcc-placeholder-btn:focus-visible {
	outline: 3px solid #1d2419;
	outline-offset: 2px;
}

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

@media (max-width: 720px) {
	#fcc-root .fcc-banner {
		left: 8px;
		right: 8px;
		bottom: 8px;
		max-height: calc(100vh - 16px);
		padding: 18px 16px 16px;
	}

	#fcc-root .fcc-banner .fcc-title {
		padding-right: 40px;
	}

	#fcc-root .fcc-actions {
		flex: 1 1 100%;
		justify-content: stretch;
	}

	/* Reject and Accept side by side at the same width; the third action below them */
	#fcc-root .fcc-actions .fcc-btn {
		flex: 1 1 0;
		min-width: 0;
		padding-left: 10px;
		padding-right: 10px;
	}

	#fcc-root .fcc-actions .fcc-btn-plain {
		flex: 1 1 100%;
		order: 3;
	}

	#fcc-root .fcc-modal-head {
		padding: 18px 56px 12px 18px;
	}

	#fcc-root .fcc-modal-body {
		padding: 14px 18px 4px;
	}

	#fcc-root .fcc-modal-actions {
		padding: 14px 18px 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	#fcc-root * {
		transition: none !important;
	}
}

@media print {
	#fcc-root,
	.fcc-placeholder {
		display: none !important;
	}
}
