/**
 * Consent Gate UI — banner, preference modal, floating re-open trigger, and the
 * CPRA "Your Privacy Choices" link. Colors are driven by CSS custom properties
 * injected inline by the plugin (see includes/gate-render.php).
 */

#pcgate-banner,
#pcgate-modal,
#pcgate-reopen,
.pcgate-dns-link {
	--pcg-bg: #000;
	--pcg-text: #fff;
	--pcg-accent: #c9a24b;
	--pcg-btn-text: #000;
	--pcg-btn-hover: #fff;
	--pcg-btn-hover-text: #000;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.5;
}

#pcgate-banner *,
#pcgate-modal * { box-sizing: border-box; }

/* ── Banner ─────────────────────────────────────────────────────────── */
#pcgate-banner {
	position: fixed;
	left: 1rem;
	right: 1rem;
	bottom: 1rem;
	z-index: 2147483000;
	max-width: 46rem;
	margin: 0 auto;
	padding: 1.25rem 1.5rem;
	background: var(--pcg-bg);
	color: var(--pcg-text);
	border: 1px solid var(--pcg-accent);
	border-radius: 10px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
	display: none;
}
#pcgate-banner.pcgate-show { display: block; }
#pcgate-banner .pcgate-text h2 {
	margin: 0 0 .4rem;
	font-size: 1.1rem;
	color: var(--pcg-accent);
}
#pcgate-banner .pcgate-text p { margin: 0 0 1rem; font-size: .9rem; }
#pcgate-banner .pcgate-text a { color: var(--pcg-accent); }
#pcgate-banner .pcgate-gpc {
	margin: .75rem 0 0;
	font-size: .78rem;
	opacity: .8;
	font-style: italic;
}
.pcgate-actions { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.pcgate-btn {
	appearance: none;
	cursor: pointer;
	border: 1px solid var(--pcg-accent);
	border-radius: 6px;
	padding: .55rem 1.1rem;
	font-size: .88rem;
	font-weight: 600;
	transition: background .15s ease, color .15s ease;
}
.pcgate-accept, .pcgate-save {
	background: var(--pcg-accent);
	color: var(--pcg-btn-text);
}
.pcgate-reject, .pcgate-manage {
	background: transparent;
	color: var(--pcg-text);
}
.pcgate-btn:hover {
	background: var(--pcg-btn-hover);
	color: var(--pcg-btn-hover-text);
}

/* ── Preference modal ───────────────────────────────────────────────── */
#pcgate-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483001;
	background: rgba(0, 0, 0, .6);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}
#pcgate-modal[hidden] { display: none; }
.pcgate-dialog {
	background: var(--pcg-bg);
	color: var(--pcg-text);
	border: 1px solid var(--pcg-accent);
	border-radius: 10px;
	max-width: 34rem;
	width: 100%;
	max-height: 85vh;
	overflow-y: auto;
	padding: 1.5rem;
	outline: none;
}
.pcgate-dialog h2 { margin: 0 0 .5rem; font-size: 1.15rem; color: var(--pcg-accent); }
.pcgate-dialog > p { margin: 0 0 1rem; font-size: .88rem; opacity: .9; }
.pcgate-cat {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: .85rem 0;
	border-top: 1px solid rgba(255, 255, 255, .12);
}
.pcgate-cat-info strong { display: block; font-size: .95rem; }
.pcgate-cat-info span { display: block; font-size: .8rem; opacity: .75; margin-top: .15rem; }
.pcgate-alwayson { font-size: .8rem; opacity: .7; white-space: nowrap; }

/* toggle switch */
.pcgate-toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; cursor: pointer; }
.pcgate-toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pcgate-track {
	position: absolute; inset: 0; border-radius: 999px;
	background: #555; transition: background .15s ease;
}
.pcgate-track::before {
	content: ""; position: absolute; top: 3px; left: 3px;
	width: 18px; height: 18px; border-radius: 50%;
	background: #fff; transition: transform .15s ease;
}
.pcgate-toggle input:checked + .pcgate-track { background: var(--pcg-accent); }
.pcgate-toggle input:checked + .pcgate-track::before { transform: translateX(20px); }
.pcgate-toggle input:disabled + .pcgate-track { opacity: .5; cursor: not-allowed; }
.pcgate-modal-foot { margin-top: 1.25rem; text-align: right; }

/* ── Floating re-open trigger ───────────────────────────────────────── */
#pcgate-reopen {
	position: fixed;
	left: 1rem;
	bottom: 1rem;
	z-index: 2147482999;
	/* Hard-pin the size so a host theme's global button rules (padding,
	   content-box sizing) can't stretch it into an oval. */
	box-sizing: border-box;
	-webkit-appearance: none; appearance: none;
	width: 44px; height: 44px;
	min-width: 44px; max-width: 44px;
	padding: 0; margin: 0;
	aspect-ratio: 1 / 1;
	display: inline-flex; align-items: center; justify-content: center;
	border-radius: 50%;
	border: 1px solid var(--pcg-accent);
	background: var(--pcg-bg);
	color: var(--pcg-accent);
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}
#pcgate-reopen svg { width: 22px; height: 22px; display: block; }
#pcgate-reopen:hover { background: var(--pcg-accent); color: var(--pcg-btn-text); }

/* ── CPRA "Your Privacy Choices" link ───────────────────────────────── */
.pcgate-dns-link { cursor: pointer; text-decoration: underline; }

@media (max-width: 600px) {
	#pcgate-banner { left: .5rem; right: .5rem; bottom: .5rem; padding: 1rem; }
	.pcgate-actions .pcgate-btn { flex: 1 1 auto; }
}
