/* Consent Compass – front end */

.hrcc-ui {
	--hrcc-bg: #ffffff;
	--hrcc-text: #1f2328;
	--hrcc-accent: #1f4fd8;
	--hrcc-accent-text: #ffffff;
	--hrcc-radius: 14px;
	--hrcc-line: color-mix(in srgb, var(--hrcc-text) 16%, transparent);
	--hrcc-muted: color-mix(in srgb, var(--hrcc-text) 72%, var(--hrcc-bg));
	--hrcc-soft: color-mix(in srgb, var(--hrcc-text) 6%, var(--hrcc-bg));
	--hrcc-shadow: 0 18px 48px -12px rgba(15, 20, 40, .35), 0 2px 6px rgba(15, 20, 40, .08);
	box-sizing: border-box;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--hrcc-text);
	-webkit-font-smoothing: antialiased;
}
.hrcc-ui *, .hrcc-ui *::before, .hrcc-ui *::after { box-sizing: inherit; }
.hrcc-ui :focus-visible { outline: 3px solid var(--hrcc-accent); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.hrcc-ui .hrcc-btn {
	all: unset;
	box-sizing: border-box;
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 44px; padding: 10px 18px;
	border-radius: calc(var(--hrcc-radius) * .6);
	border: 2px solid var(--hrcc-accent);
	font: inherit; font-weight: 650; font-size: 15px; line-height: 1.2;
	text-align: center; cursor: pointer;
	transition: filter .15s ease, background-color .15s ease;
}
.hrcc-ui .hrcc-btn--primary { background: var(--hrcc-accent); color: var(--hrcc-accent-text); }
.hrcc-ui .hrcc-btn--primary:hover { filter: brightness(1.1); }
.hrcc-ui .hrcc-btn--secondary { background: transparent; color: var(--hrcc-text); border-color: var(--hrcc-line); }
.hrcc-ui .hrcc-btn--secondary:hover { background: var(--hrcc-soft); }
.hrcc-ui .hrcc-btn:focus-visible { outline: 3px solid var(--hrcc-accent); outline-offset: 2px; }

.hrcc-ui .hrcc-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }

/* ---------- Banner ---------- */
.hrcc-banner {
	position: fixed; z-index: 2147483000;
	background: var(--hrcc-bg);
	box-shadow: var(--hrcc-shadow);
	opacity: 0; transform: translateY(12px);
	transition: opacity .25s ease, transform .25s ease;
}
.hrcc-banner.is-visible { opacity: 1; transform: none; }
.hrcc-banner__title { margin: 0 0 6px; font-size: 17px; font-weight: 750; line-height: 1.3; color: inherit; letter-spacing: 0; text-transform: none; }
.hrcc-banner__text { margin: 0; color: var(--hrcc-muted); }
.hrcc-banner__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hrcc-gpc { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--hrcc-soft); font-size: 13.5px; }

/* Bar */
.hrcc-banner--bar {
	left: 0; right: 0;
	display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px 32px;
	padding: 18px max(20px, calc((100vw - 1240px) / 2));
	border-radius: 0;
}
.hrcc-banner--bar.hrcc-pos--top { top: 0; transform: translateY(-12px); }
.hrcc-banner--bar.hrcc-pos--bottom,
.hrcc-banner--bar.hrcc-pos--left,
.hrcc-banner--bar.hrcc-pos--right { bottom: 0; }
.hrcc-banner--bar.is-visible { transform: none; }
.hrcc-banner--bar .hrcc-banner__body { max-width: 760px; }

/* Box */
.hrcc-banner--box {
	bottom: 16px; width: min(420px, calc(100vw - 32px));
	padding: 22px; border-radius: var(--hrcc-radius);
	display: grid; gap: 16px;
}
.hrcc-banner--box.hrcc-pos--left, .hrcc-banner--box.hrcc-pos--bottom, .hrcc-banner--box.hrcc-pos--top { left: 16px; }
.hrcc-banner--box.hrcc-pos--right { right: 16px; }
.hrcc-banner--box .hrcc-banner__actions .hrcc-btn--primary { flex: 1 1 140px; }
.hrcc-banner--box .hrcc-banner__actions .hrcc-btn--secondary { flex: 1 1 100%; }

/* Modal */
dialog.hrcc-banner--modal {
	position: fixed; inset: 0; margin: auto;
	width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto;
	padding: 26px; border: 0; border-radius: var(--hrcc-radius);
	display: grid; gap: 18px; color: var(--hrcc-text);
}
dialog.hrcc-banner--modal:not([open]) { display: none; }
dialog.hrcc-banner--modal::backdrop { background: rgba(10, 14, 30, .55); }
.hrcc-banner--modal .hrcc-banner__title { font-size: 20px; }
.hrcc-banner--modal .hrcc-banner__actions .hrcc-btn--primary { flex: 1 1 160px; }
.hrcc-banner--modal .hrcc-banner__actions .hrcc-btn--secondary { flex: 1 1 100%; }

/* ---------- Preferences dialog ---------- */
dialog.hrcc-prefs {
	position: fixed; inset: 0; margin: auto;
	width: min(640px, calc(100vw - 24px)); max-height: min(760px, calc(100vh - 24px));
	padding: 0; border: 0; border-radius: var(--hrcc-radius);
	background: var(--hrcc-bg); color: var(--hrcc-text);
	box-shadow: var(--hrcc-shadow);
	z-index: 2147483001;
}
dialog.hrcc-prefs[open] { display: flex; flex-direction: column; }
dialog.hrcc-prefs::backdrop { background: rgba(10, 14, 30, .55); }

.hrcc-prefs__head {
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	padding: 18px 22px; border-bottom: 1px solid var(--hrcc-line);
}
.hrcc-prefs__title { margin: 0; font-size: 19px; font-weight: 750; line-height: 1.3; color: inherit; letter-spacing: 0; text-transform: none; }
.hrcc-ui .hrcc-close {
	all: unset; box-sizing: border-box;
	display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
	font-size: 26px; line-height: 1; cursor: pointer; color: inherit;
}
.hrcc-ui .hrcc-close:hover { background: var(--hrcc-soft); }
.hrcc-ui .hrcc-close:focus-visible { outline: 3px solid var(--hrcc-accent); outline-offset: 2px; }

.hrcc-prefs__body { padding: 6px 22px 18px; overflow-y: auto; overscroll-behavior: contain; }
.hrcc-prefs__intro { margin: 12px 0 6px; color: var(--hrcc-muted); }
.hrcc-prefs__id { margin: 14px 0 0; font-size: 12.5px; color: var(--hrcc-muted); }
.hrcc-prefs__id code { font-size: 12px; word-break: break-all; }

.hrcc-cat { padding: 16px 0; border-bottom: 1px solid var(--hrcc-line); }
.hrcc-cat:last-of-type { border-bottom: 0; }
.hrcc-cat__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hrcc-cat__title { margin: 0; font-size: 16px; font-weight: 700; color: inherit; letter-spacing: 0; text-transform: none; }
.hrcc-cat__desc { margin: 4px 0 0; color: var(--hrcc-muted); font-size: 14px; }
.hrcc-always { font-size: 13px; font-weight: 700; color: var(--hrcc-accent); white-space: nowrap; }

/* Switch */
.hrcc-switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.hrcc-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.hrcc-switch__track {
	width: 46px; height: 26px; border-radius: 999px;
	background: color-mix(in srgb, var(--hrcc-text) 28%, var(--hrcc-bg));
	position: relative; transition: background-color .15s ease;
}
.hrcc-switch__track::after {
	content: ""; position: absolute; top: 3px; left: 3px;
	width: 20px; height: 20px; border-radius: 50%; background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s ease;
}
.hrcc-switch input:checked + .hrcc-switch__track { background: var(--hrcc-accent); }
.hrcc-switch input:checked + .hrcc-switch__track::after { transform: translateX(20px); }
.hrcc-switch input:focus-visible + .hrcc-switch__track { outline: 3px solid var(--hrcc-accent); outline-offset: 2px; }

/* Cookie table */
.hrcc-cookies { margin-top: 8px; }
.hrcc-cookies summary { cursor: pointer; font-size: 13.5px; font-weight: 650; color: var(--hrcc-accent); width: max-content; }
.hrcc-table-wrap { overflow-x: auto; margin-top: 8px; border: 1px solid var(--hrcc-line); border-radius: 8px; }
.hrcc-ui table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0; }
.hrcc-ui th, .hrcc-ui td { text-align: left; vertical-align: top; padding: 7px 10px; border-bottom: 1px solid var(--hrcc-line); }
.hrcc-ui tr:last-child td { border-bottom: 0; }
.hrcc-ui th { font-weight: 700; background: var(--hrcc-soft); }
.hrcc-ui td code { font-size: 12px; white-space: nowrap; }

.hrcc-prefs__foot {
	display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end;
	padding: 14px 22px; border-top: 1px solid var(--hrcc-line); background: var(--hrcc-bg);
	border-radius: 0 0 var(--hrcc-radius) var(--hrcc-radius);
}
.hrcc-prefs__foot .hrcc-btn--secondary { margin-right: auto; order: -1; }

/* ---------- Floating button ---------- */
.hrcc-ui.hrcc-fab {
	all: unset; box-sizing: border-box;
	position: fixed; bottom: 16px; z-index: 2147482999;
	display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
	background: var(--hrcc-bg); color: var(--hrcc-accent);
	box-shadow: 0 6px 18px -4px rgba(15, 20, 40, .35);
	cursor: pointer;
}
.hrcc-ui.hrcc-fab--left { left: 16px; }
.hrcc-ui.hrcc-fab--right { right: 16px; }
.hrcc-ui.hrcc-fab:hover { transform: scale(1.06); }
.hrcc-ui.hrcc-fab:focus-visible { outline: 3px solid var(--hrcc-accent); outline-offset: 3px; }

/* ---------- Blocked embeds ---------- */
.hrcc-embed {
	position: relative; display: grid; place-items: center;
	width: 100%; min-height: 220px; margin: 0 0 1.5em;
	background: var(--hrcc-soft, #f3f4f6); border-radius: 10px;
	text-align: center;
}
.hrcc-embed__notice { max-width: 440px; padding: 24px; }
.hrcc-embed__notice p { margin: 0 0 14px; font-size: 14.5px; }

/* ---------- Shortcode output ---------- */
.hrcc-cookie-list { margin: 1.5em 0; }
.hrcc-cookie-list h3 { margin-bottom: .3em; }
.hrcc-cookie-list table { width: 100%; border-collapse: collapse; font-size: .92em; margin: .6em 0 1.4em; }
.hrcc-cookie-list th, .hrcc-cookie-list td { text-align: left; vertical-align: top; padding: .5em .7em; border-bottom: 1px solid rgba(127, 127, 127, .3); }
.hrcc-cookie-list code { white-space: nowrap; }
.hrcc-table-scroll { overflow-x: auto; }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
	.hrcc-banner--bar { grid-template-columns: 1fr; padding: 16px; }
	.hrcc-banner--bar .hrcc-banner__actions .hrcc-btn { flex: 1 1 140px; }
	.hrcc-banner--box { left: 8px !important; right: 8px !important; bottom: 8px; width: auto; padding: 18px; }
	.hrcc-prefs__foot .hrcc-btn { flex: 1 1 140px; }
	.hrcc-prefs__foot .hrcc-btn--secondary { flex-basis: 100%; margin-right: 0; }
	.hrcc-ui td code { white-space: normal; word-break: break-all; }
}

@media (prefers-reduced-motion: reduce) {
	.hrcc-banner, .hrcc-ui .hrcc-btn, .hrcc-switch__track, .hrcc-switch__track::after { transition: none; }
	.hrcc-banner { transform: none; }
}
