/**
 * Grossenburg Cookie Consent — bar, modal, badge.
 * Fixed positioning only (zero CLS). AA contrast in both themes.
 */

:root {
	--gbcc-accent: #2f6b3a;
	--gbcc-z: 99990;
}

/* ---------- Shared ---------- */

.gbcc-bar,
.gbcc-modal,
.gbcc-badge {
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	box-sizing: border-box;
}

.gbcc-bar *,
.gbcc-modal * {
	box-sizing: border-box;
}

.gbcc-light {
	--gbcc-bg: #ffffff;
	--gbcc-ink: #1f2937;
	--gbcc-muted: #4b5563;
	--gbcc-line: #d1d5db;
	--gbcc-wash: #f3f4f6;
}

.gbcc-dark {
	--gbcc-bg: #1f2428;
	--gbcc-ink: #f3f4f6;
	--gbcc-muted: #c2c9d0;
	--gbcc-line: #444c54;
	--gbcc-wash: #2a3136;
}

.gbcc-btn {
	font: inherit;
	font-weight: 600;
	border-radius: 1.25rem;
	padding: 8px 18px;
	padding: .5625rem 1.5625rem;
	cursor: pointer;
	border: 1px solid transparent;
}

.gbcc-btn:focus-visible,
.gbcc-open:focus-visible,
.gbcc-badge:focus-visible,
.gbcc-modal-close:focus-visible,
.gbcc-switch input:focus-visible + .gbcc-slider {
	outline: 2px solid var(--gbcc-accent);
	outline-offset: 2px;
}

.gbcc-btn-primary {
	background: var(--gbcc-accent);
	color: #ffffff;
	border-color: var(--gbcc-accent);
}

.gbcc-btn-primary:hover {
	filter: brightness(1.1);
}

.gbcc-btn-link {
	background: transparent;
	//color: var(--gbcc-ink);
	color: var(--wp--preset--color--accent);
	text-decoration: underline;
	border: none;
	padding: 8px 6px;
}

.gbcc-btn-link:hover {
	color: var(--wp--preset--color--accent-dark);
}

.gbcc-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- Notice bar ---------- */

.gbcc-bar {
	position: fixed;
	z-index: var(--gbcc-z);
	background: var(--gbcc-bg);
	color: var(--gbcc-ink);
	border-top: 1px solid var(--gbcc-line);
	box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
}

.gbcc-style-bar.gbcc-pos-bottom {
	left: 0;
	right: 0;
	bottom: 0;
}

.gbcc-style-card {
	max-width: 420px;
	border: 1px solid var(--gbcc-line);
	border-radius: 8px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
	bottom: 16px;
}

.gbcc-style-card.gbcc-pos-bottom,
.gbcc-style-card.gbcc-pos-bottom-left {
	left: 16px;
	right: auto;
}

.gbcc-style-card.gbcc-pos-bottom-right {
	right: 16px;
	left: auto;
}

.gbcc-bar-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 25px 20px;
}

.gbcc-bar-heading {
	color: var(--wp--preset--color--accent);
	margin: 0 0 4px;
	font-weight: 700;
	font-size: 1.25rem;
}

.gbcc-bar-body,
.gbcc-bar-gpc {
	margin: 0 0 10px;
	color: var(--gbcc-muted);
}

.gbcc-bar-gpc {
	font-style: italic;
}

.gbcc-bar a {
	color: inherit;
	text-decoration: underline;
}

.gbcc-bar-actions {
	display: flex;
	gap: 12px;
	align-items: center;
	flex-wrap: wrap;
}

/* ---------- Modal ---------- */

.gbcc-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: calc(var(--gbcc-z) + 1);
}

.gbcc-modal {
	position: fixed;
	z-index: calc(var(--gbcc-z) + 2);
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: min(560px, calc(100vw - 32px));
	max-height: min(85vh, 720px);
	display: flex;
	flex-direction: column;
	background: var(--gbcc-bg);
	color: var(--gbcc-ink);
	border-radius: 8px;
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
}

.gbcc-modal[hidden],
.gbcc-overlay[hidden],
.gbcc-bar[hidden],
.gbcc-badge[hidden] {
	display: none;
}

.gbcc-modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid var(--gbcc-line);
}

.gbcc-modal-head h2 {
	margin: 0;
	font-size: 18px;
	line-height: 1.3;
}

.gbcc-modal-close {
	font-size: 22px;
	line-height: 1;
	background: transparent;
	border: none;
	color: var(--gbcc-muted);
	cursor: pointer;
	padding: 4px 8px;
}

.gbcc-modal-body {
	overflow-y: auto;
	padding: 8px 20px;
}

.gbcc-modal-foot {
	padding: 14px 20px;
	border-top: 1px solid var(--gbcc-line);
	text-align: right;
}

.gbcc-cat {
	padding: 14px 0;
	border-bottom: 1px solid var(--gbcc-line);
}

.gbcc-cat:last-child {
	border-bottom: none;
}

.gbcc-cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.gbcc-cat-label {
	font-weight: 700;
	font-size: 15px;
}

.gbcc-locked {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--gbcc-accent);
}

.gbcc-cat-desc {
	margin: 6px 0 0;
	color: var(--gbcc-muted);
	font-size: 14px;
}

.gbcc-cat-details {
	margin-top: 8px;
	font-size: 13px;
}

.gbcc-cat-details summary {
	cursor: pointer;
	color: var(--gbcc-muted);
	text-decoration: underline;
}

.gbcc-tablewrap {
	overflow-x: auto;
	margin-top: 8px;
	border: 1px solid var(--gbcc-line);
	border-radius: 6px;
}

.gbcc-tablewrap table {
	border-collapse: collapse;
	width: 100%;
	font-size: 13px;
	margin: 0;
}

.gbcc-tablewrap th,
.gbcc-tablewrap td {
	text-align: left;
	padding: 6px 10px;
	border-bottom: 1px solid var(--gbcc-line);
	vertical-align: top;
}

.gbcc-tablewrap thead th {
	background: var(--gbcc-wash);
	font-weight: 600;
}

.gbcc-tablewrap tr:last-child td {
	border-bottom: none;
}

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

.gbcc-switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	flex: none;
}

.gbcc-switch input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}

.gbcc-slider {
	position: absolute;
	inset: 0;
	background: var(--gbcc-line);
	border-radius: 24px;
	transition: background 0.15s ease;
	pointer-events: none;
}

.gbcc-slider::before {
	content: "";
	position: absolute;
	width: 18px;
	height: 18px;
	left: 3px;
	top: 3px;
	background: var(--gbcc-bg);
	border-radius: 50%;
	transition: transform 0.15s ease;
}

.gbcc-switch input:checked + .gbcc-slider {
	background: var(--gbcc-accent);
}

.gbcc-switch input:checked + .gbcc-slider::before {
	transform: translateX(20px);
}

/* ---------- Badge + footer link ---------- */

/*
 * Joins the theme's fixed icon stack on the right edge: chat 50px,
 * accessibility 94px, print 138px, then this badge at 182px with the
 * theme's scroll-to-top bumped to the top slot (226px) below. Same recipe
 * as those icons (size, border, colors, hover inversion), with fallbacks
 * for when the theme's preset variables are absent.
 */
#icon-scroll-to-top {
	bottom: 226px !important;
}

.gbcc-badge {
	position: fixed;
	z-index: 1049;
	right: 0.3125rem;
	bottom: 182px;
	width: 2.375rem;
	height: 2.375rem;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border-radius: 50%;
	border: solid 0.125rem var(--wp--preset--color--accent, var(--gbcc-accent));
	background: var(--wp--preset--color--base, #ffffff);
	color: var(--wp--preset--color--accent, var(--gbcc-accent));
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.gbcc-badge-svg {
	width: 1.25rem;
	height: 1.25rem;
}

.gbcc-badge:hover,
.gbcc-badge:focus {
	background: var(--wp--preset--color--accent, var(--gbcc-accent));
	color: var(--wp--preset--color--base, #ffffff);
}

@media (min-width: 1200px) {
	.gbcc-badge {
		width: 2.5rem;
		height: 2.5rem;
		right: 1rem;
		color: var(--wp--preset--color--accent-dark, var(--wp--preset--color--accent, var(--gbcc-accent)));
	}

	.gbcc-badge:hover,
	.gbcc-badge:focus {
		color: var(--wp--preset--color--base, #ffffff);
	}
}

.gbcc-privacy-link {
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.gbcc-slider,
	.gbcc-slider::before,
	.gbcc-badge {
		transition: none;
	}
}
