/**
 * Cookie consent manager - front end styles.
 *
 * Scoped under .cc-* and driven by custom properties so it survives any Joomla template.
 * Accept and reject share the exact same button style on purpose: a visually weaker
 * reject button is a dark pattern and voids the consent.
 *
 * @license GNU General Public License version 2 or later
 */

.cc-root {
	--cc-accent: #1f5fbf;
	--cc-bg: #ffffff;
	--cc-fg: #1a1c20;
	--cc-muted: #5b6068;
	--cc-border: #d8dbe0;
	--cc-radius: 10px;
	--cc-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
	--cc-max: 30rem;

	position: relative;
	z-index: 2147483000;
	font-size: 15px;
	line-height: 1.5;
	color: var(--cc-fg);
	font-family: inherit;
}

@media (prefers-color-scheme: dark) {
	.cc-root {
		--cc-bg: #16181c;
		--cc-fg: #f2f3f5;
		--cc-muted: #a8adb6;
		--cc-border: #33373e;
		--cc-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
	}
}

.cc-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(12, 14, 18, 0.55);
	z-index: 2147483000;
}

html.cc-locked {
	overflow: hidden;
}

html.cc-locked .cc-badge {
	display: none;
}

/* --- Card ----------------------------------------------------------- */

.cc-box {
	position: fixed;
	box-sizing: border-box;
	z-index: 2147483001;
	width: calc(100% - 2rem);
	max-width: var(--cc-max);
	max-height: calc(100vh - 2rem);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 1.5rem;
	background: var(--cc-bg);
	color: var(--cc-fg);
	border: 1px solid var(--cc-border);
	border-radius: var(--cc-radius);
	box-shadow: var(--cc-shadow);
}

.cc-box--wide {
	--cc-max: 40rem;
}

.cc-root[data-position="bottom-left"] .cc-box {
	bottom: 1rem;
	left: 1rem;
}

.cc-root[data-position="bottom-right"] .cc-box {
	bottom: 1rem;
	right: 1rem;
}

.cc-root[data-position="bottom"] .cc-box {
	bottom: 1rem;
	left: 50%;
	transform: translateX(-50%);
}

.cc-root[data-layout="bar"] .cc-box {
	--cc-max: none;
	bottom: 0;
	left: 0;
	right: 0;
	width: 100%;
	border-radius: 0;
	border-width: 1px 0 0;
	transform: none;
}

.cc-root[data-layout="center"] .cc-box,
.cc-root .cc-box--wide {
	top: 50%;
	left: 50%;
	right: auto;
	bottom: auto;
	transform: translate(-50%, -50%);
}

@media (max-width: 480px) {
	.cc-root .cc-box {
		bottom: 0;
		left: 0;
		right: 0;
		top: auto;
		width: 100%;
		max-width: none;
		max-height: 85vh;
		border-radius: var(--cc-radius) var(--cc-radius) 0 0;
		transform: none;
	}
}

.cc-title {
	margin: 0 0 0.5rem;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--cc-fg);
}

.cc-intro {
	margin: 0 0 1rem;
	color: var(--cc-muted);
	font-size: 0.9rem;
}

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

.cc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 1rem 0 0.75rem;
}

.cc-btn {
	flex: 1 1 auto;
	min-width: 8rem;
	padding: 0.7rem 1.1rem;
	font: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	text-align: center;
	border-radius: 6px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: filter 0.15s ease, background-color 0.15s ease;
}

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

/* Accept and reject are deliberately identical. */
.cc-btn--primary {
	background: var(--cc-accent);
	color: #fff;
}

.cc-btn--primary:hover {
	filter: brightness(0.92);
}

.cc-btn--link {
	flex: 1 1 100%;
	background: transparent;
	color: var(--cc-muted);
	border-color: var(--cc-border);
	font-weight: 500;
}

.cc-btn--link:hover {
	color: var(--cc-fg);
}

/* Withdrawal sits apart from the choice buttons so it cannot be hit by accident,
   but stays a full-width target rather than a buried text link. */
.cc-btn--revoke {
	width: 100%;
	margin-top: 0.25rem;
}

.cc-links {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin: 0.5rem 0 0;
	font-size: 0.8rem;
}

.cc-links a {
	color: var(--cc-muted);
	text-decoration: underline;
}

.cc-consent-id {
	margin: 0.75rem 0 0;
	font-size: 0.7rem;
	color: var(--cc-muted);
	word-break: break-all;
}

/* --- Categories and services --------------------------------------- */

.cc-cats {
	margin: 0.5rem 0;
	border-top: 1px solid var(--cc-border);
}

.cc-cat {
	padding: 1rem 0;
	border-bottom: 1px solid var(--cc-border);
}

.cc-cat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}

.cc-cat__label,
.cc-svc__head {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	cursor: pointer;
}

.cc-cat__label input,
.cc-svc__head input {
	width: 1.15rem;
	height: 1.15rem;
	margin: 0;
	accent-color: var(--cc-accent);
	flex: none;
}

.cc-cat__label input:disabled {
	cursor: not-allowed;
}

.cc-cat__name {
	font-weight: 700;
}

.cc-cat__desc {
	margin: 0.4rem 0 0;
	font-size: 0.85rem;
	color: var(--cc-muted);
}

.cc-pill {
	flex: none;
	padding: 0.15rem 0.5rem;
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--cc-muted);
	border: 1px solid var(--cc-border);
	border-radius: 999px;
}

.cc-svc {
	margin: 0.75rem 0 0;
	padding: 0.6rem 0.75rem;
	background: color-mix(in srgb, var(--cc-fg) 4%, transparent);
	border-radius: 6px;
}

.cc-svc__name {
	font-size: 0.9rem;
	font-weight: 600;
}

.cc-svc__details {
	margin-top: 0.4rem;
	font-size: 0.8rem;
}

.cc-svc__details summary {
	cursor: pointer;
	color: var(--cc-accent);
	font-weight: 600;
}

.cc-svc__link {
	display: inline-block;
	margin-top: 0.4rem;
	color: var(--cc-accent);
}

.cc-meta {
	display: grid;
	grid-template-columns: minmax(6rem, auto) 1fr;
	gap: 0.2rem 0.75rem;
	margin: 0.5rem 0 0;
}

.cc-meta dt {
	font-weight: 600;
	color: var(--cc-muted);
}

.cc-meta dd {
	margin: 0;
	overflow-wrap: anywhere;
}

.cc-note {
	margin: 0.5rem 0 0;
	padding: 0.5rem 0.6rem;
	font-size: 0.78rem;
	color: var(--cc-fg);
	background: color-mix(in srgb, #d97706 16%, transparent);
	border-radius: 4px;
}

/* --- Badge ---------------------------------------------------------- */

.cc-badge {
	position: fixed;
	bottom: 1rem;
	z-index: 2147482000;
	min-width: 0;
	flex: none;
	padding: 0.45rem 0.85rem;
	font-size: 0.75rem;
	font-weight: 600;
	color: #fff;
	background: #33373e;
	border-radius: 999px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	opacity: 0.75;
}

.cc-badge:hover {
	opacity: 1;
}

.cc-badge[data-position="bottom-right"] {
	right: 1rem;
}

.cc-badge[data-position="bottom-left"],
.cc-badge[data-position="bottom"] {
	left: 1rem;
}

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

.cc-ph {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	min-height: 12rem;
	padding: 1.25rem;
	text-align: center;
	color: #1a1c20;
	background: #eef0f3;
	border: 1px dashed #b9bec6;
	border-radius: 8px;
	font-size: 15px;
	line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
	.cc-ph {
		color: #f2f3f5;
		background: #1d2025;
		border-color: #3a3f47;
	}
}

.cc-ph__body {
	max-width: 26rem;
}

.cc-ph__title {
	margin: 0 0 0.35rem;
	font-size: 1rem;
	font-weight: 700;
}

.cc-ph__text {
	margin: 0 0 0.85rem;
	font-size: 0.85rem;
	opacity: 0.85;
}

.cc-ph .cc-btn {
	flex: none;
	--cc-accent: #1f5fbf;
	background: var(--cc-accent);
	color: #fff;
}

.cc-ph__always {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	margin-top: 0.7rem;
	font-size: 0.78rem;
	cursor: pointer;
}

.cc-ph__link {
	display: inline-block;
	margin-top: 0.6rem;
	font-size: 0.75rem;
	color: inherit;
	text-decoration: underline;
	opacity: 0.8;
}

/* --- Inline form gate (reCAPTCHA) ---------------------------------- */

.cc-gate {
	box-sizing: border-box;
	margin: 0.75rem 0;
	padding: 0.9rem 1rem;
	font-size: 0.85rem;
	line-height: 1.5;
	color: #1a1c20;
	background: #eef0f3;
	border: 1px solid #b9bec6;
	border-radius: 8px;
}

@media (prefers-color-scheme: dark) {
	.cc-gate {
		color: #f2f3f5;
		background: #1d2025;
		border-color: #3a3f47;
	}
}

.cc-gate p {
	margin: 0 0 0.6rem;
}

.cc-gate .cc-btn {
	flex: none;
	background: #1f5fbf;
	color: #fff;
}

@media (prefers-reduced-motion: reduce) {
	.cc-btn {
		transition: none;
	}
}
